diff --git a/.all-contributorsrc b/.all-contributorsrc index c1cb2a3a5..84ece03b4 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -379,7 +379,124 @@ "example", "ideas" ] + }, + { + "login": "GreenRover", + "name": "Heiko Henning", + "avatar_url": "https://avatars.githubusercontent.com/u/512850?v=4", + "profile": "https://github.com/GreenRover", + "contributions": [ + "bug", + "code", + "content", + "doc", + "example", + "ideas", + "maintenance", + "review" + ] + }, + { + "login": "alequetzalli", + "name": "Quetzalli ", + "avatar_url": "https://avatars.githubusercontent.com/u/19964402?v=4", + "profile": "http://www.docsasecosystem.com", + "contributions": [ + "content", + "doc", + "example", + "ideas", + "review" + ] + }, + { + "login": "akkshitgupta", + "name": "Akshit Gupta", + "avatar_url": "https://avatars.githubusercontent.com/u/96991785?v=4", + "profile": "https://github.com/akkshitgupta", + "contributions": [ + "content", + "doc" + ] + }, + { + "login": "Amzani", + "name": "samz", + "avatar_url": "https://avatars.githubusercontent.com/u/554438?v=4", + "profile": "https://amzani.com/", + "contributions": [ + "bug", + "content", + "doc", + "example", + "projectManagement" + ] + }, + { + "login": "kaushik-rishi", + "name": "Rishi", + "avatar_url": "https://avatars.githubusercontent.com/u/52498617?v=4", + "profile": "http://rishikaushik.com", + "contributions": [ + "maintenance", + "infra" + ] + }, + { + "login": "nickshoe", + "name": "nickshoe", + "avatar_url": "https://avatars.githubusercontent.com/u/32668766?v=4", + "profile": "https://github.com/nickshoe", + "contributions": [ + "bug", + "doc" + ] + }, + { + "login": "AceTheCreator", + "name": "Ace ", + "avatar_url": "https://avatars.githubusercontent.com/u/40604284?v=4", + "profile": "https://github.com/AceTheCreator", + "contributions": [ + "eventOrganizing", + "ideas", + "maintenance", + "talk" + ] + }, + { + "login": "AnimeshKumar923", + "name": "Animesh Kumar", + "avatar_url": "https://avatars.githubusercontent.com/u/99868037?v=4", + "profile": "https://github.com/AnimeshKumar923", + "contributions": [ + "content", + "doc", + "maintenance" + ] + }, + { + "login": "Lazzaretti", + "name": "Fabrizio Lazzaretti", + "avatar_url": "https://avatars.githubusercontent.com/u/7142819?v=4", + "profile": "https://lazzaretti.me/", + "contributions": [ + "doc" + ] + }, + { + "login": "Pakisan", + "name": "Pavel Bodiachevskii", + "avatar_url": "https://avatars.githubusercontent.com/u/3388414?v=4", + "profile": "https://www.linkedin.com/in/pavel-bo/", + "contributions": [ + "doc", + "bug", + "ideas", + "question" + ] } ], - "commitConvention": "none" + "commitConvention": "none", + "commitType": "docs" } diff --git a/.github/workflows/automerge-for-humans-add-ready-to-merge-or-do-not-merge-label.yml b/.github/workflows/automerge-for-humans-add-ready-to-merge-or-do-not-merge-label.yml index 66606fc17..02d71a796 100644 --- a/.github/workflows/automerge-for-humans-add-ready-to-merge-or-do-not-merge-label.yml +++ b/.github/workflows/automerge-for-humans-add-ready-to-merge-or-do-not-merge-label.yml @@ -59,7 +59,9 @@ jobs: body: `Hello, @${{ github.actor }}! πŸ‘‹πŸΌ This PR is not up to date with the base branch and can't be merged. Please update your branch manually with the latest version of the base branch. - PRO-TIP: Add a comment to your PR with the text: \`/au\` or \`/autoupdate\` and our bot will take care of updating the branch in the future. The only requirement for this to work is to enable [Allow edits from maintainers](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork) option in your PR. + PRO-TIP: To request an update from the upstream branch, simply comment \`/u\` or \`/update\` and our bot will handle the update operation promptly. + + The only requirement for this to work is to enable [Allow edits from maintainers](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork) option in your PR. Also the update will not work if your fork is located in an organization, not under your personal profile. Thanks πŸ˜„` }) } diff --git a/.github/workflows/autoupdate.yml b/.github/workflows/autoupdate.yml index ad8e0198f..eeb77a47b 100644 --- a/.github/workflows/autoupdate.yml +++ b/.github/workflows/autoupdate.yml @@ -1,34 +1,34 @@ -# This action is centrally managed in https://github.com/asyncapi/.github/ -# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo - -# This workflow is designed to work with: -# - autoapprove and automerge workflows for dependabot and asyncapibot. -# - special release branches that we from time to time create in upstream repos. If we open up PRs for them from the very beginning of the release, the release branch will constantly update with new things from the destination branch they are opened against - -# It uses GitHub Action that auto-updates pull requests branches, whenever changes are pushed to their destination branch. -# Autoupdating to latest destination branch works only in the context of upstream repo and not forks - -name: autoupdate - -on: - push: - branches-ignore: - - 'version-bump/**' - - 'dependabot/**' - - 'bot/**' - - 'all-contributors/**' - -jobs: - autoupdate-for-bot: - if: startsWith(github.repository, 'asyncapi/') - name: Autoupdate autoapproved PR created in the upstream - runs-on: ubuntu-latest - steps: - - name: Autoupdating - uses: docker://chinthakagodawita/autoupdate-action:v1 - env: - GITHUB_TOKEN: '${{ secrets.GH_TOKEN_BOT_EVE }}' - PR_FILTER: "labelled" - PR_LABELS: "autoupdate" - PR_READY_STATE: "ready_for_review" - MERGE_CONFLICT_ACTION: "ignore" +# This action is centrally managed in https://github.com/asyncapi/.github/ +# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo + +# This workflow is designed to work with: +# - autoapprove and automerge workflows for dependabot and asyncapibot. +# - special release branches that we from time to time create in upstream repos. If we open up PRs for them from the very beginning of the release, the release branch will constantly update with new things from the destination branch they are opened against + +# It uses GitHub Action that auto-updates pull requests branches, whenever changes are pushed to their destination branch. +# Autoupdating to latest destination branch works only in the context of upstream repo and not forks + +name: autoupdate + +on: + push: + branches-ignore: + - 'version-bump/**' + - 'dependabot/**' + - 'bot/**' + - 'all-contributors/**' + +jobs: + autoupdate-for-bot: + if: startsWith(github.repository, 'asyncapi/') + name: Autoupdate autoapproved PR created in the upstream + runs-on: ubuntu-latest + steps: + - name: Autoupdating + uses: docker://chinthakagodawita/autoupdate-action:v1 + env: + GITHUB_TOKEN: '${{ secrets.GH_TOKEN_BOT_EVE }}' + PR_FILTER: "labelled" + PR_LABELS: "autoupdate" + PR_READY_STATE: "ready_for_review" + MERGE_CONFLICT_ACTION: "ignore" diff --git a/.github/workflows/bounty-program-commands.yml b/.github/workflows/bounty-program-commands.yml new file mode 100644 index 000000000..433f7d953 --- /dev/null +++ b/.github/workflows/bounty-program-commands.yml @@ -0,0 +1,90 @@ +# This workflow is centrally managed at https://github.com/asyncapi/.github/ +# Don't make changes to this file in this repository, as they will be overwritten with +# changes made to the same file in the abovementioned repository. + +# The purpose of this workflow is to allow Bounty Team members +# (https://github.com/orgs/asyncapi/teams/bounty_team) to issue commands to the +# organization's global AsyncAPI bot related to the Bounty Program, while at the +# same time preventing unauthorized users from misusing them. + +name: Bounty Program commands + +on: + issue_comment: + types: + - created + +jobs: + guard-against-unauthorized-use: + if: > + github.actor != ('aeworxet' || 'thulieblack') && + ( + contains(github.event.comment.body, '/bounty' ) + ) + + runs-on: ubuntu-latest + + steps: + - name: ❌ @${{github.actor}} made an unauthorized attempt to use a Bounty Program's command + uses: actions/github-script@v6 + + with: + github-token: ${{ secrets.GH_TOKEN }} + script: | + const commentText = `❌ @${{github.actor}} is not authorized to use the Bounty Program's commands. + These commands can only be used by members of the [Bounty Team](https://github.com/orgs/asyncapi/teams/bounty_team).`; + + console.log(`❌ @${{github.actor}} made an unauthorized attempt to use a Bounty Program's command.`); + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: commentText + }) + + add-label-bounty: + if: > + github.actor == ('aeworxet' || 'thulieblack') && + ( + contains(github.event.comment.body, '/bounty' ) + ) + + runs-on: ubuntu-latest + env: + BOUNTY_PROGRAM_LABELS_JSON: | + [ + {"name": "bounty", "color": "0e8a16", "description": "Participation in the Bounty Program"} + ] + + steps: + - name: Add label `bounty` + uses: actions/github-script@v6 + + with: + github-token: ${{ secrets.GH_TOKEN }} + script: | + const BOUNTY_PROGRAM_LABELS = JSON.parse(process.env.BOUNTY_PROGRAM_LABELS_JSON); + let LIST_OF_LABELS_FOR_REPO = await github.rest.issues.listLabelsForRepo({ + owner: context.repo.owner, + repo: context.repo.repo, + }); + + LIST_OF_LABELS_FOR_REPO = LIST_OF_LABELS_FOR_REPO.data.map(key => key.name); + + if (!LIST_OF_LABELS_FOR_REPO.includes(BOUNTY_PROGRAM_LABELS[0].name)) { + await github.rest.issues.createLabel({ + owner: context.repo.owner, + repo: context.repo.repo, + name: BOUNTY_PROGRAM_LABELS[0].name, + color: BOUNTY_PROGRAM_LABELS[0].color, + description: BOUNTY_PROGRAM_LABELS[0].description + }); + } + + console.log('Adding label `bounty`...'); + github.rest.issues.addLabels({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + labels: [BOUNTY_PROGRAM_LABELS[0].name] + }) diff --git a/.github/workflows/help-command.yml b/.github/workflows/help-command.yml index d4ba4a44c..3f4dcbc4c 100644 --- a/.github/workflows/help-command.yml +++ b/.github/workflows/help-command.yml @@ -31,9 +31,11 @@ jobs: At the moment the following comments are supported in pull requests: + - \`/please-take-a-look\` or \`/ptal\` - This comment will add a comment to the PR asking for attention from the reviewrs who have not reviewed the PR yet. - \`/ready-to-merge\` or \`/rtm\` - This comment will trigger automerge of PR in case all required checks are green, approvals in place and do-not-merge label is not added - \`/do-not-merge\` or \`/dnm\` - This comment will block automerging even if all conditions are met and ready-to-merge label is added - - \`/autoupdate\` or \`/au\` - This comment will add \`autoupdate\` label to the PR and keeps your PR up-to-date to the target branch's future changes. Unless there is a merge conflict or it is a draft PR.` + - \`/autoupdate\` or \`/au\` - This comment will add \`autoupdate\` label to the PR and keeps your PR up-to-date to the target branch's future changes. Unless there is a merge conflict or it is a draft PR. (Currently only works for upstream branches.) + - \`/update\` or \`/u\` - This comment will update the PR with the latest changes from the target branch. Unless there is a merge conflict or it is a draft PR. NOTE: this only updates the PR once, so if you need to update again, you need to call the command again.` }) create_help_comment_issue: diff --git a/.github/workflows/please-take-a-look-command.yml b/.github/workflows/please-take-a-look-command.yml new file mode 100644 index 000000000..b26cbc41a --- /dev/null +++ b/.github/workflows/please-take-a-look-command.yml @@ -0,0 +1,54 @@ +# This action is centrally managed in https://github.com/asyncapi/.github/ +# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo + +# It uses Github actions to listen for comments on issues and pull requests and +# if the comment contains /please-take-a-look or /ptal it will add a comment pinging +# the code-owners who are reviewers for PR + +name: Please take a Look + +on: + issue_comment: + types: [created] + +jobs: + ping-for-attention: + if: > + github.event.issue.pull_request && + github.event.issue.state != 'closed' && + github.actor != 'asyncapi-bot' && + ( + contains(github.event.comment.body, '/please-take-a-look') || + contains(github.event.comment.body, '/ptal') || + contains(github.event.comment.body, '/PTAL') + ) + runs-on: ubuntu-latest + steps: + - name: Check for Please Take a Look Command + uses: actions/github-script@v6 + with: + github-token: ${{ secrets.GH_TOKEN }} + script: | + const prDetailsUrl = context.payload.issue.pull_request.url; + const { data: pull } = await github.request(prDetailsUrl); + const reviewers = pull.requested_reviewers.map(reviewer => reviewer.login); + + const { data: reviews } = await github.rest.pulls.listReviews({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: context.issue.number + }); + + const reviewersWhoHaveReviewed = reviews.map(review => review.user.login); + + const reviewersWhoHaveNotReviewed = reviewers.filter(reviewer => !reviewersWhoHaveReviewed.includes(reviewer)); + + if (reviewersWhoHaveNotReviewed.length > 0) { + const comment = reviewersWhoHaveNotReviewed.filter(reviewer => reviewer !== 'asyncapi-bot-eve' ).map(reviewer => `@${reviewer}`).join(' '); + await github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: `${comment} Please take a look at this PR. Thanks! :wave:` + }); + } diff --git a/.github/workflows/update-pr.yml b/.github/workflows/update-pr.yml new file mode 100644 index 000000000..2fa19b0ad --- /dev/null +++ b/.github/workflows/update-pr.yml @@ -0,0 +1,102 @@ +# This workflow is centrally managed in https://github.com/asyncapi/.github/ +# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo + +# This workflow will run on every comment with /update or /u. And will create merge-commits for the PR. +# This also works with forks, not only with branches in the same repository/organization. +# Currently, does not work with forks in different organizations. + +# This workflow will be distributed to all repositories in the AsyncAPI organization + +name: Update PR branches from fork + +on: + issue_comment: + types: [created] + +jobs: + update-pr: + if: > + startsWith(github.repository, 'asyncapi/') && + github.event.issue.pull_request && + github.event.issue.state != 'closed' && ( + contains(github.event.comment.body, '/update') || + contains(github.event.comment.body, '/u') + ) + runs-on: ubuntu-latest + steps: + - name: Get Pull Request Details + id: pr + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }} + previews: 'merge-info-preview' # https://docs.github.com/en/graphql/overview/schema-previews#merge-info-preview-more-detailed-information-about-a-pull-requests-merge-state-preview + script: | + const prNumber = context.payload.issue.number; + core.debug(`PR Number: ${prNumber}`); + const { data: pr } = await github.rest.pulls.get({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: prNumber + }); + + // If the PR has conflicts, we don't want to update it + const updateable = ['behind', 'blocked', 'unknown', 'draft', 'clean'].includes(pr.mergeable_state); + console.log(`PR #${prNumber} is ${pr.mergeable_state} and is ${updateable ? 'updateable' : 'not updateable'}`); + core.setOutput('updateable', updateable); + + core.debug(`Updating PR #${prNumber} with head ${pr.head.sha}`); + + return { + id: pr.node_id, + number: prNumber, + head: pr.head.sha, + } + - name: Update the Pull Request + if: steps.pr.outputs.updateable == 'true' + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }} + script: | + const mutation = `mutation update($input: UpdatePullRequestBranchInput!) { + updatePullRequestBranch(input: $input) { + pullRequest { + mergeable + } + } + }`; + + const pr_details = ${{ steps.pr.outputs.result }}; + + try { + const { data } = await github.graphql(mutation, { + input: { + pullRequestId: pr_details.id, + expectedHeadOid: pr_details.head, + } + }); + } catch (GraphQLError) { + core.debug(GraphQLError); + if ( + GraphQLError.name === 'GraphqlResponseError' && + GraphQLError.errors.some( + error => error.type === 'FORBIDDEN' || error.type === 'UNAUTHORIZED' + ) + ) { + // Add comment to PR if the bot doesn't have permissions to update the PR + const comment = `Hi @${context.actor}. Update of PR has failed. It can be due to one of the following reasons: + - I don't have permissions to update this PR. To update your fork with upstream using bot you need to enable [Allow edits from maintainers](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork) option in the PR. + - The fork is located in an organization, not under your personal profile. No solution for that. You are on your own with manual update. + - There may be a conflict in the PR. Please resolve the conflict and try again.`; + + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + body: comment + }); + + core.setFailed('Bot does not have permissions to update the PR'); + } else { + core.setFailed(GraphQLError.message); + } + } diff --git a/CODEOWNERS b/CODEOWNERS index c20380469..c8e8985f8 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -5,4 +5,4 @@ # For more details, read the following article on GitHub: https://help.github.com/articles/about-codeowners/. # The default owners are automatically added as reviewers when you open a pull request unless different owners are specified in the file. -* @fmvilas @derberg @dalelane @smoya @char0n @asyncapi-bot-eve \ No newline at end of file +* @fmvilas @derberg @dalelane @smoya @char0n @asyncapi-bot-eve @GreenRover diff --git a/README.md b/README.md index f3b7d84b5..94e7ceb8f 100644 --- a/README.md +++ b/README.md @@ -1,49 +1,16 @@ [![AsyncAPI Logo](./assets/logo.png)](https://www.asyncapi.com) -
- - - ## Read the specification The latest draft specification can be found at [spec/asyncapi.md](./spec/asyncapi.md) which tracks the latest commit to the master branch in this repository. -The human-readable markdown file is the source of truth for the specification. -- [Version 2.6.0](https://github.com/asyncapi/spec/blob/v2.6.0/spec/asyncapi.md) (latest) +**The human-readable markdown file is the source of truth for the specification.** + +- [Version 3.0.0](https://github.com/asyncapi/spec/blob/v3.0.0/spec/asyncapi.md) (latest) ([website](https://www.asyncapi.com/docs/reference/specification/latest)) +
+ Click to see reference links to older versions of the specification. + +- [Version 2.6.0](https://github.com/asyncapi/spec/blob/v2.6.0/spec/asyncapi.md) - [Version 2.5.0](https://github.com/asyncapi/spec/blob/v2.5.0/spec/asyncapi.md) - [Version 2.4.0](https://github.com/asyncapi/spec/blob/v2.4.0/spec/asyncapi.md) - [Version 2.3.0](https://github.com/asyncapi/spec/blob/v2.3.0/spec/asyncapi.md) @@ -53,100 +20,67 @@ The human-readable markdown file is the source of truth for the specification. - [Version 1.2.0](https://github.com/asyncapi/spec/blob/1.2.0/README.md) (deprecated) - [Version 1.1.0](https://github.com/asyncapi/spec/blob/1.1.0/README.md) (deprecated) - [Version 1.0.0](https://github.com/asyncapi/spec/blob/1.0.0/README.md) (deprecated) +
-**Looking for the JSON Schema files?** Check out our [spec-json-schemas](https://github.com/asyncapi/spec-json-schemas) repo. - -**Feel like contributing?** Check out our [community repo](https://www.github.com/asyncapi/community). - -## Examples - -#### :bulb: Streetlights - -Demonstrates how to use AsyncAPI to define an API that controls city streetlights. +
-> :point_right: [See more](./examples/streetlights-mqtt.yml) +Looking for the JSON Schema files? Check out our [spec-json-schemas](https://github.com/asyncapi/spec-json-schemas) repo. -#### Slack icon   Slack Events API +Feel like contributing? Check out our [contributor's guide](./CONTRIBUTING.md). -Partial definition of the Slack Events API. Find the official one [here](https://github.com/slackapi/slack-api-specs/blob/master/events-api/slack_events_api_async_v1.json). - -> :point_right: [See more](./examples/slack-rtm.yml) - -#### Gitter icon   Gitter Streaming API - -Definition of the Gitter streaming API. - -> :point_right: [See more](./examples/gitter-streaming.yml) - -#### Gemini icon   Gemini WebSocket API - -Definition of the Gemini Websocket API. +## Examples -> :point_right: [See more](./examples/websocket-gemini.yml) +Check out the [examples](https://github.com/asyncapi/asyncapi/blob/master/examples) directory for examples. -#### :heavy_plus_sign: and more... +## Case Studies and Adopters -Check out the [examples](https://github.com/asyncapi/asyncapi/blob/master/examples) directory for more examples. +Check out the [AsyncAPI website](https://www.asyncapi.com/casestudies) to see the list of AsyncAPI adopters and their use cases. ## Our Sponsors +Want to become a sponsor? Learn [what we do with sponsors' money](https://www.asyncapi.com/finance) and [join the club](https://opencollective.com/asyncapi). + ### Platinum -

- - - Solace logo - -      - IBM logo - -      - - Postman logo - -

- + IBM logo + +     + + Solace logo + ### Gold - -

- - RedHat logo - -      - -

+ + Postman logo + ### Silver -

- - Bump.sh logo - -      - - swix logo - -      - -

+ Bump.sh logo + +     + + svix logo + + +
+ + + hivemq logo + +     + + aklivity logo + ### Bronze -

- - - ably.png logo - -      - - rviewer.png logo - -      -

+ + RedHat logo + ## Contributors @@ -156,45 +90,59 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Fran MΓ©ndez

πŸ’¬ πŸ› πŸ“ πŸ“– πŸ€” πŸš‡ 🚧 πŸ‘€ βœ… πŸ“’

Lukasz Gornicki

πŸ“– πŸ€” πŸ‘€ πŸ’¬ πŸ“ πŸ“’ 🚧 πŸš‡

Mike Ralphson

πŸ’¬ πŸ“– πŸ€” πŸš‡ πŸ‘€ 🚧

raisel melian

πŸ’¬ πŸ› πŸ“– πŸ€” 🚧 πŸ‘€

Chris Wood

πŸ€” πŸ“–

Jonathan Schabowsky

πŸ“– πŸ€”

Victor Romero

πŸ€” πŸ‘€

Antonio Garrote

πŸ€” πŸ‘€ πŸ“–

Jonathan Stoikovitch

πŸ’‘ πŸ€” πŸ‘€

Jonas Lagoni

πŸ› πŸ“– πŸ€” πŸ’¬ πŸ‘€ πŸ’‘

Waleed Ashraf

πŸ“’ πŸ€” πŸ“– πŸ’‘

Andrzej Jarzyna

πŸ“’

Emmelyn Wang

πŸ“ πŸ€” πŸ“– πŸ“’

Marc DiPasquale

πŸ“ πŸ“’ πŸ‘€ πŸ› πŸ€” πŸ“Ή

Gerald Loeffler

πŸ“– πŸ› πŸ€”

Dale Lane

πŸ“ πŸ€” πŸ“Ή πŸ“’ βœ… πŸ“–

Maciej UrbaΕ„czyk

πŸ‘€ πŸ€” πŸ’¬ πŸ› πŸ“– πŸ’‘ 🚧

Vladimir Gorej

πŸ“– πŸ› πŸ’‘ πŸ€” πŸ‘€

Lorna Jane Mitchell

πŸ“’ πŸ€”

Laurent Broudoux

πŸ“– πŸ“ πŸ“’ πŸ’‘ πŸ€” πŸ‘€

Jesse Menning

πŸ“ πŸ“’ πŸ‘€ πŸ€”

Sergio Moya

πŸ‘€ πŸ€” πŸ’¬ πŸ“ πŸ› πŸ“– πŸ’‘ 🚧

Alexander Balogh

πŸ“– πŸ›

Khuda Dad Nomani

πŸ’‘ πŸ›

Aaron Korver

πŸ“–

Orlov Valentine

πŸ“–

Moez Bouhlel

πŸ“–

Muhammad Rafly Andrianza

πŸ“–

Daniel Kocot

πŸ“– πŸ’‘ πŸ€”

sekharbans-ebay

πŸ“– πŸ’‘ πŸ€”

Michael Davis

πŸ› πŸ“– πŸ’‘ πŸ€”
Fran MΓ©ndez
Fran MΓ©ndez

πŸ’¬ πŸ› πŸ“ πŸ“– πŸ€” πŸš‡ 🚧 πŸ‘€ βœ… πŸ“’
Lukasz Gornicki
Lukasz Gornicki

πŸ“– πŸ€” πŸ‘€ πŸ’¬ πŸ“ πŸ“’ 🚧 πŸš‡
Mike Ralphson
Mike Ralphson

πŸ’¬ πŸ“– πŸ€” πŸš‡ πŸ‘€ 🚧
raisel melian
raisel melian

πŸ’¬ πŸ› πŸ“– πŸ€” 🚧 πŸ‘€
Chris Wood
Chris Wood

πŸ€” πŸ“–
Jonathan Schabowsky
Jonathan Schabowsky

πŸ“– πŸ€”
Victor Romero
Victor Romero

πŸ€” πŸ‘€
Antonio Garrote
Antonio Garrote

πŸ€” πŸ‘€ πŸ“–
Jonathan Stoikovitch
Jonathan Stoikovitch

πŸ’‘ πŸ€” πŸ‘€
Jonas Lagoni
Jonas Lagoni

πŸ› πŸ“– πŸ€” πŸ’¬ πŸ‘€ πŸ’‘
Waleed Ashraf
Waleed Ashraf

πŸ“’ πŸ€” πŸ“– πŸ’‘
Andrzej Jarzyna
Andrzej Jarzyna

πŸ“’
Emmelyn Wang
Emmelyn Wang

πŸ“ πŸ€” πŸ“– πŸ“’
Marc DiPasquale
Marc DiPasquale

πŸ“ πŸ“’ πŸ‘€ πŸ› πŸ€” πŸ“Ή
Gerald Loeffler
Gerald Loeffler

πŸ“– πŸ› πŸ€”
Dale Lane
Dale Lane

πŸ“ πŸ€” πŸ“Ή πŸ“’ βœ… πŸ“–
Maciej UrbaΕ„czyk
Maciej UrbaΕ„czyk

πŸ‘€ πŸ€” πŸ’¬ πŸ› πŸ“– πŸ’‘ 🚧
Vladimir Gorej
Vladimir Gorej

πŸ“– πŸ› πŸ’‘ πŸ€” πŸ‘€
Lorna Jane Mitchell
Lorna Jane Mitchell

πŸ“’ πŸ€”
Laurent Broudoux
Laurent Broudoux

πŸ“– πŸ“ πŸ“’ πŸ’‘ πŸ€” πŸ‘€
Jesse Menning
Jesse Menning

πŸ“ πŸ“’ πŸ‘€ πŸ€”
Sergio Moya
Sergio Moya

πŸ‘€ πŸ€” πŸ’¬ πŸ“ πŸ› πŸ“– πŸ’‘ 🚧
Alexander Balogh
Alexander Balogh

πŸ“– πŸ›
Khuda Dad Nomani
Khuda Dad Nomani

πŸ’‘ πŸ›
Aaron Korver
Aaron Korver

πŸ“–
Orlov Valentine
Orlov Valentine

πŸ“–
Moez Bouhlel
Moez Bouhlel

πŸ“–
Muhammad Rafly Andrianza
Muhammad Rafly Andrianza

πŸ“–
Daniel Kocot
Daniel Kocot

πŸ“– πŸ’‘ πŸ€”
sekharbans-ebay
sekharbans-ebay

πŸ“– πŸ’‘ πŸ€”
Michael Davis
Michael Davis

πŸ› πŸ“– πŸ’‘ πŸ€”
Heiko Henning
Heiko Henning

πŸ› πŸ’» πŸ–‹ πŸ“– πŸ’‘ πŸ€” 🚧 πŸ‘€
Quetzalli
Quetzalli

πŸ–‹ πŸ“– πŸ’‘ πŸ€” πŸ‘€
Akshit Gupta
Akshit Gupta

πŸ–‹ πŸ“–
samz
samz

πŸ› πŸ–‹ πŸ“– πŸ’‘ πŸ“†
Rishi
Rishi

🚧 πŸš‡
nickshoe
nickshoe

πŸ› πŸ“–
Ace
Ace

πŸ“‹ πŸ€” 🚧 πŸ“’
Animesh Kumar
Animesh Kumar

πŸ–‹ πŸ“– 🚧
Fabrizio Lazzaretti
Fabrizio Lazzaretti

πŸ“–
Pavel Bodiachevskii
Pavel Bodiachevskii

πŸ“– πŸ› πŸ€” πŸ’¬
diff --git a/assets/ably.png b/assets/ably.png deleted file mode 100644 index b451373d2..000000000 Binary files a/assets/ably.png and /dev/null differ diff --git a/assets/aklivity.png b/assets/aklivity.png new file mode 100644 index 000000000..723612a73 Binary files /dev/null and b/assets/aklivity.png differ diff --git a/assets/hivemq-white-bg.png b/assets/hivemq-white-bg.png new file mode 100644 index 000000000..993d5891b Binary files /dev/null and b/assets/hivemq-white-bg.png differ diff --git a/assets/hivemq.png b/assets/hivemq.png new file mode 100644 index 000000000..46ce52352 Binary files /dev/null and b/assets/hivemq.png differ diff --git a/assets/svix.png b/assets/svix.png new file mode 100644 index 000000000..d4f764807 Binary files /dev/null and b/assets/svix.png differ diff --git a/assets/swix.png b/assets/swix.png deleted file mode 100644 index 88325e9dd..000000000 Binary files a/assets/swix.png and /dev/null differ diff --git a/examples/adeo-kafka-request-reply-asyncapi.yml b/examples/adeo-kafka-request-reply-asyncapi.yml index 2a2c2e3ed..623d2f563 100644 --- a/examples/adeo-kafka-request-reply-asyncapi.yml +++ b/examples/adeo-kafka-request-reply-asyncapi.yml @@ -206,36 +206,42 @@ components: RequesterId: type: string description: The Costing requester service account used to produce costing request. - example: svc-ecollect-app + examples: + - svc-ecollect-app RequesterCode: type: string description: >- The Costing requester code (generally the BU Code). The requester code is useful to get the dedicated context (tenant). - example: 1 + examples: + - 1 MessageId: type: string format: uuid description: A unique Message ID. - example: 1fa6ef40-8f47-40a8-8cf6-f8607d0066ef + examples: + - 1fa6ef40-8f47-40a8-8cf6-f8607d0066ef RequestId: type: string format: uuid description: >- A unique Request ID needed to define a `CORRELATION_ID` for exchanges, which will be sent back in the Costing Responses. - example: 1fa6ef40-8f47-40a8-8cf6-f8607d0066ef + examples: + - 1fa6ef40-8f47-40a8-8cf6-f8607d0066ef CorrelationId: type: string format: uuid description: >- A unique Correlation ID defined from the `REQUEST_ID` or the `MESSAGE_ID` provided in the Costing Request. - example: 1fa6ef40-8f47-40a8-8cf6-f8607d0066ef + examples: + - 1fa6ef40-8f47-40a8-8cf6-f8607d0066ef BuCode: type: string description: The Business Unit code for which data are applicable. - example: 1 + examples: + - 1 ReplyTopic: type: string description: > @@ -243,22 +249,26 @@ components: the [Return Address EIP pattern](https://www.enterpriseintegrationpatterns.com/patterns/messaging/ReturnAddress.html). **You must grant WRITE access to our `svc-ccr-app` service account.** - example: adeo-case-study-COSTING-RESPONSE-V1 + examples: + - adeo-case-study-COSTING-RESPONSE-V1 ErrorStep: type: string description: | The woker that has thrown the error. - example: EXPOSE_RESULT + examples: + - EXPOSE_RESULT ErrorMessage: type: string description: | The error message describing the error. - example: Error message + examples: + - Error message ErrorCode: type: string description: | The error code. - example: CURRENCY_NOT_FOUND + examples: + - CURRENCY_NOT_FOUND parameters: Env: description: Adeo Kafka Environement for messages publications. diff --git a/spec/asyncapi.md b/spec/asyncapi.md index 479648102..3e26f0c55 100644 --- a/spec/asyncapi.md +++ b/spec/asyncapi.md @@ -1,10 +1,10 @@ # AsyncAPI Specification -#### Attribution +## Attribution Part of this content has been taken from the great work done by the folks at the [OpenAPI Initiative](https://openapis.org). -#### Version 3.0.0 +### Version 3.0.0 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC 2119](https://www.ietf.org/rfc/rfc2119.txt). @@ -14,10 +14,9 @@ The AsyncAPI Specification is licensed under [The Apache License, Version 2.0](h The AsyncAPI Specification is a project used to describe message-driven APIs in a machine-readable format. It’s protocol-agnostic, so you can use it for APIs that work over any protocol (e.g., AMQP, MQTT, WebSockets, Kafka, STOMP, HTTP, Mercure, etc). -The AsyncAPI Specification defines a set of files required to describe the API of an [application](#definitionsApplication). -These files can be used to create utilities, such as documentation, code, integration, or testing tools. +The AsyncAPI Specification defines a set of fields that can be used in an AsyncAPI document to describe an [application](#definitionsApplication)'s API. The document may reference other files for additional details or shared fields, but it is typically a single, primary document that encapsulates the API description. -The file(s) SHOULD describe the [operations](#definitionsOperation) an [application](#definitionsApplication) performs. For instance, consider the following AsyncAPI definition snippet: +The AsyncAPI document SHOULD describe the [operations](#definitionsOperation) an [application](#definitionsApplication) performs. For instance, consider the following AsyncAPI definition snippet: ```yaml channels: @@ -105,7 +104,7 @@ Aside from the issues mentioned above, there may also be infrastructure configur - [Multi Format Schema Object](#multiFormatSchemaObject) - [Schema Object](#schemaObject) - [Security Scheme Object](#securitySchemeObject) - - [OAuth Flows Object](#oauth-flows-object) + - [OAuth Flows Object](#oauth-flows-object) - [OAuth Flow Object](#oauth-flow-object) - [Server Bindings Object](#serverBindingsObject) - [Parameters Object](#parametersObject) @@ -121,31 +120,39 @@ Aside from the issues mentioned above, there may also be infrastructure configur ## Definitions ### Server + A server MAY be a message broker that is capable of sending and/or receiving between a [sender](#definitionsSender) and [receiver](#definitionsReceiver). A server MAY be a service with WebSocket API that enables message-driven communication between browser-to-server or server-to-server. ### Application -An application is any kind of computer program or a group of them. It MUST be a [sender](#definitionsSender), a [receiver](#definitionsReceiver), or both. An application MAY be a microservice, IoT device (sensor), mainframe process, message broker, etc. An application MAY be written in any number of different programming languages as long as they support the selected [protocol](#definitionsProtocol). An application MUST also use a protocol supported by the [server](#definitionsServer) in order to connect and exchange [messages](#definitionsMessage). + +An application is any kind of computer program or a group of them. It MUST be a [sender](#definitionsSender), a [receiver](#definitionsReceiver), or both. An application MAY be a microservice, IoT device (sensor), mainframe process, message broker, etc. An application MAY be written in any number of different programming languages as long as they support the selected [protocol](#definitionsProtocol). An application MUST also use a protocol supported by the [server](#definitionsServer) in order to connect and exchange [messages](#definitionsMessage). ### Sender + A sender is a type of application, that is sending [messages](#definitionsMessage) to [channels](#definitionsChannel). A sender MAY send to multiple channels depending on the [server](#definitionsServer), protocol, and use-case pattern. ### Receiver + A receiver is a type of application that is receiving [messages](#definitionsMessage) from [channels](#definitionsChannel). A receiver MAY receive from multiple channels depending on the [server](#definitionsServer), protocol, and the use-case pattern. A receiver MAY forward a received message further without changing it. A receiver MAY act as a consumer and react to the message. A receiver MAY act as a processor that, for example, aggregates multiple messages in one and forwards them. ### Operation An operation describes a specific action an [application](#definitionsApplication) can take to interact with other [sender](#definitionsSender) or [receiver](#definitionsReceiver) applications. Operations are performed by sending (or receiving) [messages](#definitionsMessage) to (or from) [channels](#definitionsChannel). ### Message -A message is the mechanism by which information is exchanged via a channel between [servers](#definitionsServer) and applications. A message MAY contain a payload and MAY also contain headers. The headers MAY be subdivided into [protocol](#definitionsProtocol)-defined headers and header properties defined by the application which can act as supporting metadata. The payload contains the data, defined by the application, which MUST be serialized into a format (JSON, XML, Avro, binary, etc.). Since a message is a generic mechanism, it can support multiple interaction patterns such as event, command, request, or response. + +A message is the mechanism by which information is exchanged via a channel between [servers](#definitionsServer) and applications. A message MAY contain a payload and MAY also contain headers. The headers MAY be subdivided into [protocol](#definitionsProtocol)-defined headers and header properties defined by the application which can act as supporting metadata. The payload contains the data, defined by the application, which MUST be serialized into a format (JSON, XML, Avro, binary, etc.). Since a message is a generic mechanism, it can support multiple interaction patterns such as event, command, request, or response. ### Channel + A channel is an addressable component, made available by the [server](#definitionsServer), for the organization of [messages](#definitionsMessage). [Sender](#definitionsSender) applications send messages to channels and [receiver](#definitionsReceiver) applications receive messages from channels to perform an [operation](#definitionsOperation). [Servers](#definitionsServer) MAY support many channel instances, allowing messages with different content to be addressed to different channels. Depending on the [server](#definitionsServer) implementation, the channel MAY be included in the message via protocol-defined headers. ### Protocol -A protocol is the mechanism (wireline protocol or API) by which [messages](#definitionsMessage) are exchanged between the application and the [channel](#definitionsChannel). Example protocols include, but are not limited to, AMQP, HTTP, JMS, Kafka, Anypoint MQ, MQTT, Solace, STOMP, Mercure, WebSocket, Google Pub/Sub, Pulsar. + +A protocol is the mechanism (wireline protocol or API) by which [messages](#definitionsMessage) are exchanged between the application and the [channel](#definitionsChannel). Example protocols include, but are not limited to, AMQP, HTTP, JMS, Kafka, Anypoint MQ, MQTT, Solace, STOMP, Mercure, WebSocket, Google Pub/Sub, Pulsar. ### Bindings -A "binding" (or "protocol binding") is a mechanism to define protocol-specific information. Therefore, a protocol binding MUST define protocol-specific information only. + +A "binding" (or "protocol binding") is a mechanism to define protocol-specific information. Therefore, a protocol binding MUST define protocol-specific information only. ## Specification @@ -226,7 +233,7 @@ This field represents a unique universal identifier of the [application](#defini It is RECOMMENDED to use a [URN](https://tools.ietf.org/html/rfc8141) to globally and uniquely identify the application during long periods of time, even after it becomes unavailable or ceases to exist. -###### Examples +##### Examples ```json { @@ -268,7 +275,7 @@ Field Name | Type | Description This object MAY be extended with [Specification Extensions](#specificationExtensions). -##### Info Object Example: +##### Info Object Example ```json { @@ -330,7 +337,7 @@ Field Name | Type | Description This object MAY be extended with [Specification Extensions](#specificationExtensions). -##### Contact Object Example: +##### Contact Object Example ```json { @@ -359,7 +366,7 @@ Field Name | Type | Description This object MAY be extended with [Specification Extensions](#specificationExtensions). -##### License Object Example: +##### License Object Example ```json { @@ -393,7 +400,7 @@ Field Pattern | Type | Description "protocol": "amqp", "protocolVersion": "0-9-1", "tags": [ - { + { "name": "env:development", "description": "This environment is meant for developers to run their own tests." } @@ -405,7 +412,7 @@ Field Pattern | Type | Description "protocol": "amqp", "protocolVersion": "0-9-1", "tags": [ - { + { "name": "env:staging", "description": "This environment is a replica of the production environment." } @@ -417,7 +424,7 @@ Field Pattern | Type | Description "protocol": "amqp", "protocolVersion": "0-9-1", "tags": [ - { + { "name": "env:production", "description": "This environment is the live environment available for final users." } @@ -453,7 +460,6 @@ production: description: "This environment is the live environment available for final users." ``` - #### Server Object An object representing a message broker, a server or any other kind of computer program capable of sending and/or receiving data. This object is used to capture details such as URIs, protocols and security configuration. Variable substitution can be used so that some details, for example usernames and passwords, can be injected by code generation tools. @@ -561,7 +567,6 @@ variables: - staging ``` - #### Default Content Type A string representing the default content type to use when encoding/decoding a message's payload. The value MUST be a specific media type (e.g. `application/json`). This value MUST be used by schema parsers when the [contentType](#messageObjectContentType) property is omitted. @@ -580,11 +585,6 @@ In case a message can't be encoded/decoded using this value, schema parsers MUST defaultContentType: application/json ``` - - - - - #### Channels Object An object containing all the [Channel Object](#channelObject) definitions the [Application](#definitionsApplication) MUST use during runtime. @@ -618,9 +618,6 @@ userSignedUp: $ref: '#/components/messages/userSignedUp' ``` - - - #### Channel Object Describes a shared communication channel. @@ -640,7 +637,6 @@ Field Name | Type | Description externalDocs | [External Documentation Object](#externalDocumentationObject) \| [Reference Object](#referenceObject) | Additional external documentation for this channel. bindings | [Channel Bindings Object](#channelBindingsObject) \| [Reference Object](#referenceObject) | A map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the channel. - This object MAY be extended with [Specification Extensions](#specificationExtensions). ##### Channel Object Example @@ -714,20 +710,12 @@ externalDocs: url: 'https://example.com' ``` - - - - #### Channel Address Expressions Channel addresses MAY contain expressions that can be used to define dynamic values. Expressions MUST be composed by a name enclosed in curly braces (`{` and `}`). E.g., `{userId}`. - - - - #### Messages Object Describes a map of messages included in a channel. @@ -758,8 +746,6 @@ userCompletedOrder: $ref: '#/components/messages/userCompletedOrder' ``` - - #### Operations Object Holds a dictionary with all the [operations](#operationObject) this application MUST implement. @@ -820,7 +806,6 @@ onUserSignUp: - $ref: '#/components/operationTraits/kafka' ``` - #### Operation Object Describes a specific [operation](#definitionsOperation). @@ -924,12 +909,9 @@ reply: - $ref: '#/components/messages/userSignedUpReply' ``` - - - #### Operation Trait Object -Describes a trait that MAY be applied to an [Operation Object](#operationObject). This object MAY contain any property from the [Operation Object](#operationObject), except the `action`, `channel` and `traits` ones. +Describes a trait that MAY be applied to an [Operation Object](#operationObject). This object MAY contain any property from the [Operation Object](#operationObject), except the `action`, `channel`, `messages` and `traits` ones. If you're looking to apply traits to a message, see the [Message Trait Object](#messageTraitObject). @@ -965,9 +947,6 @@ bindings: ack: false ``` - - - #### Operation Reply Object Describes the reply part that MAY be applied to an Operation Object. If an [operation](#definitionsOperation) implements the request/reply pattern, the reply object represents the response message. @@ -984,11 +963,10 @@ This object MAY be extended with [Specification Extensions](#specificationExtens #### Operation Reply Address Object -An object that specifies where an [operation](#definitionsOperation) has to send the reply. +An object that specifies where an operation has to send the reply. For specifying and computing the location of a reply address, a [runtime expression](#runtimeExpression) is used. - ##### Fixed Fields Field Name | Type | Description @@ -1012,7 +990,6 @@ description: Consumer Inbox location: $message.header#/replyTo ``` - #### Parameters Object Describes a map of parameters included in a channel address. @@ -1045,10 +1022,6 @@ parameters: description: Id of the user. ``` - - - - #### Parameter Object Describes a parameter included in a channel address. @@ -1087,9 +1060,6 @@ parameters: location: $message.payload#/user/id ``` - - - #### Server Bindings Object Map describing protocol-specific definitions for a server. @@ -1120,8 +1090,6 @@ Field Name | Type | Description This object MAY be extended with [Specification Extensions](#specificationExtensions). - - #### Channel Bindings Object Map describing protocol-specific definitions for a channel. @@ -1152,8 +1120,6 @@ Field Name | Type | Description This object MAY be extended with [Specification Extensions](#specificationExtensions). - - #### Operation Bindings Object Map describing protocol-specific definitions for an operation. @@ -1184,9 +1150,6 @@ Field Name | Type | Description This object MAY be extended with [Specification Extensions](#specificationExtensions). - - - #### Message Bindings Object Map describing protocol-specific definitions for a message. @@ -1217,12 +1180,6 @@ Field Name | Type | Description This object MAY be extended with [Specification Extensions](#specificationExtensions). - - - - - - #### Message Object Describes a [message](#definitionsMessage) that can be sent to or received from a given [channel](#definitionsChannel) to perform an [operation](#definitionsOperation). @@ -1232,7 +1189,7 @@ Describes a [message](#definitionsMessage) that can be sent to or received from Field Name | Type | Description ---|:---:|--- headers | [Multi Format Schema Object](#multiFormatSchemaObject) | [Schema Object](#schemaObject) | [Reference Object](#referenceObject) | Schema definition of the application headers. Schema MUST be a map of key-value pairs. It **MUST NOT** define the protocol headers. If this is a [Schema Object](#schemaObject), then the `schemaFormat` will be assumed to be "application/vnd.aai.asyncapi+json;version=`asyncapi`" where the version is equal to the [AsyncAPI Version String](#A2SVersionString). -payload | [Multi Format Schema Object](#multiFormatSchemaObject) | [Schema Object](#schemaObject) | [Reference Object](#referenceObject) | Definition of the message payload. If this is a [Schema Object](#schemaObject), then the `schemaFormat` will be assumed to be "application/vnd.aai.asyncapi+json;version=`asyncapi`" where the version is equal to the [AsyncAPI Version String](#A2SVersionString). +payload | [Multi Format Schema Object](#multiFormatSchemaObject) | [Schema Object](#schemaObject) | [Reference Object](#referenceObject) | Definition of the message payload. If this is a [Schema Object](#schemaObject), then the `schemaFormat` will be assumed to be "application/vnd.aai.asyncapi+json;version=`asyncapi`" where the version is equal to the [AsyncAPI Version String](#A2SVersionString). correlationId | [Correlation ID Object](#correlationIdObject) | [Reference Object](#referenceObject) | Definition of the correlation ID used for message tracing or matching. contentType | `string` | The content type to use when encoding/decoding a message's payload. The value MUST be a specific media type (e.g. `application/json`). When omitted, the value MUST be the one specified on the [defaultContentType](#defaultContentTypeString) field. name | `string` | A machine-friendly name for the message. @@ -1394,12 +1351,6 @@ payload: $ref: 'path/to/user-create.avsc/#UserCreate' ``` - - - - - - #### Message Trait Object Describes a trait that MAY be applied to a [Message Object](#messageObject). This object MAY contain any property from the [Message Object](#messageObject), except `payload` and `traits`. @@ -1438,13 +1389,13 @@ contentType: application/json #### Message Example Object -Message Example Object represents an example of a [Message Object](#messageObject) and MUST contain either **headers** and/or **payload** fields. +Message Example Object represents an example of a [Message Object](#messageObject) and MUST contain either **headers** and/or **payload** fields. ##### Fixed Fields Field Name | Type | Description ---|:---:|--- -headers | `Map[string, any]` | The value of this field MUST validate against the [Message Object's headers](#messageObjectHeaders) field. +headers | `Map[string, any]` | The value of this field MUST validate against the [Message Object's headers](#messageObjectHeaders) field. payload | `Map[string, any]` | The value of this field MUST validate against the [Message Object's payload](#messageObjectPayload) field. name | `string` | A machine-friendly name. summary | `string` | A short summary of what the example is about. @@ -1494,6 +1445,7 @@ A Tags object is a list of [Tag Objects](#tagObject). An [Tag Object](#tagObject Allows adding meta data to a single tag. ##### Fixed Fields + Field Name | Type | Description ---|:---:|--- name | `string` | **REQUIRED.** The name of the tag. @@ -1506,8 +1458,8 @@ This object MAY be extended with [Specification Extensions](#specificationExtens ```json { - "name": "user", - "description": "User-related messages" + "name": "user", + "description": "User-related messages" } ``` @@ -1516,12 +1468,6 @@ name: user description: User-related messages ``` - - - - - - #### External Documentation Object Allows referencing an external resource for extended documentation. @@ -1549,7 +1495,6 @@ description: Find more info here url: https://example.com ``` - #### Reference Object A simple object to allow referencing other components in the specification, internally and externally. @@ -1559,6 +1504,7 @@ The Reference Object is defined by [JSON Reference](https://tools.ietf.org/html/ For this specification, reference resolution is done as defined by the JSON Reference specification and not by the JSON Schema specification. ##### Fixed Fields + Field Name | Type | Description ---|:---:|--- $ref | `string` | **REQUIRED.** The reference string. @@ -1585,14 +1531,14 @@ All objects defined within the components object will have no effect on the API ##### Fixed Fields Field Name | Type | Description ----|:---|--- +---|:---|--- schemas | Map[`string`, [Multi Format Schema Object](#multiFormatSchemaObject) \| [Schema Object](#schemaObject) \| [Reference Object](#referenceObject)] | An object to hold reusable [Schema Object](#schemaObject). If this is a [Schema Object](#schemaObject), then the `schemaFormat` will be assumed to be "application/vnd.aai.asyncapi+json;version=`asyncapi`" where the version is equal to the [AsyncAPI Version String](#A2SVersionString). servers | Map[`string`, [Server Object](#serverObject) \| [Reference Object](#referenceObject)] | An object to hold reusable [Server Objects](#serverObject). channels | Map[`string`, [Channel Object](#channelObject) \| [Reference Object](#referenceObject)] | An object to hold reusable [Channel Objects](#channelObject). operations | Map[`string`, [Operation Object](#operationObject) \| [Reference Object](#referenceObject)] | An object to hold reusable [Operation Objects](#operationObject). messages | Map[`string`, [Message Object](#messageObject) \| [Reference Object](#referenceObject)] | An object to hold reusable [Message Objects](#messageObject). securitySchemes| Map[`string`, [Security Scheme Object](#securitySchemeObject) \| [Reference Object](#referenceObject)] | An object to hold reusable [Security Scheme Objects](#securitySchemeObject). - serverVariables | Map[`string`, [Server Variable Object](#serverVariableObject) \| [Reference Object](#referenceObject)] | An object to hold reusable [Server Variable Objects](#serverVariableObject). + serverVariables | Map[`string`, [Server Variable Object](#serverVariableObject) \| [Reference Object](#referenceObject)] | An object to hold reusable [Server Variable Objects](#serverVariableObject). parameters | Map[`string`, [Parameter Object](#parameterObject) \| [Reference Object](#referenceObject)] | An object to hold reusable [Parameter Objects](#parameterObject). correlationIds | Map[`string`, [Correlation ID Object](#correlationIdObject) \| [Reference Object](#referenceObject)] | An object to hold reusable [Correlation ID Objects](#correlationIdObject). replies | Map[`string`, [Operation Reply Object](#operationReplyObject) \| [Reference Object](#referenceObject)] | An object to hold reusable [Operation Reply Objects](#operationReplyObject). @@ -1612,7 +1558,7 @@ All the fixed fields declared above are objects that MUST use keys that match th Field Name Examples: -``` +```text User User_1 User_Name @@ -1861,17 +1807,39 @@ The following table contains a set of values that every implementation MUST supp Name | Allowed values | Notes ---|:---:|--- [AsyncAPI 3.0.0 Schema Object](#schemaObject) | `application/vnd.aai.asyncapi;version=3.0.0`, `application/vnd.aai.asyncapi+json;version=3.0.0`, `application/vnd.aai.asyncapi+yaml;version=3.0.0` | This is the default when a `schemaFormat` is not provided. -[JSON Schema Draft 07](https://json-schema.org/specification-links.html#draft-7) | `application/schema+json;version=draft-07`, `application/schema+yaml;version=draft-07` | +[JSON Schema Draft 07](https://json-schema.org/specification-links.html#draft-7) | `application/schema+json;version=draft-07`, `application/schema+yaml;version=draft-07` | The following table contains a set of values that every implementation is RECOMMENDED to support. Name | Allowed values | Notes ---|:---:|--- [Avro 1.9.0 schema](https://avro.apache.org/docs/1.9.0/spec.html#schemas) | `application/vnd.apache.avro;version=1.9.0`, `application/vnd.apache.avro+json;version=1.9.0`, `application/vnd.apache.avro+yaml;version=1.9.0` | -[OpenAPI 3.0.0 Schema Object](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#schemaObject) | `application/vnd.oai.openapi;version=3.0.0`, `application/vnd.oai.openapi+json;version=3.0.0`, `application/vnd.oai.openapi+yaml;version=3.0.0` | +[OpenAPI 3.0.0 Schema Object](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#schemaObject) | `application/vnd.oai.openapi;version=3.0.0`, `application/vnd.oai.openapi+json;version=3.0.0`, `application/vnd.oai.openapi+yaml;version=3.0.0` | [RAML 1.0 data type](https://github.com/raml-org/raml-spec/blob/master/versions/raml-10/raml-10.md/) | `application/raml+yaml;version=1.0` | -[Protocol Buffers](https://protobuf.dev/) | `application/vnd.google.protobuf;version=2`, `application/vnd.google.protobuf;version=3` | +[Protocol Buffers](https://protobuf.dev/) | `application/vnd.google.protobuf;version=2`, `application/vnd.google.protobuf;version=3` | + +##### Multi Format Schema Object Examples +###### Multi Format Schema Object Example with Avro + +```yaml +channels: + example: + messages: + myMessage: + payload: + schemaFormat: 'application/vnd.apache.avro;version=1.9.0' + schema: + type: record + name: User + namespace: com.company + doc: User information + fields: + - name: displayName + type: string + - name: age + type: int +``` #### Schema Object @@ -1879,7 +1847,7 @@ The Schema Object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. This object is a superset of the [JSON Schema Specification Draft 07](https://json-schema.org/). The empty schema (which allows any instance to validate) MAY be represented by the `boolean` value `true` and a schema which allows no instance to validate MAY be represented by the `boolean` value `false`. Further information about the properties can be found in [JSON Schema Core](https://tools.ietf.org/html/draft-handrews-json-schema-01) and [JSON Schema Validation](https://tools.ietf.org/html/draft-handrews-json-schema-validation-01). -Unless stated otherwise, the property definitions follow the JSON Schema specification as referenced here. +Unless stated otherwise, the property definitions follow the JSON Schema specification as referenced here. For other formats (e.g., Avro, RAML, etc) see [Multi Format Schema Object](#multiFormatSchemaObject). ##### Properties @@ -1930,6 +1898,7 @@ Alternatively, any time a Schema Object can be used, a [Reference Object](#refer In addition to the JSON Schema fields, the following AsyncAPI vocabulary fields MAY be used for further schema documentation: ##### Fixed Fields + Field Name | Type | Description ---|:---:|--- discriminator | `string` | Adds support for polymorphism. The discriminator is the schema property name that is used to differentiate between other schema that inherit this schema. The property name used MUST be defined at this schema and it MUST be in the `required` property list. When used, the value MUST be the name of this schema or any schema that inherits it. See [Composition and Inheritance](#schemaComposition) for more details. @@ -1941,7 +1910,7 @@ This object MAY be extended with [Specification Extensions](#specificationExtens ###### Composition and Inheritance (Polymorphism) The AsyncAPI Specification allows combining and extending model definitions using the `allOf` property of JSON Schema, in effect offering model composition. -`allOf` takes in an array of object definitions that are validated *independently* but together compose a single object. +`allOf` takes in an array of object definitions that are validated _independently_ but together compose a single object. While composition offers model extensibility, it does not imply a hierarchy between the models. To support polymorphism, AsyncAPI Specification adds the support of the `discriminator` field. @@ -1952,7 +1921,7 @@ There are two ways to define the value of a discriminator for an inheriting inst - Use the schema's name. - Override the schema's name by overriding the property with a new value. If exists, this takes precedence over the schema's name. -As such, inline schema definitions, which do not have a given id, *cannot* be used in polymorphism. +As such, inline schema definitions, which do not have a given id, _cannot_ be used in polymorphism. ##### Schema Object Examples @@ -2337,25 +2306,22 @@ schemas: - color ``` - - - - #### Security Scheme Object Defines a security scheme that can be used by the operations. Supported schemes are: -* User/Password. -* API key (either as user or as password). -* X.509 certificate. -* End-to-end encryption (either symmetric or asymmetric). -* HTTP authentication. -* HTTP API key. -* OAuth2's common flows (Implicit, Resource Owner Protected Credentials, Client Credentials and Authorization Code) as defined in [RFC6749](https://tools.ietf.org/html/rfc6749). -* [OpenID Connect Discovery](https://tools.ietf.org/html/draft-ietf-oauth-discovery-06). -* SASL (Simple Authentication and Security Layer) as defined in [RFC4422](https://tools.ietf.org/html/rfc4422). +- User/Password. +- API key (either as user or as password). +- X.509 certificate. +- End-to-end encryption (either symmetric or asymmetric). +- HTTP authentication. +- HTTP API key. +- OAuth2's common flows (Implicit, Resource Owner Protected Credentials, Client Credentials and Authorization Code) as defined in [RFC6749](https://tools.ietf.org/html/rfc6749). +- [OpenID Connect Discovery](https://tools.ietf.org/html/draft-ietf-oauth-discovery-06). +- SASL (Simple Authentication and Security Layer) as defined in [RFC4422](https://tools.ietf.org/html/rfc4422). ##### Fixed Fields + Field Name | Type | Applies To | Description ---|:---:|---|--- type | `string` | Any | **REQUIRED**. The type of the security scheme. Valid values are `"userPassword"`, `"apiKey"`, `"X509"`, `"symmetricEncryption"`, `"asymmetricEncryption"`, `"httpApiKey"`, `"http"`, `"oauth2"`, `"openIdConnect"`, `"plain"`, `"scramSha256"`, `"scramSha512"`, and `"gssapi"`. @@ -2517,6 +2483,7 @@ type: scramSha512 Allows configuration of the supported OAuth Flows. ##### Fixed Fields + Field Name | Type | Description ---|:---:|--- implicit| [OAuth Flow Object](#oauthFlowObject) | Configuration for the OAuth Implicit flow. @@ -2531,6 +2498,7 @@ This object MAY be extended with [Specification Extensions](#specificationExtens Configuration details for a supported OAuth Flow ##### Fixed Fields + Field Name | Type | Applies To | Description ---|:---:|---|--- authorizationUrl | `string` | `oauth2` (`"implicit"`, `"authorizationCode"`) | **REQUIRED**. The authorization URL to be used for this flow. This MUST be in the form of an absolute URL. @@ -2561,15 +2529,13 @@ availableScopes: read:pets: read your pets ``` - - ### Correlation ID Object -An object that specifies an identifier at design time that can used for message tracing and correlation. +An object that specifies an identifier at design time that can used for message tracing and correlation. For specifying and computing the location of a Correlation ID, a [runtime expression](#runtimeExpression) is used. -##### Fixed Fields +#### Fixed Fields Field Name | Type | Description ---|:---|--- @@ -2599,7 +2565,7 @@ This mechanism is used by [Correlation ID Object](#correlationIdObject) and [Ope The runtime expression is defined by the following [ABNF](https://tools.ietf.org/html/rfc5234) syntax: -``` +```text expression = ( "$message" "." source ) source = ( header-reference | payload-reference ) header-reference = "header" ["#" fragment] @@ -2609,7 +2575,7 @@ The runtime expression is defined by the following [ABNF](https://tools.ietf.org The table below provides examples of runtime expressions and examples of their use in a value: -##### Examples +#### Examples Source Location | Example expression | Notes ---|:---|:---| @@ -2652,7 +2618,7 @@ The extensions properties are implemented as patterned fields that are always pr Field Pattern | Type | Description ---|:---:|--- -`^x-[\w\d\-\_]+$` | Any | Allows extensions to the AsyncAPI Schema. The field name MUST begin with `x-`, for example, `x-internal-id`. The value can be `null`, a primitive, an array or an object. Can have any valid JSON format value. +`^x-[\w\d\.\x2d_]+$` | Any | Allows extensions to the AsyncAPI Schema. The field name MUST begin with `x-`, for example, `x-internal-id`. The value can be `null`, a primitive, an array or an object. Can have any valid JSON format value. The extensions may or may not be supported by the available tooling, but those may be extended as well to add requested support (if tools are internal or open-sourced). @@ -2667,7 +2633,6 @@ Tools that do not recognize a specific `format` MAY default back to the `type` a The formats defined by the AsyncAPI Specification are: - Common Name | `type` | [`format`](#dataTypeFormat) | Comments ----------- | ------ | -------- | -------- integer | `integer` | `int32` | signed 32 bits