say I have a domain model for a person
type Person struct {
ID int
Name string
Status string // "married", "engaged", "single"
}
and I want to return it in a route
huma.Register(api, huma.Operation{
OperationID: "get-person",
Method: http.MethodGet,
Path: "/people/{id}",
Summary: "Get a person by ID",
DefaultStatus: http.StatusOK
}, func(ctx context.Context, input PersonRequest)
the server panics with "status field must an int", of course I can change the name of the field in my domain object, but it has semantic meaning to the app.
It'd be preferable for the register method (line 763) to ignore the "Status" field in the return struct if a DefaultStatus is set.