Class: ModelAPIExpress

merest-swagger

extention of ModelAPIExpress

Methods

exposeSwagger(pathopt, optionsopt) → {ModelAPIExpress}

exposeSwagger exposes the swagger document. If document is not created the method forces model description;
Parameters:
Name Type Attributes Default Description
path String <optional>
'/swagger.json' path to mount swagger document
options Object <optional>
options for swagger document exposition
Properties
Name Type Attributes Default Description
cors boolean <optional>
true should the swagger doc be exposed with CORS
beautify String <optional>
the separator for JSON beautifier
Source:
Returns:
the API object
Type
ModelAPIExpress

exposeSwaggerUi(pathopt, optionsopt) → {ModelAPIExpress}

exposeSwaggerUi exposes swagger ui application
Parameters:
Name Type Attributes Default Description
path String <optional>
'/swagger-ui' the path to mount swagger ui app
options Object <optional>
options to expose swagger ui
Properties
Name Type Attributes Default Description
swaggerDoc String <optional>
'/swagger.json' the path to mount swagger document
cors boolean <optional>
true should the swagger doc be exposed with CORS
beautify String <optional>
the separator for JSON beautifier for swagger document
title String <optional>
the title of API
path String <optional>
the path of the API
version String <optional>
the API version
host String <optional>
the host name of the API
Source:
Returns:
the API object
Type
ModelAPIExpress

swaggerDoc(optionsopt) → {Object}

swaggerDoc builds Swagger document for the API
Parameters:
Name Type Attributes Description
options Object <optional>
api description parameters (http://dscheglov.github.io/merest/ModelAPIExpress.html)
Properties
Name Type Attributes Description
title String <optional>
the title of API
path String <optional>
the path of the API
version String <optional>
the API version
host String <optional>
the host name of the API
Source:
Returns:
Swagger document
Type
Object