Skip to main content

generate_proto

Function generate_proto 

Source
pub fn generate_proto(resource: &ResourceDefinition) -> String
Expand description

Generates a .proto file content from a single ResourceDefinition.

The generated proto includes:

  • A message type for the resource with all schema fields
  • Create/Update input messages based on endpoint input fields
  • Request/Response wrappers for each endpoint
  • A gRPC service with RPCs for each declared endpoint
  • Server-streaming RPC for list endpoints