Get the Event Schema with Pub/Sub API
Use Pub/Sub API to retrieve the event schema with the GetSchema RPC method and pass in a schema ID.
Because the schema typically doesn’t change often, we recommend that you call GetSchema once and use the returned schema for all operations. If the event schema changes, for example, when an administrator adds a field to the event definition, the schema ID changes. We recommend that you store the schema ID and compare it with the latest schema ID. If the schema ID changes, call GetSchema to retrieve the new schema.
1rpc GetSchema (SchemaRequest) returns (SchemaInfo);For more information, see GetSchema RPC Method in the Pub/Sub API Developer Guide.