Skip to content

AsyncAPI with CloudEvents #1349

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Lazzaretti
Copy link
Member

@Lazzaretti Lazzaretti commented May 23, 2025

Working draft for #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>
@@ -0,0 +1,32 @@
# AsyncAPI With CloudEvents
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you wrap the lines at 80 chars to align with our other docs?

# AsyncAPI With CloudEvents

This document describes how CloudEvents can be defined in [AsyncAPI v3](https://www.asyncapi.com/docs/reference/specification/v3.0.0).
It was created as a follow-up after discussion [cloudevents/spec#1276](https://github.com/cloudevents/spec/issues/1276).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove this line since once the PR is merged people shouldn't need to see the history to understand what's going on. Or, if there's important info in the issue then let's bring it into this doc.

Asynchronous APIs, e.g., events, can be specified in AsyncAPI, similar to how RESTful APIs can be specified in [OpenAPI](https://swagger.io/specification/).
When defining new events in an API-first approach it can be hard to add CloudEvents headers or fields according to spec.
This makes following the standard harder.
This document should clarify how CloudEvents headers can be specified in AsyncAPI.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/should/will/

@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.

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.

2 participants