(f protoreflect.FieldDescriptor, visited map[protoreflect.FullName]struct{})
| 64 | } |
| 65 | |
| 66 | func schemaForKind(f protoreflect.FieldDescriptor, visited map[protoreflect.FullName]struct{}) jsonSchema { |
| 67 | switch f.Kind() { |
| 68 | case protoreflect.BoolKind: |
| 69 | return jsonSchema{Type: "boolean"} |
| 70 | case protoreflect.Int32Kind, protoreflect.Int64Kind, |
| 71 | protoreflect.Uint32Kind, protoreflect.Uint64Kind, |
| 72 | protoreflect.Sint32Kind, protoreflect.Sint64Kind, |
| 73 | protoreflect.Fixed32Kind, protoreflect.Fixed64Kind, |
| 74 | protoreflect.Sfixed32Kind, protoreflect.Sfixed64Kind: |
| 75 | return jsonSchema{Type: "integer"} |
| 76 | case protoreflect.FloatKind, protoreflect.DoubleKind: |
| 77 | return jsonSchema{Type: "number"} |
| 78 | case protoreflect.StringKind, protoreflect.BytesKind: |
| 79 | return jsonSchema{Type: "string"} |
| 80 | case protoreflect.EnumKind: |
| 81 | return jsonSchema{Type: "string"} |
| 82 | case protoreflect.MessageKind, protoreflect.GroupKind: |
| 83 | return schemaForMessageWithVisited(f.Message(), visited) |
| 84 | default: |
| 85 | return jsonSchema{Type: "string"} |
| 86 | } |
| 87 | } |
no test coverage detected