Closed FabriceGaillard closed 6 months ago
Currently, not. What would be the use case?
To parse data, to filter it depending on some conditions
docs()
returns a stringified YAML. You should be able convert it back into json.
Yes, i could use a package for this, but don't you convert js to yaml in this package? It Can be interesting to add in the options the output format wanted eventually.
Yes, I do convert it, and it additionally saves a swagger.yaml file, which is used in production mode.
When you run the adonisJS app in dev mode, everything works seamlessly. However, when you deploy it to production, you MUST execute node ace docs:generate
command, to generate the swagger.yml file, since in production you obviously don't have all the necessary references to the *.ts files and their comments, etc.
In this case, Autoswagger would have to create two file, swagger.yaml and swagger.json, to make it production ready.
Ok thx for the explanations. I think it could be a good option to have the choose of the output format. Autoswagger would have to create only one file depending of options defined in config/swagger.ts
You're lucky I'm bored right now. AutoSwagger.json()
is now implemented in version 2.14.x 😅 See the docs.
Thx!
Hi, Is there a way to get data in json format ?