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

Method UnmarshalJSON

schema_test.go:1392–1402  ·  view source on GitHub ↗
(b []byte)

Source from the content-addressed store, hash-verified

1390}
1391
1392func (o *OmittableNullable[T]) UnmarshalJSON(b []byte) error {
1393 if len(b) > 0 {
1394 o.Sent = true
1395 if bytes.Equal(b, []byte("null")) {
1396 o.Null = true
1397 return nil
1398 }
1399 return json.Unmarshal(b, &o.Value)
1400 }
1401 return nil
1402}
1403
1404func (o OmittableNullable[T]) Schema(r huma.Registry) *huma.Schema {
1405 s := r.Schema(reflect.TypeOf(o.Value), true, "")

Callers

nothing calls this directly

Calls 1

UnmarshalMethod · 0.65

Tested by

no test coverage detected