ad-on-is / adonis-autoswagger

Auto-Generate swagger docs for AdonisJS
MIT License
97 stars 32 forks source link

How to override auto values #96

Closed ShahriarKh closed 1 month ago

ShahriarKh commented 1 month 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 1 month ago

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

ShahriarKh commented 1 month ago

Awesome. Thank you!