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)
| 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. |
| 551 | func 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 |
no test coverage detected
searching dependent graphs…