danielgtaylor / huma

Huma REST/HTTP API Framework for Golang with OpenAPI 3.1
https://huma.rocks/
MIT License
2.2k stars 152 forks source link

Feature request - request side transformer #614

Open ddl-ebrown opened 1 month ago

ddl-ebrown commented 1 month ago

As a follow-on to https://github.com/danielgtaylor/huma/issues/289, we're seeing a need to have request-aware middleware plugged into the request processing pipeline to implement a pattern that cross-cuts all API endpoints.

The main idea is:

Right now we're doing this by wrapping the API handler functions that get setup at registration time -- but it would be better to have a well defined construct for this pattern.

Thanks in advance for considering!