You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using a custom RequestBody in a huma.Operation given to the huma.Register function, s.propertyNames field is only populated when the PrecomputeMessages() method is explicitly called on the Schema given to a MediaType.
Example:
// Schema definition// ...schema.PrecomputeMessages()
huma.Register(
api,
huma.Operation{
OperationID: "post-user-attributes",
Method: http.MethodPost,
Path: "/",
Description: "upsert the given attributes for the given user, validating using the given appKey's attributes",
Summary: "upsert attributes",
DefaultStatus: http.StatusOK,
RequestBody: &huma.RequestBody{
Description: "My custom request schema",
Required: true,
Content: map[string]*huma.MediaType{
"application/json": {
Schema: schema,
},
},
},
},
// handler omitted
If this is a feature, I believe that it should be explicitly documented.
Thanks 🙏
The text was updated successfully, but these errors were encountered:
huma/validate.go
Line 543 in 6019e80
When using a custom
RequestBody
in ahuma.Operation
given to thehuma.Register
function,s.propertyNames
field is only populated when thePrecomputeMessages()
method is explicitly called on theSchema
given to aMediaType
.Example:
If this is a feature, I believe that it should be explicitly documented.
Thanks 🙏
The text was updated successfully, but these errors were encountered: