Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow adding additional static routes in addition to dynamic mode #798

Open
2 tasks done
navalex opened this issue Apr 24, 2024 · 1 comment
Open
2 tasks done

Allow adding additional static routes in addition to dynamic mode #798

navalex opened this issue Apr 24, 2024 · 1 comment

Comments

@navalex
Copy link

navalex commented Apr 24, 2024

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the feature has not already been requested

🚀 Feature Proposal

The goal would be to be able to have a static file (like yaml or anything like that) to details some routes statically, that come in addition to the dynamic generated doc. This would allow routes that the plugin can't read to the final documentation.

Motivation

The motivation come from my usage of Supertokens, an authentification provider. The SDK adds all auth routes, to manage sessions etc, but they do not use the Fastify router, instead they handle all request and check the route to determine if an auth action is called. They are doing like that to allow an easier maintainability for all Node.js http framework they supports.

Because of this implementation, Fastify-swagger can't detect those routes. And it would be really helpful to add those to my documentation, especially for the "Try out" function of the Swagger-ui, to easily login to try other routes.

Example

Don't really have a precise idea of how could it work, but probably defining a file like a static mode, but allow it to merge with the dynamic mode.

@mcollina
Copy link
Member

I have no idea either, but it would be good to have indeed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants