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

Function schemaForField

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

Source from the content-addressed store, hash-verified

52}
53
54func 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
66func schemaForKind(f protoreflect.FieldDescriptor, visited map[protoreflect.FullName]struct{}) jsonSchema {
67 switch f.Kind() {

Callers 2

Calls 1

schemaForKindFunction · 0.85

Tested by 1