danielgtaylor / danielgtaylor/huma

Request - Header-Based Routing Options

Open
#985 1 comment 0 reactions 0 assignees View on GitHub
question
Dominant language
Go
Stars
4.4k
Forks
285
Avg merge
40m
Merged PRs (30d)
1

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+json` should be routed to some `handleModelV1` function
- `Content-Type: model.v2+json` should be routed to some `handleModelV2` function
- `Content-Type: application/json` should be ALSO routed to some `handleModelV2` function

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!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.