You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Protobuf provides compact size and faster serialization. CloudEvents already provides a Protobuf schema. Can we also create Protobuf schema for CDEvents.
Am I not sure if it was a conscious decision to not provide Protobuf and use JSON schemas, but even with JSON schema both producer and consumer has to do validations as per the spec. Protobuf would be much more faster and has a better code generation support.
We are in favor of more typed schemas.
Currently we have several constraints:
for extensibility:
customData can be anything
subject can be anything, for custom event (aka when context.type doesn't start by dev.cdevents.)
each event's type has its own schema (and version)
IMHO using google.protobuf.Any doesn't provide more type, or compact/faster (de)serialization if we have to chain (de)serialization. TBH, it's already the case with json as we have to read context.version/specversion and context.type to know how to handle the rest of the data.
If you have a draft of a protobuf schema, I'll be happy to review and help on it.
Look at #240 (I didn't update it) but it could give you some insight. (If needed, I could update the discussion, the matrix, and the github repo where I store my experiments)
Anyway, I guess, CDEvents will keep a "text" format, simply to ease the integration with notification/template system or event system without require them to have "native" support for the expected protobuf IDL format (in the expected version)
Activity
davidB commentedon Jan 12, 2026
Hello,
We are in favor of more typed schemas.
Currently we have several constraints:
customDatacan be anythingsubjectcan be anything, for custom event (aka whencontext.typedoesn't start bydev.cdevents.)IMHO using
google.protobuf.Anydoesn't provide more type, or compact/faster (de)serialization if we have to chain (de)serialization. TBH, it's already the case with json as we have to readcontext.version/specversionandcontext.typeto know how to handle the rest of the data.If you have a draft of a protobuf schema, I'll be happy to review and help on it.
Look at #240 (I didn't update it) but it could give you some insight. (If needed, I could update the discussion, the matrix, and the github repo where I store my experiments)
davidB commentedon Jan 12, 2026
Anyway, I guess, CDEvents will keep a "text" format, simply to ease the integration with notification/template system or event system without require them to have "native" support for the expected protobuf IDL format (in the expected version)