Plumier provide facility to generate Open API 3.0 Specification commonly used by Swagger UI. The API specification directly generated from controllers metadata.
To enable this facility you need to install the
@plumier/swagger and use the
SwaggerFacility on existing Plumier application like below:
Above is the minimum configuration required to generate the Open Api 3.0 Specification, some configuration may needed but optional.
Using above code Plumier automatically generate Open API 3.0 Specification using controllers metadata and create two endpoints:
/swagger.jsonThe Open API 3.0 Specification
/swaggerThe swagger UI (API explorer)
By default the endpoint of the Swagger ui is
/swagger this endpoint is customisable by providing
endpoint on the
SwaggerFacility like below:
Above code will host the Swagger ui in
Swagger facility provide default project info for OpenAPI 3.0 spec, you can override this by providing it in facility constructor