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

Function jsonTag

schema.go:551–557  ·  view source on GitHub ↗

jsonTag returns a value of the schema's type for the given tag string. Uses JSON parsing if the schema is not a string.

(r Registry, f reflect.StructField, s *Schema, name string)

Source from the content-addressed store, hash-verified

549// jsonTag returns a value of the schema's type for the given tag string.
550// Uses JSON parsing if the schema is not a string.
551func jsonTag(r Registry, f reflect.StructField, s *Schema, name string) any {
552 t := f.Type
553 if value := f.Tag.Get(name); value != "" {
554 return convertType(f.Name, t, jsonTagValue(r, f.Name, s, value))
555 }
556 return nil
557}
558
559// SchemaFromField generates a schema for a given struct field. If the field
560// is a struct (or slice/map of structs) then the registry is used to

Callers 1

SchemaFromFieldFunction · 0.85

Calls 3

convertTypeFunction · 0.85
jsonTagValueFunction · 0.85
GetMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…