(f protoreflect.FieldDescriptor, visited map[protoreflect.FullName]struct{})
| 52 | } |
| 53 | |
| 54 | func schemaForField(f protoreflect.FieldDescriptor, visited map[protoreflect.FullName]struct{}) jsonSchema { |
| 55 | // repeated → JSON array |
| 56 | if f.IsList() { |
| 57 | item := schemaForKind(f, visited) |
| 58 | return jsonSchema{Type: "array", Items: &item} |
| 59 | } |
| 60 | if f.IsMap() { |
| 61 | return jsonSchema{Type: "object"} |
| 62 | } |
| 63 | return schemaForKind(f, visited) |
| 64 | } |
| 65 | |
| 66 | func schemaForKind(f protoreflect.FieldDescriptor, visited map[protoreflect.FullName]struct{}) jsonSchema { |
| 67 | switch f.Kind() { |