huma
huma copied to clipboard
Huma REST/HTTP API Framework for Golang with OpenAPI 3.1
This PR introduces: - :sparkles: `WithContext` methods to adapters' context for proper context propagation. This is then opportunistically used in `huma.WithContext` to avoid the general `subContext`. - :sparkles: `middleware` conversion...
For our use case, we'd like to use optional path parameters. If the registered path does not include the path parameter, then the struct property can be an empty string....
Hi there! I have a question/feature request. I want to achieve the state where a single operation has multiple media types on request and response, and the exact type that's...
Similar to https://github.com/danielgtaylor/huma/issues/495 I want to define a common header that is documented and reused by a group of API. What's the correct way to ref the header in the...
The OpenAPI generated by Huma contains `$schema` properties: ```json { "components": { "schemas": { "Foo": { "additionalProperties": false, "properties": { "$schema": { "description": "A URL to the JSON Schema for...
Currently, using `huma.WithValue` in a pure-huma middleware sets the value only in `huma.Context`. This does not get propagated to the underlying adapter context, so using `Unwrap` (e.g. `humachi.Unwrap`) in a...
The docs show how to handle errors in a middleware by using `huma.WriteErr` [here](https://huma.rocks/features/middleware/#errors) with the following code: ```go func MyMiddleware(ctx huma.Context, next func(ctx huma.Context)) { // If there is...