ad-on-is / adonis-autoswagger

Auto-Generate swagger docs for AdonisJS
MIT License
129 stars 41 forks source link

How to override auto values #96

Closed ShahriarKh closed 5 months ago

ShahriarKh commented 5 months ago

I tried to change some values, like @summary but it doesn't work. Am I missing something? Or is it a bug with the v6 or the package itself?

example:

export default class SomeController {
  /**
   * @custom
   * @summary Lorem ipsum dolor sit amet
   * @paramPath provider - The login provider to be used - @enum(google, facebook, apple)
   * @responseBody 200 - {"token": "xxxxxxx"}
   * @requestBody {"code": "xxxxxx"}
   */
  async something({ response }: HttpContext) {
    return response.send('y')
  }
}
/some-route:
  get:
    summary: " (something)" # 👈 This should be "Lorem ipsum dolor sit amet"
    description: "\n\n _app/controllers/test_controller.ts_ - **something**"
    parameters: []
    tags:
      - "SOME-ROUTE"
    responses:
      200:
        description: "OK"
        content:
          application/json: {}
    security: []
ad-on-is commented 5 months ago

you have @custom, but your function name is something, so change @custom to @something

ShahriarKh commented 5 months ago

Awesome. Thank you!