A Koa2 app instance you want the middleware to be applied to.
specOrUri
String / Object
true
Either a URI to a swagger specification Koa2-OAS3 can grab down and apply, or a JavaScript object that contains the OpenAPI3 specification.
options
Object
false
Custom options to pass to the middleware, see all options below.
Allowed Options and Defaults
Option
Type
Default
Description
mergeRemoteRefs
Boolean
false
OpenAPI 3 allows you to reference from other api specifications based on a URI. This option will reach out to these different refs and merge the definitions into the provided API spec.
renderDocs
Boolean
true
This renders a UI to visualize the OpenAPI specification.
docsPath
String
/docs
What path should the docs be rendered at. In addition a second route will be rendered {docsPath}/spec that responds with the api specification in JSON format.
docsSuupportedSubmitMethods
Array
['get', 'post', 'put', 'delete', 'patch']
In the DOC's interactive interface example requests can be submitted to the configured API spec remotes. This allows adding limitations on the feature.
docsJsonEditor
Boolean
false
Should the JSON editor be visible in the render documentation view.