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)
| 20 | // descriptor. Field naming uses the proto field name (snake_case), matching |
| 21 | // the gateway's UseProtoNames=true configuration. |
| 22 | func 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 — |