-
-
Notifications
You must be signed in to change notification settings - Fork 254
Request - Header-Based Routing Options #985
Description
Hello!
This is an amazing package that solves a TON of boilerplate and offers a lot of great value. The more I use it, the more I'd love to adopt it on a more broad case; however, I'm finding there's one missing requirement.
The platform I'm building for has a requirement that routes can be defined by the URL as well as the Content-Type Header value. This is used when specifying breaking changes between model versions as opposed to in-line version attributes within the URL.
For example:
Content-Type: model.v1+jsonshould be routed to somehandleModelV1functionContent-Type: model.v2+jsonshould be routed to somehandleModelV2functionContent-Type: application/jsonshould be ALSO routed to somehandleModelV2function
I think this part is where things get a bit tricky. I know the underlying tools are router agnostics, and some of the routers support this type of routing while others do not. Is there a way from within Huma to support this type of header-based routing?
Thanks for your time and consideration!