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

Struct ExampleUpdateStruct

schema_test.go:1608–1614  ·  view source on GitHub ↗

Implements SchemaTransformer interface, reusing parts of the schema from `ExampleInputStruct`

Source from the content-addressed store, hash-verified

1606
1607// Implements SchemaTransformer interface, reusing parts of the schema from `ExampleInputStruct`
1608type ExampleUpdateStruct struct {
1609 Name *string `json:"name"`
1610 Email *string `json:"email" doc:"Override doc for email"`
1611 Age OmittableNullable[int] `json:"age"`
1612 Comment OmittableNullable[string] `json:"comment"`
1613 Pattern string `json:"pattern"`
1614}
1615
1616func (u *ExampleUpdateStruct) TransformSchema(r huma.Registry, s *huma.Schema) *huma.Schema {
1617 inputSchema := r.Schema(reflect.TypeFor[*ExampleInputStruct](), false, "")

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected