fastify / fastify/fastify-swagger

Allow adding additional static routes in addition to dynamic mode

Open
#798 1 comment 4 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
1.1k
Forks
219
Avg merge
4h 24m
Merged PRs (30d)
2

Description

### Prerequisites

- [X] I have written a descriptive issue title
- [X] 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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.