From 0ce2dd6af30d875a8a357b5fb835670e8b665fba Mon Sep 17 00:00:00 2001 From: Carlos Tasada Date: Sun, 31 Mar 2024 18:52:38 +0200 Subject: [PATCH 01/15] fix: kafka bindings not using latest version (#508) Co-authored-by: carlos.tasada --- definitions/3.0.0/operationBindingsObject.json | 2 +- definitions/3.0.0/serverBindingsObject.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/definitions/3.0.0/operationBindingsObject.json b/definitions/3.0.0/operationBindingsObject.json index 26555d2d..dd1744d6 100644 --- a/definitions/3.0.0/operationBindingsObject.json +++ b/definitions/3.0.0/operationBindingsObject.json @@ -131,7 +131,7 @@ "kafka": { "properties": { "bindingVersion": { - "enum": ["0.4.0", "0.3.0"] + "enum": ["0.5.0", "0.4.0", "0.3.0"] } }, "allOf": [ diff --git a/definitions/3.0.0/serverBindingsObject.json b/definitions/3.0.0/serverBindingsObject.json index 2e65a2a0..91f8b90a 100644 --- a/definitions/3.0.0/serverBindingsObject.json +++ b/definitions/3.0.0/serverBindingsObject.json @@ -50,7 +50,7 @@ "kafka": { "properties": { "bindingVersion": { - "enum": ["0.4.0", "0.3.0"] + "enum": ["0.5.0", "0.4.0", "0.3.0"] } }, "allOf": [ From a0dfbd8c3f8ac01869d61078dee7b30b186df9f8 Mon Sep 17 00:00:00 2001 From: asyncapi-bot Date: Sun, 31 Mar 2024 18:55:24 +0200 Subject: [PATCH 02/15] chore(release): v6.5.4 (#509) --- package-lock.json | 4 ++-- package.json | 2 +- schemas/3.0.0-without-$id.json | 2 ++ schemas/3.0.0.json | 2 ++ 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4e17dbf3..d3cf2c9f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@asyncapi/specs", - "version": "6.5.3", + "version": "6.5.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@asyncapi/specs", - "version": "6.5.3", + "version": "6.5.4", "license": "Apache-2.0", "dependencies": { "@types/json-schema": "^7.0.11" diff --git a/package.json b/package.json index 3aecff62..5785de52 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@asyncapi/specs", - "version": "6.5.3", + "version": "6.5.4", "description": "AsyncAPI schema versions", "main": "index.js", "types": "index.d.ts", diff --git a/schemas/3.0.0-without-$id.json b/schemas/3.0.0-without-$id.json index 398d434a..34f23ee4 100644 --- a/schemas/3.0.0-without-$id.json +++ b/schemas/3.0.0-without-$id.json @@ -1211,6 +1211,7 @@ "properties": { "bindingVersion": { "enum": [ + "0.5.0", "0.4.0", "0.3.0" ] @@ -6902,6 +6903,7 @@ "properties": { "bindingVersion": { "enum": [ + "0.5.0", "0.4.0", "0.3.0" ] diff --git a/schemas/3.0.0.json b/schemas/3.0.0.json index 9fb59b7e..32d55118 100644 --- a/schemas/3.0.0.json +++ b/schemas/3.0.0.json @@ -1244,6 +1244,7 @@ "properties": { "bindingVersion": { "enum": [ + "0.5.0", "0.4.0", "0.3.0" ] @@ -6990,6 +6991,7 @@ "properties": { "bindingVersion": { "enum": [ + "0.5.0", "0.4.0", "0.3.0" ] From 4a522abe683b4ea1d057812083245c3880c65a8e Mon Sep 17 00:00:00 2001 From: asyncapi-bot Date: Tue, 2 Apr 2024 20:43:20 +0200 Subject: [PATCH 03/15] ci: update of files from global .github repo (#510) --- .github/workflows/if-nodejs-pr-testing.yml | 7 ++++--- .github/workflows/if-nodejs-release.yml | 10 +++++++++- .github/workflows/if-nodejs-version-bump.yml | 2 +- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/if-nodejs-pr-testing.yml b/.github/workflows/if-nodejs-pr-testing.yml index 691f8350..75eaaac7 100644 --- a/.github/workflows/if-nodejs-pr-testing.yml +++ b/.github/workflows/if-nodejs-pr-testing.yml @@ -33,6 +33,7 @@ jobs: id: should_run name: Should Run run: echo "shouldrun=true" >> $GITHUB_OUTPUT + shell: bash - if: steps.should_run.outputs.shouldrun == 'true' name: Set git to use LF #to once and for all finish neverending fight between Unix and Windows run: | @@ -60,13 +61,13 @@ jobs: - if: steps.packagejson.outputs.exists == 'true' name: Install dependencies id: first-installation - run: npm install --loglevel verbose + run: npm ci continue-on-error: true - if: steps.first-installation.outputs.status == 'failure' && steps.packagejson.outputs.exists == 'true' name: Clear NPM cache and install deps again run: | npm cache clean --force - npm install --loglevel verbose + npm ci - if: steps.packagejson.outputs.exists == 'true' name: Test run: npm test --if-present @@ -75,4 +76,4 @@ jobs: run: npm run lint --if-present - if: steps.packagejson.outputs.exists == 'true' name: Run release assets generation to make sure PR does not break it - run: npm run generate:assets --if-present \ No newline at end of file + run: npm run generate:assets --if-present diff --git a/.github/workflows/if-nodejs-release.yml b/.github/workflows/if-nodejs-release.yml index 4938a37d..fbad21df 100644 --- a/.github/workflows/if-nodejs-release.yml +++ b/.github/workflows/if-nodejs-release.yml @@ -85,6 +85,7 @@ jobs: - name: Check if Node.js project and has package.json id: packagejson run: test -e ./package.json && echo "exists=true" >> $GITHUB_OUTPUT || echo "exists=false" >> $GITHUB_OUTPUT + shell: bash - if: steps.packagejson.outputs.exists == 'true' name: Check package-lock version uses: asyncapi/.github/.github/actions/get-node-version-from-package-lock@master @@ -98,7 +99,14 @@ jobs: cache-dependency-path: '**/package-lock.json' - if: steps.packagejson.outputs.exists == 'true' name: Install dependencies - run: npm install + id: first-installation + run: npm ci + continue-on-error: true + - if: steps.first-installation.outputs.status == 'failure' && steps.packagejson.outputs.exists == 'true' + name: Clear NPM cache and install deps again + run: | + npm cache clean --force + npm ci - if: steps.packagejson.outputs.exists == 'true' name: Add plugin for conventional commits for semantic-release run: npm install --save-dev conventional-changelog-conventionalcommits@5.0.0 diff --git a/.github/workflows/if-nodejs-version-bump.yml b/.github/workflows/if-nodejs-version-bump.yml index 7e27f90b..36847d80 100644 --- a/.github/workflows/if-nodejs-version-bump.yml +++ b/.github/workflows/if-nodejs-version-bump.yml @@ -37,7 +37,7 @@ jobs: cache-dependency-path: '**/package-lock.json' - if: steps.packagejson.outputs.exists == 'true' name: Install dependencies - run: npm install + run: npm ci - if: steps.packagejson.outputs.exists == 'true' name: Assets generation run: npm run generate:assets --if-present From a4ae97a6af421592a42306f22b095f960c65fb3a Mon Sep 17 00:00:00 2001 From: asyncapi-bot Date: Tue, 2 Apr 2024 21:50:07 +0200 Subject: [PATCH 04/15] ci: update of files from global .github repo (#511) --- .github/workflows/help-command.yml | 1 + .../workflows/please-take-a-look-command.yml | 54 +++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 .github/workflows/please-take-a-look-command.yml diff --git a/.github/workflows/help-command.yml b/.github/workflows/help-command.yml index d4ba4a44..ada81682 100644 --- a/.github/workflows/help-command.yml +++ b/.github/workflows/help-command.yml @@ -31,6 +31,7 @@ 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.` 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 00000000..216055ca --- /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 /ping-for-attention or /pfa it will add a comment pinging +# the code-owners who have not yet reviewed the pull request + +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.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:` + }); + } From d58bf5ecfdee4f035c676cdc3350395d7f802551 Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Wed, 3 Apr 2024 18:25:10 +0400 Subject: [PATCH 05/15] fix: wrong validation with AsyncAPI v3 in VS Code and JetBrains IDEs (#495) Co-authored-by: Sergio Moya <1083296+smoya@users.noreply.github.com> --- .gitignore | 4 +- definitions/3.0.0/components.json | 9 +- definitions/3.0.0/multiFormatSchema.json | 51 +- schemas/3.0.0-without-$id.json | 96 +-- schemas/3.0.0.json | 52 +- test/docs/3.0.0/streetlights-all.json | 687 ++++++++++++++++++++- test/docs/3.0.0/streetlights-asyncapi.json | 126 ++++ test/docs/3.0.0/streetlights-avro.json | 20 +- test/docs/3.0.0/streetlights-json.json | 225 +++++++ test/docs/3.0.0/streetlights-openapi.json | 16 +- test/docs/3.0.0/streetlights-unknown.json | 106 ++++ tools/bundler/index.js | 18 +- 12 files changed, 1230 insertions(+), 180 deletions(-) create mode 100644 test/docs/3.0.0/streetlights-asyncapi.json create mode 100644 test/docs/3.0.0/streetlights-json.json create mode 100644 test/docs/3.0.0/streetlights-unknown.json diff --git a/.gitignore b/.gitignore index d4a20833..fc668545 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ node_modules .nyc_output .vscode -coverage \ No newline at end of file +coverage + +.DS_Store \ No newline at end of file diff --git a/definitions/3.0.0/components.json b/definitions/3.0.0/components.json index 2d7b5e2f..2243d978 100644 --- a/definitions/3.0.0/components.json +++ b/definitions/3.0.0/components.json @@ -13,14 +13,7 @@ "description": "An object to hold reusable Schema Object. If this is a Schema Object, 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.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { - "oneOf": [ - { - "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" - }, - { - "$ref": "http://asyncapi.com/definitions/3.0.0/anySchema.json" - } - ] + "$ref": "http://asyncapi.com/definitions/3.0.0/anySchema.json" } } }, diff --git a/definitions/3.0.0/multiFormatSchema.json b/definitions/3.0.0/multiFormatSchema.json index d4047bb0..077cdcf6 100644 --- a/definitions/3.0.0/multiFormatSchema.json +++ b/definitions/3.0.0/multiFormatSchema.json @@ -1,5 +1,11 @@ { "description": "The Multi Format Schema Object represents a schema definition. It differs from the Schema Object in that it supports multiple schema formats or languages (e.g., JSON Schema, Avro, etc.).", + "type": "object", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, "if": { "not": { "type": "object" @@ -9,13 +15,6 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" }, "else": { - "type": "object", - "additionalProperties": false, - "patternProperties": { - "^x-[\\w\\d\\.\\x2d_]+$": { - "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" - } - }, "properties": { "schemaFormat": { "description": "A string containing the name of the schema format that is used to define the information. If schemaFormat is missing, it MUST default to application/vnd.aai.asyncapi+json;version={{asyncapi}} where {{asyncapi}} matches the AsyncAPI Version String. In such a case, this would make the Multi Format Schema Object equivalent to the Schema Object. When using Reference Object within the schema, the schemaFormat of the resource being referenced MUST match the schemaFormat of the schema that contains the initial reference. For example, if you reference Avro schema, then schemaFormat of referencing resource and the resource being reference MUST match.", @@ -37,21 +36,18 @@ { "description": "All the schema formats tools are RECOMMENDED to support", "enum": [ - "application/vnd.oai.openapi;version=3.0.0", - "application/vnd.oai.openapi+json;version=3.0.0", + "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", - + "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", - + "application/raml+yaml;version=1.0" ] } ] - }, - "schema": { - "description": "Definition of the message payload. It can be of any type but defaults to Schema Object. It MUST match the schema format defined in schemaFormat, including the encoding type. E.g., Avro should be inlined as either a YAML or JSON object instead of as a string to be parsed as YAML or JSON. Non-JSON-based schemas (e.g., Protobuf or XSD) MUST be inlined as a string." } }, "allOf": [ @@ -67,14 +63,7 @@ "then": { "properties": { "schema": { - "oneOf": [ - { - "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" - }, - { - "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" - } - ] + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" } } } @@ -119,14 +108,7 @@ "then": { "properties": { "schema": { - "oneOf": [ - { - "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" - }, - { - "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" - } - ] + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" } } } @@ -148,14 +130,7 @@ "then": { "properties": { "schema": { - "oneOf": [ - { - "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" - }, - { - "$ref": "http://json-schema.org/draft-07/schema" - } - ] + "$ref": "http://json-schema.org/draft-07/schema" } } } diff --git a/schemas/3.0.0-without-$id.json b/schemas/3.0.0-without-$id.json index 34f23ee4..297899e2 100644 --- a/schemas/3.0.0-without-$id.json +++ b/schemas/3.0.0-without-$id.json @@ -2056,7 +2056,7 @@ "properties": { "type": "array", "items": { - "$ref": "#/definitions/bindings-jms-0.0.1-server" + "$ref": "#/definitions/bindings-jms-0.0.1-server/definitions/property" }, "description": "Additional properties to set on the JMS ConnectionFactory implementation for the JMS Provider." }, @@ -2702,6 +2702,12 @@ }, "multiFormatSchema": { "description": "The Multi Format Schema Object represents a schema definition. It differs from the Schema Object in that it supports multiple schema formats or languages (e.g., JSON Schema, Avro, etc.).", + "type": "object", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, "if": { "not": { "type": "object" @@ -2711,13 +2717,6 @@ "$ref": "#/definitions/schema" }, "else": { - "type": "object", - "additionalProperties": false, - "patternProperties": { - "^x-[\\w\\d\\.\\x2d_]+$": { - "$ref": "#/definitions/specificationExtension" - } - }, "properties": { "schemaFormat": { "description": "A string containing the name of the schema format that is used to define the information. If schemaFormat is missing, it MUST default to application/vnd.aai.asyncapi+json;version={{asyncapi}} where {{asyncapi}} matches the AsyncAPI Version String. In such a case, this would make the Multi Format Schema Object equivalent to the Schema Object. When using Reference Object within the schema, the schemaFormat of the resource being referenced MUST match the schemaFormat of the schema that contains the initial reference. For example, if you reference Avro schema, then schemaFormat of referencing resource and the resource being reference MUST match.", @@ -2748,9 +2747,6 @@ ] } ] - }, - "schema": { - "description": "Definition of the message payload. It can be of any type but defaults to Schema Object. It MUST match the schema format defined in schemaFormat, including the encoding type. E.g., Avro should be inlined as either a YAML or JSON object instead of as a string to be parsed as YAML or JSON. Non-JSON-based schemas (e.g., Protobuf or XSD) MUST be inlined as a string." } }, "allOf": [ @@ -2766,14 +2762,7 @@ "then": { "properties": { "schema": { - "oneOf": [ - { - "$ref": "#/definitions/Reference" - }, - { - "$ref": "#/definitions/schema" - } - ] + "$ref": "#/definitions/schema" } } } @@ -2818,14 +2807,7 @@ "then": { "properties": { "schema": { - "oneOf": [ - { - "$ref": "#/definitions/Reference" - }, - { - "$ref": "#/definitions/schema" - } - ] + "$ref": "#/definitions/schema" } } } @@ -2847,14 +2829,7 @@ "then": { "properties": { "schema": { - "oneOf": [ - { - "$ref": "#/definitions/Reference" - }, - { - "$ref": "#/definitions/json-schema-draft-07-schema" - } - ] + "$ref": "#/definitions/json-schema-draft-07-schema" } } } @@ -5719,10 +5694,10 @@ "description": "The name of the topic. Can be different from the channel name to allow flexibility around AWS resource naming limitations." }, "ordering": { - "$ref": "#/definitions/bindings-sns-0.1.0-channel" + "$ref": "#/definitions/bindings-sns-0.1.0-channel/definitions/ordering" }, "policy": { - "$ref": "#/definitions/bindings-sns-0.1.0-channel" + "$ref": "#/definitions/bindings-sns-0.1.0-channel/definitions/policy" }, "tags": { "type": "object", @@ -5777,7 +5752,7 @@ "type": "array", "description": "An array of statement objects, each of which controls a permission for this topic", "items": { - "$ref": "#/definitions/bindings-sns-0.1.0-channel" + "$ref": "#/definitions/bindings-sns-0.1.0-channel/definitions/statement" } } }, @@ -5864,11 +5839,11 @@ "properties": { "queue": { "description": "A definition of the queue that will be used as the channel.", - "$ref": "#/definitions/bindings-sqs-0.2.0-channel" + "$ref": "#/definitions/bindings-sqs-0.2.0-channel/definitions/queue" }, "deadLetterQueue": { "description": "A definition of the queue that will be used for un-processable messages.", - "$ref": "#/definitions/bindings-sqs-0.2.0-channel" + "$ref": "#/definitions/bindings-sqs-0.2.0-channel/definitions/queue" }, "bindingVersion": { "type": "string", @@ -5947,10 +5922,10 @@ "default": 345600 }, "redrivePolicy": { - "$ref": "#/definitions/bindings-sqs-0.2.0-channel" + "$ref": "#/definitions/bindings-sqs-0.2.0-channel/definitions/redrivePolicy" }, "policy": { - "$ref": "#/definitions/bindings-sqs-0.2.0-channel" + "$ref": "#/definitions/bindings-sqs-0.2.0-channel/definitions/policy" }, "tags": { "type": "object", @@ -5972,7 +5947,7 @@ }, "properties": { "deadLetterQueue": { - "$ref": "#/definitions/bindings-sqs-0.2.0-channel" + "$ref": "#/definitions/bindings-sqs-0.2.0-channel/definitions/identifier" }, "maxReceiveCount": { "type": "integer", @@ -6016,7 +5991,7 @@ "type": "array", "description": "An array of statement objects, each of which controls a permission for this queue.", "items": { - "$ref": "#/definitions/bindings-sqs-0.2.0-channel" + "$ref": "#/definitions/bindings-sqs-0.2.0-channel/definitions/statement" } } }, @@ -7638,19 +7613,19 @@ }, "properties": { "topic": { - "$ref": "#/definitions/bindings-sns-0.1.0-operation", + "$ref": "#/definitions/bindings-sns-0.1.0-operation/definitions/identifier", "description": "Often we can assume that the SNS Topic is the channel name-we provide this field in case the you need to supply the ARN, or the Topic name is not the channel name in the AsyncAPI document." }, "consumers": { "type": "array", "description": "The protocols that listen to this topic and their endpoints.", "items": { - "$ref": "#/definitions/bindings-sns-0.1.0-operation" + "$ref": "#/definitions/bindings-sns-0.1.0-operation/definitions/consumer" }, "minItems": 1 }, "deliveryPolicy": { - "$ref": "#/definitions/bindings-sns-0.1.0-operation", + "$ref": "#/definitions/bindings-sns-0.1.0-operation/definitions/deliveryPolicy", "description": "Policy for retries to HTTP. The field is the default for HTTP receivers of the SNS Topic which may be overridden by a specific consumer." }, "bindingVersion": { @@ -7718,7 +7693,7 @@ }, "endpoint": { "description": "The endpoint messages are delivered to.", - "$ref": "#/definitions/bindings-sns-0.1.0-operation" + "$ref": "#/definitions/bindings-sns-0.1.0-operation/definitions/identifier" }, "filterPolicy": { "type": "object", @@ -7759,10 +7734,10 @@ "description": "If true AWS SNS attributes are removed from the body, and for SQS, SNS message attributes are copied to SQS message attributes. If false the SNS attributes are included in the body." }, "redrivePolicy": { - "$ref": "#/definitions/bindings-sns-0.1.0-operation" + "$ref": "#/definitions/bindings-sns-0.1.0-operation/definitions/redrivePolicy" }, "deliveryPolicy": { - "$ref": "#/definitions/bindings-sns-0.1.0-operation", + "$ref": "#/definitions/bindings-sns-0.1.0-operation/definitions/deliveryPolicy", "description": "Policy for retries to HTTP. The parameter is for that SNS Subscription and overrides any policy on the SNS Topic." }, "displayName": { @@ -7834,7 +7809,7 @@ }, "properties": { "deadLetterQueue": { - "$ref": "#/definitions/bindings-sns-0.1.0-operation", + "$ref": "#/definitions/bindings-sns-0.1.0-operation/definitions/identifier", "description": "The SQS queue to use as a dead letter queue (DLQ)." }, "maxReceiveCount": { @@ -7912,7 +7887,7 @@ "type": "array", "description": "Queue objects that are either the endpoint for an SNS Operation Binding Object, or the deadLetterQueue of the SQS Operation Binding Object.", "items": { - "$ref": "#/definitions/bindings-sqs-0.2.0-operation" + "$ref": "#/definitions/bindings-sqs-0.2.0-operation/definitions/queue" } }, "bindingVersion": { @@ -7996,10 +7971,10 @@ "default": 345600 }, "redrivePolicy": { - "$ref": "#/definitions/bindings-sqs-0.2.0-operation" + "$ref": "#/definitions/bindings-sqs-0.2.0-operation/definitions/redrivePolicy" }, "policy": { - "$ref": "#/definitions/bindings-sqs-0.2.0-operation" + "$ref": "#/definitions/bindings-sqs-0.2.0-operation/definitions/policy" }, "tags": { "type": "object", @@ -8020,7 +7995,7 @@ }, "properties": { "deadLetterQueue": { - "$ref": "#/definitions/bindings-sqs-0.2.0-operation" + "$ref": "#/definitions/bindings-sqs-0.2.0-operation/definitions/identifier" }, "maxReceiveCount": { "type": "integer", @@ -8064,7 +8039,7 @@ "type": "array", "description": "An array of statement objects, each of which controls a permission for this queue.", "items": { - "$ref": "#/definitions/bindings-sqs-0.2.0-operation" + "$ref": "#/definitions/bindings-sqs-0.2.0-operation/definitions/statement" } } }, @@ -8516,14 +8491,7 @@ "description": "An object to hold reusable Schema Object. If this is a Schema Object, 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.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { - "oneOf": [ - { - "$ref": "#/definitions/Reference" - }, - { - "$ref": "#/definitions/anySchema" - } - ] + "$ref": "#/definitions/anySchema" } } }, diff --git a/schemas/3.0.0.json b/schemas/3.0.0.json index 32d55118..25bbc016 100644 --- a/schemas/3.0.0.json +++ b/schemas/3.0.0.json @@ -2753,6 +2753,12 @@ "http://asyncapi.com/definitions/3.0.0/multiFormatSchema.json": { "$id": "http://asyncapi.com/definitions/3.0.0/multiFormatSchema.json", "description": "The Multi Format Schema Object represents a schema definition. It differs from the Schema Object in that it supports multiple schema formats or languages (e.g., JSON Schema, Avro, etc.).", + "type": "object", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, "if": { "not": { "type": "object" @@ -2762,13 +2768,6 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" }, "else": { - "type": "object", - "additionalProperties": false, - "patternProperties": { - "^x-[\\w\\d\\.\\x2d_]+$": { - "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" - } - }, "properties": { "schemaFormat": { "description": "A string containing the name of the schema format that is used to define the information. If schemaFormat is missing, it MUST default to application/vnd.aai.asyncapi+json;version={{asyncapi}} where {{asyncapi}} matches the AsyncAPI Version String. In such a case, this would make the Multi Format Schema Object equivalent to the Schema Object. When using Reference Object within the schema, the schemaFormat of the resource being referenced MUST match the schemaFormat of the schema that contains the initial reference. For example, if you reference Avro schema, then schemaFormat of referencing resource and the resource being reference MUST match.", @@ -2799,9 +2798,6 @@ ] } ] - }, - "schema": { - "description": "Definition of the message payload. It can be of any type but defaults to Schema Object. It MUST match the schema format defined in schemaFormat, including the encoding type. E.g., Avro should be inlined as either a YAML or JSON object instead of as a string to be parsed as YAML or JSON. Non-JSON-based schemas (e.g., Protobuf or XSD) MUST be inlined as a string." } }, "allOf": [ @@ -2817,14 +2813,7 @@ "then": { "properties": { "schema": { - "oneOf": [ - { - "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" - }, - { - "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" - } - ] + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" } } } @@ -2869,14 +2858,7 @@ "then": { "properties": { "schema": { - "oneOf": [ - { - "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" - }, - { - "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" - } - ] + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" } } } @@ -2898,14 +2880,7 @@ "then": { "properties": { "schema": { - "oneOf": [ - { - "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" - }, - { - "$ref": "http://json-schema.org/draft-07/schema" - } - ] + "$ref": "http://json-schema.org/draft-07/schema" } } } @@ -8618,14 +8593,7 @@ "description": "An object to hold reusable Schema Object. If this is a Schema Object, 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.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { - "oneOf": [ - { - "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" - }, - { - "$ref": "http://asyncapi.com/definitions/3.0.0/anySchema.json" - } - ] + "$ref": "http://asyncapi.com/definitions/3.0.0/anySchema.json" } } }, diff --git a/test/docs/3.0.0/streetlights-all.json b/test/docs/3.0.0/streetlights-all.json index 15b7cdc6..e0e3e781 100644 --- a/test/docs/3.0.0/streetlights-all.json +++ b/test/docs/3.0.0/streetlights-all.json @@ -6,7 +6,53 @@ "description": "This service is in charge of processing user signups" }, "channels": { - "UserSignedUpChannel": { + "AsyncAPI-UserSignedUpChannel": { + "address": "user/signedup/{test_param}", + "parameters": { + "test_param": { + "enum": [ + "test" + ], + "default": "test", + "description": "Just a test description", + "examples": [ + "test" + ], + "location": "$message.payload#", + "x-custom-extension": "test" + } + }, + "messages": { + "AsyncAPI-UserSignedUp": { + "$ref": "#/components/messages/AsyncAPI-UserSignedUp" + } + } + }, + "Avro-UserSignedUpChannel": { + "address": "user/signedup", + "messages": { + "UserSignedUp": { + "$ref": "#/components/messages/Avro-UserSignedUp" + } + } + }, + "Json-UserSignedUpChannel": { + "address": "user/signedup", + "messages": { + "UserSignedUp": { + "$ref": "#/components/messages/Json-UserSignedUp" + } + } + }, + "OpenAPI-UserSignedUpChannel": { + "address": "user/signedup", + "messages": { + "UserSignedUp": { + "$ref": "#/components/messages/OpenAPI-UserSignedUp" + } + } + }, + "Unknown-UserSignedUpChannel": { "address": "user/signedup/{test_param}", "parameters": { "test_param": { @@ -24,16 +70,96 @@ }, "messages": { "UserSignedUp": { - "$ref": "#/components/messages/UserSignedUp" + "$ref": "#/components/messages/Unknown-UserSignedUp" } } } }, "operations": { - "PublishUserSignedUp": { + "AsyncAPI-PublishUserSignedUp": { + "action": "send", + "channel": { + "$ref": "#/channels/AsyncAPI-UserSignedUpChannel" + }, + "bindings": { + "mqtt": { + "bindingVersion": "0.2.0", + "qos": 1 + }, + "kafka": { + "bindingVersion": "0.3.0", + "clientId": { + "type": "string", + "enum": [ + "my-app-id" + ] + } + } + } + }, + "AsyncAPI-PublishUserSignedUpDefaultBinding": { + "action": "send", + "channel": { + "$ref": "#/channels/AsyncAPI-UserSignedUpChannel" + }, + "bindings": { + "mqtt": { + "qos": 1 + }, + "kafka": { + "clientId": { + "type": "string", + "enum": [ + "my-app-id" + ] + } + } + } + }, + "Avro-PublishUserSignedUp": { + "action": "send", + "channel": { + "$ref": "#/channels/Avro-UserSignedUpChannel" + }, + "bindings": { + "mqtt": { + "bindingVersion": "0.2.0", + "qos": 1 + }, + "kafka": { + "bindingVersion": "0.3.0", + "clientId": { + "type": "string", + "enum": [ + "my-app-id" + ] + } + } + } + }, + "Avro-PublishUserSignedUpDefaultBinding": { "action": "send", "channel": { - "$ref": "#/channels/UserSignedUpChannel" + "$ref": "#/channels/Avro-UserSignedUpChannel" + }, + "bindings": { + "mqtt": { + "qos": 1 + }, + "kafka": { + "clientId": { + "type": "string", + "enum": [ + "my-app-id" + ] + } + } + } + }, + "Json-PublishUserSignedUp": { + "action": "send", + "channel": { + "$ref": "#/channels/Json-UserSignedUpChannel" }, "bindings": { "mqtt": { @@ -51,10 +177,90 @@ } } }, - "PublishUserSignedUpDefaultBinding": { + "Json-PublishUserSignedUpDefaultBinding": { "action": "send", "channel": { - "$ref": "#/channels/UserSignedUpChannel" + "$ref": "#/channels/Json-UserSignedUpChannel" + }, + "bindings": { + "mqtt": { + "qos": 1 + }, + "kafka": { + "clientId": { + "type": "string", + "enum": [ + "my-app-id" + ] + } + } + } + }, + "OpenAPI-PublishUserSignedUp": { + "action": "send", + "channel": { + "$ref": "#/channels/OpenAPI-UserSignedUpChannel" + }, + "bindings": { + "mqtt": { + "bindingVersion": "0.2.0", + "qos": 1 + }, + "kafka": { + "bindingVersion": "0.3.0", + "clientId": { + "type": "string", + "enum": [ + "my-app-id" + ] + } + } + } + }, + "OpenAPI-PublishUserSignedUpDefaultBinding": { + "action": "send", + "channel": { + "$ref": "#/channels/OpenAPI-UserSignedUpChannel" + }, + "bindings": { + "mqtt": { + "qos": 1 + }, + "kafka": { + "clientId": { + "type": "string", + "enum": [ + "my-app-id" + ] + } + } + } + }, + "Unknown-PublishUserSignedUp": { + "action": "send", + "channel": { + "$ref": "#/channels/Unknown-UserSignedUpChannel" + }, + "bindings": { + "mqtt": { + "bindingVersion": "0.2.0", + "qos": 1 + }, + "kafka": { + "bindingVersion": "0.3.0", + "clientId": { + "type": "string", + "enum": [ + "my-app-id" + ] + } + } + } + }, + "Unknown-PublishUserSignedUpDefaultBinding": { + "action": "send", + "channel": { + "$ref": "#/channels/Unknown-UserSignedUpChannel" }, "bindings": { "mqtt": { @@ -72,8 +278,85 @@ } }, "components": { + "schemas": { + "Avro-UserSignedUpHeaders": { + "schemaFormat": "application/vnd.apache.avro;version=1.9.0", + "schema": { + "fields": [ + { + "name": "applicationInstanceId", + "type": "string" + }, + { + "name": "correlationId", + "type": "string" + } + ], + "name": "UserSignedUpHeaders", + "namespace": "com.example.avro", + "type": "record" + } + }, + "Avro-ReferencedSchema": { + "schemaFormat": "application/vnd.apache.avro;version=1.9.0", + "schema": { + "$ref": "reference-to-some-avro-file.avsc" + } + }, + "Json-UserSignedUpHeaders": { + "schemaFormat": "application/schema+json;version=draft-07", + "schema": { + "type": "object", + "properties": { + "applicationInstanceId": { + "type": "string", + "description": "Application instance Id" + }, + "correlationId": { + "type": "string", + "description": "Correlation Id" + } + } + } + }, + "Json-ReferencedSchema": { + "schemaFormat": "application/schema+json;version=draft-07", + "schema": { + "$ref": "reference-to-some-json-schema-file.json" + } + }, + "OpenAPI-ReferencedSchema": { + "schemaFormat": "application/vnd.oai.openapi;version=3.0.0", + "schema": { + "$ref": "reference-to-some-openapi-file.json" + } + } + }, "messages": { - "UserSignedUp": { + "AsyncAPI-UserSignedUp": { + "payload": { + "schemaFormat": "application/vnd.aai.asyncapi+json;version=3.0.0", + "schema": { + "type": "object", + "properties": { + "displayName": { + "type": "string", + "description": "Name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "Email of the user" + } + }, + "externalDocs": { + "url": "https://account-service/docs/UserSignedUp" + }, + "deprecated": false + } + } + }, + "AsyncAPI-UserSignedUpV2": { "payload": { "type": "object", "properties": { @@ -86,10 +369,398 @@ "format": "email", "description": "Email of the user" } + }, + "externalDocs": { + "url": "https://account-service/docs/UserSignedUp" + }, + "deprecated": false + } + }, + "AsyncAPI-UserSignedUpV3": { + "payload": { + "$ref": "external-schema.json" + } + }, + "Avro-UserSignedUp": { + "headers": { + "$ref": "#/components/schemas/Avro-UserSignedUpHeaders" + }, + "payload": { + "schemaFormat": "application/vnd.apache.avro;version=1.9.0", + "schema": { + "doc": "This is a user record in a fictitious to-do-list management app. It supports arbitrary grouping and nesting of items, and allows you to add items by email or by tweeting.\n\nNote this app doesn't actually exist. The schema is just a demo for [Avrodoc](https://github.com/ept/avrodoc)!", + "fields": [ + { + "name": "id", + "doc": "System-assigned numeric user ID. Cannot be changed by the user.", + "type": "int" + }, + { + "name": "username", + "doc": "The username chosen by the user. Can be changed by the user.", + "type": "string" + }, + { + "name": "passwordHash", + "doc": "The user's password, hashed using [scrypt](http://www.tarsnap.com/scrypt.html).", + "type": "string" + }, + { + "name": "signupDate", + "doc": "Timestamp (milliseconds since epoch) when the user signed up", + "type": "long" + }, + { + "name": "emailAddresses", + "doc": "All email addresses on the user's account", + "type": { + "type": "array", + "items": { + "type": "record", + "name": "EmailAddress", + "doc": "Stores details about an email address that a user has associated with their account.", + "fields": [ + { + "name": "address", + "doc": "The email address, e.g. `foo@example.com`", + "type": "string" + }, + { + "name": "verified", + "doc": "true if the user has clicked the link in a confirmation email to this address.", + "type": "boolean", + "default": false + }, + { + "name": "dateAdded", + "doc": "Timestamp (milliseconds since epoch) when the email address was added to the account.", + "type": "long" + }, + { + "name": "dateBounced", + "doc": "Timestamp (milliseconds since epoch) when an email sent to this address last bounced. Reset to null when the address no longer bounces.", + "type": [ + "null", + "long" + ] + } + ] + } + } + }, + { + "name": "twitterAccounts", + "doc": "All Twitter accounts that the user has OAuthed", + "type": { + "type": "array", + "items": { + "type": "record", + "name": "TwitterAccount", + "doc": "Stores access credentials for one Twitter account, as granted to us by the user by OAuth.", + "fields": [ + { + "name": "status", + "doc": "Indicator of whether this authorization is currently active, or has been revoked", + "type": { + "type": "enum", + "name": "OAuthStatus", + "doc": "* `PENDING`: the user has started authorizing, but not yet finished\n* `ACTIVE`: the token should work\n* `DENIED`: the user declined the authorization\n* `EXPIRED`: the token used to work, but now it doesn't\n* `REVOKED`: the user has explicitly revoked the token", + "symbols": [ + "PENDING", + "ACTIVE", + "DENIED", + "EXPIRED", + "REVOKED" + ] + } + }, + { + "name": "userId", + "doc": "Twitter's numeric ID for this user", + "type": "long" + }, + { + "name": "screenName", + "doc": "The twitter username for this account (can be changed by the user)", + "type": "string" + }, + { + "name": "oauthToken", + "doc": "The OAuth token for this Twitter account", + "type": "string" + }, + { + "name": "oauthTokenSecret", + "doc": "The OAuth secret, used for signing requests on behalf of this Twitter account. `null` whilst the OAuth flow is not yet complete.", + "type": [ + "null", + "string" + ] + }, + { + "name": "dateAuthorized", + "doc": "Timestamp (milliseconds since epoch) when the user last authorized this Twitter account", + "type": "long" + } + ] + } + } + }, + { + "name": "toDoItems", + "doc": "The top-level items in the user's to-do list", + "type": { + "type": "array", + "items": { + "type": "record", + "name": "ToDoItem", + "doc": "A record is one node in a To-Do item tree (every record can contain nested sub-records).", + "fields": [ + { + "name": "status", + "doc": "User-selected state for this item (e.g. whether or not it is marked as done)", + "type": { + "type": "enum", + "name": "ToDoStatus", + "doc": "* `HIDDEN`: not currently visible, e.g. because it becomes actionable in future\n* `ACTIONABLE`: appears in the current to-do list\n* `DONE`: marked as done, but still appears in the list\n* `ARCHIVED`: marked as done and no longer visible\n* `DELETED`: not done and removed from list (preserved for undo purposes)", + "symbols": [ + "HIDDEN", + "ACTIONABLE", + "DONE", + "ARCHIVED", + "DELETED" + ] + } + }, + { + "name": "title", + "doc": "One-line summary of the item", + "type": "string" + }, + { + "name": "description", + "doc": "Detailed description (may contain HTML markup)", + "type": [ + "null", + "string" + ] + }, + { + "name": "snoozeDate", + "doc": "Timestamp (milliseconds since epoch) at which the item should go from `HIDDEN` to `ACTIONABLE` status", + "type": [ + "null", + "long" + ] + }, + { + "name": "subItems", + "doc": "List of children of this to-do tree node", + "type": { + "type": "array", + "items": "ToDoItem" + } + } + ] + } + } + } + ], + "name": "User", + "namespace": "com.example.avro", + "type": "record" + } + } + }, + "Json-UserSignedUp": { + "headers": { + "$ref": "#/components/schemas/Json-UserSignedUpHeaders" + }, + "payload": { + "schemaFormat": "application/schema+json;version=draft-07", + "schema": { + "type": "object", + "description": "This is a user record in a fictitious to-do-list management app. It supports arbitrary grouping and nesting of items, and allows you to add items by email or by tweeting.\n\nNote this app doesn't actually exist. The schema is just a demo for [Avrodoc](https://github.com/ept/avrodoc)!", + "properties": { + "id": { + "type": "integer", + "description": "System-assigned numeric user ID. Cannot be changed by the user." + }, + "username": { + "type": "string", + "description": "The username chosen by the user. Can be changed by the user." + }, + "passwordHash": { + "type": "string", + "description": "The user's password, hashed using [scrypt](http://www.tarsnap.com/scrypt.html)." + }, + "signupDate": { + "type": "number", + "description": "Timestamp (milliseconds since epoch) when the user signed up" + }, + "emailAddresses": { + "type": "array", + "description": "All email addresses on the user's account", + "items": { + "type": "object", + "description": "Stores details about an email address that a user has associated with their account.", + "properties": { + "address": { + "type": "string", + "description": "The email address, e.g. `foo@example.com`" + }, + "verified": { + "type": "boolean", + "description": "true if the user has clicked the link in a confirmation email to this address.", + "default": false + }, + "dateAdded": { + "type": "number", + "description": "Timestamp (milliseconds since epoch) when the email address was added to the account." + }, + "dateBounced": { + "type": "number", + "description": "Timestamp (milliseconds since epoch) when an email sent to this address last bounced. Reset to null when the address no longer bounces." + } + } + } + }, + "twitterAccounts": { + "type": "array", + "description": "All Twitter accounts that the user has OAuthed", + "items": { + "type": "object", + "description": "Stores access credentials for one Twitter account, as granted to us by the user by OAuth.", + "properties": { + "status": { + "type": "string", + "description": "Indicator of whether this authorization is currently active, or has been revoked", + "enum": [ + "PENDING", + "ACTIVE", + "DENIED", + "EXPIRED", + "REVOKED" + ] + }, + "userId": { + "type": "number", + "description": "Twitter's numeric ID for this user" + }, + "screenName": { + "type": "string", + "description": "The twitter username for this account (can be changed by the user)" + }, + "oauthToken": { + "type": "string", + "description": "The OAuth token for this Twitter account" + }, + "oauthTokenSecret": { + "type": "string", + "description": "The OAuth secret, used for signing requests on behalf of this Twitter account. `null` whilst the OAuth flow is not yet complete." + }, + "dateAuthorized": { + "type": "number", + "description": "Timestamp (milliseconds since epoch) when the user last authorized this Twitter account" + } + } + } + }, + "toDoItems": { + "type": "array", + "items": { + "type": "object", + "description": "A record is one node in a To-Do item tree (every record can contain nested sub-records).", + "properties": { + "status": { + "type": "string", + "description": "User-selected state for this item (e.g. whether or not it is marked as done)", + "enum": [ + "HIDDEN", + "ACTIONABLE", + "DONE", + "ARCHIVED", + "DELETED" + ] + }, + "title": { + "type": "string", + "description": "One-line summary of the item" + }, + "description": { + "type": "string", + "description": "Detailed description (may contain HTML markup)" + }, + "snoozeDate": { + "type": "number", + "description": "Timestamp (milliseconds since epoch) at which the item should go from `HIDDEN` to `ACTIONABLE` status" + }, + "subItems": { + "type": "array", + "doc": "List of children of this to-do tree node", + "items": { + "$ref": "#/components/messages/UserSignedUp/payload/schema/properties/toDoItems" + } + } + } + } + } + } + } + } + }, + "OpenAPI-UserSignedUp": { + "payload": { + "schemaFormat": "application/vnd.oai.openapi;version=3.0.0", + "schema": { + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "completed": { + "type": "boolean" + }, + "completed_at": { + "type": "string", + "format": "date-time", + "nullable": true + } + }, + "required": [ + "id", + "name", + "completed" + ] + } + } + }, + "Unknown-UserSignedUp": { + "payload": { + "schemaFormat": "unknown-schema-format", + "schema": { + "type": "object", + "properties": { + "displayName": { + "type": "string", + "description": "Name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "Email of the user" + } + }, + "externalDocs": { + "url": "https://account-service/docs/UserSignedUp" + }, + "deprecated": false } } }, - "UserSignedUpV2": { + "Unknown-UserSignedUpV2": { "payload": { "$ref": "external-schema.json" } diff --git a/test/docs/3.0.0/streetlights-asyncapi.json b/test/docs/3.0.0/streetlights-asyncapi.json new file mode 100644 index 00000000..c6885a2e --- /dev/null +++ b/test/docs/3.0.0/streetlights-asyncapi.json @@ -0,0 +1,126 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "Account Service", + "version": "1.0.0", + "description": "This service is in charge of processing user signups" + }, + "channels": { + "AsyncAPI-UserSignedUpChannel": { + "address": "user/signedup/{test_param}", + "parameters": { + "test_param": { + "enum": [ + "test" + ], + "default": "test", + "description": "Just a test description", + "examples": [ + "test" + ], + "location": "$message.payload#", + "x-custom-extension": "test" + } + }, + "messages": { + "AsyncAPI-UserSignedUp": { + "$ref": "#/components/messages/AsyncAPI-UserSignedUp" + } + } + } + }, + "operations": { + "AsyncAPI-PublishUserSignedUp": { + "action": "send", + "channel": { + "$ref": "#/channels/AsyncAPI-UserSignedUpChannel" + }, + "bindings": { + "mqtt": { + "bindingVersion": "0.2.0", + "qos": 1 + }, + "kafka": { + "bindingVersion": "0.3.0", + "clientId": { + "type": "string", + "enum": [ + "my-app-id" + ] + } + } + } + }, + "AsyncAPI-PublishUserSignedUpDefaultBinding": { + "action": "send", + "channel": { + "$ref": "#/channels/AsyncAPI-UserSignedUpChannel" + }, + "bindings": { + "mqtt": { + "qos": 1 + }, + "kafka": { + "clientId": { + "type": "string", + "enum": [ + "my-app-id" + ] + } + } + } + } + }, + "components": { + "messages": { + "AsyncAPI-UserSignedUp": { + "payload": { + "schemaFormat": "application/vnd.aai.asyncapi+json;version=3.0.0", + "schema": { + "type": "object", + "properties": { + "displayName": { + "type": "string", + "description": "Name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "Email of the user" + } + }, + "externalDocs": { + "url": "https://account-service/docs/UserSignedUp" + }, + "deprecated": false + } + } + }, + "AsyncAPI-UserSignedUpV2": { + "payload": { + "type": "object", + "properties": { + "displayName": { + "type": "string", + "description": "Name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "Email of the user" + } + }, + "externalDocs": { + "url": "https://account-service/docs/UserSignedUp" + }, + "deprecated": false + } + }, + "AsyncAPI-UserSignedUpV3": { + "payload": { + "$ref": "external-schema.json" + } + } + } + } +} \ No newline at end of file diff --git a/test/docs/3.0.0/streetlights-avro.json b/test/docs/3.0.0/streetlights-avro.json index 34eed135..4396022b 100644 --- a/test/docs/3.0.0/streetlights-avro.json +++ b/test/docs/3.0.0/streetlights-avro.json @@ -6,20 +6,20 @@ "description": "This service is in charge of processing user signups" }, "channels": { - "UserSignedUpChannel": { + "Avro-UserSignedUpChannel": { "address": "user/signedup", "messages": { "UserSignedUp": { - "$ref": "#/components/messages/UserSignedUp" + "$ref": "#/components/messages/Avro-UserSignedUp" } } } }, "operations": { - "PublishUserSignedUp": { + "Avro-PublishUserSignedUp": { "action": "send", "channel": { - "$ref": "#/channels/UserSignedUpChannel" + "$ref": "#/channels/Avro-UserSignedUpChannel" }, "bindings": { "mqtt": { @@ -37,10 +37,10 @@ } } }, - "PublishUserSignedUpDefaultBinding": { + "Avro-PublishUserSignedUpDefaultBinding": { "action": "send", "channel": { - "$ref": "#/channels/UserSignedUpChannel" + "$ref": "#/channels/Avro-UserSignedUpChannel" }, "bindings": { "mqtt": { @@ -59,7 +59,7 @@ }, "components": { "schemas": { - "UserSignedUpHeaders": { + "Avro-UserSignedUpHeaders": { "schemaFormat": "application/vnd.apache.avro;version=1.9.0", "schema": { "fields": [ @@ -77,7 +77,7 @@ "type": "record" } }, - "ReferencedSchema" : { + "Avro-ReferencedSchema" : { "schemaFormat": "application/vnd.apache.avro;version=1.9.0", "schema": { "$ref": "reference-to-some-avro-file.avsc" @@ -85,9 +85,9 @@ } }, "messages": { - "UserSignedUp": { + "Avro-UserSignedUp": { "headers": { - "$ref": "#/components/schemas/UserSignedUpHeaders" + "$ref": "#/components/schemas/Avro-UserSignedUpHeaders" }, "payload": { "schemaFormat": "application/vnd.apache.avro;version=1.9.0", diff --git a/test/docs/3.0.0/streetlights-json.json b/test/docs/3.0.0/streetlights-json.json new file mode 100644 index 00000000..61b96152 --- /dev/null +++ b/test/docs/3.0.0/streetlights-json.json @@ -0,0 +1,225 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "Account Service", + "version": "1.0.0", + "description": "This service is in charge of processing user signups" + }, + "channels": { + "Json-UserSignedUpChannel": { + "address": "user/signedup", + "messages": { + "UserSignedUp": { + "$ref": "#/components/messages/Json-UserSignedUp" + } + } + } + }, + "operations": { + "Json-PublishUserSignedUp": { + "action": "send", + "channel": { + "$ref": "#/channels/Json-UserSignedUpChannel" + }, + "bindings": { + "mqtt": { + "bindingVersion": "0.2.0", + "qos": 1 + }, + "kafka": { + "bindingVersion": "0.3.0", + "clientId": { + "type": "string", + "enum": [ + "my-app-id" + ] + } + } + } + }, + "Json-PublishUserSignedUpDefaultBinding": { + "action": "send", + "channel": { + "$ref": "#/channels/Json-UserSignedUpChannel" + }, + "bindings": { + "mqtt": { + "qos": 1 + }, + "kafka": { + "clientId": { + "type": "string", + "enum": [ + "my-app-id" + ] + } + } + } + } + }, + "components": { + "schemas": { + "Json-UserSignedUpHeaders": { + "schemaFormat": "application/schema+json;version=draft-07", + "schema": { + "type": "object", + "properties": { + "applicationInstanceId": { + "type": "string", + "description": "Application instance Id" + }, + "correlationId": { + "type": "string", + "description": "Correlation Id" + } + } + } + }, + "Json-ReferencedSchema" : { + "schemaFormat": "application/schema+json;version=draft-07", + "schema": { + "$ref": "reference-to-some-json-schema-file.json" + } + } + }, + "messages": { + "Json-UserSignedUp": { + "headers": { + "$ref": "#/components/schemas/Json-UserSignedUpHeaders" + }, + "payload": { + "schemaFormat": "application/schema+json;version=draft-07", + "schema": { + "type": "object", + "description": "This is a user record in a fictitious to-do-list management app. It supports arbitrary grouping and nesting of items, and allows you to add items by email or by tweeting.\n\nNote this app doesn't actually exist. The schema is just a demo for [Avrodoc](https://github.com/ept/avrodoc)!", + "properties": { + "id": { + "type": "integer", + "description": "System-assigned numeric user ID. Cannot be changed by the user." + }, + "username": { + "type": "string", + "description": "The username chosen by the user. Can be changed by the user." + }, + "passwordHash": { + "type": "string", + "description": "The user's password, hashed using [scrypt](http://www.tarsnap.com/scrypt.html)." + }, + "signupDate": { + "type": "number", + "description": "Timestamp (milliseconds since epoch) when the user signed up" + }, + "emailAddresses": { + "type": "array", + "description": "All email addresses on the user's account", + "items": { + "type": "object", + "description": "Stores details about an email address that a user has associated with their account.", + "properties": { + "address": { + "type": "string", + "description": "The email address, e.g. `foo@example.com`" + }, + "verified": { + "type": "boolean", + "description": "true if the user has clicked the link in a confirmation email to this address.", + "default": false + }, + "dateAdded": { + "type": "number", + "description": "Timestamp (milliseconds since epoch) when the email address was added to the account." + }, + "dateBounced": { + "type": "number", + "description": "Timestamp (milliseconds since epoch) when an email sent to this address last bounced. Reset to null when the address no longer bounces." + } + } + } + }, + "twitterAccounts": { + "type": "array", + "description": "All Twitter accounts that the user has OAuthed", + "items": { + "type": "object", + "description": "Stores access credentials for one Twitter account, as granted to us by the user by OAuth.", + "properties": { + "status": { + "type": "string", + "description": "Indicator of whether this authorization is currently active, or has been revoked", + "enum": [ + "PENDING", + "ACTIVE", + "DENIED", + "EXPIRED", + "REVOKED" + ] + }, + "userId": { + "type": "number", + "description": "Twitter's numeric ID for this user" + }, + "screenName": { + "type": "string", + "description": "The twitter username for this account (can be changed by the user)" + }, + "oauthToken": { + "type": "string", + "description": "The OAuth token for this Twitter account" + }, + "oauthTokenSecret": { + "type": "string", + "description": "The OAuth secret, used for signing requests on behalf of this Twitter account. `null` whilst the OAuth flow is not yet complete." + }, + "dateAuthorized": { + "type": "number", + "description": "Timestamp (milliseconds since epoch) when the user last authorized this Twitter account" + } + } + } + }, + "toDoItems": { + "type": "array", + "items": { + "type": "object", + "description": "A record is one node in a To-Do item tree (every record can contain nested sub-records).", + "properties": { + "status": { + "type": "string", + "description": "User-selected state for this item (e.g. whether or not it is marked as done)", + "enum": [ + "HIDDEN", + "ACTIONABLE", + "DONE", + "ARCHIVED", + "DELETED" + ] + }, + "title": { + "type": "string", + "description": "One-line summary of the item" + }, + "description": { + "type": "string", + "description": "Detailed description (may contain HTML markup)" + }, + "snoozeDate": { + "type": "number", + "description": "Timestamp (milliseconds since epoch) at which the item should go from `HIDDEN` to `ACTIONABLE` status" + }, + "subItems": { + "type": "array", + "doc": "List of children of this to-do tree node", + "items": { + "$ref": "#/components/messages/UserSignedUp/payload/schema/properties/toDoItems" + } + } + } + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/test/docs/3.0.0/streetlights-openapi.json b/test/docs/3.0.0/streetlights-openapi.json index 08f25ae4..2d99bcb3 100644 --- a/test/docs/3.0.0/streetlights-openapi.json +++ b/test/docs/3.0.0/streetlights-openapi.json @@ -6,20 +6,20 @@ "description": "This service is in charge of processing user signups" }, "channels": { - "UserSignedUpChannel": { + "OpenAPI-UserSignedUpChannel": { "address": "user/signedup", "messages": { "UserSignedUp": { - "$ref": "#/components/messages/UserSignedUp" + "$ref": "#/components/messages/OpenAPI-UserSignedUp" } } } }, "operations": { - "PublishUserSignedUp": { + "OpenAPI-PublishUserSignedUp": { "action": "send", "channel": { - "$ref": "#/channels/UserSignedUpChannel" + "$ref": "#/channels/OpenAPI-UserSignedUpChannel" }, "bindings": { "mqtt": { @@ -37,10 +37,10 @@ } } }, - "PublishUserSignedUpDefaultBinding": { + "OpenAPI-PublishUserSignedUpDefaultBinding": { "action": "send", "channel": { - "$ref": "#/channels/UserSignedUpChannel" + "$ref": "#/channels/OpenAPI-UserSignedUpChannel" }, "bindings": { "mqtt": { @@ -59,7 +59,7 @@ }, "components": { "schemas": { - "ReferencedSchema" : { + "OpenAPI-ReferencedSchema" : { "schemaFormat": "application/vnd.oai.openapi;version=3.0.0", "schema": { "$ref": "reference-to-some-openapi-file.json" @@ -67,7 +67,7 @@ } }, "messages": { - "UserSignedUp": { + "OpenAPI-UserSignedUp": { "payload": { "schemaFormat": "application/vnd.oai.openapi;version=3.0.0", "schema": { diff --git a/test/docs/3.0.0/streetlights-unknown.json b/test/docs/3.0.0/streetlights-unknown.json new file mode 100644 index 00000000..cca2c654 --- /dev/null +++ b/test/docs/3.0.0/streetlights-unknown.json @@ -0,0 +1,106 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "Account Service", + "version": "1.0.0", + "description": "This service is in charge of processing user signups" + }, + "channels": { + "Unknown-UserSignedUpChannel": { + "address": "user/signedup/{test_param}", + "parameters": { + "test_param": { + "enum": [ + "test" + ], + "default": "test", + "description": "Just a test description", + "examples": [ + "test" + ], + "location": "$message.payload#", + "x-custom-extension": "test" + } + }, + "messages": { + "UserSignedUp": { + "$ref": "#/components/messages/Unknown-UserSignedUp" + } + } + } + }, + "operations": { + "Unknown-PublishUserSignedUp": { + "action": "send", + "channel": { + "$ref": "#/channels/Unknown-UserSignedUpChannel" + }, + "bindings": { + "mqtt": { + "bindingVersion": "0.2.0", + "qos": 1 + }, + "kafka": { + "bindingVersion": "0.3.0", + "clientId": { + "type": "string", + "enum": [ + "my-app-id" + ] + } + } + } + }, + "Unknown-PublishUserSignedUpDefaultBinding": { + "action": "send", + "channel": { + "$ref": "#/channels/Unknown-UserSignedUpChannel" + }, + "bindings": { + "mqtt": { + "qos": 1 + }, + "kafka": { + "clientId": { + "type": "string", + "enum": [ + "my-app-id" + ] + } + } + } + } + }, + "components": { + "messages": { + "Unknown-UserSignedUp": { + "payload": { + "schemaFormat": "unknown-schema-format", + "schema": { + "type": "object", + "properties": { + "displayName": { + "type": "string", + "description": "Name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "Email of the user" + } + }, + "externalDocs": { + "url": "https://account-service/docs/UserSignedUp" + }, + "deprecated": false + } + } + }, + "Unknown-UserSignedUpV2": { + "payload": { + "$ref": "external-schema.json" + } + } + } + } +} \ No newline at end of file diff --git a/tools/bundler/index.js b/tools/bundler/index.js index c405b2e4..3596c8b3 100644 --- a/tools/bundler/index.js +++ b/tools/bundler/index.js @@ -165,7 +165,23 @@ function getDefinitionName(def) { } if (def.startsWith('http://asyncapi.com/bindings')) { const result = bindingsRegex.exec(def); - if (result) return `${result[1].replace('/', '-')}-${result[2]}-${result[3]}`; + if (result) { + /* + 4th element is for internal definitions like http://asyncapi.com/bindings/jms/0.0.1/server.json#/definitions/property + + When is empty, we can ignore it: + convert this: http://asyncapi.com/bindings/jms/0.0.1/server.json + to this: bindings-jms-0.0.1-server + Otherwise we MUST add it to not broke Json Schema validation: + convert this: http://asyncapi.com/bindings/jms/0.0.1/server.json#/definitions/property + to this: bindings-jms-0.0.1-server/definitions/property + */ + if (result[4] === '') { + return `${result[1].replace('/', '-')}-${result[2]}-${result[3]}`; + } + + return `${result[1].replace('/', '-')}-${result[2]}-${result[3]}/${result[4].replace('#/', '')}`; + } } return path.basename(def, '.json'); From b38af82c8de86f537084840c79cec9a3fc3a94a2 Mon Sep 17 00:00:00 2001 From: asyncapi-bot Date: Wed, 3 Apr 2024 16:27:55 +0200 Subject: [PATCH 06/15] chore(release): v6.5.5 (#512) --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index d3cf2c9f..2e7a80f7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@asyncapi/specs", - "version": "6.5.4", + "version": "6.5.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@asyncapi/specs", - "version": "6.5.4", + "version": "6.5.5", "license": "Apache-2.0", "dependencies": { "@types/json-schema": "^7.0.11" diff --git a/package.json b/package.json index 5785de52..e40ee39c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@asyncapi/specs", - "version": "6.5.4", + "version": "6.5.5", "description": "AsyncAPI schema versions", "main": "index.js", "types": "index.d.ts", From f24cd340d026106e75594fe698e7c06b2928e53e Mon Sep 17 00:00:00 2001 From: asyncapi-bot Date: Wed, 3 Apr 2024 20:12:10 +0200 Subject: [PATCH 07/15] ci: update of files from global .github repo (#514) --- .github/workflows/if-nodejs-pr-testing.yml | 2 +- .github/workflows/if-nodejs-release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/if-nodejs-pr-testing.yml b/.github/workflows/if-nodejs-pr-testing.yml index 75eaaac7..73a2af5c 100644 --- a/.github/workflows/if-nodejs-pr-testing.yml +++ b/.github/workflows/if-nodejs-pr-testing.yml @@ -63,7 +63,7 @@ jobs: id: first-installation run: npm ci continue-on-error: true - - if: steps.first-installation.outputs.status == 'failure' && steps.packagejson.outputs.exists == 'true' + - if: steps.first-installation.outcome != 'success' && steps.packagejson.outputs.exists == 'true' name: Clear NPM cache and install deps again run: | npm cache clean --force diff --git a/.github/workflows/if-nodejs-release.yml b/.github/workflows/if-nodejs-release.yml index fbad21df..f407e59a 100644 --- a/.github/workflows/if-nodejs-release.yml +++ b/.github/workflows/if-nodejs-release.yml @@ -102,7 +102,7 @@ jobs: id: first-installation run: npm ci continue-on-error: true - - if: steps.first-installation.outputs.status == 'failure' && steps.packagejson.outputs.exists == 'true' + - if: steps.first-installation.outcome != 'success' && steps.packagejson.outputs.exists == 'true' name: Clear NPM cache and install deps again run: | npm cache clean --force From ec7147094e76951879d81289567e59b9f5643b64 Mon Sep 17 00:00:00 2001 From: asyncapi-bot Date: Thu, 4 Apr 2024 16:14:49 +0200 Subject: [PATCH 08/15] ci: update of files from global .github repo (#515) --- .github/workflows/please-take-a-look-command.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/please-take-a-look-command.yml b/.github/workflows/please-take-a-look-command.yml index 216055ca..b26cbc41 100644 --- a/.github/workflows/please-take-a-look-command.yml +++ b/.github/workflows/please-take-a-look-command.yml @@ -2,8 +2,8 @@ # 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 /ping-for-attention or /pfa it will add a comment pinging -# the code-owners who have not yet reviewed the pull request +# 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 @@ -44,7 +44,7 @@ jobs: const reviewersWhoHaveNotReviewed = reviewers.filter(reviewer => !reviewersWhoHaveReviewed.includes(reviewer)); if (reviewersWhoHaveNotReviewed.length > 0) { - const comment = reviewersWhoHaveNotReviewed.map(reviewer => `@${reviewer}`).join(' '); + 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, From 4f76ad4b31680944ef62b228d93cea958bc25ea9 Mon Sep 17 00:00:00 2001 From: asyncapi-bot Date: Mon, 8 Apr 2024 14:18:35 +0200 Subject: [PATCH 09/15] ci: update of files from global .github repo (#516) --- .github/workflows/help-command.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/help-command.yml b/.github/workflows/help-command.yml index ada81682..55353bb8 100644 --- a/.github/workflows/help-command.yml +++ b/.github/workflows/help-command.yml @@ -31,7 +31,7 @@ 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. + - \`/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.` From 4609daedc87b68751581460de372236a0d2e4bd6 Mon Sep 17 00:00:00 2001 From: asyncapi-bot Date: Tue, 9 Apr 2024 18:14:08 +0200 Subject: [PATCH 10/15] ci: update of files from global .github repo (#517) --- .github/workflows/if-nodejs-pr-testing.yml | 24 ++++++++--------- .github/workflows/if-nodejs-release.yml | 31 ++++++++++------------ 2 files changed, 26 insertions(+), 29 deletions(-) diff --git a/.github/workflows/if-nodejs-pr-testing.yml b/.github/workflows/if-nodejs-pr-testing.yml index 73a2af5c..66ea6552 100644 --- a/.github/workflows/if-nodejs-pr-testing.yml +++ b/.github/workflows/if-nodejs-pr-testing.yml @@ -39,9 +39,10 @@ jobs: run: | git config --global core.autocrlf false git config --global core.eol lf + shell: bash - if: steps.should_run.outputs.shouldrun == 'true' name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - if: steps.should_run.outputs.shouldrun == 'true' name: Check if Node.js project and has package.json id: packagejson @@ -53,27 +54,26 @@ jobs: id: lockversion - if: steps.packagejson.outputs.exists == 'true' name: Setup Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: "${{ steps.lockversion.outputs.version }}" - cache: 'npm' - cache-dependency-path: '**/package-lock.json' + - if: steps.lockversion.outputs.version == '18' && matrix.os == 'windows-latest' + #npm cli 10 is buggy because of some cache issue + name: Install npm cli 8 + shell: bash + run: npm install -g npm@8.19.4 - if: steps.packagejson.outputs.exists == 'true' name: Install dependencies - id: first-installation + shell: bash run: npm ci - continue-on-error: true - - if: steps.first-installation.outcome != 'success' && steps.packagejson.outputs.exists == 'true' - name: Clear NPM cache and install deps again - run: | - npm cache clean --force - npm ci - if: steps.packagejson.outputs.exists == 'true' name: Test run: npm test --if-present - - if: steps.packagejson.outputs.exists == 'true' + - if: steps.packagejson.outputs.exists == 'true' && matrix.os == 'ubuntu-latest' + #linting should run just one and not on all possible operating systems name: Run linter run: npm run lint --if-present - if: steps.packagejson.outputs.exists == 'true' name: Run release assets generation to make sure PR does not break it + shell: bash run: npm run generate:assets --if-present diff --git a/.github/workflows/if-nodejs-release.yml b/.github/workflows/if-nodejs-release.yml index f407e59a..234c5a9c 100644 --- a/.github/workflows/if-nodejs-release.yml +++ b/.github/workflows/if-nodejs-release.yml @@ -38,8 +38,9 @@ jobs: run: | git config --global core.autocrlf false git config --global core.eol lf + shell: bash - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Check if Node.js project and has package.json id: packagejson run: test -e ./package.json && echo "exists=true" >> $GITHUB_OUTPUT || echo "exists=false" >> $GITHUB_OUTPUT @@ -50,14 +51,18 @@ jobs: id: lockversion - if: steps.packagejson.outputs.exists == 'true' name: Setup Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: "${{ steps.lockversion.outputs.version }}" - cache: 'npm' - cache-dependency-path: '**/package-lock.json' + - if: steps.lockversion.outputs.version == '18' && matrix.os == 'windows-latest' + name: Install npm cli 8 + shell: bash + #npm cli 10 is buggy because of some cache issues + run: npm install -g npm@8.19.4 - if: steps.packagejson.outputs.exists == 'true' name: Install dependencies - run: npm install + shell: bash + run: npm ci - if: steps.packagejson.outputs.exists == 'true' name: Run test run: npm test --if-present @@ -81,7 +86,7 @@ jobs: git config --global core.autocrlf false git config --global core.eol lf - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Check if Node.js project and has package.json id: packagejson run: test -e ./package.json && echo "exists=true" >> $GITHUB_OUTPUT || echo "exists=false" >> $GITHUB_OUTPUT @@ -92,21 +97,13 @@ jobs: id: lockversion - if: steps.packagejson.outputs.exists == 'true' name: Setup Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: "${{ steps.lockversion.outputs.version }}" - cache: 'npm' - cache-dependency-path: '**/package-lock.json' - if: steps.packagejson.outputs.exists == 'true' name: Install dependencies - id: first-installation + shell: bash run: npm ci - continue-on-error: true - - if: steps.first-installation.outcome != 'success' && steps.packagejson.outputs.exists == 'true' - name: Clear NPM cache and install deps again - run: | - npm cache clean --force - npm ci - if: steps.packagejson.outputs.exists == 'true' name: Add plugin for conventional commits for semantic-release run: npm install --save-dev conventional-changelog-conventionalcommits@5.0.0 @@ -131,4 +128,4 @@ jobs: fields: repo,action,workflow text: 'Release workflow failed in release job' env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }} + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }} \ No newline at end of file From 6e5e950ffc64c0b392afd5c00737e79edff2326a Mon Sep 17 00:00:00 2001 From: asyncapi-bot Date: Tue, 9 Apr 2024 18:34:11 +0200 Subject: [PATCH 11/15] ci: update of files from global .github repo (#518) --- .github/workflows/bump.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/bump.yml b/.github/workflows/bump.yml index dff50cfa..1e17ccf2 100644 --- a/.github/workflows/bump.yml +++ b/.github/workflows/bump.yml @@ -26,9 +26,10 @@ jobs: run: test -e ./package.json && echo "exists=true" >> $GITHUB_OUTPUT || echo "exists=false" >> $GITHUB_OUTPUT - if: steps.packagejson.outputs.exists == 'true' name: Bumping latest version of this package in other repositories - uses: derberg/npm-dependency-manager-for-your-github-org@3df56be95bcaa5c76a9c9a4af863ab151545b649 # using v6.-.- https://github.com/derberg/npm-dependency-manager-for-your-github-org/releases/tag/v6 + uses: derberg/npm-dependency-manager-for-your-github-org@1eafd3bf3974f21d395c1abac855cb04b295d570 # using v6.-.- https://github.com/derberg/npm-dependency-manager-for-your-github-org/releases/tag/v6 with: github_token: ${{ secrets.GH_TOKEN }} committer_username: asyncapi-bot committer_email: info@asyncapi.io repos_to_ignore: spec,bindings,saunter + custom_id: "dependency update from asyncapi bot" From a75e436380985f15d104bb7891ef4a5a5130282b Mon Sep 17 00:00:00 2001 From: Sergio Moya <1083296+smoya@users.noreply.github.com> Date: Mon, 15 Apr 2024 12:03:51 +0200 Subject: [PATCH 12/15] =?UTF-8?q?fix:=20go=20module=20version=20now=20supp?= =?UTF-8?q?orts=20v6.=20This=20does=20not=20affect=20the=20NPM=20=E2=80=A6?= =?UTF-8?q?=20(#519)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index fdec2e5d..7b522bae 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/asyncapi/spec-json-schemas/v4 +module github.com/asyncapi/spec-json-schemas/v6 go 1.17 From 36533fe957a4dd1c7231d4ae971bd7b3266d7ad3 Mon Sep 17 00:00:00 2001 From: asyncapi-bot Date: Mon, 15 Apr 2024 12:08:30 +0200 Subject: [PATCH 13/15] chore(release): v6.5.6 (#521) --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2e7a80f7..7100aae6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@asyncapi/specs", - "version": "6.5.5", + "version": "6.5.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@asyncapi/specs", - "version": "6.5.5", + "version": "6.5.6", "license": "Apache-2.0", "dependencies": { "@types/json-schema": "^7.0.11" diff --git a/package.json b/package.json index e40ee39c..652fb441 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@asyncapi/specs", - "version": "6.5.5", + "version": "6.5.6", "description": "AsyncAPI schema versions", "main": "index.js", "types": "index.d.ts", From 8f79700324d1006dd484985ecdf49861a5346f85 Mon Sep 17 00:00:00 2001 From: Jonas Lagoni Date: Wed, 17 Apr 2024 16:57:21 +0200 Subject: [PATCH 14/15] chore: add jonaslagoni as maintainer (#522) --- CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CODEOWNERS b/CODEOWNERS index c6c77c26..bfa20c51 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -6,7 +6,7 @@ # 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 @GreenRover +* @fmvilas @derberg @dalelane @smoya @char0n @GreenRover @jonaslagoni @asyncapi-bot-eve /bindings/anypointmq/ @mboss37 @GeraldLoeffler /bindings/ibmmq/ @rcoppen From 9507aff9af14125f0edbb81a5445164c217467aa Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Wed, 17 Apr 2024 19:00:18 +0400 Subject: [PATCH 15/15] chore: add Pakisan as maintainer (#523) Co-authored-by: Lukasz Gornicki --- CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CODEOWNERS b/CODEOWNERS index bfa20c51..f2346c90 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -6,7 +6,7 @@ # 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 @GreenRover @jonaslagoni @asyncapi-bot-eve +* @fmvilas @derberg @dalelane @smoya @char0n @GreenRover @jonaslagoni @pakisan @asyncapi-bot-eve /bindings/anypointmq/ @mboss37 @GeraldLoeffler /bindings/ibmmq/ @rcoppen