You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Before I jump in, thanks for this library, it's really great! I'm working on adding OpenAPI request validation to Backstage and found this library. Basically, Backstage has a routing system that decouples the parent route from the plugin. Each plugin can be mounted at different routes for different implementations so a full Backstage spec has to be dynamic. See this.
To support that dynamic nature, each plugin has a spec with a
servers:
- url: '/'
section (you can see an example here). Those specs can then be combined with routing knowledge at run time to create a tailored "Backstage" full API spec. However, my goal is to support per plugin validation that's decoupled from the full API spec. Plugin owners could then opt into validation and configure it themselves. Ideally, this library would be what we use for that. However, I'm getting issues from this line. The req.originalUrl will always contain the full URL with all of the parent routers, meaning it's not possible to validate against a router specific spec.
Describe the solution you'd like
A toggle to use req.path or req.url instead of req.originalUrl. Basically, the ability to turn off the functionality introduced in #211 to support fully context aware routers.
Describe alternatives you've considered
I also looked at #113, but I think this is a separate use case with a similar soluiton.
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Before I jump in, thanks for this library, it's really great! I'm working on adding OpenAPI request validation to Backstage and found this library. Basically, Backstage has a routing system that decouples the parent route from the plugin. Each plugin can be mounted at different routes for different implementations so a full Backstage spec has to be dynamic. See this.
To support that dynamic nature, each plugin has a spec with a
section (you can see an example here). Those specs can then be combined with routing knowledge at run time to create a tailored "Backstage" full API spec. However, my goal is to support per plugin validation that's decoupled from the full API spec. Plugin owners could then opt into validation and configure it themselves. Ideally, this library would be what we use for that. However, I'm getting issues from this line. The
req.originalUrl
will always contain the full URL with all of the parent routers, meaning it's not possible to validate against a router specific spec.Describe the solution you'd like
A toggle to use
req.path
orreq.url
instead ofreq.originalUrl
. Basically, the ability to turn off the functionality introduced in #211 to support fully context aware routers.Describe alternatives you've considered
I also looked at #113, but I think this is a separate use case with a similar soluiton.
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: