An npm package to create and expose CRUD APIs in Node.js ExpressJS projects for mongoose models. Automatically creates swagger documentation for each API.
In OpenAPI version 3, you do this with the allOf keyword:
components:
schemas:
BasicErrorModel:
type: object
required:
- message
- code
properties:
message:
type: string
code:
type: integer
minimum: 100
maximum: 600
ExtendedErrorModel:
allOf: # Combines the BasicErrorModel and the inline model
- $ref: '#/components/schemas/BasicErrorModel'
- type: object
required:
- rootCause
properties:
rootCause:
type: string
In the example above, the ExtendedErrorModel schema includes its own properties and properties inherited from BasicErrorModel