Skip to content

AsyncAPI with CloudEvents#1349

Merged
duglin merged 5 commits intocloudevents:mainfrom
Lazzaretti:feature/asyncapi-traits
Jun 16, 2025
Merged

AsyncAPI with CloudEvents#1349
duglin merged 5 commits intocloudevents:mainfrom
Lazzaretti:feature/asyncapi-traits

Conversation

@Lazzaretti
Copy link
Member

@Lazzaretti Lazzaretti commented May 23, 2025

Working draft for #1276

Fixes #1276

Clarify how CloudEvents headers can be specified in AsyncAPI.

Proposed Changes

  • Add a first draft on how CloudEvents can be specified in AsyncAPI with an example and spec for structured mode with JSON and binary mode with Kafka.

Release Note

Define how CloudEvents headers can be specified in AsyncAPI.

Open points

  • Change $ref: in cloudevents/working-drafts/asyncapi-examples/light-switch-events-binary-kafka.yaml to trait before merging. The current version is better to test the API spec. Afterwards, it should point to the main branch of the cloudevents/spec repo.

Adding a first draft according to cloudevents#1276

Signed-off-by: Lazzaretti <fabrizio@lazzaretti.me>
@duglin
Copy link
Collaborator

duglin commented May 27, 2025

CI failed with:

cloudevents/working-drafts/asyncapi.md: Translation file cloudevents/languages/zh-CN/working-drafts/asyncapi.md does not exist
cloudevents/working-drafts/asyncapi.md: Translation file cloudevents/languages/he/working-drafts/asyncapi.md does not exist

you should be able to clone an existing he/CN template files and just change the href in there.

- remove intorudcion
- wrap the lines at 80 chars
- s/should/will/
- create translation files he/CN

Signed-off-by: Lazzaretti <fabrizio@lazzaretti.me>
@Lazzaretti Lazzaretti force-pushed the feature/asyncapi-traits branch from 703ed3f to d9eae54 Compare May 28, 2025 13:01
Signed-off-by: Lazzaretti <fabrizio@lazzaretti.me>
@Lazzaretti Lazzaretti force-pushed the feature/asyncapi-traits branch from d9eae54 to 2e5a250 Compare May 28, 2025 13:09
@Lazzaretti Lazzaretti requested a review from duglin May 28, 2025 13:30
@duglin
Copy link
Collaborator

duglin commented May 28, 2025

Overall it looks good with my limited knowledge of AsyncAPI. However, and this might be a nonsensical question, but is there anything more normative we can add? Or are "examples" really all that we can do because each use of it will need to be customized?

For example, I kind of expected there to be a "normative" file similar to https://github.com/cloudevents/spec/pull/1349/files#diff-062a9fa03bc40a7d12508a8bfb8780a43aeb9356e395385bc23cb4f810272a1b that says: "here's what the CE stuff would look like, so you should be able to point to (reference?) this in your specific usage", because everything after line 1 should be the same each time, no? Or does that not make sense?

@Lazzaretti
Copy link
Member Author

Lazzaretti commented May 28, 2025

Overall it looks good with my limited knowledge of AsyncAPI. However, and this might be a nonsensical question, but is there anything more normative we can add? Or are "examples" really all that we can do because each use of it will need to be customized?

For example, I kind of expected there to be a "normative" file similar to https://github.com/cloudevents/spec/pull/1349/files#diff-062a9fa03bc40a7d12508a8bfb8780a43aeb9356e395385bc23cb4f810272a1b that says: "here's what the CE stuff would look like, so you should be able to point to (reference?) this in your specific usage", because everything after line 1 should be the same each time, no? Or does that not make sense?

I agree that a small sample or snippet on how to add it would be helpful. I can add this, but due to the holidays, I will only be able to do so in two weeks.

@duglin
Copy link
Collaborator

duglin commented Jun 10, 2025

@Lazzaretti do you still plan on making that change we discussed? Are you back from vacation yet?:-)

Signed-off-by: Lazzaretti <fabrizio@lazzaretti.me>
@Lazzaretti
Copy link
Member Author

@Lazzaretti do you still plan on making that change we discussed? Are you back from vacation yet?:-)

@duglin I added two small examples that illustrate how to add the CloudEvents headers or traits to an asyncapi document. Does that address your input?

@duglin
Copy link
Collaborator

duglin commented Jun 11, 2025

@Lazzaretti yes that helps! thanks!

Signed-off-by: Lazzaretti <fabrizio@lazzaretti.me>
@Lazzaretti Lazzaretti requested a review from duglin June 11, 2025 16:40
@duglin
Copy link
Collaborator

duglin commented Jun 16, 2025

Approved on the 6/12 call

@duglin duglin merged commit 3fd0012 into cloudevents:main Jun 16, 2025
2 of 4 checks passed
@Lazzaretti Lazzaretti deleted the feature/asyncapi-traits branch June 16, 2025 06:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AsyncAPI v3 Trait for CloudEvents

2 participants