MCPcopy
hub / github.com/danielgtaylor/huma / ExampleInputBody

Struct ExampleInputBody

resolver_test.go:17–19  ·  view source on GitHub ↗

Step 1: Create your input struct where you want to do additional validation. This struct must implement the `huma.Resolver` interface.

Source from the content-addressed store, hash-verified

15// Step 1: Create your input struct where you want to do additional validation.
16// This struct must implement the `huma.Resolver` interface.
17type ExampleInputBody struct {
18 Count int `json:"count" minimum:"0"`
19}
20
21func (b *ExampleInputBody) Resolve(ctx huma.Context, prefix *huma.PathBuffer) []error {
22 // Return an error if some arbitrary rule is broken. In this case, if it's

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected