Swagger integration support for the travetto framework
npm install @travetto/swaggertravetto: Swagger
===
Install: primary
``bash`
$ npm install @travetto/swagger
In the Rest module, the controllers and endpoints can be described via decorators, comments, or typings. This only provides the general metadata internally. This is not sufficient to generate a usable API doc, and so this module exists to bridge that gap.
The module is provides a swagger v2 representation of the API metadata provided via the Rest and Schema modules.
endpoint is automatically generated and exposed at the root of the application as /swagger.json. All of the high level configurations can be found in the following structure:
Config: Swagger configuration
`yaml
api:
info:
contact:
email:
name:
description:
license:
termsOfService?:
title:
version:
host:
basePath:
host?:
swagger:
client:
codeGenImage: swaggerapi/swagger-codegen-cli
output?: Codegen ouptut directory
format?: Codegen language format
formatOptions?: Options to pass to the codegen tool
`Client Generation
In addition to the swagger JSON file generation, the module also supports generating a client via swagger-codegen-cli`. This module integrates with the file watching paradigm and can regenerate the swagger client as changes to endpoints and models are made during development.