MCPcopy Create free account
hub / github.com/authorizerdev/authorizer / schemaForKind

Function schemaForKind

internal/mcp/schema.go:66–87  ·  view source on GitHub ↗
(f protoreflect.FieldDescriptor, visited map[protoreflect.FullName]struct{})

Source from the content-addressed store, hash-verified

64}
65
66func 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}

Callers 1

schemaForFieldFunction · 0.85

Calls 1

Tested by

no test coverage detected