[X] I have searched existing issues to ensure the issue has not already been raised
Issue
Hey! I'm coding a generator that is using this awesome package.
It is generating fastify routes and, optionally, schemas through fastify.addSchema. This means that, before even running tsc to transpile the typescript code, the kita CLI knows every schema that will be added at runtime.
To give more context, this is an example of a group of generated schemas:
With the above in mind, how can i fully generate a swagger.json file (the same as a /documentation/json response is), without even starting the server? Tried to understand a bit of this library code and couldn't find where all schemas are glued...
This is not possible right now, you need to boot the server to know all the routes. You can do that by doing fastify.ready() (which does not listen to any port).
Prerequisites
Issue
Hey! I'm coding a generator that is using this awesome package.
It is generating fastify routes and, optionally, schemas through
fastify.addSchema
. This means that, before even runningtsc
to transpile the typescript code, the kita CLI knows every schema that will be added at runtime.To give more context, this is an example of a group of generated schemas:
https://github.com/arthurfiorette/kita/blob/10175fedb015b28fdb9651caf0221d6d7dd78dd0/packages/test-package/src/routes.ts#L103-L151
With the above in mind, how can i fully generate a swagger.json file (the same as a
/documentation/json
response is), without even starting the server? Tried to understand a bit of this library code and couldn't find where all schemas are glued...Thanks!