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

Function schemaForMessage

internal/mcp/schema.go:22–24  ·  view source on GitHub ↗

schemaForMessage derives a JSON Schema (object form) for a proto message descriptor. Field naming uses the proto field name (snake_case), matching the gateway's UseProtoNames=true configuration.

(md protoreflect.MessageDescriptor)

Source from the content-addressed store, hash-verified

20// descriptor. Field naming uses the proto field name (snake_case), matching
21// the gateway's UseProtoNames=true configuration.
22func schemaForMessage(md protoreflect.MessageDescriptor) jsonSchema {
23 return schemaForMessageWithVisited(md, map[protoreflect.FullName]struct{}{})
24}
25
26// schemaForMessageWithVisited recurses into nested message fields while
27// guarding against cycles. The descriptor full-name is the visit key —

Calls 1