Private
constructorPrivate
Readonly
_documentPrivate
Readonly
componentsStatic
Private
Optional
instanceStatic
documentPrivate
buildA method for adding and retrieving callback components from the document
The callback or undefined if it doesn't exist on the document
The name of the callback component
Optional
params: ComponentParameterOptions
A method for adding and retrieving components from the document
The component or undefined if it doesn't exist on the document
If the field name is not one of ComponentFieldNames
The category of the component, based on the OpenApiv3 spec
The name of the component object
Optional
params: ComponentParameterOptions
A builder method that can create an allOf, oneOf, anyOf schema objects.
A valid allOf, oneOf, anyOf schema object, using $ref syntax to reference component schemas
Error if a component name doesn't exist on the document
One of 'anyOf', 'oneOf', 'allOf', selecting which will be created
List of names of schemas in the components of this document
A method for adding and retrieving example components from the document
The example or undefined if it doesn't exist on the document
The name of the example component
Optional
params: ComponentParameterOptions
Parses the express app and builds an OpenApiv3 Paths object
Warning: This must be used after all other routes have been attached and processed onto the express app. Suggested to be placed right before app.listen().
You may use this, build a document, then use this method with different flags and build again for multiple versions of the OpenApi v3 document.
This allows you to remove routes you don't want documented on one doc, but include it on another.
The Express App object
Require extended OpenApi middleware documentation to exist to include the route in the final Paths Object
Override the exclude flag that was attached by middleware and include those routes in the final Paths Object
A method for adding and retrieving header components from the document
The header or undefined if it doesn't exist on the document
The name of the header component
Optional
params: ComponentParameterOptions
A method for adding and retrieving link components from the document
The link or undefined if it doesn't exist on the document
The name of the link component
Optional
params: ComponentParameterOptions
Private
mergeA method for adding and retrieving parameter components from the document
The parameter or undefined if it doesn't exist on the document
The name of the parameter component
Optional
params: ComponentParameterOptions
Private
processA method for adding and retrieving requestBody components from the document
The requestBody or undefined if it doesn't exist on the document
The name of the requestBody component
Optional
params: ComponentParameterOptions
A method for adding and retrieving response components from the document
The response or undefined if it doesn't exist on the document
The name of the response component
Optional
params: ComponentParameterOptions
A method for adding and retrieving schema components from the document
The schema or undefined if it doesn't exist on the document
The name of the schema component
Optional
params: ComponentParameterOptions
A method for adding and retrieving securityScheme components from the document
The securityScheme or undefined if it doesn't exist on the document
The name of the securityScheme component
Optional
params: ComponentParameterOptions
Static
deleteStatic
initializeInitializes and returns an instance of a DocumentBuilder that is not attached to the static reference of DocumentBuilder. Allows you to create a second document builder object, export it and use however desired.
Does NOT override the underlying singleton instance
The newly created document builder object
The minimum required OpenApiv3 skeleton spec
Static
initializeInitializes the singleton document. This allows you to import this class from any module and maintain an global document reference.
Warning: Each call to this method will override previous instances, loosing the internal document. Recommended to only call this once per project.
The document builder object instance
The minimum required OpenApiv3 skeleton spec
Generated using TypeDoc
Retrieves the current document builder instance. Used to retrieve references across modules.