Cody2333 / koa-swagger-decorator

using decorator to automatically generate swagger doc for koa-router
348 stars 81 forks source link

Allow passing $ref as body parameters #156

Closed eastcoastcoder closed 2 years ago

eastcoastcoder commented 2 years ago

With this change it would be possible for the body decorator to make reference to already existing models within the definitions key of the swagger-json. This prevents duplication of generated schemas.

Usage example: @body({ $ref: '#/definitions/Order' })

You can see this method used in the Swagger Petstore example: https://petstore.swagger.io/v2/swagger.json image