From 360891c2f0369cb568c23c4b69668d1c15ca2fac Mon Sep 17 00:00:00 2001 From: Artem Kostiuk Date: Thu, 9 Jan 2020 11:28:25 +0200 Subject: [PATCH 01/26] Add tck tests for "Format" and "File Structure" spec sections --- .gitignore | 1 + tests/asyncapi-2.0/File Structure/common.yaml | 6 +++++ .../invalid-inexisting-file-ref.yaml | 12 ++++++++++ tests/asyncapi-2.0/File Structure/valid.yaml | 12 ++++++++++ .../Format/invalid-case-sensitive.json | 24 +++++++++++++++++++ .../Format/invalid-case-sensitive.yaml | 16 +++++++++++++ .../Format/invalid-integer-key.yaml | 21 ++++++++++++++++ .../Format/invalid-json-schema-tag.yaml | 16 +++++++++++++ tests/asyncapi-2.0/Format/invalid-syntax.json | 5 ++++ tests/asyncapi-2.0/Format/invalid-syntax.yaml | 4 ++++ tests/asyncapi-2.0/Format/valid.json | 24 +++++++++++++++++++ tests/asyncapi-2.0/Format/valid.yaml | 16 +++++++++++++ 12 files changed, 157 insertions(+) create mode 100644 .gitignore create mode 100644 tests/asyncapi-2.0/File Structure/common.yaml create mode 100644 tests/asyncapi-2.0/File Structure/invalid-inexisting-file-ref.yaml create mode 100644 tests/asyncapi-2.0/File Structure/valid.yaml create mode 100644 tests/asyncapi-2.0/Format/invalid-case-sensitive.json create mode 100644 tests/asyncapi-2.0/Format/invalid-case-sensitive.yaml create mode 100644 tests/asyncapi-2.0/Format/invalid-integer-key.yaml create mode 100644 tests/asyncapi-2.0/Format/invalid-json-schema-tag.yaml create mode 100644 tests/asyncapi-2.0/Format/invalid-syntax.json create mode 100644 tests/asyncapi-2.0/Format/invalid-syntax.yaml create mode 100644 tests/asyncapi-2.0/Format/valid.json create mode 100644 tests/asyncapi-2.0/Format/valid.yaml diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..3c3629e6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/tests/asyncapi-2.0/File Structure/common.yaml b/tests/asyncapi-2.0/File Structure/common.yaml new file mode 100644 index 00000000..143af674 --- /dev/null +++ b/tests/asyncapi-2.0/File Structure/common.yaml @@ -0,0 +1,6 @@ +userSignUp: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/File Structure/invalid-inexisting-file-ref.yaml b/tests/asyncapi-2.0/File Structure/invalid-inexisting-file-ref.yaml new file mode 100644 index 00000000..39c1582a --- /dev/null +++ b/tests/asyncapi-2.0/File Structure/invalid-inexisting-file-ref.yaml @@ -0,0 +1,12 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + $ref: inexistingFile.yaml/#userSignUp diff --git a/tests/asyncapi-2.0/File Structure/valid.yaml b/tests/asyncapi-2.0/File Structure/valid.yaml new file mode 100644 index 00000000..fba512dc --- /dev/null +++ b/tests/asyncapi-2.0/File Structure/valid.yaml @@ -0,0 +1,12 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + $ref: common.yaml/#userSignUp diff --git a/tests/asyncapi-2.0/Format/invalid-case-sensitive.json b/tests/asyncapi-2.0/Format/invalid-case-sensitive.json new file mode 100644 index 00000000..3659b02c --- /dev/null +++ b/tests/asyncapi-2.0/Format/invalid-case-sensitive.json @@ -0,0 +1,24 @@ +{ + "asyncapi": "2.0.0", + "INFO": { + "title": "Signup service example (internal)", + "version": "0.1.0" + }, + "channels": { + "/user/signedup": { + "SUBSCRIBE": { + "MESSAGE": { + "payload": { + "type": "object", + "properties": { + "email": { + "type": "string", + "format": "email" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/tests/asyncapi-2.0/Format/invalid-case-sensitive.yaml b/tests/asyncapi-2.0/Format/invalid-case-sensitive.yaml new file mode 100644 index 00000000..f3e35d1d --- /dev/null +++ b/tests/asyncapi-2.0/Format/invalid-case-sensitive.yaml @@ -0,0 +1,16 @@ +asyncapi: 2.0.0 + +INFO: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + SUBSCRIBE: + MESSAGE: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/Format/invalid-integer-key.yaml b/tests/asyncapi-2.0/Format/invalid-integer-key.yaml new file mode 100644 index 00000000..a65bdd83 --- /dev/null +++ b/tests/asyncapi-2.0/Format/invalid-integer-key.yaml @@ -0,0 +1,21 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + $ref: '#/components/messages/1' + +components: + messages: + 1: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/Format/invalid-json-schema-tag.yaml b/tests/asyncapi-2.0/Format/invalid-json-schema-tag.yaml new file mode 100644 index 00000000..e291693e --- /dev/null +++ b/tests/asyncapi-2.0/Format/invalid-json-schema-tag.yaml @@ -0,0 +1,16 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: !!invalidTag 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/Format/invalid-syntax.json b/tests/asyncapi-2.0/Format/invalid-syntax.json new file mode 100644 index 00000000..1d03796c --- /dev/null +++ b/tests/asyncapi-2.0/Format/invalid-syntax.json @@ -0,0 +1,5 @@ +{ + "asyncapi": "2.0.0", + "info": { + "servers": { +} diff --git a/tests/asyncapi-2.0/Format/invalid-syntax.yaml b/tests/asyncapi-2.0/Format/invalid-syntax.yaml new file mode 100644 index 00000000..10caf301 --- /dev/null +++ b/tests/asyncapi-2.0/Format/invalid-syntax.yaml @@ -0,0 +1,4 @@ +qwe +asd +zxc +123 diff --git a/tests/asyncapi-2.0/Format/valid.json b/tests/asyncapi-2.0/Format/valid.json new file mode 100644 index 00000000..02edc2f1 --- /dev/null +++ b/tests/asyncapi-2.0/Format/valid.json @@ -0,0 +1,24 @@ +{ + "asyncapi": "2.0.0", + "info": { + "title": "Signup service example (internal)", + "version": "0.1.0" + }, + "channels": { + "/user/signedup": { + "subscribe": { + "message": { + "payload": { + "type": "object", + "properties": { + "email": { + "type": "string", + "format": "email" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/tests/asyncapi-2.0/Format/valid.yaml b/tests/asyncapi-2.0/Format/valid.yaml new file mode 100644 index 00000000..2daeb076 --- /dev/null +++ b/tests/asyncapi-2.0/Format/valid.yaml @@ -0,0 +1,16 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email From 9ebba32c5b1f56e74edce2dec2c9b7914369786d Mon Sep 17 00:00:00 2001 From: Artem Kostiuk Date: Fri, 10 Jan 2020 10:51:09 +0200 Subject: [PATCH 02/26] Add more tck tests AsyncAPI Object AsyncAPI Version String Contact Object Identifier Info Object License Object Servers Object --- .../invalid-missing-asyncapi.yaml | 14 +++++++++++ .../invalid-missing-channels.yaml | 5 ++++ .../AsyncAPI Object/invalid-missing-info.yaml | 12 ++++++++++ tests/asyncapi-2.0/AsyncAPI Object/valid.yaml | 16 +++++++++++++ .../invalid-version-string-format.yaml | 16 +++++++++++++ .../valid-major-minor-patch.yaml | 16 +++++++++++++ .../valid-major-minor.yaml | 16 +++++++++++++ .../valid-with-hyphen.yaml | 16 +++++++++++++ .../Contact Object/invalid-email-format.yaml | 20 ++++++++++++++++ .../Contact Object/invalid-url-format.yaml | 20 ++++++++++++++++ tests/asyncapi-2.0/Contact Object/valid.yaml | 20 ++++++++++++++++ .../Identifier/invalid-uri-format.yaml | 18 +++++++++++++++ tests/asyncapi-2.0/Identifier/valid-uri.yaml | 18 +++++++++++++++ tests/asyncapi-2.0/Identifier/valid-urn.yaml | 18 +++++++++++++++ .../Info Object/invalid-missing-title.yaml | 17 ++++++++++++++ .../Info Object/invalid-missing-version.yaml | 17 ++++++++++++++ .../invalid-termsofservice-url-format.yaml | 18 +++++++++++++++ tests/asyncapi-2.0/Info Object/valid.yaml | 18 +++++++++++++++ .../License Object/invalid-missing-name.yaml | 18 +++++++++++++++ .../License Object/invalid-url-format.yaml | 19 +++++++++++++++ tests/asyncapi-2.0/License Object/valid.yaml | 19 +++++++++++++++ .../invalid-patterned-field.yaml | 23 +++++++++++++++++++ tests/asyncapi-2.0/Servers Object/valid.yaml | 23 +++++++++++++++++++ 23 files changed, 397 insertions(+) create mode 100644 tests/asyncapi-2.0/AsyncAPI Object/invalid-missing-asyncapi.yaml create mode 100644 tests/asyncapi-2.0/AsyncAPI Object/invalid-missing-channels.yaml create mode 100644 tests/asyncapi-2.0/AsyncAPI Object/invalid-missing-info.yaml create mode 100644 tests/asyncapi-2.0/AsyncAPI Object/valid.yaml create mode 100644 tests/asyncapi-2.0/AsyncAPI Version String/invalid-version-string-format.yaml create mode 100644 tests/asyncapi-2.0/AsyncAPI Version String/valid-major-minor-patch.yaml create mode 100644 tests/asyncapi-2.0/AsyncAPI Version String/valid-major-minor.yaml create mode 100644 tests/asyncapi-2.0/AsyncAPI Version String/valid-with-hyphen.yaml create mode 100644 tests/asyncapi-2.0/Contact Object/invalid-email-format.yaml create mode 100644 tests/asyncapi-2.0/Contact Object/invalid-url-format.yaml create mode 100644 tests/asyncapi-2.0/Contact Object/valid.yaml create mode 100644 tests/asyncapi-2.0/Identifier/invalid-uri-format.yaml create mode 100644 tests/asyncapi-2.0/Identifier/valid-uri.yaml create mode 100644 tests/asyncapi-2.0/Identifier/valid-urn.yaml create mode 100644 tests/asyncapi-2.0/Info Object/invalid-missing-title.yaml create mode 100644 tests/asyncapi-2.0/Info Object/invalid-missing-version.yaml create mode 100644 tests/asyncapi-2.0/Info Object/invalid-termsofservice-url-format.yaml create mode 100644 tests/asyncapi-2.0/Info Object/valid.yaml create mode 100644 tests/asyncapi-2.0/License Object/invalid-missing-name.yaml create mode 100644 tests/asyncapi-2.0/License Object/invalid-url-format.yaml create mode 100644 tests/asyncapi-2.0/License Object/valid.yaml create mode 100644 tests/asyncapi-2.0/Servers Object/invalid-patterned-field.yaml create mode 100644 tests/asyncapi-2.0/Servers Object/valid.yaml diff --git a/tests/asyncapi-2.0/AsyncAPI Object/invalid-missing-asyncapi.yaml b/tests/asyncapi-2.0/AsyncAPI Object/invalid-missing-asyncapi.yaml new file mode 100644 index 00000000..94c1e232 --- /dev/null +++ b/tests/asyncapi-2.0/AsyncAPI Object/invalid-missing-asyncapi.yaml @@ -0,0 +1,14 @@ +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/AsyncAPI Object/invalid-missing-channels.yaml b/tests/asyncapi-2.0/AsyncAPI Object/invalid-missing-channels.yaml new file mode 100644 index 00000000..4f9f99dc --- /dev/null +++ b/tests/asyncapi-2.0/AsyncAPI Object/invalid-missing-channels.yaml @@ -0,0 +1,5 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 diff --git a/tests/asyncapi-2.0/AsyncAPI Object/invalid-missing-info.yaml b/tests/asyncapi-2.0/AsyncAPI Object/invalid-missing-info.yaml new file mode 100644 index 00000000..0f175248 --- /dev/null +++ b/tests/asyncapi-2.0/AsyncAPI Object/invalid-missing-info.yaml @@ -0,0 +1,12 @@ +asyncapi: 2.0.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/AsyncAPI Object/valid.yaml b/tests/asyncapi-2.0/AsyncAPI Object/valid.yaml new file mode 100644 index 00000000..2daeb076 --- /dev/null +++ b/tests/asyncapi-2.0/AsyncAPI Object/valid.yaml @@ -0,0 +1,16 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/AsyncAPI Version String/invalid-version-string-format.yaml b/tests/asyncapi-2.0/AsyncAPI Version String/invalid-version-string-format.yaml new file mode 100644 index 00000000..6963fbfe --- /dev/null +++ b/tests/asyncapi-2.0/AsyncAPI Version String/invalid-version-string-format.yaml @@ -0,0 +1,16 @@ +asyncapi: welcome + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/AsyncAPI Version String/valid-major-minor-patch.yaml b/tests/asyncapi-2.0/AsyncAPI Version String/valid-major-minor-patch.yaml new file mode 100644 index 00000000..2daeb076 --- /dev/null +++ b/tests/asyncapi-2.0/AsyncAPI Version String/valid-major-minor-patch.yaml @@ -0,0 +1,16 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/AsyncAPI Version String/valid-major-minor.yaml b/tests/asyncapi-2.0/AsyncAPI Version String/valid-major-minor.yaml new file mode 100644 index 00000000..66fe3217 --- /dev/null +++ b/tests/asyncapi-2.0/AsyncAPI Version String/valid-major-minor.yaml @@ -0,0 +1,16 @@ +asyncapi: 2.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/AsyncAPI Version String/valid-with-hyphen.yaml b/tests/asyncapi-2.0/AsyncAPI Version String/valid-with-hyphen.yaml new file mode 100644 index 00000000..a66fb8e7 --- /dev/null +++ b/tests/asyncapi-2.0/AsyncAPI Version String/valid-with-hyphen.yaml @@ -0,0 +1,16 @@ +asyncapi: 2.0.0-rc2 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/Contact Object/invalid-email-format.yaml b/tests/asyncapi-2.0/Contact Object/invalid-email-format.yaml new file mode 100644 index 00000000..cb9e3afd --- /dev/null +++ b/tests/asyncapi-2.0/Contact Object/invalid-email-format.yaml @@ -0,0 +1,20 @@ +asyncapi: 2.0.0 + +info: + title: AsyncAPI Sample App + version: 1.0.1 + contact: + name: API Support + url: http://www.asyncapi.org/support + email: is not in the format of an email address + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/Contact Object/invalid-url-format.yaml b/tests/asyncapi-2.0/Contact Object/invalid-url-format.yaml new file mode 100644 index 00000000..189fb905 --- /dev/null +++ b/tests/asyncapi-2.0/Contact Object/invalid-url-format.yaml @@ -0,0 +1,20 @@ +asyncapi: 2.0.0 + +info: + title: AsyncAPI Sample App + version: 1.0.1 + contact: + name: API Support + url: is not in the format of a URL + email: support@asyncapi.org + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/Contact Object/valid.yaml b/tests/asyncapi-2.0/Contact Object/valid.yaml new file mode 100644 index 00000000..fd4ee3e9 --- /dev/null +++ b/tests/asyncapi-2.0/Contact Object/valid.yaml @@ -0,0 +1,20 @@ +asyncapi: 2.0.0 + +info: + title: AsyncAPI Sample App + version: 1.0.1 + contact: + name: API Support + url: http://www.asyncapi.org/support + email: support@asyncapi.org + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/Identifier/invalid-uri-format.yaml b/tests/asyncapi-2.0/Identifier/invalid-uri-format.yaml new file mode 100644 index 00000000..efcc3651 --- /dev/null +++ b/tests/asyncapi-2.0/Identifier/invalid-uri-format.yaml @@ -0,0 +1,18 @@ +asyncapi: 2.0.0 + +id: 'this id does not conform to the URI format' + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/Identifier/valid-uri.yaml b/tests/asyncapi-2.0/Identifier/valid-uri.yaml new file mode 100644 index 00000000..c6a3b193 --- /dev/null +++ b/tests/asyncapi-2.0/Identifier/valid-uri.yaml @@ -0,0 +1,18 @@ +asyncapi: 2.0.0 + +id: 'https://github.com/smartylighting/streetlights-server' + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/Identifier/valid-urn.yaml b/tests/asyncapi-2.0/Identifier/valid-urn.yaml new file mode 100644 index 00000000..4c2128cd --- /dev/null +++ b/tests/asyncapi-2.0/Identifier/valid-urn.yaml @@ -0,0 +1,18 @@ +asyncapi: 2.0.0 + +id: 'urn:com:smartylighting:streetlights:server' + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/Info Object/invalid-missing-title.yaml b/tests/asyncapi-2.0/Info Object/invalid-missing-title.yaml new file mode 100644 index 00000000..62bfdc2d --- /dev/null +++ b/tests/asyncapi-2.0/Info Object/invalid-missing-title.yaml @@ -0,0 +1,17 @@ +asyncapi: 2.0.0 + +info: + version: 1.0.1 + description: This is a sample server. + termsOfService: http://asyncapi.org/terms/ + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/Info Object/invalid-missing-version.yaml b/tests/asyncapi-2.0/Info Object/invalid-missing-version.yaml new file mode 100644 index 00000000..9d507912 --- /dev/null +++ b/tests/asyncapi-2.0/Info Object/invalid-missing-version.yaml @@ -0,0 +1,17 @@ +asyncapi: 2.0.0 + +info: + title: AsyncAPI Sample App + description: This is a sample server. + termsOfService: http://asyncapi.org/terms/ + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/Info Object/invalid-termsofservice-url-format.yaml b/tests/asyncapi-2.0/Info Object/invalid-termsofservice-url-format.yaml new file mode 100644 index 00000000..003235af --- /dev/null +++ b/tests/asyncapi-2.0/Info Object/invalid-termsofservice-url-format.yaml @@ -0,0 +1,18 @@ +asyncapi: 2.0.0 + +info: + title: AsyncAPI Sample App + version: 1.0.1 + description: This is a sample server. + termsOfService: is not in the format of a URL + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/Info Object/valid.yaml b/tests/asyncapi-2.0/Info Object/valid.yaml new file mode 100644 index 00000000..51958bf9 --- /dev/null +++ b/tests/asyncapi-2.0/Info Object/valid.yaml @@ -0,0 +1,18 @@ +asyncapi: 2.0.0 + +info: + title: AsyncAPI Sample App + version: 1.0.1 + description: This is a sample server. + termsOfService: http://asyncapi.org/terms/ + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/License Object/invalid-missing-name.yaml b/tests/asyncapi-2.0/License Object/invalid-missing-name.yaml new file mode 100644 index 00000000..6d6728c2 --- /dev/null +++ b/tests/asyncapi-2.0/License Object/invalid-missing-name.yaml @@ -0,0 +1,18 @@ +asyncapi: 2.0.0 + +info: + title: AsyncAPI Sample App + version: 1.0.1 + license: + url: http://www.apache.org/licenses/LICENSE-2.0.html + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/License Object/invalid-url-format.yaml b/tests/asyncapi-2.0/License Object/invalid-url-format.yaml new file mode 100644 index 00000000..20facabf --- /dev/null +++ b/tests/asyncapi-2.0/License Object/invalid-url-format.yaml @@ -0,0 +1,19 @@ +asyncapi: 2.0.0 + +info: + title: AsyncAPI Sample App + version: 1.0.1 + license: + name: Apache 2.0 + url: this is not in the format of a URL + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/License Object/valid.yaml b/tests/asyncapi-2.0/License Object/valid.yaml new file mode 100644 index 00000000..413cae2a --- /dev/null +++ b/tests/asyncapi-2.0/License Object/valid.yaml @@ -0,0 +1,19 @@ +asyncapi: 2.0.0 + +info: + title: AsyncAPI Sample App + version: 1.0.1 + license: + name: Apache 2.0 + url: http://www.apache.org/licenses/LICENSE-2.0.html + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/Servers Object/invalid-patterned-field.yaml b/tests/asyncapi-2.0/Servers Object/invalid-patterned-field.yaml new file mode 100644 index 00000000..9f3690aa --- /dev/null +++ b/tests/asyncapi-2.0/Servers Object/invalid-patterned-field.yaml @@ -0,0 +1,23 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + +servers: + production$!@&*^!%@$: + url: development.gigantic-server.com + description: Development server + protocol: kafka + protocolVersion: '1.0.0' diff --git a/tests/asyncapi-2.0/Servers Object/valid.yaml b/tests/asyncapi-2.0/Servers Object/valid.yaml new file mode 100644 index 00000000..a10cde69 --- /dev/null +++ b/tests/asyncapi-2.0/Servers Object/valid.yaml @@ -0,0 +1,23 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + +servers: + production: + url: development.gigantic-server.com + description: Development server + protocol: kafka + protocolVersion: '1.0.0' From 4f463694e40ed77e236d5c410efeed26fad4fbf4 Mon Sep 17 00:00:00 2001 From: Artem Kostiuk Date: Fri, 10 Jan 2020 12:06:26 +0200 Subject: [PATCH 03/26] Add more tck tests Server Object Server Variable Object Channels Object --- .../invalid-absolute-path.yaml | 16 +++++++++ .../invalid-fragment-used.yaml | 16 +++++++++ .../invalid-query-param-used.yaml | 16 +++++++++ tests/asyncapi-2.0/Channels Object/valid.yaml | 16 +++++++++ .../invalid-inexisting-security-scheme.yaml | 32 +++++++++++++++++ .../invalid-missing-protocol.yaml | 22 ++++++++++++ .../Server Object/invalid-missing-url.yaml | 22 ++++++++++++ .../Server Object/valid-multiple-servers.yaml | 33 ++++++++++++++++++ .../valid-not-official-protocol.yaml | 23 +++++++++++++ .../Server Object/valid-relative-url.yaml | 23 +++++++++++++ .../Server Object/valid-security.yaml | 32 +++++++++++++++++ tests/asyncapi-2.0/Server Object/valid.yaml | 23 +++++++++++++ .../Server Variable Object/valid.yaml | 34 +++++++++++++++++++ .../invalid-patterned-field.yaml | 2 -- tests/asyncapi-2.0/Servers Object/valid.yaml | 2 -- 15 files changed, 308 insertions(+), 4 deletions(-) create mode 100644 tests/asyncapi-2.0/Channels Object/invalid-absolute-path.yaml create mode 100644 tests/asyncapi-2.0/Channels Object/invalid-fragment-used.yaml create mode 100644 tests/asyncapi-2.0/Channels Object/invalid-query-param-used.yaml create mode 100644 tests/asyncapi-2.0/Channels Object/valid.yaml create mode 100644 tests/asyncapi-2.0/Server Object/invalid-inexisting-security-scheme.yaml create mode 100644 tests/asyncapi-2.0/Server Object/invalid-missing-protocol.yaml create mode 100644 tests/asyncapi-2.0/Server Object/invalid-missing-url.yaml create mode 100644 tests/asyncapi-2.0/Server Object/valid-multiple-servers.yaml create mode 100644 tests/asyncapi-2.0/Server Object/valid-not-official-protocol.yaml create mode 100644 tests/asyncapi-2.0/Server Object/valid-relative-url.yaml create mode 100644 tests/asyncapi-2.0/Server Object/valid-security.yaml create mode 100644 tests/asyncapi-2.0/Server Object/valid.yaml create mode 100644 tests/asyncapi-2.0/Server Variable Object/valid.yaml diff --git a/tests/asyncapi-2.0/Channels Object/invalid-absolute-path.yaml b/tests/asyncapi-2.0/Channels Object/invalid-absolute-path.yaml new file mode 100644 index 00000000..aacd35e8 --- /dev/null +++ b/tests/asyncapi-2.0/Channels Object/invalid-absolute-path.yaml @@ -0,0 +1,16 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + https://example.som/user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/Channels Object/invalid-fragment-used.yaml b/tests/asyncapi-2.0/Channels Object/invalid-fragment-used.yaml new file mode 100644 index 00000000..4cbd01c2 --- /dev/null +++ b/tests/asyncapi-2.0/Channels Object/invalid-fragment-used.yaml @@ -0,0 +1,16 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup#something: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/Channels Object/invalid-query-param-used.yaml b/tests/asyncapi-2.0/Channels Object/invalid-query-param-used.yaml new file mode 100644 index 00000000..0b651e41 --- /dev/null +++ b/tests/asyncapi-2.0/Channels Object/invalid-query-param-used.yaml @@ -0,0 +1,16 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup?foo=1: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/Channels Object/valid.yaml b/tests/asyncapi-2.0/Channels Object/valid.yaml new file mode 100644 index 00000000..2daeb076 --- /dev/null +++ b/tests/asyncapi-2.0/Channels Object/valid.yaml @@ -0,0 +1,16 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/Server Object/invalid-inexisting-security-scheme.yaml b/tests/asyncapi-2.0/Server Object/invalid-inexisting-security-scheme.yaml new file mode 100644 index 00000000..5d321fc7 --- /dev/null +++ b/tests/asyncapi-2.0/Server Object/invalid-inexisting-security-scheme.yaml @@ -0,0 +1,32 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + protocolVersion: '1.0.0' + description: Development server + security: + - complex: [] + +components: + securitySchemes: + simple: + type: httpApiKey + name: Api-Key + in: header diff --git a/tests/asyncapi-2.0/Server Object/invalid-missing-protocol.yaml b/tests/asyncapi-2.0/Server Object/invalid-missing-protocol.yaml new file mode 100644 index 00000000..c7cecf22 --- /dev/null +++ b/tests/asyncapi-2.0/Server Object/invalid-missing-protocol.yaml @@ -0,0 +1,22 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + +servers: + production: + url: development.gigantic-server.com + protocolVersion: '1.0.0' + description: Development server diff --git a/tests/asyncapi-2.0/Server Object/invalid-missing-url.yaml b/tests/asyncapi-2.0/Server Object/invalid-missing-url.yaml new file mode 100644 index 00000000..0ad0f922 --- /dev/null +++ b/tests/asyncapi-2.0/Server Object/invalid-missing-url.yaml @@ -0,0 +1,22 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + +servers: + production: + protocol: kafka + protocolVersion: '1.0.0' + description: Development server diff --git a/tests/asyncapi-2.0/Server Object/valid-multiple-servers.yaml b/tests/asyncapi-2.0/Server Object/valid-multiple-servers.yaml new file mode 100644 index 00000000..c1244e17 --- /dev/null +++ b/tests/asyncapi-2.0/Server Object/valid-multiple-servers.yaml @@ -0,0 +1,33 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + +servers: + development: + url: development.gigantic-server.com + description: Development server + protocol: amqp + protocolVersion: '0.9.1' + staging: + url: staging.gigantic-server.com + description: Staging server + protocol: amqp + protocolVersion: '0.9.1' + production: + url: api.gigantic-server.com + description: Production server + protocol: amqp + protocolVersion: '0.9.1' diff --git a/tests/asyncapi-2.0/Server Object/valid-not-official-protocol.yaml b/tests/asyncapi-2.0/Server Object/valid-not-official-protocol.yaml new file mode 100644 index 00000000..e9a509bf --- /dev/null +++ b/tests/asyncapi-2.0/Server Object/valid-not-official-protocol.yaml @@ -0,0 +1,23 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + +servers: + production: + url: development.gigantic-server.com + protocol: custom-protocol + protocolVersion: '1.0.0' + description: Development server diff --git a/tests/asyncapi-2.0/Server Object/valid-relative-url.yaml b/tests/asyncapi-2.0/Server Object/valid-relative-url.yaml new file mode 100644 index 00000000..98898536 --- /dev/null +++ b/tests/asyncapi-2.0/Server Object/valid-relative-url.yaml @@ -0,0 +1,23 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + +servers: + dev: + url: /dev/pubserver/ + protocol: kafka + protocolVersion: '1.0.0' + description: Development server diff --git a/tests/asyncapi-2.0/Server Object/valid-security.yaml b/tests/asyncapi-2.0/Server Object/valid-security.yaml new file mode 100644 index 00000000..806674f7 --- /dev/null +++ b/tests/asyncapi-2.0/Server Object/valid-security.yaml @@ -0,0 +1,32 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + protocolVersion: '1.0.0' + description: Development server + security: + - simple: [] + +components: + securitySchemes: + simple: + type: httpApiKey + name: Api-Key + in: header diff --git a/tests/asyncapi-2.0/Server Object/valid.yaml b/tests/asyncapi-2.0/Server Object/valid.yaml new file mode 100644 index 00000000..b11b2171 --- /dev/null +++ b/tests/asyncapi-2.0/Server Object/valid.yaml @@ -0,0 +1,23 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + protocolVersion: '1.0.0' + description: Development server diff --git a/tests/asyncapi-2.0/Server Variable Object/valid.yaml b/tests/asyncapi-2.0/Server Variable Object/valid.yaml new file mode 100644 index 00000000..2eb8418f --- /dev/null +++ b/tests/asyncapi-2.0/Server Variable Object/valid.yaml @@ -0,0 +1,34 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + +servers: + production: + url: '{username}.gigantic-server.com:{port}' + description: The production API server + protocol: secure-mqtt + variables: + username: + default: demo + description: Active user name + examples: + - 'admin' + - 'user123' + port: + enum: + - '8883' + - '8884' + default: '8883' diff --git a/tests/asyncapi-2.0/Servers Object/invalid-patterned-field.yaml b/tests/asyncapi-2.0/Servers Object/invalid-patterned-field.yaml index 9f3690aa..de6465dd 100644 --- a/tests/asyncapi-2.0/Servers Object/invalid-patterned-field.yaml +++ b/tests/asyncapi-2.0/Servers Object/invalid-patterned-field.yaml @@ -18,6 +18,4 @@ channels: servers: production$!@&*^!%@$: url: development.gigantic-server.com - description: Development server protocol: kafka - protocolVersion: '1.0.0' diff --git a/tests/asyncapi-2.0/Servers Object/valid.yaml b/tests/asyncapi-2.0/Servers Object/valid.yaml index a10cde69..b1bd3005 100644 --- a/tests/asyncapi-2.0/Servers Object/valid.yaml +++ b/tests/asyncapi-2.0/Servers Object/valid.yaml @@ -18,6 +18,4 @@ channels: servers: production: url: development.gigantic-server.com - description: Development server protocol: kafka - protocolVersion: '1.0.0' From 51a7b04f2d61b8e09d910d7763cd3f68a3db0427 Mon Sep 17 00:00:00 2001 From: Artem Kostiuk Date: Mon, 13 Jan 2020 09:57:15 +0200 Subject: [PATCH 04/26] Add more tck tests Channel Item Object Operation Object Operation Trait Object --- .../invalid-ref-structure.yaml | 9 ++++++ .../Channel Item Object/referenced.yaml | 12 ++++++++ .../referencedInvalid.yaml | 3 ++ .../Channel Item Object/valid-publish.yaml | 13 +++++++++ .../Channel Item Object/valid-ref.yaml | 9 ++++++ .../Channel Item Object/valid-subscribe.yaml | 17 +++++++++++ .../invalid-duplicate-operationId.yaml | 22 ++++++++++++++ .../Operation Object/valid-bare-minimum.yaml | 16 ++++++++++ .../valid-case-sensitive-operationId.yaml | 22 ++++++++++++++ .../valid-multiple-messages.yaml | 26 +++++++++++++++++ .../asyncapi-2.0/Operation Object/valid.yaml | 19 ++++++++++++ .../invalid-duplicate-operationId.yaml | 29 +++++++++++++++++++ .../invalid-trait-with-message.yaml | 27 +++++++++++++++++ .../invalid-trait-with-traits.yaml | 26 +++++++++++++++++ .../valid-case-sensetive-operationId.yaml | 29 +++++++++++++++++++ .../valid-empty-trait.yaml | 22 ++++++++++++++ .../Operation Trait Object/valid.yaml | 27 +++++++++++++++++ 17 files changed, 328 insertions(+) create mode 100644 tests/asyncapi-2.0/Channel Item Object/invalid-ref-structure.yaml create mode 100644 tests/asyncapi-2.0/Channel Item Object/referenced.yaml create mode 100644 tests/asyncapi-2.0/Channel Item Object/referencedInvalid.yaml create mode 100644 tests/asyncapi-2.0/Channel Item Object/valid-publish.yaml create mode 100644 tests/asyncapi-2.0/Channel Item Object/valid-ref.yaml create mode 100644 tests/asyncapi-2.0/Channel Item Object/valid-subscribe.yaml create mode 100644 tests/asyncapi-2.0/Operation Object/invalid-duplicate-operationId.yaml create mode 100644 tests/asyncapi-2.0/Operation Object/valid-bare-minimum.yaml create mode 100644 tests/asyncapi-2.0/Operation Object/valid-case-sensitive-operationId.yaml create mode 100644 tests/asyncapi-2.0/Operation Object/valid-multiple-messages.yaml create mode 100644 tests/asyncapi-2.0/Operation Object/valid.yaml create mode 100644 tests/asyncapi-2.0/Operation Trait Object/invalid-duplicate-operationId.yaml create mode 100644 tests/asyncapi-2.0/Operation Trait Object/invalid-trait-with-message.yaml create mode 100644 tests/asyncapi-2.0/Operation Trait Object/invalid-trait-with-traits.yaml create mode 100644 tests/asyncapi-2.0/Operation Trait Object/valid-case-sensetive-operationId.yaml create mode 100644 tests/asyncapi-2.0/Operation Trait Object/valid-empty-trait.yaml create mode 100644 tests/asyncapi-2.0/Operation Trait Object/valid.yaml diff --git a/tests/asyncapi-2.0/Channel Item Object/invalid-ref-structure.yaml b/tests/asyncapi-2.0/Channel Item Object/invalid-ref-structure.yaml new file mode 100644 index 00000000..2320835d --- /dev/null +++ b/tests/asyncapi-2.0/Channel Item Object/invalid-ref-structure.yaml @@ -0,0 +1,9 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + $ref: referencedInvalid.yaml diff --git a/tests/asyncapi-2.0/Channel Item Object/referenced.yaml b/tests/asyncapi-2.0/Channel Item Object/referenced.yaml new file mode 100644 index 00000000..ab8b9894 --- /dev/null +++ b/tests/asyncapi-2.0/Channel Item Object/referenced.yaml @@ -0,0 +1,12 @@ +subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email +publish: + message: + payload: + type: string diff --git a/tests/asyncapi-2.0/Channel Item Object/referencedInvalid.yaml b/tests/asyncapi-2.0/Channel Item Object/referencedInvalid.yaml new file mode 100644 index 00000000..ef65571b --- /dev/null +++ b/tests/asyncapi-2.0/Channel Item Object/referencedInvalid.yaml @@ -0,0 +1,3 @@ +email: + type: string + format: email diff --git a/tests/asyncapi-2.0/Channel Item Object/valid-publish.yaml b/tests/asyncapi-2.0/Channel Item Object/valid-publish.yaml new file mode 100644 index 00000000..7946445b --- /dev/null +++ b/tests/asyncapi-2.0/Channel Item Object/valid-publish.yaml @@ -0,0 +1,13 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + description: User signed up + publish: + message: + payload: + type: string diff --git a/tests/asyncapi-2.0/Channel Item Object/valid-ref.yaml b/tests/asyncapi-2.0/Channel Item Object/valid-ref.yaml new file mode 100644 index 00000000..656486ee --- /dev/null +++ b/tests/asyncapi-2.0/Channel Item Object/valid-ref.yaml @@ -0,0 +1,9 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + $ref: referenced.yaml diff --git a/tests/asyncapi-2.0/Channel Item Object/valid-subscribe.yaml b/tests/asyncapi-2.0/Channel Item Object/valid-subscribe.yaml new file mode 100644 index 00000000..e5912699 --- /dev/null +++ b/tests/asyncapi-2.0/Channel Item Object/valid-subscribe.yaml @@ -0,0 +1,17 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + description: User signed up + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/Operation Object/invalid-duplicate-operationId.yaml b/tests/asyncapi-2.0/Operation Object/invalid-duplicate-operationId.yaml new file mode 100644 index 00000000..58868655 --- /dev/null +++ b/tests/asyncapi-2.0/Operation Object/invalid-duplicate-operationId.yaml @@ -0,0 +1,22 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + message: + payload: + type: object + properties: + email: + type: string + format: email + publish: + operationId: userSignedUp + message: + payload: + type: string diff --git a/tests/asyncapi-2.0/Operation Object/valid-bare-minimum.yaml b/tests/asyncapi-2.0/Operation Object/valid-bare-minimum.yaml new file mode 100644 index 00000000..2daeb076 --- /dev/null +++ b/tests/asyncapi-2.0/Operation Object/valid-bare-minimum.yaml @@ -0,0 +1,16 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/Operation Object/valid-case-sensitive-operationId.yaml b/tests/asyncapi-2.0/Operation Object/valid-case-sensitive-operationId.yaml new file mode 100644 index 00000000..4ee367a0 --- /dev/null +++ b/tests/asyncapi-2.0/Operation Object/valid-case-sensitive-operationId.yaml @@ -0,0 +1,22 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + message: + payload: + type: object + properties: + email: + type: string + format: email + publish: + operationId: USERSIGNEDUP + message: + payload: + type: string diff --git a/tests/asyncapi-2.0/Operation Object/valid-multiple-messages.yaml b/tests/asyncapi-2.0/Operation Object/valid-multiple-messages.yaml new file mode 100644 index 00000000..481ba9b5 --- /dev/null +++ b/tests/asyncapi-2.0/Operation Object/valid-multiple-messages.yaml @@ -0,0 +1,26 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + oneOf: + - $ref: '#/components/messages/signup' + - $ref: '#/components/messages/login' + +components: + messages: + signup: + payload: + type: object + properties: + email: + type: string + format: email + login: + payload: + type: string diff --git a/tests/asyncapi-2.0/Operation Object/valid.yaml b/tests/asyncapi-2.0/Operation Object/valid.yaml new file mode 100644 index 00000000..51daa70d --- /dev/null +++ b/tests/asyncapi-2.0/Operation Object/valid.yaml @@ -0,0 +1,19 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: user signed up to load some data + message: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/Operation Trait Object/invalid-duplicate-operationId.yaml b/tests/asyncapi-2.0/Operation Trait Object/invalid-duplicate-operationId.yaml new file mode 100644 index 00000000..a5fa324c --- /dev/null +++ b/tests/asyncapi-2.0/Operation Trait Object/invalid-duplicate-operationId.yaml @@ -0,0 +1,29 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + traits: + - $ref: "#/components/operationTraits/userSignedUpTrait" + publish: + operationId: userSignedUp + message: + payload: + type: string + +components: + operationTraits: + userSignedUpTrait: + operationId: userSignedUp + summary: user signed up diff --git a/tests/asyncapi-2.0/Operation Trait Object/invalid-trait-with-message.yaml b/tests/asyncapi-2.0/Operation Trait Object/invalid-trait-with-message.yaml new file mode 100644 index 00000000..ef80e419 --- /dev/null +++ b/tests/asyncapi-2.0/Operation Trait Object/invalid-trait-with-message.yaml @@ -0,0 +1,27 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + traits: + - $ref: "#/components/operationTraits/userSignedUpTrait" + +components: + operationTraits: + userSignedUpTrait: + operationId: userSignedUp + summary: user signed up + message: + payload: + type: string diff --git a/tests/asyncapi-2.0/Operation Trait Object/invalid-trait-with-traits.yaml b/tests/asyncapi-2.0/Operation Trait Object/invalid-trait-with-traits.yaml new file mode 100644 index 00000000..0f7b5c80 --- /dev/null +++ b/tests/asyncapi-2.0/Operation Trait Object/invalid-trait-with-traits.yaml @@ -0,0 +1,26 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + traits: + - $ref: "#/components/operationTraits/userSignedUpTrait" + +components: + operationTraits: + userSignedUpTrait: + operationId: userSignedUp + summary: user signed up + traits: + - $ref: "#/components/operationTraits/userSignedUpTrait" diff --git a/tests/asyncapi-2.0/Operation Trait Object/valid-case-sensetive-operationId.yaml b/tests/asyncapi-2.0/Operation Trait Object/valid-case-sensetive-operationId.yaml new file mode 100644 index 00000000..4061981a --- /dev/null +++ b/tests/asyncapi-2.0/Operation Trait Object/valid-case-sensetive-operationId.yaml @@ -0,0 +1,29 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + traits: + - $ref: "#/components/operationTraits/userSignedUpTrait" + publish: + operationId: userSignedUp + message: + payload: + type: string + +components: + operationTraits: + userSignedUpTrait: + operationId: USERSIGNEDUP + summary: user signed up diff --git a/tests/asyncapi-2.0/Operation Trait Object/valid-empty-trait.yaml b/tests/asyncapi-2.0/Operation Trait Object/valid-empty-trait.yaml new file mode 100644 index 00000000..26008bc2 --- /dev/null +++ b/tests/asyncapi-2.0/Operation Trait Object/valid-empty-trait.yaml @@ -0,0 +1,22 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + traits: + - $ref: "#/components/operationTraits/userSignedUpTrait" + +components: + operationTraits: + userSignedUpTrait: diff --git a/tests/asyncapi-2.0/Operation Trait Object/valid.yaml b/tests/asyncapi-2.0/Operation Trait Object/valid.yaml new file mode 100644 index 00000000..06049feb --- /dev/null +++ b/tests/asyncapi-2.0/Operation Trait Object/valid.yaml @@ -0,0 +1,27 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + traits: + - $ref: "#/components/operationTraits/userSignedUpTrait" + - $ref: "#/components/operationTraits/userSignedUpDescTrait" + +components: + operationTraits: + userSignedUpTrait: + operationId: userSignedUp + summary: user signed up + userSignedUpDescTrait: + description: user signed up to load some data From 78690580e6c03713ad0bd133b1deec80d3660a00 Mon Sep 17 00:00:00 2001 From: Artem Kostiuk Date: Mon, 13 Jan 2020 10:57:21 +0200 Subject: [PATCH 05/26] Add more tck tests Channel Bindings Object Message Bindings Object Operation Bindings Object Parameter Object Parameters Object Server Bindings Object --- .../invalid-exchange-name-length.yaml.yaml | 28 +++++++++++++++++ .../amqp/invalid-exchange-type.yaml | 28 +++++++++++++++++ .../amqp/invalid-is-value.yaml | 28 +++++++++++++++++ .../amqp/invalid-queue-name-length.yaml | 28 +++++++++++++++++ .../Channel Bindings Object/amqp/valid.yaml | 28 +++++++++++++++++ .../ws/invalid-extra-properties.yaml | 27 ++++++++++++++++ .../ws/invalid-headers-type.yaml | 23 ++++++++++++++ .../ws/invalid-method.yaml | 26 ++++++++++++++++ .../ws/invalid-query-type.yaml | 23 ++++++++++++++ .../Channel Bindings Object/ws/valid.yaml | 26 ++++++++++++++++ .../amqp/invalid-extra-properties.yaml | 22 +++++++++++++ .../Message Bindings Object/amqp/valid.yaml | 21 +++++++++++++ .../http/invalid-extra-properties.yaml | 27 ++++++++++++++++ .../http/invalid-headers-type.yaml | 22 +++++++++++++ .../Message Bindings Object/http/valid.yaml | 26 ++++++++++++++++ .../kafka/invalid-extra-properties.yaml | 21 +++++++++++++ .../Message Bindings Object/kafka/valid.yaml | 20 ++++++++++++ .../mqtt/invalid-extra-properties.yaml | 20 ++++++++++++ .../Message Bindings Object/mqtt/valid.yaml | 19 ++++++++++++ .../amqp/invalid-deliveryMode-value.yaml | 29 +++++++++++++++++ .../amqp/invalid-expiration-below-zero.yaml | 29 +++++++++++++++++ .../amqp/invalid-extra-properties.yaml | 30 ++++++++++++++++++ .../Operation Bindings Object/amqp/valid.yaml | 29 +++++++++++++++++ .../http/invalid-method.yaml | 31 +++++++++++++++++++ .../http/invalid-missing-type.yaml | 30 ++++++++++++++++++ .../http/invalid-query-type.yaml | 23 ++++++++++++++ .../http/invalid-type.yaml | 31 +++++++++++++++++++ .../Operation Bindings Object/http/valid.yaml | 31 +++++++++++++++++++ .../kafka/invalid-extra-properties.yaml | 22 +++++++++++++ .../kafka/valid.yaml | 21 +++++++++++++ .../mqtt/invalid-extra-properties.yaml | 22 +++++++++++++ .../mqtt/invalid-qos-value.yaml | 21 +++++++++++++ .../Operation Bindings Object/mqtt/valid.yaml | 21 +++++++++++++ .../invalid-runtime-expression.yaml | 18 +++++++++++ .../asyncapi-2.0/Parameter Object/valid.yaml | 18 +++++++++++ .../invalid-not-matching-param-name.yaml | 16 ++++++++++ .../invalid-pattern-field.yaml | 19 ++++++++++++ .../Parameters Object/valid-ref.yaml | 22 +++++++++++++ .../asyncapi-2.0/Parameters Object/valid.yaml | 17 ++++++++++ .../mqtt/invalid-extra-properties.yaml | 29 +++++++++++++++++ .../Server Bindings Object/mqtt/valid.yaml | 28 +++++++++++++++++ 41 files changed, 1000 insertions(+) create mode 100644 tests/asyncapi-2.0/Channel Bindings Object/amqp/invalid-exchange-name-length.yaml.yaml create mode 100644 tests/asyncapi-2.0/Channel Bindings Object/amqp/invalid-exchange-type.yaml create mode 100644 tests/asyncapi-2.0/Channel Bindings Object/amqp/invalid-is-value.yaml create mode 100644 tests/asyncapi-2.0/Channel Bindings Object/amqp/invalid-queue-name-length.yaml create mode 100644 tests/asyncapi-2.0/Channel Bindings Object/amqp/valid.yaml create mode 100644 tests/asyncapi-2.0/Channel Bindings Object/ws/invalid-extra-properties.yaml create mode 100644 tests/asyncapi-2.0/Channel Bindings Object/ws/invalid-headers-type.yaml create mode 100644 tests/asyncapi-2.0/Channel Bindings Object/ws/invalid-method.yaml create mode 100644 tests/asyncapi-2.0/Channel Bindings Object/ws/invalid-query-type.yaml create mode 100644 tests/asyncapi-2.0/Channel Bindings Object/ws/valid.yaml create mode 100644 tests/asyncapi-2.0/Message Bindings Object/amqp/invalid-extra-properties.yaml create mode 100644 tests/asyncapi-2.0/Message Bindings Object/amqp/valid.yaml create mode 100644 tests/asyncapi-2.0/Message Bindings Object/http/invalid-extra-properties.yaml create mode 100644 tests/asyncapi-2.0/Message Bindings Object/http/invalid-headers-type.yaml create mode 100644 tests/asyncapi-2.0/Message Bindings Object/http/valid.yaml create mode 100644 tests/asyncapi-2.0/Message Bindings Object/kafka/invalid-extra-properties.yaml create mode 100644 tests/asyncapi-2.0/Message Bindings Object/kafka/valid.yaml create mode 100644 tests/asyncapi-2.0/Message Bindings Object/mqtt/invalid-extra-properties.yaml create mode 100644 tests/asyncapi-2.0/Message Bindings Object/mqtt/valid.yaml create mode 100644 tests/asyncapi-2.0/Operation Bindings Object/amqp/invalid-deliveryMode-value.yaml create mode 100644 tests/asyncapi-2.0/Operation Bindings Object/amqp/invalid-expiration-below-zero.yaml create mode 100644 tests/asyncapi-2.0/Operation Bindings Object/amqp/invalid-extra-properties.yaml create mode 100644 tests/asyncapi-2.0/Operation Bindings Object/amqp/valid.yaml create mode 100644 tests/asyncapi-2.0/Operation Bindings Object/http/invalid-method.yaml create mode 100644 tests/asyncapi-2.0/Operation Bindings Object/http/invalid-missing-type.yaml create mode 100644 tests/asyncapi-2.0/Operation Bindings Object/http/invalid-query-type.yaml create mode 100644 tests/asyncapi-2.0/Operation Bindings Object/http/invalid-type.yaml create mode 100644 tests/asyncapi-2.0/Operation Bindings Object/http/valid.yaml create mode 100644 tests/asyncapi-2.0/Operation Bindings Object/kafka/invalid-extra-properties.yaml create mode 100644 tests/asyncapi-2.0/Operation Bindings Object/kafka/valid.yaml create mode 100644 tests/asyncapi-2.0/Operation Bindings Object/mqtt/invalid-extra-properties.yaml create mode 100644 tests/asyncapi-2.0/Operation Bindings Object/mqtt/invalid-qos-value.yaml create mode 100644 tests/asyncapi-2.0/Operation Bindings Object/mqtt/valid.yaml create mode 100644 tests/asyncapi-2.0/Parameter Object/invalid-runtime-expression.yaml create mode 100644 tests/asyncapi-2.0/Parameter Object/valid.yaml create mode 100644 tests/asyncapi-2.0/Parameters Object/invalid-not-matching-param-name.yaml create mode 100644 tests/asyncapi-2.0/Parameters Object/invalid-pattern-field.yaml create mode 100644 tests/asyncapi-2.0/Parameters Object/valid-ref.yaml create mode 100644 tests/asyncapi-2.0/Parameters Object/valid.yaml create mode 100644 tests/asyncapi-2.0/Server Bindings Object/mqtt/invalid-extra-properties.yaml create mode 100644 tests/asyncapi-2.0/Server Bindings Object/mqtt/valid.yaml diff --git a/tests/asyncapi-2.0/Channel Bindings Object/amqp/invalid-exchange-name-length.yaml.yaml b/tests/asyncapi-2.0/Channel Bindings Object/amqp/invalid-exchange-name-length.yaml.yaml new file mode 100644 index 00000000..827d4115 --- /dev/null +++ b/tests/asyncapi-2.0/Channel Bindings Object/amqp/invalid-exchange-name-length.yaml.yaml @@ -0,0 +1,28 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: string + bindings: + amqp: + is: routingKey + queue: + name: my-queue-name + durable: true + exclusive: true + autoDelete: false + vhost: / + exchange: + name: qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq + type: topic + durable: true + autoDelete: false + vhost: / + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Channel Bindings Object/amqp/invalid-exchange-type.yaml b/tests/asyncapi-2.0/Channel Bindings Object/amqp/invalid-exchange-type.yaml new file mode 100644 index 00000000..da19df94 --- /dev/null +++ b/tests/asyncapi-2.0/Channel Bindings Object/amqp/invalid-exchange-type.yaml @@ -0,0 +1,28 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: string + bindings: + amqp: + is: routingKey + queue: + name: my-queue-name + durable: true + exclusive: true + autoDelete: false + vhost: / + exchange: + name: myExchange + type: invalidType + durable: true + autoDelete: false + vhost: / + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Channel Bindings Object/amqp/invalid-is-value.yaml b/tests/asyncapi-2.0/Channel Bindings Object/amqp/invalid-is-value.yaml new file mode 100644 index 00000000..02d5b965 --- /dev/null +++ b/tests/asyncapi-2.0/Channel Bindings Object/amqp/invalid-is-value.yaml @@ -0,0 +1,28 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: string + bindings: + amqp: + is: invalidValue + queue: + name: my-queue-name + durable: true + exclusive: true + autoDelete: false + vhost: / + exchange: + name: myExchange + type: topic + durable: true + autoDelete: false + vhost: / + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Channel Bindings Object/amqp/invalid-queue-name-length.yaml b/tests/asyncapi-2.0/Channel Bindings Object/amqp/invalid-queue-name-length.yaml new file mode 100644 index 00000000..c34c5a15 --- /dev/null +++ b/tests/asyncapi-2.0/Channel Bindings Object/amqp/invalid-queue-name-length.yaml @@ -0,0 +1,28 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: string + bindings: + amqp: + is: routingKey + queue: + name: qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq + durable: true + exclusive: true + autoDelete: false + vhost: / + exchange: + name: myExchange + type: topic + durable: true + autoDelete: false + vhost: / + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Channel Bindings Object/amqp/valid.yaml b/tests/asyncapi-2.0/Channel Bindings Object/amqp/valid.yaml new file mode 100644 index 00000000..085bfb10 --- /dev/null +++ b/tests/asyncapi-2.0/Channel Bindings Object/amqp/valid.yaml @@ -0,0 +1,28 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: string + bindings: + amqp: + is: routingKey + queue: + name: my-queue-name + durable: true + exclusive: true + autoDelete: false + vhost: / + exchange: + name: myExchange + type: topic + durable: true + autoDelete: false + vhost: / + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Channel Bindings Object/ws/invalid-extra-properties.yaml b/tests/asyncapi-2.0/Channel Bindings Object/ws/invalid-extra-properties.yaml new file mode 100644 index 00000000..413c7f0d --- /dev/null +++ b/tests/asyncapi-2.0/Channel Bindings Object/ws/invalid-extra-properties.yaml @@ -0,0 +1,27 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: string + bindings: + ws: + method: OPTIONS + query: + type: object + properties: + userId: + type: string + headers: + type: object + properties: + UserType: + type: string + bindingVersion: '1.1.1' + hello: 1 diff --git a/tests/asyncapi-2.0/Channel Bindings Object/ws/invalid-headers-type.yaml b/tests/asyncapi-2.0/Channel Bindings Object/ws/invalid-headers-type.yaml new file mode 100644 index 00000000..f9a5557b --- /dev/null +++ b/tests/asyncapi-2.0/Channel Bindings Object/ws/invalid-headers-type.yaml @@ -0,0 +1,23 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: string + bindings: + ws: + method: GET + query: + type: object + properties: + userId: + type: string + headers: + type: string + bindingVersion: '1.1.1' diff --git a/tests/asyncapi-2.0/Channel Bindings Object/ws/invalid-method.yaml b/tests/asyncapi-2.0/Channel Bindings Object/ws/invalid-method.yaml new file mode 100644 index 00000000..c7458643 --- /dev/null +++ b/tests/asyncapi-2.0/Channel Bindings Object/ws/invalid-method.yaml @@ -0,0 +1,26 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: string + bindings: + ws: + method: OPTIONS + query: + type: object + properties: + userId: + type: string + headers: + type: object + properties: + UserType: + type: string + bindingVersion: '1.1.1' diff --git a/tests/asyncapi-2.0/Channel Bindings Object/ws/invalid-query-type.yaml b/tests/asyncapi-2.0/Channel Bindings Object/ws/invalid-query-type.yaml new file mode 100644 index 00000000..e5309d84 --- /dev/null +++ b/tests/asyncapi-2.0/Channel Bindings Object/ws/invalid-query-type.yaml @@ -0,0 +1,23 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: string + bindings: + ws: + method: GET + query: + type: string + headers: + type: object + properties: + UserType: + type: string + bindingVersion: '1.1.1' diff --git a/tests/asyncapi-2.0/Channel Bindings Object/ws/valid.yaml b/tests/asyncapi-2.0/Channel Bindings Object/ws/valid.yaml new file mode 100644 index 00000000..cf15c64d --- /dev/null +++ b/tests/asyncapi-2.0/Channel Bindings Object/ws/valid.yaml @@ -0,0 +1,26 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: string + bindings: + ws: + method: GET + query: + type: object + properties: + userId: + type: string + headers: + type: object + properties: + UserType: + type: string + bindingVersion: '1.1.1' diff --git a/tests/asyncapi-2.0/Message Bindings Object/amqp/invalid-extra-properties.yaml b/tests/asyncapi-2.0/Message Bindings Object/amqp/invalid-extra-properties.yaml new file mode 100644 index 00000000..936f1768 --- /dev/null +++ b/tests/asyncapi-2.0/Message Bindings Object/amqp/invalid-extra-properties.yaml @@ -0,0 +1,22 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: object + properties: + email: + type: string + format: email + bindings: + amqp: + hello: 1 + contentEncoding: gzip + messageType: 'user.signup' + bindingVersion: 0.1.0 diff --git a/tests/asyncapi-2.0/Message Bindings Object/amqp/valid.yaml b/tests/asyncapi-2.0/Message Bindings Object/amqp/valid.yaml new file mode 100644 index 00000000..b724e621 --- /dev/null +++ b/tests/asyncapi-2.0/Message Bindings Object/amqp/valid.yaml @@ -0,0 +1,21 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: object + properties: + email: + type: string + format: email + bindings: + amqp: + contentEncoding: gzip + messageType: 'user.signup' + bindingVersion: 0.1.0 diff --git a/tests/asyncapi-2.0/Message Bindings Object/http/invalid-extra-properties.yaml b/tests/asyncapi-2.0/Message Bindings Object/http/invalid-extra-properties.yaml new file mode 100644 index 00000000..b85acfb3 --- /dev/null +++ b/tests/asyncapi-2.0/Message Bindings Object/http/invalid-extra-properties.yaml @@ -0,0 +1,27 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: object + properties: + email: + type: string + format: email + bindings: + http: + hello: 1 + headers: + type: object + properties: + Content-Type: + type: string + enum: ['application/json'] + meta: + version: '0.1.0' diff --git a/tests/asyncapi-2.0/Message Bindings Object/http/invalid-headers-type.yaml b/tests/asyncapi-2.0/Message Bindings Object/http/invalid-headers-type.yaml new file mode 100644 index 00000000..9368c28d --- /dev/null +++ b/tests/asyncapi-2.0/Message Bindings Object/http/invalid-headers-type.yaml @@ -0,0 +1,22 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: object + properties: + email: + type: string + format: email + bindings: + http: + headers: + type: string + meta: + version: '0.1.0' diff --git a/tests/asyncapi-2.0/Message Bindings Object/http/valid.yaml b/tests/asyncapi-2.0/Message Bindings Object/http/valid.yaml new file mode 100644 index 00000000..7517b7e2 --- /dev/null +++ b/tests/asyncapi-2.0/Message Bindings Object/http/valid.yaml @@ -0,0 +1,26 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: object + properties: + email: + type: string + format: email + bindings: + http: + headers: + type: object + properties: + Content-Type: + type: string + enum: ['application/json'] + meta: + version: '0.1.0' diff --git a/tests/asyncapi-2.0/Message Bindings Object/kafka/invalid-extra-properties.yaml b/tests/asyncapi-2.0/Message Bindings Object/kafka/invalid-extra-properties.yaml new file mode 100644 index 00000000..8ea06df1 --- /dev/null +++ b/tests/asyncapi-2.0/Message Bindings Object/kafka/invalid-extra-properties.yaml @@ -0,0 +1,21 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: object + properties: + email: + type: string + format: email + bindings: + kafka: + hello: 1 + key: myKey + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Message Bindings Object/kafka/valid.yaml b/tests/asyncapi-2.0/Message Bindings Object/kafka/valid.yaml new file mode 100644 index 00000000..1b451c02 --- /dev/null +++ b/tests/asyncapi-2.0/Message Bindings Object/kafka/valid.yaml @@ -0,0 +1,20 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: object + properties: + email: + type: string + format: email + bindings: + kafka: + key: myKey + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Message Bindings Object/mqtt/invalid-extra-properties.yaml b/tests/asyncapi-2.0/Message Bindings Object/mqtt/invalid-extra-properties.yaml new file mode 100644 index 00000000..0cc0aaf6 --- /dev/null +++ b/tests/asyncapi-2.0/Message Bindings Object/mqtt/invalid-extra-properties.yaml @@ -0,0 +1,20 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: object + properties: + email: + type: string + format: email + bindings: + mqtt: + hello: 1 + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Message Bindings Object/mqtt/valid.yaml b/tests/asyncapi-2.0/Message Bindings Object/mqtt/valid.yaml new file mode 100644 index 00000000..7783cb72 --- /dev/null +++ b/tests/asyncapi-2.0/Message Bindings Object/mqtt/valid.yaml @@ -0,0 +1,19 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: object + properties: + email: + type: string + format: email + bindings: + mqtt: + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Operation Bindings Object/amqp/invalid-deliveryMode-value.yaml b/tests/asyncapi-2.0/Operation Bindings Object/amqp/invalid-deliveryMode-value.yaml new file mode 100644 index 00000000..1069d587 --- /dev/null +++ b/tests/asyncapi-2.0/Operation Bindings Object/amqp/invalid-deliveryMode-value.yaml @@ -0,0 +1,29 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: object + properties: + email: + type: string + format: email + bindings: + amqp: + expiration: 100000 + userId: guest + cc: ['user.logs'] + priority: 10 + deliveryMode: 78 + mandatory: false + bcc: ['external.audit'] + replyTo: user.signedup + timestamp: true + ack: false + bindingVersion: 0.1.0 diff --git a/tests/asyncapi-2.0/Operation Bindings Object/amqp/invalid-expiration-below-zero.yaml b/tests/asyncapi-2.0/Operation Bindings Object/amqp/invalid-expiration-below-zero.yaml new file mode 100644 index 00000000..8226614a --- /dev/null +++ b/tests/asyncapi-2.0/Operation Bindings Object/amqp/invalid-expiration-below-zero.yaml @@ -0,0 +1,29 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: object + properties: + email: + type: string + format: email + bindings: + amqp: + expiration: -90 + userId: guest + cc: ['user.logs'] + priority: 10 + deliveryMode: 2 + mandatory: false + bcc: ['external.audit'] + replyTo: user.signedup + timestamp: true + ack: false + bindingVersion: 0.1.0 diff --git a/tests/asyncapi-2.0/Operation Bindings Object/amqp/invalid-extra-properties.yaml b/tests/asyncapi-2.0/Operation Bindings Object/amqp/invalid-extra-properties.yaml new file mode 100644 index 00000000..8fea0bc6 --- /dev/null +++ b/tests/asyncapi-2.0/Operation Bindings Object/amqp/invalid-extra-properties.yaml @@ -0,0 +1,30 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: object + properties: + email: + type: string + format: email + bindings: + amqp: + hello: 1 + expiration: 100000 + userId: guest + cc: ['user.logs'] + priority: 10 + deliveryMode: 2 + mandatory: false + bcc: ['external.audit'] + replyTo: user.signedup + timestamp: true + ack: false + bindingVersion: 0.1.0 diff --git a/tests/asyncapi-2.0/Operation Bindings Object/amqp/valid.yaml b/tests/asyncapi-2.0/Operation Bindings Object/amqp/valid.yaml new file mode 100644 index 00000000..698fa16b --- /dev/null +++ b/tests/asyncapi-2.0/Operation Bindings Object/amqp/valid.yaml @@ -0,0 +1,29 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: object + properties: + email: + type: string + format: email + bindings: + amqp: + expiration: 100000 + userId: guest + cc: ['user.logs'] + priority: 10 + deliveryMode: 2 + mandatory: false + bcc: ['external.audit'] + replyTo: user.signedup + timestamp: true + ack: false + bindingVersion: 0.1.0 diff --git a/tests/asyncapi-2.0/Operation Bindings Object/http/invalid-method.yaml b/tests/asyncapi-2.0/Operation Bindings Object/http/invalid-method.yaml new file mode 100644 index 00000000..cbeb1e3d --- /dev/null +++ b/tests/asyncapi-2.0/Operation Bindings Object/http/invalid-method.yaml @@ -0,0 +1,31 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + bindings: + http: + type: request + method: invalidMethod + query: + type: object + required: + - companyId + properties: + companyId: + type: number + minimum: 1 + description: The Id of the company. + additionalProperties: false + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Operation Bindings Object/http/invalid-missing-type.yaml b/tests/asyncapi-2.0/Operation Bindings Object/http/invalid-missing-type.yaml new file mode 100644 index 00000000..4c4c709a --- /dev/null +++ b/tests/asyncapi-2.0/Operation Bindings Object/http/invalid-missing-type.yaml @@ -0,0 +1,30 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + bindings: + http: + method: GET + query: + type: object + required: + - companyId + properties: + companyId: + type: number + minimum: 1 + description: The Id of the company. + additionalProperties: false + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Operation Bindings Object/http/invalid-query-type.yaml b/tests/asyncapi-2.0/Operation Bindings Object/http/invalid-query-type.yaml new file mode 100644 index 00000000..1e81bae2 --- /dev/null +++ b/tests/asyncapi-2.0/Operation Bindings Object/http/invalid-query-type.yaml @@ -0,0 +1,23 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + bindings: + http: + type: request + method: GET + query: + type: string + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Operation Bindings Object/http/invalid-type.yaml b/tests/asyncapi-2.0/Operation Bindings Object/http/invalid-type.yaml new file mode 100644 index 00000000..ca2411e9 --- /dev/null +++ b/tests/asyncapi-2.0/Operation Bindings Object/http/invalid-type.yaml @@ -0,0 +1,31 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + bindings: + http: + type: invalidType + method: GET + query: + type: object + required: + - companyId + properties: + companyId: + type: number + minimum: 1 + description: The Id of the company. + additionalProperties: false + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Operation Bindings Object/http/valid.yaml b/tests/asyncapi-2.0/Operation Bindings Object/http/valid.yaml new file mode 100644 index 00000000..986a4a4b --- /dev/null +++ b/tests/asyncapi-2.0/Operation Bindings Object/http/valid.yaml @@ -0,0 +1,31 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + bindings: + http: + type: request + method: GET + query: + type: object + required: + - companyId + properties: + companyId: + type: number + minimum: 1 + description: The Id of the company. + additionalProperties: false + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Operation Bindings Object/kafka/invalid-extra-properties.yaml b/tests/asyncapi-2.0/Operation Bindings Object/kafka/invalid-extra-properties.yaml new file mode 100644 index 00000000..36f32c01 --- /dev/null +++ b/tests/asyncapi-2.0/Operation Bindings Object/kafka/invalid-extra-properties.yaml @@ -0,0 +1,22 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + bindings: + kafka: + groupId: myGroupId + clientId: myClientId + bindingVersion: '0.1.0' + hello: 1 diff --git a/tests/asyncapi-2.0/Operation Bindings Object/kafka/valid.yaml b/tests/asyncapi-2.0/Operation Bindings Object/kafka/valid.yaml new file mode 100644 index 00000000..e4338868 --- /dev/null +++ b/tests/asyncapi-2.0/Operation Bindings Object/kafka/valid.yaml @@ -0,0 +1,21 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + bindings: + kafka: + groupId: myGroupId + clientId: myClientId + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Operation Bindings Object/mqtt/invalid-extra-properties.yaml b/tests/asyncapi-2.0/Operation Bindings Object/mqtt/invalid-extra-properties.yaml new file mode 100644 index 00000000..d98b39e6 --- /dev/null +++ b/tests/asyncapi-2.0/Operation Bindings Object/mqtt/invalid-extra-properties.yaml @@ -0,0 +1,22 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: object + properties: + email: + type: string + format: email + bindings: + mqtt: + hello: 1 + qos: 1 + retain: true + bindingVersion: 0.1.0 diff --git a/tests/asyncapi-2.0/Operation Bindings Object/mqtt/invalid-qos-value.yaml b/tests/asyncapi-2.0/Operation Bindings Object/mqtt/invalid-qos-value.yaml new file mode 100644 index 00000000..0d7ea664 --- /dev/null +++ b/tests/asyncapi-2.0/Operation Bindings Object/mqtt/invalid-qos-value.yaml @@ -0,0 +1,21 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: object + properties: + email: + type: string + format: email + bindings: + mqtt: + qos: 124 + retain: true + bindingVersion: 0.1.0 diff --git a/tests/asyncapi-2.0/Operation Bindings Object/mqtt/valid.yaml b/tests/asyncapi-2.0/Operation Bindings Object/mqtt/valid.yaml new file mode 100644 index 00000000..d7b04ee6 --- /dev/null +++ b/tests/asyncapi-2.0/Operation Bindings Object/mqtt/valid.yaml @@ -0,0 +1,21 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: object + properties: + email: + type: string + format: email + bindings: + mqtt: + qos: 2 + retain: true + bindingVersion: 0.1.0 diff --git a/tests/asyncapi-2.0/Parameter Object/invalid-runtime-expression.yaml b/tests/asyncapi-2.0/Parameter Object/invalid-runtime-expression.yaml new file mode 100644 index 00000000..8682b1cb --- /dev/null +++ b/tests/asyncapi-2.0/Parameter Object/invalid-runtime-expression.yaml @@ -0,0 +1,18 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + user/{userId}/signup: + parameters: + userId: + description: Id of the user. + schema: + type: string + location: somewhere else + publish: + message: + payload: + type: string diff --git a/tests/asyncapi-2.0/Parameter Object/valid.yaml b/tests/asyncapi-2.0/Parameter Object/valid.yaml new file mode 100644 index 00000000..7bfaf19f --- /dev/null +++ b/tests/asyncapi-2.0/Parameter Object/valid.yaml @@ -0,0 +1,18 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + user/{userId}/signup: + parameters: + userId: + description: Id of the user. + schema: + type: string + location: $message.payload#/user/id + publish: + message: + payload: + type: string diff --git a/tests/asyncapi-2.0/Parameters Object/invalid-not-matching-param-name.yaml b/tests/asyncapi-2.0/Parameters Object/invalid-not-matching-param-name.yaml new file mode 100644 index 00000000..eaee2a4a --- /dev/null +++ b/tests/asyncapi-2.0/Parameters Object/invalid-not-matching-param-name.yaml @@ -0,0 +1,16 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + user/{userId}/signup: + parameters: + userEmail: + schema: + type: string + publish: + message: + payload: + type: string diff --git a/tests/asyncapi-2.0/Parameters Object/invalid-pattern-field.yaml b/tests/asyncapi-2.0/Parameters Object/invalid-pattern-field.yaml new file mode 100644 index 00000000..6deadf86 --- /dev/null +++ b/tests/asyncapi-2.0/Parameters Object/invalid-pattern-field.yaml @@ -0,0 +1,19 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + user/{userId}/signup: + parameters: + userId: + schema: + type: string + $!@$%#!@$: + schema: + type: string + publish: + message: + payload: + type: string diff --git a/tests/asyncapi-2.0/Parameters Object/valid-ref.yaml b/tests/asyncapi-2.0/Parameters Object/valid-ref.yaml new file mode 100644 index 00000000..5f980dfd --- /dev/null +++ b/tests/asyncapi-2.0/Parameters Object/valid-ref.yaml @@ -0,0 +1,22 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + user/{userId}/signup: + parameters: + userId: + $ref: "#/components/parameters/userId" + publish: + message: + payload: + type: string + +components: + parameters: + userId: + description: Id of the user. + schema: + type: string diff --git a/tests/asyncapi-2.0/Parameters Object/valid.yaml b/tests/asyncapi-2.0/Parameters Object/valid.yaml new file mode 100644 index 00000000..17a3e9e9 --- /dev/null +++ b/tests/asyncapi-2.0/Parameters Object/valid.yaml @@ -0,0 +1,17 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + user/{userId}/signup: + parameters: + userId: + description: Id of the user. + schema: + type: string + publish: + message: + payload: + type: string diff --git a/tests/asyncapi-2.0/Server Bindings Object/mqtt/invalid-extra-properties.yaml b/tests/asyncapi-2.0/Server Bindings Object/mqtt/invalid-extra-properties.yaml new file mode 100644 index 00000000..4a1d7af1 --- /dev/null +++ b/tests/asyncapi-2.0/Server Bindings Object/mqtt/invalid-extra-properties.yaml @@ -0,0 +1,29 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: mqtt + bindings: + mqtt: + hello: 1 + clientId: guest + cleanSession: true + lastWill: + topic: /last-wills + qos: 2 + message: Guest gone offline. + retain: false + keepAlive: 60 + bindingVersion: 0.1.0 diff --git a/tests/asyncapi-2.0/Server Bindings Object/mqtt/valid.yaml b/tests/asyncapi-2.0/Server Bindings Object/mqtt/valid.yaml new file mode 100644 index 00000000..37d5df62 --- /dev/null +++ b/tests/asyncapi-2.0/Server Bindings Object/mqtt/valid.yaml @@ -0,0 +1,28 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: mqtt + bindings: + mqtt: + clientId: guest + cleanSession: true + lastWill: + topic: /last-wills + qos: 2 + message: Guest gone offline. + retain: false + keepAlive: 60 + bindingVersion: 0.1.0 From a8de0620a9e069332cd172f85aae4345a1810d2b Mon Sep 17 00:00:00 2001 From: Artem Kostiuk Date: Mon, 13 Jan 2020 12:07:11 +0200 Subject: [PATCH 06/26] Add more tck tests Message Object --- .../Message Object/invalid-headers-type.yaml | 32 ++++++++++++++ .../invalid-missing-contentType.yaml | 31 ++++++++++++++ .../valid-ref-corelationId.yaml | 42 +++++++++++++++++++ .../Message Object/valid-ref-header.yaml | 39 +++++++++++++++++ tests/asyncapi-2.0/Message Object/valid.yaml | 42 +++++++++++++++++++ 5 files changed, 186 insertions(+) create mode 100644 tests/asyncapi-2.0/Message Object/invalid-headers-type.yaml create mode 100644 tests/asyncapi-2.0/Message Object/invalid-missing-contentType.yaml create mode 100644 tests/asyncapi-2.0/Message Object/valid-ref-corelationId.yaml create mode 100644 tests/asyncapi-2.0/Message Object/valid-ref-header.yaml create mode 100644 tests/asyncapi-2.0/Message Object/valid.yaml diff --git a/tests/asyncapi-2.0/Message Object/invalid-headers-type.yaml b/tests/asyncapi-2.0/Message Object/invalid-headers-type.yaml new file mode 100644 index 00000000..2a8d0732 --- /dev/null +++ b/tests/asyncapi-2.0/Message Object/invalid-headers-type.yaml @@ -0,0 +1,32 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: user signed up to load some data + message: + name: UserSignup + title: User signup + summary: Action to sign a user up. + description: A longer description + contentType: application/json + schemaFormat: application/vnd.oai.openapi;version=3.0.0 + headers: + type: string + payload: + type: object + properties: + email: + type: string + format: email + examples: + - one: + email: hello@foo.bar + - two: + email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Object/invalid-missing-contentType.yaml b/tests/asyncapi-2.0/Message Object/invalid-missing-contentType.yaml new file mode 100644 index 00000000..c12fb16f --- /dev/null +++ b/tests/asyncapi-2.0/Message Object/invalid-missing-contentType.yaml @@ -0,0 +1,31 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: user signed up to load some data + message: + name: UserSignup + title: User signup + summary: Action to sign a user up. + description: A longer description + schemaFormat: application/vnd.oai.openapi;version=3.0.0 + headers: + type: string + payload: + type: object + properties: + email: + type: string + format: email + examples: + - one: + email: hello@foo.bar + - two: + email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Object/valid-ref-corelationId.yaml b/tests/asyncapi-2.0/Message Object/valid-ref-corelationId.yaml new file mode 100644 index 00000000..65ed7f2b --- /dev/null +++ b/tests/asyncapi-2.0/Message Object/valid-ref-corelationId.yaml @@ -0,0 +1,42 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: user signed up to load some data + message: + name: UserSignup + title: User signup + summary: Action to sign a user up. + description: A longer description + contentType: application/json + schemaFormat: application/vnd.oai.openapi;version=3.0.0 + correlationId: + $ref: "#/components/correlationIds/userSignedUpCorId" + headers: + type: object + properties: + correlationId: + description: Correlation ID set by application + type: string + applicationInstanceId: + description: Unique identifier for a given instance of the publishing application + type: string + payload: + type: object + properties: + email: + type: string + format: email + +components: + correlationIds: + userSignedUpCorId: + description: Default Correlation ID + location: $message.header#/correlationId diff --git a/tests/asyncapi-2.0/Message Object/valid-ref-header.yaml b/tests/asyncapi-2.0/Message Object/valid-ref-header.yaml new file mode 100644 index 00000000..c4e2771d --- /dev/null +++ b/tests/asyncapi-2.0/Message Object/valid-ref-header.yaml @@ -0,0 +1,39 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: user signed up to load some data + message: + name: UserSignup + title: User signup + summary: Action to sign a user up. + description: A longer description + contentType: application/json + schemaFormat: application/vnd.oai.openapi;version=3.0.0 + headers: + $ref: "#/components/schemas/userSignedUpHeaders" + payload: + type: object + properties: + email: + type: string + format: email + +components: + schemas: + userSignedUpHeaders: + type: object + properties: + correlationId: + description: Correlation ID set by application + type: string + applicationInstanceId: + description: Unique identifier for a given instance of the publishing application + type: string diff --git a/tests/asyncapi-2.0/Message Object/valid.yaml b/tests/asyncapi-2.0/Message Object/valid.yaml new file mode 100644 index 00000000..d6002063 --- /dev/null +++ b/tests/asyncapi-2.0/Message Object/valid.yaml @@ -0,0 +1,42 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: user signed up to load some data + message: + name: UserSignup + title: User signup + summary: Action to sign a user up. + description: A longer description + contentType: application/json + schemaFormat: application/vnd.oai.openapi;version=3.0.0 + correlationId: + description: Default Correlation ID + location: $message.header#/correlationId + headers: + type: object + properties: + correlationId: + description: Correlation ID set by application + type: string + applicationInstanceId: + description: Unique identifier for a given instance of the publishing application + type: string + payload: + type: object + properties: + email: + type: string + format: email + examples: + - one: + email: hello@foo.bar + - two: + email: bye@foo.bar From 1ed14c7144c40a37dbd2f145f9f5575154d66942 Mon Sep 17 00:00:00 2001 From: Artem Kostiuk Date: Wed, 15 Jan 2020 10:10:56 +0200 Subject: [PATCH 07/26] Add more tck tests. Extend existing ones. External Documentation Object Message Trait Object Tag Object --- .../invalid-duplicate-tags.yaml | 21 +++++++ tests/asyncapi-2.0/AsyncAPI Object/valid.yaml | 9 +++ .../invalid-missing-url.yaml | 19 +++++++ .../invalid-url-format.yaml | 20 +++++++ .../External Documentation Object/valid.yaml | 20 +++++++ .../invalid-duplicate-tags.yaml | 46 ++++++++++++++++ tests/asyncapi-2.0/Message Object/valid.yaml | 7 +++ .../invalid-defines-payload.yaml | 50 +++++++++++++++++ .../invalid-defines-traits.yaml | 50 +++++++++++++++++ .../invalid-duplicate-tags.yaml | 52 ++++++++++++++++++ .../invalid-headers-type.yaml | 41 ++++++++++++++ .../invalid-missing-content-type.yaml | 47 ++++++++++++++++ .../valid-ref-corelationId.yaml | 51 +++++++++++++++++ .../valid-ref-header.yaml | 51 +++++++++++++++++ .../Message Trait Object/valid.yaml | 55 +++++++++++++++++++ .../invalid-duplicate-tags.yaml | 23 ++++++++ .../asyncapi-2.0/Operation Object/valid.yaml | 7 +++ .../invalid-duplicate-tags.yaml | 31 +++++++++++ .../Operation Trait Object/valid.yaml | 7 +++ .../Tag Object/invalid-missing-name.yaml | 19 +++++++ tests/asyncapi-2.0/Tag Object/valid.yaml | 25 +++++++++ 21 files changed, 651 insertions(+) create mode 100644 tests/asyncapi-2.0/AsyncAPI Object/invalid-duplicate-tags.yaml create mode 100644 tests/asyncapi-2.0/External Documentation Object/invalid-missing-url.yaml create mode 100644 tests/asyncapi-2.0/External Documentation Object/invalid-url-format.yaml create mode 100644 tests/asyncapi-2.0/External Documentation Object/valid.yaml create mode 100644 tests/asyncapi-2.0/Message Object/invalid-duplicate-tags.yaml create mode 100644 tests/asyncapi-2.0/Message Trait Object/invalid-defines-payload.yaml create mode 100644 tests/asyncapi-2.0/Message Trait Object/invalid-defines-traits.yaml create mode 100644 tests/asyncapi-2.0/Message Trait Object/invalid-duplicate-tags.yaml create mode 100644 tests/asyncapi-2.0/Message Trait Object/invalid-headers-type.yaml create mode 100644 tests/asyncapi-2.0/Message Trait Object/invalid-missing-content-type.yaml create mode 100644 tests/asyncapi-2.0/Message Trait Object/valid-ref-corelationId.yaml create mode 100644 tests/asyncapi-2.0/Message Trait Object/valid-ref-header.yaml create mode 100644 tests/asyncapi-2.0/Message Trait Object/valid.yaml create mode 100644 tests/asyncapi-2.0/Operation Object/invalid-duplicate-tags.yaml create mode 100644 tests/asyncapi-2.0/Operation Trait Object/invalid-duplicate-tags.yaml create mode 100644 tests/asyncapi-2.0/Tag Object/invalid-missing-name.yaml create mode 100644 tests/asyncapi-2.0/Tag Object/valid.yaml diff --git a/tests/asyncapi-2.0/AsyncAPI Object/invalid-duplicate-tags.yaml b/tests/asyncapi-2.0/AsyncAPI Object/invalid-duplicate-tags.yaml new file mode 100644 index 00000000..828e5846 --- /dev/null +++ b/tests/asyncapi-2.0/AsyncAPI Object/invalid-duplicate-tags.yaml @@ -0,0 +1,21 @@ +asyncapi: 2.0.0 + +tags: + - name: user + description: user signed up + - name: user + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/AsyncAPI Object/valid.yaml b/tests/asyncapi-2.0/AsyncAPI Object/valid.yaml index 2daeb076..ca441bfb 100644 --- a/tests/asyncapi-2.0/AsyncAPI Object/valid.yaml +++ b/tests/asyncapi-2.0/AsyncAPI Object/valid.yaml @@ -1,5 +1,14 @@ asyncapi: 2.0.0 +externalDocs: + description: Find more info here + url: https://example.com + +tags: + - name: user + description: user signed up + - name: signup + info: title: Signup service example (internal) version: 0.1.0 diff --git a/tests/asyncapi-2.0/External Documentation Object/invalid-missing-url.yaml b/tests/asyncapi-2.0/External Documentation Object/invalid-missing-url.yaml new file mode 100644 index 00000000..73841048 --- /dev/null +++ b/tests/asyncapi-2.0/External Documentation Object/invalid-missing-url.yaml @@ -0,0 +1,19 @@ +asyncapi: 2.0.0 + +externalDocs: + description: Find more info here + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/External Documentation Object/invalid-url-format.yaml b/tests/asyncapi-2.0/External Documentation Object/invalid-url-format.yaml new file mode 100644 index 00000000..f1b4ca26 --- /dev/null +++ b/tests/asyncapi-2.0/External Documentation Object/invalid-url-format.yaml @@ -0,0 +1,20 @@ +asyncapi: 2.0.0 + +externalDocs: + description: Find more info here + url: invalid url format + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/External Documentation Object/valid.yaml b/tests/asyncapi-2.0/External Documentation Object/valid.yaml new file mode 100644 index 00000000..354ee72a --- /dev/null +++ b/tests/asyncapi-2.0/External Documentation Object/valid.yaml @@ -0,0 +1,20 @@ +asyncapi: 2.0.0 + +externalDocs: + description: Find more info here + url: https://example.com + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/Message Object/invalid-duplicate-tags.yaml b/tests/asyncapi-2.0/Message Object/invalid-duplicate-tags.yaml new file mode 100644 index 00000000..52c66ecd --- /dev/null +++ b/tests/asyncapi-2.0/Message Object/invalid-duplicate-tags.yaml @@ -0,0 +1,46 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: user signed up to load some data + message: + name: UserSignup + title: User signup + summary: Action to sign a user up. + description: A longer description + contentType: application/json + schemaFormat: application/vnd.oai.openapi;version=3.0.0 + correlationId: + description: Default Correlation ID + location: $message.header#/correlationId + headers: + type: object + properties: + correlationId: + description: Correlation ID set by application + type: string + applicationInstanceId: + description: Unique identifier for a given instance of the publishing application + type: string + tags: + - name: user + description: user signed up + - name: user + payload: + type: object + properties: + email: + type: string + format: email + examples: + - one: + email: hello@foo.bar + - two: + email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Object/valid.yaml b/tests/asyncapi-2.0/Message Object/valid.yaml index d6002063..519652f2 100644 --- a/tests/asyncapi-2.0/Message Object/valid.yaml +++ b/tests/asyncapi-2.0/Message Object/valid.yaml @@ -29,6 +29,13 @@ channels: applicationInstanceId: description: Unique identifier for a given instance of the publishing application type: string + tags: + - name: user + description: user signed up + - name: signup + externalDocs: + description: Find more info here + url: https://example.com payload: type: object properties: diff --git a/tests/asyncapi-2.0/Message Trait Object/invalid-defines-payload.yaml b/tests/asyncapi-2.0/Message Trait Object/invalid-defines-payload.yaml new file mode 100644 index 00000000..b356a92c --- /dev/null +++ b/tests/asyncapi-2.0/Message Trait Object/invalid-defines-payload.yaml @@ -0,0 +1,50 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: user signed up to load some data + message: + payload: + type: object + properties: + email: + type: string + format: email + traits: + - signedUpMessage + +components: + messageTraits: + signedUpMessage: + payload: + type: string + name: UserSignup + title: User signup + summary: Action to sign a user up. + description: A longer description + contentType: application/json + schemaFormat: application/vnd.oai.openapi;version=3.0.0 + correlationId: + description: Default Correlation ID + location: $message.header#/correlationId + headers: + type: object + properties: + correlationId: + description: Correlation ID set by application + type: string + applicationInstanceId: + description: Unique identifier for a given instance of the publishing application + type: string + examples: + - one: + email: hello@foo.bar + - two: + email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Trait Object/invalid-defines-traits.yaml b/tests/asyncapi-2.0/Message Trait Object/invalid-defines-traits.yaml new file mode 100644 index 00000000..b7d8af6b --- /dev/null +++ b/tests/asyncapi-2.0/Message Trait Object/invalid-defines-traits.yaml @@ -0,0 +1,50 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: user signed up to load some data + message: + payload: + type: object + properties: + email: + type: string + format: email + traits: + - signedUpMessage + +components: + messageTraits: + signedUpMessage: + traits: + - signedUpMessage + name: UserSignup + title: User signup + summary: Action to sign a user up. + description: A longer description + contentType: application/json + schemaFormat: application/vnd.oai.openapi;version=3.0.0 + correlationId: + description: Default Correlation ID + location: $message.header#/correlationId + headers: + type: object + properties: + correlationId: + description: Correlation ID set by application + type: string + applicationInstanceId: + description: Unique identifier for a given instance of the publishing application + type: string + examples: + - one: + email: hello@foo.bar + - two: + email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Trait Object/invalid-duplicate-tags.yaml b/tests/asyncapi-2.0/Message Trait Object/invalid-duplicate-tags.yaml new file mode 100644 index 00000000..3ad1122e --- /dev/null +++ b/tests/asyncapi-2.0/Message Trait Object/invalid-duplicate-tags.yaml @@ -0,0 +1,52 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: user signed up to load some data + message: + payload: + type: object + properties: + email: + type: string + format: email + traits: + - signedUpMessage + +components: + messageTraits: + signedUpMessage: + tags: + - name: user + description: user signed up + - name: user + name: UserSignup + title: User signup + summary: Action to sign a user up. + description: A longer description + contentType: application/json + schemaFormat: application/vnd.oai.openapi;version=3.0.0 + correlationId: + description: Default Correlation ID + location: $message.header#/correlationId + headers: + type: object + properties: + correlationId: + description: Correlation ID set by application + type: string + applicationInstanceId: + description: Unique identifier for a given instance of the publishing application + type: string + examples: + - one: + email: hello@foo.bar + - two: + email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Trait Object/invalid-headers-type.yaml b/tests/asyncapi-2.0/Message Trait Object/invalid-headers-type.yaml new file mode 100644 index 00000000..36cefed4 --- /dev/null +++ b/tests/asyncapi-2.0/Message Trait Object/invalid-headers-type.yaml @@ -0,0 +1,41 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: user signed up to load some data + message: + payload: + type: object + properties: + email: + type: string + format: email + traits: + - signedUpMessage + +components: + messageTraits: + signedUpMessage: + name: UserSignup + title: User signup + summary: Action to sign a user up. + description: A longer description + contentType: application/json + schemaFormat: application/vnd.oai.openapi;version=3.0.0 + correlationId: + description: Default Correlation ID + location: $message.header#/correlationId + headers: + type: string + examples: + - one: + email: hello@foo.bar + - two: + email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Trait Object/invalid-missing-content-type.yaml b/tests/asyncapi-2.0/Message Trait Object/invalid-missing-content-type.yaml new file mode 100644 index 00000000..90255ed2 --- /dev/null +++ b/tests/asyncapi-2.0/Message Trait Object/invalid-missing-content-type.yaml @@ -0,0 +1,47 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: user signed up to load some data + message: + payload: + type: object + properties: + email: + type: string + format: email + traits: + - signedUpMessage + +components: + messageTraits: + signedUpMessage: + name: UserSignup + title: User signup + summary: Action to sign a user up. + description: A longer description + schemaFormat: application/vnd.oai.openapi;version=3.0.0 + correlationId: + description: Default Correlation ID + location: $message.header#/correlationId + headers: + type: object + properties: + correlationId: + description: Correlation ID set by application + type: string + applicationInstanceId: + description: Unique identifier for a given instance of the publishing application + type: string + examples: + - one: + email: hello@foo.bar + - two: + email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Trait Object/valid-ref-corelationId.yaml b/tests/asyncapi-2.0/Message Trait Object/valid-ref-corelationId.yaml new file mode 100644 index 00000000..c9c61b34 --- /dev/null +++ b/tests/asyncapi-2.0/Message Trait Object/valid-ref-corelationId.yaml @@ -0,0 +1,51 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: user signed up to load some data + message: + payload: + type: object + properties: + email: + type: string + format: email + traits: + - signedUpMessage + +components: + messageTraits: + signedUpMessage: + name: UserSignup + title: User signup + summary: Action to sign a user up. + description: A longer description + contentType: application/json + schemaFormat: application/vnd.oai.openapi;version=3.0.0 + correlationId: + $ref: "#/components/correlationIds/userSignedUpCorId" + headers: + type: object + properties: + correlationId: + description: Correlation ID set by application + type: string + applicationInstanceId: + description: Unique identifier for a given instance of the publishing application + type: string + examples: + - one: + email: hello@foo.bar + - two: + email: bye@foo.bar + correlationIds: + userSignedUpCorId: + description: Default Correlation ID + location: $message.header#/correlationId diff --git a/tests/asyncapi-2.0/Message Trait Object/valid-ref-header.yaml b/tests/asyncapi-2.0/Message Trait Object/valid-ref-header.yaml new file mode 100644 index 00000000..f606e1d2 --- /dev/null +++ b/tests/asyncapi-2.0/Message Trait Object/valid-ref-header.yaml @@ -0,0 +1,51 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: user signed up to load some data + message: + payload: + type: object + properties: + email: + type: string + format: email + traits: + - signedUpMessage + +components: + messageTraits: + signedUpMessage: + name: UserSignup + title: User signup + summary: Action to sign a user up. + description: A longer description + contentType: application/json + schemaFormat: application/vnd.oai.openapi;version=3.0.0 + correlationId: + description: Default Correlation ID + location: $message.header#/correlationId + headers: + $ref: "#/components/schemas/userSignedUpHeaders" + examples: + - one: + email: hello@foo.bar + - two: + email: bye@foo.bar + schemas: + userSignedUpHeaders: + type: object + properties: + correlationId: + description: Correlation ID set by application + type: string + applicationInstanceId: + description: Unique identifier for a given instance of the publishing application + type: string diff --git a/tests/asyncapi-2.0/Message Trait Object/valid.yaml b/tests/asyncapi-2.0/Message Trait Object/valid.yaml new file mode 100644 index 00000000..43b55e34 --- /dev/null +++ b/tests/asyncapi-2.0/Message Trait Object/valid.yaml @@ -0,0 +1,55 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: user signed up to load some data + message: + payload: + type: object + properties: + email: + type: string + format: email + traits: + - signedUpMessage + +components: + messageTraits: + signedUpMessage: + tags: + - name: user + description: user signed up + - name: signup + externalDocs: + description: Find more info here + url: https://example.com + name: UserSignup + title: User signup + summary: Action to sign a user up. + description: A longer description + contentType: application/json + schemaFormat: application/vnd.oai.openapi;version=3.0.0 + correlationId: + description: Default Correlation ID + location: $message.header#/correlationId + headers: + type: object + properties: + correlationId: + description: Correlation ID set by application + type: string + applicationInstanceId: + description: Unique identifier for a given instance of the publishing application + type: string + examples: + - one: + email: hello@foo.bar + - two: + email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Operation Object/invalid-duplicate-tags.yaml b/tests/asyncapi-2.0/Operation Object/invalid-duplicate-tags.yaml new file mode 100644 index 00000000..a93e8381 --- /dev/null +++ b/tests/asyncapi-2.0/Operation Object/invalid-duplicate-tags.yaml @@ -0,0 +1,23 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: user signed up to load some data + message: + payload: + type: object + properties: + email: + type: string + format: email + tags: + - name: user + description: user signed up + - name: user diff --git a/tests/asyncapi-2.0/Operation Object/valid.yaml b/tests/asyncapi-2.0/Operation Object/valid.yaml index 51daa70d..2b7e902f 100644 --- a/tests/asyncapi-2.0/Operation Object/valid.yaml +++ b/tests/asyncapi-2.0/Operation Object/valid.yaml @@ -17,3 +17,10 @@ channels: email: type: string format: email + tags: + - name: user + description: user signed up + - name: signup + externalDocs: + description: Find more info here + url: https://example.com diff --git a/tests/asyncapi-2.0/Operation Trait Object/invalid-duplicate-tags.yaml b/tests/asyncapi-2.0/Operation Trait Object/invalid-duplicate-tags.yaml new file mode 100644 index 00000000..a0cdc304 --- /dev/null +++ b/tests/asyncapi-2.0/Operation Trait Object/invalid-duplicate-tags.yaml @@ -0,0 +1,31 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + traits: + - $ref: "#/components/operationTraits/userSignedUpTrait" + - $ref: "#/components/operationTraits/userSignedUpDescTrait" + +components: + operationTraits: + userSignedUpTrait: + operationId: userSignedUp + tags: + - name: user + description: user signed up + - name: user + summary: user signed up + userSignedUpDescTrait: + description: user signed up to load some data diff --git a/tests/asyncapi-2.0/Operation Trait Object/valid.yaml b/tests/asyncapi-2.0/Operation Trait Object/valid.yaml index 06049feb..a63da1eb 100644 --- a/tests/asyncapi-2.0/Operation Trait Object/valid.yaml +++ b/tests/asyncapi-2.0/Operation Trait Object/valid.yaml @@ -22,6 +22,13 @@ components: operationTraits: userSignedUpTrait: operationId: userSignedUp + tags: + - name: user + description: user signed up + - name: signup + externalDocs: + description: Find more info here + url: https://example.com summary: user signed up userSignedUpDescTrait: description: user signed up to load some data diff --git a/tests/asyncapi-2.0/Tag Object/invalid-missing-name.yaml b/tests/asyncapi-2.0/Tag Object/invalid-missing-name.yaml new file mode 100644 index 00000000..516aa42d --- /dev/null +++ b/tests/asyncapi-2.0/Tag Object/invalid-missing-name.yaml @@ -0,0 +1,19 @@ +asyncapi: 2.0.0 + +tags: + - description: user signed up + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/Tag Object/valid.yaml b/tests/asyncapi-2.0/Tag Object/valid.yaml new file mode 100644 index 00000000..c3af4f8c --- /dev/null +++ b/tests/asyncapi-2.0/Tag Object/valid.yaml @@ -0,0 +1,25 @@ +asyncapi: 2.0.0 + +tags: + - name: user + description: user signed up + - name: signup + externalDocs: + description: Find more info here + url: https://example.com + - name: register + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email From 652103f260c8c65e0d897d7f516d78b2437198f8 Mon Sep 17 00:00:00 2001 From: Artem Kostiuk Date: Wed, 15 Jan 2020 11:28:36 +0200 Subject: [PATCH 08/26] Add Components Object tests. Rename few tests. --- ...ml => invalid-external-ref-structure.yaml} | 0 ...valid-ref.yaml => valid-external-ref.yaml} | 0 .../invalid-channelBindings-key.yaml | 35 ++++ .../invalid-correlationIds-key.yaml | 22 +++ .../invalid-messageBindings-key.yaml | 24 +++ .../invalid-messageTraits-key.yaml | 35 ++++ .../invalid-messages-key.yaml | 56 +++++++ .../invalid-operationBindings-key.yaml | 32 ++++ .../invalid-operationTraits-key.yaml | 21 +++ .../invalid-parameters-key.yaml | 24 +++ .../invalid-schemas-key.yaml | 28 ++++ .../invalid-securitySchemes-key.yaml | 23 +++ .../invalid-serverBindings-key.yaml | 30 ++++ .../Components Object/valid-complete.yaml | 149 ++++++++++++++++++ ... => valid-internal-ref-correlationId.yaml} | 0 ...er.yaml => valid-internal-ref-header.yaml} | 0 .../invalid-defines-payload.yaml | 2 +- .../invalid-defines-traits.yaml | 2 +- .../invalid-duplicate-tags.yaml | 2 +- .../invalid-headers-type.yaml | 2 +- .../invalid-missing-content-type.yaml | 2 +- ... => valid-internal-ref-correlationId.yaml} | 2 +- ...er.yaml => valid-internal-ref-header.yaml} | 2 +- .../Message Trait Object/valid.yaml | 2 +- ...valid-ref.yaml => valid-internal-ref.yaml} | 0 25 files changed, 487 insertions(+), 8 deletions(-) rename tests/asyncapi-2.0/Channel Item Object/{invalid-ref-structure.yaml => invalid-external-ref-structure.yaml} (100%) rename tests/asyncapi-2.0/Channel Item Object/{valid-ref.yaml => valid-external-ref.yaml} (100%) create mode 100644 tests/asyncapi-2.0/Components Object/invalid-channelBindings-key.yaml create mode 100644 tests/asyncapi-2.0/Components Object/invalid-correlationIds-key.yaml create mode 100644 tests/asyncapi-2.0/Components Object/invalid-messageBindings-key.yaml create mode 100644 tests/asyncapi-2.0/Components Object/invalid-messageTraits-key.yaml create mode 100644 tests/asyncapi-2.0/Components Object/invalid-messages-key.yaml create mode 100644 tests/asyncapi-2.0/Components Object/invalid-operationBindings-key.yaml create mode 100644 tests/asyncapi-2.0/Components Object/invalid-operationTraits-key.yaml create mode 100644 tests/asyncapi-2.0/Components Object/invalid-parameters-key.yaml create mode 100644 tests/asyncapi-2.0/Components Object/invalid-schemas-key.yaml create mode 100644 tests/asyncapi-2.0/Components Object/invalid-securitySchemes-key.yaml create mode 100644 tests/asyncapi-2.0/Components Object/invalid-serverBindings-key.yaml create mode 100644 tests/asyncapi-2.0/Components Object/valid-complete.yaml rename tests/asyncapi-2.0/Message Object/{valid-ref-corelationId.yaml => valid-internal-ref-correlationId.yaml} (100%) rename tests/asyncapi-2.0/Message Object/{valid-ref-header.yaml => valid-internal-ref-header.yaml} (100%) rename tests/asyncapi-2.0/Message Trait Object/{valid-ref-corelationId.yaml => valid-internal-ref-correlationId.yaml} (95%) rename tests/asyncapi-2.0/Message Trait Object/{valid-ref-header.yaml => valid-internal-ref-header.yaml} (95%) rename tests/asyncapi-2.0/Parameters Object/{valid-ref.yaml => valid-internal-ref.yaml} (100%) diff --git a/tests/asyncapi-2.0/Channel Item Object/invalid-ref-structure.yaml b/tests/asyncapi-2.0/Channel Item Object/invalid-external-ref-structure.yaml similarity index 100% rename from tests/asyncapi-2.0/Channel Item Object/invalid-ref-structure.yaml rename to tests/asyncapi-2.0/Channel Item Object/invalid-external-ref-structure.yaml diff --git a/tests/asyncapi-2.0/Channel Item Object/valid-ref.yaml b/tests/asyncapi-2.0/Channel Item Object/valid-external-ref.yaml similarity index 100% rename from tests/asyncapi-2.0/Channel Item Object/valid-ref.yaml rename to tests/asyncapi-2.0/Channel Item Object/valid-external-ref.yaml diff --git a/tests/asyncapi-2.0/Components Object/invalid-channelBindings-key.yaml b/tests/asyncapi-2.0/Components Object/invalid-channelBindings-key.yaml new file mode 100644 index 00000000..62bbb063 --- /dev/null +++ b/tests/asyncapi-2.0/Components Object/invalid-channelBindings-key.yaml @@ -0,0 +1,35 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + +components: + serverBindings: + inval#d: + amqp: + is: routingKey + queue: + name: my-queue-name + durable: true + exclusive: true + autoDelete: false + vhost: / + exchange: + name: myExchange + type: topic + durable: true + autoDelete: false + vhost: / + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Components Object/invalid-correlationIds-key.yaml b/tests/asyncapi-2.0/Components Object/invalid-correlationIds-key.yaml new file mode 100644 index 00000000..6cbea6dd --- /dev/null +++ b/tests/asyncapi-2.0/Components Object/invalid-correlationIds-key.yaml @@ -0,0 +1,22 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + +components: + correlationIds: + inval#d: + description: Default Correlation ID + location: $message.header#/correlationId diff --git a/tests/asyncapi-2.0/Components Object/invalid-messageBindings-key.yaml b/tests/asyncapi-2.0/Components Object/invalid-messageBindings-key.yaml new file mode 100644 index 00000000..bd0bf262 --- /dev/null +++ b/tests/asyncapi-2.0/Components Object/invalid-messageBindings-key.yaml @@ -0,0 +1,24 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + +components: + messageBindings: + inval#d: + amqp: + contentEncoding: gzip + messageType: 'user.signup' + bindingVersion: 0.1.0 diff --git a/tests/asyncapi-2.0/Components Object/invalid-messageTraits-key.yaml b/tests/asyncapi-2.0/Components Object/invalid-messageTraits-key.yaml new file mode 100644 index 00000000..ca25f549 --- /dev/null +++ b/tests/asyncapi-2.0/Components Object/invalid-messageTraits-key.yaml @@ -0,0 +1,35 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + +components: + messageTraits: + inval#d: + name: UserSignup + title: User signup + summary: Action to sign a user up. + description: A longer description + contentType: application/json + schemaFormat: application/vnd.oai.openapi;version=3.0.0 + correlationId: + description: Default Correlation ID + location: $message.header#/correlationId + headers: + type: object + properties: + applicationInstanceId: + description: Unique identifier + type: string diff --git a/tests/asyncapi-2.0/Components Object/invalid-messages-key.yaml b/tests/asyncapi-2.0/Components Object/invalid-messages-key.yaml new file mode 100644 index 00000000..538be3df --- /dev/null +++ b/tests/asyncapi-2.0/Components Object/invalid-messages-key.yaml @@ -0,0 +1,56 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + +components: + messages: + inval#d: + name: UserSignup + title: User signup + summary: Action to sign a user up. + description: A longer description + contentType: application/json + schemaFormat: application/vnd.oai.openapi;version=3.0.0 + correlationId: + description: Default Correlation ID + location: $message.header#/correlationId + headers: + type: object + properties: + correlationId: + description: Correlation ID set by application + type: string + applicationInstanceId: + description: Unique identifier for a given instance of the publishing application + type: string + tags: + - name: user + description: user signed up + - name: signup + externalDocs: + description: Find more info here + url: https://example.com + payload: + type: object + properties: + email: + type: string + format: email + examples: + - one: + email: hello@foo.bar + - two: + email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Components Object/invalid-operationBindings-key.yaml b/tests/asyncapi-2.0/Components Object/invalid-operationBindings-key.yaml new file mode 100644 index 00000000..956bdad9 --- /dev/null +++ b/tests/asyncapi-2.0/Components Object/invalid-operationBindings-key.yaml @@ -0,0 +1,32 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + +components: + operationBindings: + inval#d: + amqp: + expiration: 100000 + userId: guest + cc: ['user.logs'] + priority: 10 + deliveryMode: 2 + mandatory: false + bcc: ['external.audit'] + replyTo: user.signedup + timestamp: true + ack: false + bindingVersion: 0.1.0 diff --git a/tests/asyncapi-2.0/Components Object/invalid-operationTraits-key.yaml b/tests/asyncapi-2.0/Components Object/invalid-operationTraits-key.yaml new file mode 100644 index 00000000..8eea6a68 --- /dev/null +++ b/tests/asyncapi-2.0/Components Object/invalid-operationTraits-key.yaml @@ -0,0 +1,21 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + +components: + operationTraits: + inval#d: + description: user signed up to load some data diff --git a/tests/asyncapi-2.0/Components Object/invalid-parameters-key.yaml b/tests/asyncapi-2.0/Components Object/invalid-parameters-key.yaml new file mode 100644 index 00000000..7a04769b --- /dev/null +++ b/tests/asyncapi-2.0/Components Object/invalid-parameters-key.yaml @@ -0,0 +1,24 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + +components: + parameters: + inval#d: + description: Id of the user. + schema: + type: string + location: $message.payload#/user/id diff --git a/tests/asyncapi-2.0/Components Object/invalid-schemas-key.yaml b/tests/asyncapi-2.0/Components Object/invalid-schemas-key.yaml new file mode 100644 index 00000000..74f91827 --- /dev/null +++ b/tests/asyncapi-2.0/Components Object/invalid-schemas-key.yaml @@ -0,0 +1,28 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + +components: + schemas: + inval#d: + type: object + properties: + correlationId: + description: Correlation ID set by application + type: string + applicationInstanceId: + description: Unique identifier + type: string diff --git a/tests/asyncapi-2.0/Components Object/invalid-securitySchemes-key.yaml b/tests/asyncapi-2.0/Components Object/invalid-securitySchemes-key.yaml new file mode 100644 index 00000000..82caf738 --- /dev/null +++ b/tests/asyncapi-2.0/Components Object/invalid-securitySchemes-key.yaml @@ -0,0 +1,23 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + +components: + securitySchemes: + inval#d: + type: httpApiKey + name: Api-Key + in: header diff --git a/tests/asyncapi-2.0/Components Object/invalid-serverBindings-key.yaml b/tests/asyncapi-2.0/Components Object/invalid-serverBindings-key.yaml new file mode 100644 index 00000000..ea43d5c1 --- /dev/null +++ b/tests/asyncapi-2.0/Components Object/invalid-serverBindings-key.yaml @@ -0,0 +1,30 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + +components: + serverBindings: + inval#d: + mqtt: + clientId: guest + cleanSession: true + lastWill: + topic: /last-wills + qos: 2 + message: Guest gone offline. + retain: false + keepAlive: 60 + bindingVersion: 0.1.0 diff --git a/tests/asyncapi-2.0/Components Object/valid-complete.yaml b/tests/asyncapi-2.0/Components Object/valid-complete.yaml new file mode 100644 index 00000000..194e6510 --- /dev/null +++ b/tests/asyncapi-2.0/Components Object/valid-complete.yaml @@ -0,0 +1,149 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + protocolVersion: '1.0.0' + description: Development server + security: + - simple: [] + bindings: + $ref: "#/components/serverBindings/myServerBindings" + +channels: + /user/{userId}/signedup: + parameters: + userId: + $ref: "#/components/parameters/userId" + bindings: + $ref: "#/components/channelBindings/myChannelBindings" + subscribe: + bindings: + $ref: "#/components/operationBindings/myOperationBindings" + traits: + - $ref: "#/components/operationTraits/userSignedUpTrait" + message: + $ref: "#/components/messages/userSignedUpMessage" + +components: + schemas: + userSignedUpHeaders: + type: object + properties: + correlationId: + description: Correlation ID set by application + type: string + applicationInstanceId: + description: Unique identifier + type: string + messages: + userSignedUpMessage: + name: UserSignup + title: User signup + summary: Action to sign a user up. + description: A longer description + contentType: application/json + schemaFormat: application/vnd.oai.openapi;version=3.0.0 + correlationId: + $ref: "#/components/correlationIds/userSignedUpCorId" + headers: + $ref: "#/components/schemas/userSignedUpHeaders" + traits: + - $ref: "#/components/messageTraits/signedUpMessageTrait" + bindings: + $ref: "#/components/messageBindings/myMessageBindings" + payload: + type: object + properties: + email: + type: string + format: email + securitySchemes: + simple: + type: httpApiKey + name: Api-Key + in: header + parameters: + userId: + description: Id of the user. + schema: + type: string + location: $message.payload#/user/id + correlationIds: + userSignedUpCorId: + description: Default Correlation ID + location: $message.header#/correlationId + operationTraits: + userSignedUpTrait: + description: user signed up to load some data + messageTraits: + signedUpMessageTrait: + name: UserSignup + title: User signup + summary: Action to sign a user up. + description: A longer description + contentType: application/json + schemaFormat: application/vnd.oai.openapi;version=3.0.0 + correlationId: + description: Default Correlation ID + location: $message.header#/correlationId + headers: + type: object + properties: + applicationInstanceId: + description: Unique identifier + type: string + serverBindings: + myServerBindings: + mqtt: + clientId: guest + cleanSession: true + lastWill: + topic: /last-wills + qos: 2 + message: Guest gone offline. + retain: false + keepAlive: 60 + bindingVersion: 0.1.0 + channelBindings: + myChannelBindings: + amqp: + is: routingKey + queue: + name: my-queue-name + durable: true + exclusive: true + autoDelete: false + vhost: / + exchange: + name: myExchange + type: topic + durable: true + autoDelete: false + vhost: / + bindingVersion: '0.1.0' + operationBindings: + myOperationBindings: + amqp: + expiration: 100000 + userId: guest + cc: ['user.logs'] + priority: 10 + deliveryMode: 2 + mandatory: false + bcc: ['external.audit'] + replyTo: user.signedup + timestamp: true + ack: false + bindingVersion: 0.1.0 + messageBindings: + myMessageBindings: + amqp: + contentEncoding: gzip + messageType: 'user.signup' + bindingVersion: 0.1.0 diff --git a/tests/asyncapi-2.0/Message Object/valid-ref-corelationId.yaml b/tests/asyncapi-2.0/Message Object/valid-internal-ref-correlationId.yaml similarity index 100% rename from tests/asyncapi-2.0/Message Object/valid-ref-corelationId.yaml rename to tests/asyncapi-2.0/Message Object/valid-internal-ref-correlationId.yaml diff --git a/tests/asyncapi-2.0/Message Object/valid-ref-header.yaml b/tests/asyncapi-2.0/Message Object/valid-internal-ref-header.yaml similarity index 100% rename from tests/asyncapi-2.0/Message Object/valid-ref-header.yaml rename to tests/asyncapi-2.0/Message Object/valid-internal-ref-header.yaml diff --git a/tests/asyncapi-2.0/Message Trait Object/invalid-defines-payload.yaml b/tests/asyncapi-2.0/Message Trait Object/invalid-defines-payload.yaml index b356a92c..44f89f8c 100644 --- a/tests/asyncapi-2.0/Message Trait Object/invalid-defines-payload.yaml +++ b/tests/asyncapi-2.0/Message Trait Object/invalid-defines-payload.yaml @@ -18,7 +18,7 @@ channels: type: string format: email traits: - - signedUpMessage + - $ref: "#/components/messageTraits/signedUpMessage" components: messageTraits: diff --git a/tests/asyncapi-2.0/Message Trait Object/invalid-defines-traits.yaml b/tests/asyncapi-2.0/Message Trait Object/invalid-defines-traits.yaml index b7d8af6b..78b3bc61 100644 --- a/tests/asyncapi-2.0/Message Trait Object/invalid-defines-traits.yaml +++ b/tests/asyncapi-2.0/Message Trait Object/invalid-defines-traits.yaml @@ -18,7 +18,7 @@ channels: type: string format: email traits: - - signedUpMessage + - $ref: "#/components/messageTraits/signedUpMessage" components: messageTraits: diff --git a/tests/asyncapi-2.0/Message Trait Object/invalid-duplicate-tags.yaml b/tests/asyncapi-2.0/Message Trait Object/invalid-duplicate-tags.yaml index 3ad1122e..28f8d738 100644 --- a/tests/asyncapi-2.0/Message Trait Object/invalid-duplicate-tags.yaml +++ b/tests/asyncapi-2.0/Message Trait Object/invalid-duplicate-tags.yaml @@ -18,7 +18,7 @@ channels: type: string format: email traits: - - signedUpMessage + - $ref: "#/components/messageTraits/signedUpMessage" components: messageTraits: diff --git a/tests/asyncapi-2.0/Message Trait Object/invalid-headers-type.yaml b/tests/asyncapi-2.0/Message Trait Object/invalid-headers-type.yaml index 36cefed4..3b1a8fe9 100644 --- a/tests/asyncapi-2.0/Message Trait Object/invalid-headers-type.yaml +++ b/tests/asyncapi-2.0/Message Trait Object/invalid-headers-type.yaml @@ -18,7 +18,7 @@ channels: type: string format: email traits: - - signedUpMessage + - $ref: "#/components/messageTraits/signedUpMessage" components: messageTraits: diff --git a/tests/asyncapi-2.0/Message Trait Object/invalid-missing-content-type.yaml b/tests/asyncapi-2.0/Message Trait Object/invalid-missing-content-type.yaml index 90255ed2..72037ecc 100644 --- a/tests/asyncapi-2.0/Message Trait Object/invalid-missing-content-type.yaml +++ b/tests/asyncapi-2.0/Message Trait Object/invalid-missing-content-type.yaml @@ -18,7 +18,7 @@ channels: type: string format: email traits: - - signedUpMessage + - $ref: "#/components/messageTraits/signedUpMessage" components: messageTraits: diff --git a/tests/asyncapi-2.0/Message Trait Object/valid-ref-corelationId.yaml b/tests/asyncapi-2.0/Message Trait Object/valid-internal-ref-correlationId.yaml similarity index 95% rename from tests/asyncapi-2.0/Message Trait Object/valid-ref-corelationId.yaml rename to tests/asyncapi-2.0/Message Trait Object/valid-internal-ref-correlationId.yaml index c9c61b34..8c5ef8ff 100644 --- a/tests/asyncapi-2.0/Message Trait Object/valid-ref-corelationId.yaml +++ b/tests/asyncapi-2.0/Message Trait Object/valid-internal-ref-correlationId.yaml @@ -18,7 +18,7 @@ channels: type: string format: email traits: - - signedUpMessage + - $ref: "#/components/messageTraits/signedUpMessage" components: messageTraits: diff --git a/tests/asyncapi-2.0/Message Trait Object/valid-ref-header.yaml b/tests/asyncapi-2.0/Message Trait Object/valid-internal-ref-header.yaml similarity index 95% rename from tests/asyncapi-2.0/Message Trait Object/valid-ref-header.yaml rename to tests/asyncapi-2.0/Message Trait Object/valid-internal-ref-header.yaml index f606e1d2..2ebf1ed2 100644 --- a/tests/asyncapi-2.0/Message Trait Object/valid-ref-header.yaml +++ b/tests/asyncapi-2.0/Message Trait Object/valid-internal-ref-header.yaml @@ -18,7 +18,7 @@ channels: type: string format: email traits: - - signedUpMessage + - $ref: "#/components/messageTraits/signedUpMessage" components: messageTraits: diff --git a/tests/asyncapi-2.0/Message Trait Object/valid.yaml b/tests/asyncapi-2.0/Message Trait Object/valid.yaml index 43b55e34..4fcf02cf 100644 --- a/tests/asyncapi-2.0/Message Trait Object/valid.yaml +++ b/tests/asyncapi-2.0/Message Trait Object/valid.yaml @@ -18,7 +18,7 @@ channels: type: string format: email traits: - - signedUpMessage + - $ref: "#/components/messageTraits/signedUpMessage" components: messageTraits: diff --git a/tests/asyncapi-2.0/Parameters Object/valid-ref.yaml b/tests/asyncapi-2.0/Parameters Object/valid-internal-ref.yaml similarity index 100% rename from tests/asyncapi-2.0/Parameters Object/valid-ref.yaml rename to tests/asyncapi-2.0/Parameters Object/valid-internal-ref.yaml From 39464d70d704b213349049ae283cf3b287685f21 Mon Sep 17 00:00:00 2001 From: Artem Kostiuk Date: Wed, 15 Jan 2020 12:02:00 +0200 Subject: [PATCH 09/26] Add Reference Object tck tests --- tests/asyncapi-2.0/Reference Object/lib.yaml | 131 ++++++++++++++++++ .../valid-external-ref-channelBindings.yaml | 21 +++ .../valid-external-ref-correlationId.yaml | 21 +++ .../valid-external-ref-message.yaml | 21 +++ .../valid-external-ref-messageBindings.yaml | 21 +++ .../valid-external-ref-messageTraits.yaml | 21 +++ .../valid-external-ref-operationBindings.yaml | 21 +++ .../valid-external-ref-operationTraits.yaml | 21 +++ .../valid-external-ref-parameter.yaml | 21 +++ .../valid-external-ref-schema.yaml | 21 +++ .../valid-external-ref-securityScheme.yaml | 21 +++ .../valid-external-ref-serverBindings.yaml | 21 +++ .../Server Object/valid-security.yaml | 2 +- 13 files changed, 363 insertions(+), 1 deletion(-) create mode 100644 tests/asyncapi-2.0/Reference Object/lib.yaml create mode 100644 tests/asyncapi-2.0/Reference Object/valid-external-ref-channelBindings.yaml create mode 100644 tests/asyncapi-2.0/Reference Object/valid-external-ref-correlationId.yaml create mode 100644 tests/asyncapi-2.0/Reference Object/valid-external-ref-message.yaml create mode 100644 tests/asyncapi-2.0/Reference Object/valid-external-ref-messageBindings.yaml create mode 100644 tests/asyncapi-2.0/Reference Object/valid-external-ref-messageTraits.yaml create mode 100644 tests/asyncapi-2.0/Reference Object/valid-external-ref-operationBindings.yaml create mode 100644 tests/asyncapi-2.0/Reference Object/valid-external-ref-operationTraits.yaml create mode 100644 tests/asyncapi-2.0/Reference Object/valid-external-ref-parameter.yaml create mode 100644 tests/asyncapi-2.0/Reference Object/valid-external-ref-schema.yaml create mode 100644 tests/asyncapi-2.0/Reference Object/valid-external-ref-securityScheme.yaml create mode 100644 tests/asyncapi-2.0/Reference Object/valid-external-ref-serverBindings.yaml diff --git a/tests/asyncapi-2.0/Reference Object/lib.yaml b/tests/asyncapi-2.0/Reference Object/lib.yaml new file mode 100644 index 00000000..38fe6fb5 --- /dev/null +++ b/tests/asyncapi-2.0/Reference Object/lib.yaml @@ -0,0 +1,131 @@ +mySchema: + type: object + properties: + correlationId: + description: Correlation ID set by application + type: string + applicationInstanceId: + description: Unique identifier + type: string + +myMessage: + name: UserSignup + title: User signup + summary: Action to sign a user up. + description: A longer description + contentType: application/json + schemaFormat: application/vnd.oai.openapi;version=3.0.0 + correlationId: + description: Default Correlation ID + location: $message.header#/correlationId + headers: + type: object + properties: + correlationId: + description: Correlation ID set by application + type: string + applicationInstanceId: + description: Unique identifier + type: string + tags: + - name: user + description: user signed up + - name: signup + externalDocs: + description: Find more info here + url: https://example.com + payload: + type: object + properties: + email: + type: string + format: email + examples: + - one: + email: hello@foo.bar + - two: + email: bye@foo.bar + +mySecurityScheme: + type: httpApiKey + name: Api-Key + in: header + +myParam: + description: Id of the user. + schema: + type: string + location: $message.payload#/user/id + +myCorrelationId: + description: Default Correlation ID + location: $message.header#/correlationId + +myOperationTrait: + description: user signed up to load some data + +myMessageTrait: + name: UserSignup + title: User signup + summary: Action to sign a user up. + description: A longer description + contentType: application/json + schemaFormat: application/vnd.oai.openapi;version=3.0.0 + correlationId: + description: Default Correlation ID + location: $message.header#/correlationId + headers: + type: object + properties: + applicationInstanceId: + description: Unique identifier + type: string + +myServerBindings: + mqtt: + clientId: guest + cleanSession: true + lastWill: + topic: /last-wills + qos: 2 + message: Guest gone offline. + retain: false + keepAlive: 60 + bindingVersion: 0.1.0 + +myChannelBindings: + amqp: + is: routingKey + queue: + name: my-queue-name + durable: true + exclusive: true + autoDelete: false + vhost: / + exchange: + name: myExchange + type: topic + durable: true + autoDelete: false + vhost: / + bindingVersion: '0.1.0' + +myOperationBindings: + amqp: + expiration: 100000 + userId: guest + cc: ['user.logs'] + priority: 10 + deliveryMode: 2 + mandatory: false + bcc: ['external.audit'] + replyTo: user.signedup + timestamp: true + ack: false + bindingVersion: 0.1.0 + +myMessageBindings: + amqp: + contentEncoding: gzip + messageType: 'user.signup' + bindingVersion: 0.1.0 diff --git a/tests/asyncapi-2.0/Reference Object/valid-external-ref-channelBindings.yaml b/tests/asyncapi-2.0/Reference Object/valid-external-ref-channelBindings.yaml new file mode 100644 index 00000000..34206c51 --- /dev/null +++ b/tests/asyncapi-2.0/Reference Object/valid-external-ref-channelBindings.yaml @@ -0,0 +1,21 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + +components: + channelBindings: + myChannelBindings: + $ref: "lib.yaml#/myChannelBindings" diff --git a/tests/asyncapi-2.0/Reference Object/valid-external-ref-correlationId.yaml b/tests/asyncapi-2.0/Reference Object/valid-external-ref-correlationId.yaml new file mode 100644 index 00000000..970b16f0 --- /dev/null +++ b/tests/asyncapi-2.0/Reference Object/valid-external-ref-correlationId.yaml @@ -0,0 +1,21 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + +components: + correlationIds: + myCorrelationId: + $ref: "lib.yaml#/myCorrelationId" diff --git a/tests/asyncapi-2.0/Reference Object/valid-external-ref-message.yaml b/tests/asyncapi-2.0/Reference Object/valid-external-ref-message.yaml new file mode 100644 index 00000000..39e54ace --- /dev/null +++ b/tests/asyncapi-2.0/Reference Object/valid-external-ref-message.yaml @@ -0,0 +1,21 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + +components: + messages: + myMessage: + $ref: "lib.yaml#/myMessage" diff --git a/tests/asyncapi-2.0/Reference Object/valid-external-ref-messageBindings.yaml b/tests/asyncapi-2.0/Reference Object/valid-external-ref-messageBindings.yaml new file mode 100644 index 00000000..159ba7bc --- /dev/null +++ b/tests/asyncapi-2.0/Reference Object/valid-external-ref-messageBindings.yaml @@ -0,0 +1,21 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + +components: + messageBindings: + myMessageBindings: + $ref: "lib.yaml#/myMessageBindings" diff --git a/tests/asyncapi-2.0/Reference Object/valid-external-ref-messageTraits.yaml b/tests/asyncapi-2.0/Reference Object/valid-external-ref-messageTraits.yaml new file mode 100644 index 00000000..e348b80d --- /dev/null +++ b/tests/asyncapi-2.0/Reference Object/valid-external-ref-messageTraits.yaml @@ -0,0 +1,21 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + +components: + messageTraits: + myMessageTrait: + $ref: "lib.yaml#/myMessageTrait" diff --git a/tests/asyncapi-2.0/Reference Object/valid-external-ref-operationBindings.yaml b/tests/asyncapi-2.0/Reference Object/valid-external-ref-operationBindings.yaml new file mode 100644 index 00000000..c2a4de2f --- /dev/null +++ b/tests/asyncapi-2.0/Reference Object/valid-external-ref-operationBindings.yaml @@ -0,0 +1,21 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + +components: + operationBindings: + myOperationBindings: + $ref: "lib.yaml#/myOperationBindings" diff --git a/tests/asyncapi-2.0/Reference Object/valid-external-ref-operationTraits.yaml b/tests/asyncapi-2.0/Reference Object/valid-external-ref-operationTraits.yaml new file mode 100644 index 00000000..d9e16667 --- /dev/null +++ b/tests/asyncapi-2.0/Reference Object/valid-external-ref-operationTraits.yaml @@ -0,0 +1,21 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + +components: + operationTraits: + myOperationTrait: + $ref: "lib.yaml#/myOperationTrait" diff --git a/tests/asyncapi-2.0/Reference Object/valid-external-ref-parameter.yaml b/tests/asyncapi-2.0/Reference Object/valid-external-ref-parameter.yaml new file mode 100644 index 00000000..f317eb21 --- /dev/null +++ b/tests/asyncapi-2.0/Reference Object/valid-external-ref-parameter.yaml @@ -0,0 +1,21 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + +components: + parameters: + myParam: + $ref: "lib.yaml#/myParam" diff --git a/tests/asyncapi-2.0/Reference Object/valid-external-ref-schema.yaml b/tests/asyncapi-2.0/Reference Object/valid-external-ref-schema.yaml new file mode 100644 index 00000000..48efe816 --- /dev/null +++ b/tests/asyncapi-2.0/Reference Object/valid-external-ref-schema.yaml @@ -0,0 +1,21 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + +components: + schemas: + mySchema: + $ref: "lib.yaml#/mySchema" diff --git a/tests/asyncapi-2.0/Reference Object/valid-external-ref-securityScheme.yaml b/tests/asyncapi-2.0/Reference Object/valid-external-ref-securityScheme.yaml new file mode 100644 index 00000000..5132fc0d --- /dev/null +++ b/tests/asyncapi-2.0/Reference Object/valid-external-ref-securityScheme.yaml @@ -0,0 +1,21 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + +components: + securitySchemes: + simple: + $ref: "lib.yaml#/mySecurityScheme" diff --git a/tests/asyncapi-2.0/Reference Object/valid-external-ref-serverBindings.yaml b/tests/asyncapi-2.0/Reference Object/valid-external-ref-serverBindings.yaml new file mode 100644 index 00000000..b2f9d1dd --- /dev/null +++ b/tests/asyncapi-2.0/Reference Object/valid-external-ref-serverBindings.yaml @@ -0,0 +1,21 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + +components: + serverBindings: + myServerBindings: + $ref: "lib.yaml#/myServerBindings" diff --git a/tests/asyncapi-2.0/Server Object/valid-security.yaml b/tests/asyncapi-2.0/Server Object/valid-security.yaml index 806674f7..c76bcf36 100644 --- a/tests/asyncapi-2.0/Server Object/valid-security.yaml +++ b/tests/asyncapi-2.0/Server Object/valid-security.yaml @@ -25,7 +25,7 @@ servers: - simple: [] components: - securitySchemes: + securitySchemes: simple: type: httpApiKey name: Api-Key From 083a68ace711727730d30513510168c7bf5daca5 Mon Sep 17 00:00:00 2001 From: Artem Kostiuk Date: Thu, 16 Jan 2020 10:44:23 +0200 Subject: [PATCH 10/26] Add tck tests for Schema Object --- .../Parameter Object/valid-ref-schema.yaml | 23 ++++ ...id-polymorphism-missing-discriminator.yaml | 66 ++++++++++++ .../Schema Object/valid-composition.yaml | 36 +++++++ .../Schema Object/valid-polymorphism.yaml | 67 ++++++++++++ tests/asyncapi-2.0/Schema Object/valid.yaml | 101 ++++++++++++++++++ 5 files changed, 293 insertions(+) create mode 100644 tests/asyncapi-2.0/Parameter Object/valid-ref-schema.yaml create mode 100644 tests/asyncapi-2.0/Schema Object/invalid-polymorphism-missing-discriminator.yaml create mode 100644 tests/asyncapi-2.0/Schema Object/valid-composition.yaml create mode 100644 tests/asyncapi-2.0/Schema Object/valid-polymorphism.yaml create mode 100644 tests/asyncapi-2.0/Schema Object/valid.yaml diff --git a/tests/asyncapi-2.0/Parameter Object/valid-ref-schema.yaml b/tests/asyncapi-2.0/Parameter Object/valid-ref-schema.yaml new file mode 100644 index 00000000..c8f8ebc7 --- /dev/null +++ b/tests/asyncapi-2.0/Parameter Object/valid-ref-schema.yaml @@ -0,0 +1,23 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + user/{userId}/signup: + parameters: + userId: + description: Id of the user. + schema: + $ref: "#/components/schemas/defaultString" + location: $message.payload#/user/id + publish: + message: + payload: + type: string + +components: + schemas: + defaultString: + type: string diff --git a/tests/asyncapi-2.0/Schema Object/invalid-polymorphism-missing-discriminator.yaml b/tests/asyncapi-2.0/Schema Object/invalid-polymorphism-missing-discriminator.yaml new file mode 100644 index 00000000..9cf372fa --- /dev/null +++ b/tests/asyncapi-2.0/Schema Object/invalid-polymorphism-missing-discriminator.yaml @@ -0,0 +1,66 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + $ref: "#/components/schemas/Pet" + +components: + schemas: + Pet: + type: object + properties: + name: + type: string + petType: + type: string + required: + - name + - petType + Cat: + description: A representation of a cat + allOf: + - $ref: '#/components/schemas/Pet' + - type: object + properties: + huntingSkill: + type: string + description: The measured skill for hunting + enum: + - clueless + - lazy + - adventurous + - aggressive + required: + - huntingSkill + Dog: + description: A representation of a dog + allOf: + - $ref: '#/components/schemas/Pet' + - type: object + properties: + packSize: + type: integer + format: int32 + description: the size of the pack the dog is from + minimum: 0 + required: + - packSize + StickInsect: + description: A representation of an Australian walking stick + allOf: + - $ref: '#/components/schemas/Pet' + - type: object + properties: + petType: + const: StickBug + color: + type: string + required: + - color diff --git a/tests/asyncapi-2.0/Schema Object/valid-composition.yaml b/tests/asyncapi-2.0/Schema Object/valid-composition.yaml new file mode 100644 index 00000000..bbb1836f --- /dev/null +++ b/tests/asyncapi-2.0/Schema Object/valid-composition.yaml @@ -0,0 +1,36 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + $ref: "#/components/schemas/ErrorModel" + +components: + schemas: + ErrorModel: + type: object + required: + - message + - code + properties: + message: + type: string + code: + type: integer + minimum: 100 + maximum: 600 + ExtendedErrorModel: + allOf: + - $ref: '#/components/schemas/ErrorModel' + - type: object + required: + - rootCause + properties: + rootCause: + type: string diff --git a/tests/asyncapi-2.0/Schema Object/valid-polymorphism.yaml b/tests/asyncapi-2.0/Schema Object/valid-polymorphism.yaml new file mode 100644 index 00000000..6f3f1014 --- /dev/null +++ b/tests/asyncapi-2.0/Schema Object/valid-polymorphism.yaml @@ -0,0 +1,67 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + $ref: "#/components/schemas/Pet" + +components: + schemas: + Pet: + type: object + discriminator: petType + properties: + name: + type: string + petType: + type: string + required: + - name + - petType + Cat: + description: A representation of a cat + allOf: + - $ref: '#/components/schemas/Pet' + - type: object + properties: + huntingSkill: + type: string + description: The measured skill for hunting + enum: + - clueless + - lazy + - adventurous + - aggressive + required: + - huntingSkill + Dog: + description: A representation of a dog + allOf: + - $ref: '#/components/schemas/Pet' + - type: object + properties: + packSize: + type: integer + format: int32 + description: the size of the pack the dog is from + minimum: 0 + required: + - packSize + StickInsect: + description: A representation of an Australian walking stick + allOf: + - $ref: '#/components/schemas/Pet' + - type: object + properties: + petType: + const: StickBug + color: + type: string + required: + - color diff --git a/tests/asyncapi-2.0/Schema Object/valid.yaml b/tests/asyncapi-2.0/Schema Object/valid.yaml new file mode 100644 index 00000000..f87294a1 --- /dev/null +++ b/tests/asyncapi-2.0/Schema Object/valid.yaml @@ -0,0 +1,101 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + $ref: "#/components/schemas/Main" + +components: + schemas: + Main: + type: object + description: hi + propertyNames: + type: string + minLength: 1 + externalDocs: + description: Find more info here + url: https://example.com + deprecated: true + additionalProperties: true + maxProperties: 99 + minProperties: 1 + required: + - stringProp + properties: + objectProp: + readOnly: true + type: object + patternProperties: + ^[a-zA-Z0-9\.\-_]+$: + type: number + arrayProp: + contains: + type: number + writeOnly: true + type: array + minItems: 1 + maxItems: 99 + uniqueItems: false + additionalItems: true + items: + type: integer + default: 3 + format: int32 + multipleOf: 1 + maximum: 99 + exclusiveMaximum: true + minimum: 1 + exclusiveMinimum: true + anotherString: + type: string + const: hello + oneOfProp: + oneOf: + type: string + type: number + allOfProp: + allOf: + type: string + type: number + notProp: + allOf: + type: string + not: + type: number + stringProp: + type: string + title: String property + minLength: 1 + maxLength: 10 + pattern: ^[a-zA-Z0-9\.\-_]+$ + enum: + - John + - Doe + examples: + - John + ifthenelseObj: + type: object + properties: + country: + type: string + street_address: + type: string + if: + properties: + country: + const: United States of America + then: + properties: + postal_code: + pattern: [0-9]{5}(-[0-9]{4})? + else: + properties: + postal_code: + pattern: [A-Z][0-9][A-Z] [0-9][A-Z][0-9] From 46de081378c3cbcbae29191b0db0edcca5f15452 Mon Sep 17 00:00:00 2001 From: Artem Kostiuk Date: Thu, 16 Jan 2020 11:56:37 +0200 Subject: [PATCH 11/26] Add more tck tests Correlation ID Object Security Requirement Object Security Scheme Object Specification Extensions --- .../invalid-location-expression.yaml | 31 +++++++++++ .../invalid-missing-location.yaml | 30 +++++++++++ .../Correlation ID Object/valid.yaml | 31 +++++++++++ .../invalid-X509-non-empty-array.yaml | 25 +++++++++ .../invalid-apiKey-non-empty-array.yaml | 26 ++++++++++ ...-asymmetricEncryption-non-empty-array.yaml | 25 +++++++++ .../invalid-http-non-empty-array.yaml | 27 ++++++++++ .../invalid-httpApiKey-non-empty-array.yaml | 27 ++++++++++ .../invalid-inexisting-scheme.yaml | 25 +++++++++ .../invalid-oauth2-without-scopes.yaml | 31 +++++++++++ .../invalid-openIdConnect-without-scopes.yaml | 25 +++++++++ ...d-symmetricEncryption-non-empty-array.yaml | 25 +++++++++ .../invalid-userPassword-non-empty-array.yaml | 25 +++++++++ .../Security Scheme Object/X509/valid.yaml | 24 +++++++++ .../apiKey/invalid-in-value.yaml | 29 +++++++++++ .../apiKey/invalid-missing-in-property.yaml | 28 ++++++++++ .../Security Scheme Object/apiKey/valid.yaml | 29 +++++++++++ .../asymmetricEncryption/valid.yaml | 24 +++++++++ .../http/invalid-missing-scheme.yaml | 25 +++++++++ .../Security Scheme Object/http/valid.yaml | 26 ++++++++++ .../httpApiKey/invalid-in-value.yaml | 36 +++++++++++++ .../invalid-missing-in-property.yaml | 35 +++++++++++++ .../httpApiKey/invalid-missing-name.yaml | 35 +++++++++++++ .../httpApiKey/valid.yaml | 36 +++++++++++++ .../invalid-authorizationUrl-format.yaml | 34 ++++++++++++ ...ing-authorizationCode-authrozationUrl.yaml | 33 ++++++++++++ ...id-missing-authorizationCode-tokenUrl.yaml | 33 ++++++++++++ ...id-missing-clientCredentials-tokenUrl.yaml | 32 ++++++++++++ .../oauth2/invalid-missing-flows.yaml | 26 ++++++++++ ...lid-missing-implicit-authorizationUrl.yaml | 32 ++++++++++++ .../oauth2/invalid-missing-scopes.yaml | 30 +++++++++++ .../invalid-password-missing-tokenUrl.yaml | 32 ++++++++++++ .../oauth2/invalid-refreshUrl-format.yaml | 34 ++++++++++++ .../oauth2/invalid-tokenUrl-format.yaml | 34 ++++++++++++ .../Security Scheme Object/oauth2/valid.yaml | 52 +++++++++++++++++++ .../openIdConnect/valid.yaml | 27 ++++++++++ .../symmetricEncryption/valid.yaml | 24 +++++++++ .../userPassword/invalid-missing-type.yaml | 24 +++++++++ .../userPassword/valid.yaml | 25 +++++++++ .../Specification Extensions/valid.yaml | 29 +++++++++++ 40 files changed, 1181 insertions(+) create mode 100644 tests/asyncapi-2.0/Correlation ID Object/invalid-location-expression.yaml create mode 100644 tests/asyncapi-2.0/Correlation ID Object/invalid-missing-location.yaml create mode 100644 tests/asyncapi-2.0/Correlation ID Object/valid.yaml create mode 100644 tests/asyncapi-2.0/Security Requirement Object/invalid-X509-non-empty-array.yaml create mode 100644 tests/asyncapi-2.0/Security Requirement Object/invalid-apiKey-non-empty-array.yaml create mode 100644 tests/asyncapi-2.0/Security Requirement Object/invalid-asymmetricEncryption-non-empty-array.yaml create mode 100644 tests/asyncapi-2.0/Security Requirement Object/invalid-http-non-empty-array.yaml create mode 100644 tests/asyncapi-2.0/Security Requirement Object/invalid-httpApiKey-non-empty-array.yaml create mode 100644 tests/asyncapi-2.0/Security Requirement Object/invalid-inexisting-scheme.yaml create mode 100644 tests/asyncapi-2.0/Security Requirement Object/invalid-oauth2-without-scopes.yaml create mode 100644 tests/asyncapi-2.0/Security Requirement Object/invalid-openIdConnect-without-scopes.yaml create mode 100644 tests/asyncapi-2.0/Security Requirement Object/invalid-symmetricEncryption-non-empty-array.yaml create mode 100644 tests/asyncapi-2.0/Security Requirement Object/invalid-userPassword-non-empty-array.yaml create mode 100644 tests/asyncapi-2.0/Security Scheme Object/X509/valid.yaml create mode 100644 tests/asyncapi-2.0/Security Scheme Object/apiKey/invalid-in-value.yaml create mode 100644 tests/asyncapi-2.0/Security Scheme Object/apiKey/invalid-missing-in-property.yaml create mode 100644 tests/asyncapi-2.0/Security Scheme Object/apiKey/valid.yaml create mode 100644 tests/asyncapi-2.0/Security Scheme Object/asymmetricEncryption/valid.yaml create mode 100644 tests/asyncapi-2.0/Security Scheme Object/http/invalid-missing-scheme.yaml create mode 100644 tests/asyncapi-2.0/Security Scheme Object/http/valid.yaml create mode 100644 tests/asyncapi-2.0/Security Scheme Object/httpApiKey/invalid-in-value.yaml create mode 100644 tests/asyncapi-2.0/Security Scheme Object/httpApiKey/invalid-missing-in-property.yaml create mode 100644 tests/asyncapi-2.0/Security Scheme Object/httpApiKey/invalid-missing-name.yaml create mode 100644 tests/asyncapi-2.0/Security Scheme Object/httpApiKey/valid.yaml create mode 100644 tests/asyncapi-2.0/Security Scheme Object/oauth2/invalid-authorizationUrl-format.yaml create mode 100644 tests/asyncapi-2.0/Security Scheme Object/oauth2/invalid-missing-authorizationCode-authrozationUrl.yaml create mode 100644 tests/asyncapi-2.0/Security Scheme Object/oauth2/invalid-missing-authorizationCode-tokenUrl.yaml create mode 100644 tests/asyncapi-2.0/Security Scheme Object/oauth2/invalid-missing-clientCredentials-tokenUrl.yaml create mode 100644 tests/asyncapi-2.0/Security Scheme Object/oauth2/invalid-missing-flows.yaml create mode 100644 tests/asyncapi-2.0/Security Scheme Object/oauth2/invalid-missing-implicit-authorizationUrl.yaml create mode 100644 tests/asyncapi-2.0/Security Scheme Object/oauth2/invalid-missing-scopes.yaml create mode 100644 tests/asyncapi-2.0/Security Scheme Object/oauth2/invalid-password-missing-tokenUrl.yaml create mode 100644 tests/asyncapi-2.0/Security Scheme Object/oauth2/invalid-refreshUrl-format.yaml create mode 100644 tests/asyncapi-2.0/Security Scheme Object/oauth2/invalid-tokenUrl-format.yaml create mode 100644 tests/asyncapi-2.0/Security Scheme Object/oauth2/valid.yaml create mode 100644 tests/asyncapi-2.0/Security Scheme Object/openIdConnect/valid.yaml create mode 100644 tests/asyncapi-2.0/Security Scheme Object/symmetricEncryption/valid.yaml create mode 100644 tests/asyncapi-2.0/Security Scheme Object/userPassword/invalid-missing-type.yaml create mode 100644 tests/asyncapi-2.0/Security Scheme Object/userPassword/valid.yaml create mode 100644 tests/asyncapi-2.0/Specification Extensions/valid.yaml diff --git a/tests/asyncapi-2.0/Correlation ID Object/invalid-location-expression.yaml b/tests/asyncapi-2.0/Correlation ID Object/invalid-location-expression.yaml new file mode 100644 index 00000000..84b36286 --- /dev/null +++ b/tests/asyncapi-2.0/Correlation ID Object/invalid-location-expression.yaml @@ -0,0 +1,31 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: user signed up to load some data + message: + name: UserSignup + title: User signup + contentType: application/json + schemaFormat: application/vnd.oai.openapi;version=3.0.0 + correlationId: + $ref: "#/components/correlationIds/userSignedUpCorId" + payload: + type: object + properties: + email: + type: string + format: email + +components: + correlationIds: + userSignedUpCorId: + description: Default Correlation ID + location: not a valid runtime expression diff --git a/tests/asyncapi-2.0/Correlation ID Object/invalid-missing-location.yaml b/tests/asyncapi-2.0/Correlation ID Object/invalid-missing-location.yaml new file mode 100644 index 00000000..ba682def --- /dev/null +++ b/tests/asyncapi-2.0/Correlation ID Object/invalid-missing-location.yaml @@ -0,0 +1,30 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: user signed up to load some data + message: + name: UserSignup + title: User signup + contentType: application/json + schemaFormat: application/vnd.oai.openapi;version=3.0.0 + correlationId: + $ref: "#/components/correlationIds/userSignedUpCorId" + payload: + type: object + properties: + email: + type: string + format: email + +components: + correlationIds: + userSignedUpCorId: + description: Default Correlation ID diff --git a/tests/asyncapi-2.0/Correlation ID Object/valid.yaml b/tests/asyncapi-2.0/Correlation ID Object/valid.yaml new file mode 100644 index 00000000..f8cbac31 --- /dev/null +++ b/tests/asyncapi-2.0/Correlation ID Object/valid.yaml @@ -0,0 +1,31 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: user signed up to load some data + message: + name: UserSignup + title: User signup + contentType: application/json + schemaFormat: application/vnd.oai.openapi;version=3.0.0 + correlationId: + $ref: "#/components/correlationIds/userSignedUpCorId" + payload: + type: object + properties: + email: + type: string + format: email + +components: + correlationIds: + userSignedUpCorId: + description: Default Correlation ID + location: $message.header#/correlationId diff --git a/tests/asyncapi-2.0/Security Requirement Object/invalid-X509-non-empty-array.yaml b/tests/asyncapi-2.0/Security Requirement Object/invalid-X509-non-empty-array.yaml new file mode 100644 index 00000000..476788d1 --- /dev/null +++ b/tests/asyncapi-2.0/Security Requirement Object/invalid-X509-non-empty-array.yaml @@ -0,0 +1,25 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + security: + - mainSecurity: + - hello + +components: + securitySchemes: + mainSecurity: + type: X509 diff --git a/tests/asyncapi-2.0/Security Requirement Object/invalid-apiKey-non-empty-array.yaml b/tests/asyncapi-2.0/Security Requirement Object/invalid-apiKey-non-empty-array.yaml new file mode 100644 index 00000000..f986fcb7 --- /dev/null +++ b/tests/asyncapi-2.0/Security Requirement Object/invalid-apiKey-non-empty-array.yaml @@ -0,0 +1,26 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + security: + - mainSecurity: + - hello + +components: + securitySchemes: + mainSecurity: + type: apiKey + in: user diff --git a/tests/asyncapi-2.0/Security Requirement Object/invalid-asymmetricEncryption-non-empty-array.yaml b/tests/asyncapi-2.0/Security Requirement Object/invalid-asymmetricEncryption-non-empty-array.yaml new file mode 100644 index 00000000..577a5f8c --- /dev/null +++ b/tests/asyncapi-2.0/Security Requirement Object/invalid-asymmetricEncryption-non-empty-array.yaml @@ -0,0 +1,25 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + security: + - mainSecurity: + - hello + +components: + securitySchemes: + mainSecurity: + type: asymmetricEncryption diff --git a/tests/asyncapi-2.0/Security Requirement Object/invalid-http-non-empty-array.yaml b/tests/asyncapi-2.0/Security Requirement Object/invalid-http-non-empty-array.yaml new file mode 100644 index 00000000..524a2312 --- /dev/null +++ b/tests/asyncapi-2.0/Security Requirement Object/invalid-http-non-empty-array.yaml @@ -0,0 +1,27 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + security: + - mainSecurity: + - hello + +components: + securitySchemes: + mainSecurity: + type: http + scheme: bearer + bearerFormat: a hint diff --git a/tests/asyncapi-2.0/Security Requirement Object/invalid-httpApiKey-non-empty-array.yaml b/tests/asyncapi-2.0/Security Requirement Object/invalid-httpApiKey-non-empty-array.yaml new file mode 100644 index 00000000..6c104db7 --- /dev/null +++ b/tests/asyncapi-2.0/Security Requirement Object/invalid-httpApiKey-non-empty-array.yaml @@ -0,0 +1,27 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + security: + - mainSecurity: + - hello + +components: + securitySchemes: + mainSecurity: + type: httpApiKey + name: "My-Key-Header" + in: header diff --git a/tests/asyncapi-2.0/Security Requirement Object/invalid-inexisting-scheme.yaml b/tests/asyncapi-2.0/Security Requirement Object/invalid-inexisting-scheme.yaml new file mode 100644 index 00000000..f8b64e9b --- /dev/null +++ b/tests/asyncapi-2.0/Security Requirement Object/invalid-inexisting-scheme.yaml @@ -0,0 +1,25 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + security: + - foobar: [] + +components: + securitySchemes: + mainSecurity: + type: openIdConnect + openIdConnectUrl: http://foo.com diff --git a/tests/asyncapi-2.0/Security Requirement Object/invalid-oauth2-without-scopes.yaml b/tests/asyncapi-2.0/Security Requirement Object/invalid-oauth2-without-scopes.yaml new file mode 100644 index 00000000..de25e2ae --- /dev/null +++ b/tests/asyncapi-2.0/Security Requirement Object/invalid-oauth2-without-scopes.yaml @@ -0,0 +1,31 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + security: + - mainSecurity: [] + +components: + securitySchemes: + mainSecurity: + type: oauth2 + flows: + implicit: + authorizationUrl: https://example.com/api/oauth/auth + refreshUrl: https://example.com/api/oauth/refresh + scopes: + write:pets: modify pets in your account + read:pets: read your pets diff --git a/tests/asyncapi-2.0/Security Requirement Object/invalid-openIdConnect-without-scopes.yaml b/tests/asyncapi-2.0/Security Requirement Object/invalid-openIdConnect-without-scopes.yaml new file mode 100644 index 00000000..72c7f5c3 --- /dev/null +++ b/tests/asyncapi-2.0/Security Requirement Object/invalid-openIdConnect-without-scopes.yaml @@ -0,0 +1,25 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + security: + - mainSecurity: [] + +components: + securitySchemes: + mainSecurity: + type: openIdConnect + openIdConnectUrl: http://foo.com diff --git a/tests/asyncapi-2.0/Security Requirement Object/invalid-symmetricEncryption-non-empty-array.yaml b/tests/asyncapi-2.0/Security Requirement Object/invalid-symmetricEncryption-non-empty-array.yaml new file mode 100644 index 00000000..d7f22e45 --- /dev/null +++ b/tests/asyncapi-2.0/Security Requirement Object/invalid-symmetricEncryption-non-empty-array.yaml @@ -0,0 +1,25 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + security: + - mainSecurity: + - hello + +components: + securitySchemes: + mainSecurity: + type: symmetricEncryption diff --git a/tests/asyncapi-2.0/Security Requirement Object/invalid-userPassword-non-empty-array.yaml b/tests/asyncapi-2.0/Security Requirement Object/invalid-userPassword-non-empty-array.yaml new file mode 100644 index 00000000..4abf4459 --- /dev/null +++ b/tests/asyncapi-2.0/Security Requirement Object/invalid-userPassword-non-empty-array.yaml @@ -0,0 +1,25 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + security: + - mainSecurity: + - hello + +components: + securitySchemes: + mainSecurity: + type: userPassword diff --git a/tests/asyncapi-2.0/Security Scheme Object/X509/valid.yaml b/tests/asyncapi-2.0/Security Scheme Object/X509/valid.yaml new file mode 100644 index 00000000..391c4859 --- /dev/null +++ b/tests/asyncapi-2.0/Security Scheme Object/X509/valid.yaml @@ -0,0 +1,24 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + security: + - mainSecurity: [] + +components: + securitySchemes: + mainSecurity: + type: X509 diff --git a/tests/asyncapi-2.0/Security Scheme Object/apiKey/invalid-in-value.yaml b/tests/asyncapi-2.0/Security Scheme Object/apiKey/invalid-in-value.yaml new file mode 100644 index 00000000..4ef5396c --- /dev/null +++ b/tests/asyncapi-2.0/Security Scheme Object/apiKey/invalid-in-value.yaml @@ -0,0 +1,29 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + security: + - mainSecurity: [] + - secondarySecurity: [] + +components: + securitySchemes: + mainSecurity: + type: apiKey + in: user + secondarySecurity: + type: apiKey + in: invalidValue diff --git a/tests/asyncapi-2.0/Security Scheme Object/apiKey/invalid-missing-in-property.yaml b/tests/asyncapi-2.0/Security Scheme Object/apiKey/invalid-missing-in-property.yaml new file mode 100644 index 00000000..9cc53859 --- /dev/null +++ b/tests/asyncapi-2.0/Security Scheme Object/apiKey/invalid-missing-in-property.yaml @@ -0,0 +1,28 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + security: + - mainSecurity: [] + - secondarySecurity: [] + +components: + securitySchemes: + mainSecurity: + type: apiKey + in: user + secondarySecurity: + type: apiKey diff --git a/tests/asyncapi-2.0/Security Scheme Object/apiKey/valid.yaml b/tests/asyncapi-2.0/Security Scheme Object/apiKey/valid.yaml new file mode 100644 index 00000000..34dd0c7a --- /dev/null +++ b/tests/asyncapi-2.0/Security Scheme Object/apiKey/valid.yaml @@ -0,0 +1,29 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + security: + - mainSecurity: [] + - secondarySecurity: [] + +components: + securitySchemes: + mainSecurity: + type: apiKey + in: user + secondarySecurity: + type: apiKey + in: password diff --git a/tests/asyncapi-2.0/Security Scheme Object/asymmetricEncryption/valid.yaml b/tests/asyncapi-2.0/Security Scheme Object/asymmetricEncryption/valid.yaml new file mode 100644 index 00000000..fb046bbf --- /dev/null +++ b/tests/asyncapi-2.0/Security Scheme Object/asymmetricEncryption/valid.yaml @@ -0,0 +1,24 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + security: + - mainSecurity: [] + +components: + securitySchemes: + mainSecurity: + type: asymmetricEncryption diff --git a/tests/asyncapi-2.0/Security Scheme Object/http/invalid-missing-scheme.yaml b/tests/asyncapi-2.0/Security Scheme Object/http/invalid-missing-scheme.yaml new file mode 100644 index 00000000..a2b1903e --- /dev/null +++ b/tests/asyncapi-2.0/Security Scheme Object/http/invalid-missing-scheme.yaml @@ -0,0 +1,25 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + security: + - mainSecurity: [] + +components: + securitySchemes: + mainSecurity: + type: http + bearerFormat: a hint diff --git a/tests/asyncapi-2.0/Security Scheme Object/http/valid.yaml b/tests/asyncapi-2.0/Security Scheme Object/http/valid.yaml new file mode 100644 index 00000000..d760a5d5 --- /dev/null +++ b/tests/asyncapi-2.0/Security Scheme Object/http/valid.yaml @@ -0,0 +1,26 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + security: + - mainSecurity: [] + +components: + securitySchemes: + mainSecurity: + type: http + scheme: bearer + bearerFormat: a hint diff --git a/tests/asyncapi-2.0/Security Scheme Object/httpApiKey/invalid-in-value.yaml b/tests/asyncapi-2.0/Security Scheme Object/httpApiKey/invalid-in-value.yaml new file mode 100644 index 00000000..9b43dd50 --- /dev/null +++ b/tests/asyncapi-2.0/Security Scheme Object/httpApiKey/invalid-in-value.yaml @@ -0,0 +1,36 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + security: + - mainSecurity: [] + - secondarySecurity: [] + - thirdSecurity: [] + +components: + securitySchemes: + mainSecurity: + type: httpApiKey + name: "My-Key-Header" + in: header + secondarySecurity: + type: httpApiKey + name: "My-Key-Cookie" + in: cookie + thirdSecurity: + type: httpApiKey + name: "My-Key-Query" + in: invalidValue diff --git a/tests/asyncapi-2.0/Security Scheme Object/httpApiKey/invalid-missing-in-property.yaml b/tests/asyncapi-2.0/Security Scheme Object/httpApiKey/invalid-missing-in-property.yaml new file mode 100644 index 00000000..62880d03 --- /dev/null +++ b/tests/asyncapi-2.0/Security Scheme Object/httpApiKey/invalid-missing-in-property.yaml @@ -0,0 +1,35 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + security: + - mainSecurity: [] + - secondarySecurity: [] + - thirdSecurity: [] + +components: + securitySchemes: + mainSecurity: + type: httpApiKey + name: "My-Key-Header" + in: header + secondarySecurity: + type: httpApiKey + name: "My-Key-Cookie" + in: cookie + thirdSecurity: + type: httpApiKey + name: "My-Key-Query" diff --git a/tests/asyncapi-2.0/Security Scheme Object/httpApiKey/invalid-missing-name.yaml b/tests/asyncapi-2.0/Security Scheme Object/httpApiKey/invalid-missing-name.yaml new file mode 100644 index 00000000..125120aa --- /dev/null +++ b/tests/asyncapi-2.0/Security Scheme Object/httpApiKey/invalid-missing-name.yaml @@ -0,0 +1,35 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + security: + - mainSecurity: [] + - secondarySecurity: [] + - thirdSecurity: [] + +components: + securitySchemes: + mainSecurity: + type: httpApiKey + name: "My-Key-Header" + in: header + secondarySecurity: + type: httpApiKey + name: "My-Key-Cookie" + in: cookie + thirdSecurity: + type: httpApiKey + in: query diff --git a/tests/asyncapi-2.0/Security Scheme Object/httpApiKey/valid.yaml b/tests/asyncapi-2.0/Security Scheme Object/httpApiKey/valid.yaml new file mode 100644 index 00000000..a9541116 --- /dev/null +++ b/tests/asyncapi-2.0/Security Scheme Object/httpApiKey/valid.yaml @@ -0,0 +1,36 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + security: + - mainSecurity: [] + - secondarySecurity: [] + - thirdSecurity: [] + +components: + securitySchemes: + mainSecurity: + type: httpApiKey + name: "My-Key-Header" + in: header + secondarySecurity: + type: httpApiKey + name: "My-Key-Cookie" + in: cookie + thirdSecurity: + type: httpApiKey + name: "My-Key-Query" + in: query diff --git a/tests/asyncapi-2.0/Security Scheme Object/oauth2/invalid-authorizationUrl-format.yaml b/tests/asyncapi-2.0/Security Scheme Object/oauth2/invalid-authorizationUrl-format.yaml new file mode 100644 index 00000000..6a34a14a --- /dev/null +++ b/tests/asyncapi-2.0/Security Scheme Object/oauth2/invalid-authorizationUrl-format.yaml @@ -0,0 +1,34 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + security: + - mainSecurity: + - write:pets + - read:pets + +components: + securitySchemes: + mainSecurity: + type: oauth2 + flows: + authorizationCode: + authorizationUrl: invalid url + tokenUrl: https://example.com/api/oauth/token + refreshUrl: https://example.com/api/oauth/refresh + scopes: + write:pets: modify pets in your account + read:pets: read your pets diff --git a/tests/asyncapi-2.0/Security Scheme Object/oauth2/invalid-missing-authorizationCode-authrozationUrl.yaml b/tests/asyncapi-2.0/Security Scheme Object/oauth2/invalid-missing-authorizationCode-authrozationUrl.yaml new file mode 100644 index 00000000..2a9ceb94 --- /dev/null +++ b/tests/asyncapi-2.0/Security Scheme Object/oauth2/invalid-missing-authorizationCode-authrozationUrl.yaml @@ -0,0 +1,33 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + security: + - mainSecurity: + - write:pets + - read:pets + +components: + securitySchemes: + mainSecurity: + type: oauth2 + flows: + authorizationCode: + tokenUrl: https://example.com/api/oauth/token + refreshUrl: https://example.com/api/oauth/refresh + scopes: + write:pets: modify pets in your account + read:pets: read your pets diff --git a/tests/asyncapi-2.0/Security Scheme Object/oauth2/invalid-missing-authorizationCode-tokenUrl.yaml b/tests/asyncapi-2.0/Security Scheme Object/oauth2/invalid-missing-authorizationCode-tokenUrl.yaml new file mode 100644 index 00000000..150debc7 --- /dev/null +++ b/tests/asyncapi-2.0/Security Scheme Object/oauth2/invalid-missing-authorizationCode-tokenUrl.yaml @@ -0,0 +1,33 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + security: + - mainSecurity: + - write:pets + - read:pets + +components: + securitySchemes: + mainSecurity: + type: oauth2 + flows: + authorizationCode: + authorizationUrl: https://example.com/api/oauth/auth + refreshUrl: https://example.com/api/oauth/refresh + scopes: + write:pets: modify pets in your account + read:pets: read your pets diff --git a/tests/asyncapi-2.0/Security Scheme Object/oauth2/invalid-missing-clientCredentials-tokenUrl.yaml b/tests/asyncapi-2.0/Security Scheme Object/oauth2/invalid-missing-clientCredentials-tokenUrl.yaml new file mode 100644 index 00000000..94597e24 --- /dev/null +++ b/tests/asyncapi-2.0/Security Scheme Object/oauth2/invalid-missing-clientCredentials-tokenUrl.yaml @@ -0,0 +1,32 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + security: + - mainSecurity: + - write:pets + - read:pets + +components: + securitySchemes: + mainSecurity: + type: oauth2 + flows: + clientCredentials: + refreshUrl: https://example.com/api/oauth/refresh + scopes: + write:pets: modify pets in your account + read:pets: read your pets diff --git a/tests/asyncapi-2.0/Security Scheme Object/oauth2/invalid-missing-flows.yaml b/tests/asyncapi-2.0/Security Scheme Object/oauth2/invalid-missing-flows.yaml new file mode 100644 index 00000000..4229ac6d --- /dev/null +++ b/tests/asyncapi-2.0/Security Scheme Object/oauth2/invalid-missing-flows.yaml @@ -0,0 +1,26 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + security: + - mainSecurity: + - write:pets + - read:pets + +components: + securitySchemes: + mainSecurity: + type: oauth2 diff --git a/tests/asyncapi-2.0/Security Scheme Object/oauth2/invalid-missing-implicit-authorizationUrl.yaml b/tests/asyncapi-2.0/Security Scheme Object/oauth2/invalid-missing-implicit-authorizationUrl.yaml new file mode 100644 index 00000000..96dee30b --- /dev/null +++ b/tests/asyncapi-2.0/Security Scheme Object/oauth2/invalid-missing-implicit-authorizationUrl.yaml @@ -0,0 +1,32 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + security: + - mainSecurity: + - write:pets + - read:pets + +components: + securitySchemes: + mainSecurity: + type: oauth2 + flows: + implicit: + refreshUrl: https://example.com/api/oauth/refresh + scopes: + write:pets: modify pets in your account + read:pets: read your pets diff --git a/tests/asyncapi-2.0/Security Scheme Object/oauth2/invalid-missing-scopes.yaml b/tests/asyncapi-2.0/Security Scheme Object/oauth2/invalid-missing-scopes.yaml new file mode 100644 index 00000000..8e1b36a4 --- /dev/null +++ b/tests/asyncapi-2.0/Security Scheme Object/oauth2/invalid-missing-scopes.yaml @@ -0,0 +1,30 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + security: + - mainSecurity: + - write:pets + - read:pets + +components: + securitySchemes: + mainSecurity: + type: oauth2 + flows: + implicit: + authorizationUrl: https://example.com/api/oauth/auth + refreshUrl: https://example.com/api/oauth/refresh diff --git a/tests/asyncapi-2.0/Security Scheme Object/oauth2/invalid-password-missing-tokenUrl.yaml b/tests/asyncapi-2.0/Security Scheme Object/oauth2/invalid-password-missing-tokenUrl.yaml new file mode 100644 index 00000000..b362e494 --- /dev/null +++ b/tests/asyncapi-2.0/Security Scheme Object/oauth2/invalid-password-missing-tokenUrl.yaml @@ -0,0 +1,32 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + security: + - mainSecurity: + - write:pets + - read:pets + +components: + securitySchemes: + mainSecurity: + type: oauth2 + flows: + password: + refreshUrl: https://example.com/api/oauth/refresh + scopes: + write:pets: modify pets in your account + read:pets: read your pets diff --git a/tests/asyncapi-2.0/Security Scheme Object/oauth2/invalid-refreshUrl-format.yaml b/tests/asyncapi-2.0/Security Scheme Object/oauth2/invalid-refreshUrl-format.yaml new file mode 100644 index 00000000..48dd1da0 --- /dev/null +++ b/tests/asyncapi-2.0/Security Scheme Object/oauth2/invalid-refreshUrl-format.yaml @@ -0,0 +1,34 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + security: + - mainSecurity: + - write:pets + - read:pets + +components: + securitySchemes: + mainSecurity: + type: oauth2 + flows: + authorizationCode: + authorizationUrl: https://example.com/api/oauth/auth + tokenUrl: https://example.com/api/oauth/token + refreshUrl: invalid url + scopes: + write:pets: modify pets in your account + read:pets: read your pets diff --git a/tests/asyncapi-2.0/Security Scheme Object/oauth2/invalid-tokenUrl-format.yaml b/tests/asyncapi-2.0/Security Scheme Object/oauth2/invalid-tokenUrl-format.yaml new file mode 100644 index 00000000..4fa7a67d --- /dev/null +++ b/tests/asyncapi-2.0/Security Scheme Object/oauth2/invalid-tokenUrl-format.yaml @@ -0,0 +1,34 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + security: + - mainSecurity: + - write:pets + - read:pets + +components: + securitySchemes: + mainSecurity: + type: oauth2 + flows: + authorizationCode: + authorizationUrl: https://example.com/api/oauth/auth + tokenUrl: invalid url + refreshUrl: https://example.com/api/oauth/refresh + scopes: + write:pets: modify pets in your account + read:pets: read your pets diff --git a/tests/asyncapi-2.0/Security Scheme Object/oauth2/valid.yaml b/tests/asyncapi-2.0/Security Scheme Object/oauth2/valid.yaml new file mode 100644 index 00000000..c5407272 --- /dev/null +++ b/tests/asyncapi-2.0/Security Scheme Object/oauth2/valid.yaml @@ -0,0 +1,52 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + security: + - mainSecurity: + - write:pets + - read:pets + +components: + securitySchemes: + mainSecurity: + type: oauth2 + flows: + implicit: + authorizationUrl: https://example.com/api/oauth/auth + refreshUrl: https://example.com/api/oauth/refresh + scopes: + write:pets: modify pets in your account + read:pets: read your pets + password: + tokenUrl: https://example.com/api/oauth/token + refreshUrl: https://example.com/api/oauth/refresh + scopes: + write:pets: modify pets in your account + read:pets: read your pets + clientCredentials: + tokenUrl: https://example.com/api/oauth/token + refreshUrl: https://example.com/api/oauth/refresh + scopes: + write:pets: modify pets in your account + read:pets: read your pets + authorizationCode: + authorizationUrl: https://example.com/api/oauth/auth + tokenUrl: https://example.com/api/oauth/token + refreshUrl: https://example.com/api/oauth/refresh + scopes: + write:pets: modify pets in your account + read:pets: read your pets diff --git a/tests/asyncapi-2.0/Security Scheme Object/openIdConnect/valid.yaml b/tests/asyncapi-2.0/Security Scheme Object/openIdConnect/valid.yaml new file mode 100644 index 00000000..142353e9 --- /dev/null +++ b/tests/asyncapi-2.0/Security Scheme Object/openIdConnect/valid.yaml @@ -0,0 +1,27 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + security: + - mainSecurity: + - write:pets + - read:pets + +components: + securitySchemes: + mainSecurity: + type: openIdConnect + openIdConnectUrl: http://foo.com diff --git a/tests/asyncapi-2.0/Security Scheme Object/symmetricEncryption/valid.yaml b/tests/asyncapi-2.0/Security Scheme Object/symmetricEncryption/valid.yaml new file mode 100644 index 00000000..b870d7c9 --- /dev/null +++ b/tests/asyncapi-2.0/Security Scheme Object/symmetricEncryption/valid.yaml @@ -0,0 +1,24 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + security: + - mainSecurity: [] + +components: + securitySchemes: + mainSecurity: + type: symmetricEncryption diff --git a/tests/asyncapi-2.0/Security Scheme Object/userPassword/invalid-missing-type.yaml b/tests/asyncapi-2.0/Security Scheme Object/userPassword/invalid-missing-type.yaml new file mode 100644 index 00000000..7b2005d8 --- /dev/null +++ b/tests/asyncapi-2.0/Security Scheme Object/userPassword/invalid-missing-type.yaml @@ -0,0 +1,24 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + security: + - mainSecurity: [] + +components: + securitySchemes: + mainSecurity: + description: generic security scheme diff --git a/tests/asyncapi-2.0/Security Scheme Object/userPassword/valid.yaml b/tests/asyncapi-2.0/Security Scheme Object/userPassword/valid.yaml new file mode 100644 index 00000000..e7122be8 --- /dev/null +++ b/tests/asyncapi-2.0/Security Scheme Object/userPassword/valid.yaml @@ -0,0 +1,25 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + security: + - mainSecurity: [] + +components: + securitySchemes: + mainSecurity: + type: userPassword + description: generic security scheme diff --git a/tests/asyncapi-2.0/Specification Extensions/valid.yaml b/tests/asyncapi-2.0/Specification Extensions/valid.yaml new file mode 100644 index 00000000..1dc018a1 --- /dev/null +++ b/tests/asyncapi-2.0/Specification Extensions/valid.yaml @@ -0,0 +1,29 @@ +asyncapi: 2.0.0 + +x-internal-id: + identificationSource: http://some.url.co/foo/bar + expirationTimer: 6000 + +externalDocs: + description: Find more info here + url: https://example.com + +tags: + - name: user + description: user signed up + - name: signup + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email From 55eba1e18f6280f24db73d236efd43fede145e3c Mon Sep 17 00:00:00 2001 From: Artem Kostiuk Date: Thu, 16 Jan 2020 13:04:04 +0200 Subject: [PATCH 12/26] Add tests for fields types --- .../Fields Types/invalid-asyncapi-type.yaml | 17 +++++++++ .../Fields Types/invalid-channels-type.yaml | 7 ++++ .../Fields Types/invalid-components-type.yaml | 18 ++++++++++ .../invalid-externalDocs-type.yaml | 18 ++++++++++ .../Fields Types/invalid-id-type.yaml | 19 ++++++++++ .../Fields Types/invalid-info-type.yaml | 14 ++++++++ .../Fields Types/invalid-servers-type.yaml | 18 ++++++++++ .../Fields Types/invalid-tags-type.yaml | 18 ++++++++++ .../invalid-bindingVersion-type.yaml | 29 +++++++++++++++ .../invalid-exchange-autoDelete-type.yaml | 28 +++++++++++++++ .../invalid-exchange-durable-type.yaml | 28 +++++++++++++++ .../invalid-exchange-name-type.yaml | 29 +++++++++++++++ .../invalid-exchange-type-type.yaml | 29 +++++++++++++++ .../Fields Types/invalid-exchange-type.yaml | 23 ++++++++++++ .../invalid-exchange-vhost-type.yaml | 29 +++++++++++++++ .../amqp/Fields Types/invalid-is-type.yaml | 29 +++++++++++++++ .../invalid-queue-autoDelete-type.yaml | 28 +++++++++++++++ .../invalid-queue-durable-type.yaml | 28 +++++++++++++++ .../invalid-queue-exclusive-type.yaml | 28 +++++++++++++++ .../Fields Types/invalid-queue-name-type.yaml | 29 +++++++++++++++ .../amqp/Fields Types/invalid-queue-type.yaml | 23 ++++++++++++ .../invalid-queue-vhost-type.yaml | 29 +++++++++++++++ .../invalid-bindingVersion-type.yaml | 27 ++++++++++++++ .../ws/Fields Types/invalid-headers-type.yaml | 22 ++++++++++++ .../ws/Fields Types/invalid-method-type.yaml | 27 ++++++++++++++ .../ws/Fields Types/invalid-query-type.yaml | 22 ++++++++++++ .../Fields Types/invalid-bindings-type.yaml | 18 ++++++++++ .../invalid-description-type.yaml | 18 ++++++++++ .../Fields Types/invalid-parameters-type.yaml | 18 ++++++++++ .../Fields Types/invalid-publish-type.yaml | 9 +++++ .../Fields Types/invalid-ref-type.yaml | 10 ++++++ .../Fields Types/invalid-subscribe-type.yaml | 9 +++++ .../Fields Types/invalid-channel-type.yaml | 8 +++++ .../Fields Types/invalid-email-type.yaml | 21 +++++++++++ .../Fields Types/invalid-name-type.yaml | 21 +++++++++++ .../Fields Types/invalid-url-type.yaml | 21 +++++++++++ .../Fields Types/invalid-contact-type.yaml | 18 ++++++++++ .../invalid-description-type.yaml | 19 ++++++++++ .../Fields Types/invalid-license-type.yaml | 18 ++++++++++ .../invalid-termsOfService-type.yaml | 19 ++++++++++ .../Fields Types/invalid-title-type.yaml | 19 ++++++++++ .../Fields Types/invalid-version-type.yaml | 19 ++++++++++ .../Fields Types/invalid-name-type.yaml | 20 +++++++++++ .../Fields Types/invalid-url-type.yaml | 20 +++++++++++ .../Fields Types/invalid-bindings-type.yaml | 27 ++++++++++++++ .../invalid-description-type.yaml | 27 ++++++++++++++ .../invalid-externalDocs-type.yaml | 24 +++++++++++++ .../Fields Types/invalid-message-type.yaml | 20 +++++++++++ .../invalid-operationId-type.yaml | 27 ++++++++++++++ .../Fields Types/invalid-summary-type.yaml | 27 ++++++++++++++ .../Fields Types/invalid-tags-type.yaml | 23 ++++++++++++ .../Fields Types/invalid-traits-type.yaml | 27 ++++++++++++++ .../Fields Types/invalid-bindings-type.yaml | 35 +++++++++++++++++++ .../invalid-description-type.yaml | 35 +++++++++++++++++++ .../invalid-externalDocs-type.yaml | 32 +++++++++++++++++ .../invalid-operationId-type.yaml | 35 +++++++++++++++++++ .../Fields Types/invalid-summary-type.yaml | 35 +++++++++++++++++++ .../Fields Types/invalid-tags-type.yaml | 31 ++++++++++++++++ .../invalid-description-type.yaml | 19 ++++++++++ .../Fields Types/invalid-location-type.yaml | 19 ++++++++++ .../Fields Types/invalid-schema-type.yaml | 17 +++++++++ .../Fields Types/invalid-parameter-type.yaml | 13 +++++++ .../invalid-bindingVersion-type.yaml | 28 +++++++++++++++ .../invalid-cleanSession-type.yaml | 27 ++++++++++++++ .../Fields Types/invalid-clientId-type.yaml | 28 +++++++++++++++ .../Fields Types/invalid-keepAlive-type.yaml | 27 ++++++++++++++ .../invalid-lastWill-qos-type.yaml | 28 +++++++++++++++ .../invalid-lastWill-retain-type.yaml | 27 ++++++++++++++ .../invalid-lastWill-topic-type.yaml | 28 +++++++++++++++ .../Fields Types/invalid-lastWill-type.yaml | 24 +++++++++++++ .../mqtt/invalid-extra-properties.yaml | 1 - .../Server Bindings Object/mqtt/valid.yaml | 1 - .../Fields Types/invalid-bindings-type.yaml | 20 +++++++++++ .../invalid-description-type.yaml | 20 +++++++++++ .../Fields Types/invalid-protocol-type.yaml | 20 +++++++++++ .../invalid-protocolVersion-type.yaml | 20 +++++++++++ .../Fields Types/invalid-security-type.yaml | 20 +++++++++++ .../Fields Types/invalid-url-type.yaml | 20 +++++++++++ .../Fields Types/invalid-variables-type.yaml | 20 +++++++++++ .../Fields Types/invalid-default-type.yaml | 35 +++++++++++++++++++ .../invalid-description-type.yaml | 35 +++++++++++++++++++ .../Fields Types/invalid-enum-type.yaml | 32 +++++++++++++++++ .../Fields Types/invalid-examples-type.yaml | 32 +++++++++++++++++ 83 files changed, 1885 insertions(+), 2 deletions(-) create mode 100644 tests/asyncapi-2.0/AsyncAPI Object/Fields Types/invalid-asyncapi-type.yaml create mode 100644 tests/asyncapi-2.0/AsyncAPI Object/Fields Types/invalid-channels-type.yaml create mode 100644 tests/asyncapi-2.0/AsyncAPI Object/Fields Types/invalid-components-type.yaml create mode 100644 tests/asyncapi-2.0/AsyncAPI Object/Fields Types/invalid-externalDocs-type.yaml create mode 100644 tests/asyncapi-2.0/AsyncAPI Object/Fields Types/invalid-id-type.yaml create mode 100644 tests/asyncapi-2.0/AsyncAPI Object/Fields Types/invalid-info-type.yaml create mode 100644 tests/asyncapi-2.0/AsyncAPI Object/Fields Types/invalid-servers-type.yaml create mode 100644 tests/asyncapi-2.0/AsyncAPI Object/Fields Types/invalid-tags-type.yaml create mode 100644 tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-bindingVersion-type.yaml create mode 100644 tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-exchange-autoDelete-type.yaml create mode 100644 tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-exchange-durable-type.yaml create mode 100644 tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-exchange-name-type.yaml create mode 100644 tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-exchange-type-type.yaml create mode 100644 tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-exchange-type.yaml create mode 100644 tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-exchange-vhost-type.yaml create mode 100644 tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-is-type.yaml create mode 100644 tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-queue-autoDelete-type.yaml create mode 100644 tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-queue-durable-type.yaml create mode 100644 tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-queue-exclusive-type.yaml create mode 100644 tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-queue-name-type.yaml create mode 100644 tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-queue-type.yaml create mode 100644 tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-queue-vhost-type.yaml create mode 100644 tests/asyncapi-2.0/Channel Bindings Object/ws/Fields Types/invalid-bindingVersion-type.yaml create mode 100644 tests/asyncapi-2.0/Channel Bindings Object/ws/Fields Types/invalid-headers-type.yaml create mode 100644 tests/asyncapi-2.0/Channel Bindings Object/ws/Fields Types/invalid-method-type.yaml create mode 100644 tests/asyncapi-2.0/Channel Bindings Object/ws/Fields Types/invalid-query-type.yaml create mode 100644 tests/asyncapi-2.0/Channel Item Object/Fields Types/invalid-bindings-type.yaml create mode 100644 tests/asyncapi-2.0/Channel Item Object/Fields Types/invalid-description-type.yaml create mode 100644 tests/asyncapi-2.0/Channel Item Object/Fields Types/invalid-parameters-type.yaml create mode 100644 tests/asyncapi-2.0/Channel Item Object/Fields Types/invalid-publish-type.yaml create mode 100644 tests/asyncapi-2.0/Channel Item Object/Fields Types/invalid-ref-type.yaml create mode 100644 tests/asyncapi-2.0/Channel Item Object/Fields Types/invalid-subscribe-type.yaml create mode 100644 tests/asyncapi-2.0/Channels Object/Fields Types/invalid-channel-type.yaml create mode 100644 tests/asyncapi-2.0/Contact Object/Fields Types/invalid-email-type.yaml create mode 100644 tests/asyncapi-2.0/Contact Object/Fields Types/invalid-name-type.yaml create mode 100644 tests/asyncapi-2.0/Contact Object/Fields Types/invalid-url-type.yaml create mode 100644 tests/asyncapi-2.0/Info Object/Fields Types/invalid-contact-type.yaml create mode 100644 tests/asyncapi-2.0/Info Object/Fields Types/invalid-description-type.yaml create mode 100644 tests/asyncapi-2.0/Info Object/Fields Types/invalid-license-type.yaml create mode 100644 tests/asyncapi-2.0/Info Object/Fields Types/invalid-termsOfService-type.yaml create mode 100644 tests/asyncapi-2.0/Info Object/Fields Types/invalid-title-type.yaml create mode 100644 tests/asyncapi-2.0/Info Object/Fields Types/invalid-version-type.yaml create mode 100644 tests/asyncapi-2.0/License Object/Fields Types/invalid-name-type.yaml create mode 100644 tests/asyncapi-2.0/License Object/Fields Types/invalid-url-type.yaml create mode 100644 tests/asyncapi-2.0/Operation Object/Fields Types/invalid-bindings-type.yaml create mode 100644 tests/asyncapi-2.0/Operation Object/Fields Types/invalid-description-type.yaml create mode 100644 tests/asyncapi-2.0/Operation Object/Fields Types/invalid-externalDocs-type.yaml create mode 100644 tests/asyncapi-2.0/Operation Object/Fields Types/invalid-message-type.yaml create mode 100644 tests/asyncapi-2.0/Operation Object/Fields Types/invalid-operationId-type.yaml create mode 100644 tests/asyncapi-2.0/Operation Object/Fields Types/invalid-summary-type.yaml create mode 100644 tests/asyncapi-2.0/Operation Object/Fields Types/invalid-tags-type.yaml create mode 100644 tests/asyncapi-2.0/Operation Object/Fields Types/invalid-traits-type.yaml create mode 100644 tests/asyncapi-2.0/Operation Trait Object/Fields Types/invalid-bindings-type.yaml create mode 100644 tests/asyncapi-2.0/Operation Trait Object/Fields Types/invalid-description-type.yaml create mode 100644 tests/asyncapi-2.0/Operation Trait Object/Fields Types/invalid-externalDocs-type.yaml create mode 100644 tests/asyncapi-2.0/Operation Trait Object/Fields Types/invalid-operationId-type.yaml create mode 100644 tests/asyncapi-2.0/Operation Trait Object/Fields Types/invalid-summary-type.yaml create mode 100644 tests/asyncapi-2.0/Operation Trait Object/Fields Types/invalid-tags-type.yaml create mode 100644 tests/asyncapi-2.0/Parameter Object/Fields Types/invalid-description-type.yaml create mode 100644 tests/asyncapi-2.0/Parameter Object/Fields Types/invalid-location-type.yaml create mode 100644 tests/asyncapi-2.0/Parameter Object/Fields Types/invalid-schema-type.yaml create mode 100644 tests/asyncapi-2.0/Parameters Object/Fields Types/invalid-parameter-type.yaml create mode 100644 tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-bindingVersion-type.yaml create mode 100644 tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-cleanSession-type.yaml create mode 100644 tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-clientId-type.yaml create mode 100644 tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-keepAlive-type.yaml create mode 100644 tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-qos-type.yaml create mode 100644 tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-retain-type.yaml create mode 100644 tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-topic-type.yaml create mode 100644 tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-type.yaml create mode 100644 tests/asyncapi-2.0/Server Object/Fields Types/invalid-bindings-type.yaml create mode 100644 tests/asyncapi-2.0/Server Object/Fields Types/invalid-description-type.yaml create mode 100644 tests/asyncapi-2.0/Server Object/Fields Types/invalid-protocol-type.yaml create mode 100644 tests/asyncapi-2.0/Server Object/Fields Types/invalid-protocolVersion-type.yaml create mode 100644 tests/asyncapi-2.0/Server Object/Fields Types/invalid-security-type.yaml create mode 100644 tests/asyncapi-2.0/Server Object/Fields Types/invalid-url-type.yaml create mode 100644 tests/asyncapi-2.0/Server Object/Fields Types/invalid-variables-type.yaml create mode 100644 tests/asyncapi-2.0/Server Variable Object/Fields Types/invalid-default-type.yaml create mode 100644 tests/asyncapi-2.0/Server Variable Object/Fields Types/invalid-description-type.yaml create mode 100644 tests/asyncapi-2.0/Server Variable Object/Fields Types/invalid-enum-type.yaml create mode 100644 tests/asyncapi-2.0/Server Variable Object/Fields Types/invalid-examples-type.yaml diff --git a/tests/asyncapi-2.0/AsyncAPI Object/Fields Types/invalid-asyncapi-type.yaml b/tests/asyncapi-2.0/AsyncAPI Object/Fields Types/invalid-asyncapi-type.yaml new file mode 100644 index 00000000..39ba5fd5 --- /dev/null +++ b/tests/asyncapi-2.0/AsyncAPI Object/Fields Types/invalid-asyncapi-type.yaml @@ -0,0 +1,17 @@ +asyncapi: + prop: 1 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/AsyncAPI Object/Fields Types/invalid-channels-type.yaml b/tests/asyncapi-2.0/AsyncAPI Object/Fields Types/invalid-channels-type.yaml new file mode 100644 index 00000000..0144210a --- /dev/null +++ b/tests/asyncapi-2.0/AsyncAPI Object/Fields Types/invalid-channels-type.yaml @@ -0,0 +1,7 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: 123 diff --git a/tests/asyncapi-2.0/AsyncAPI Object/Fields Types/invalid-components-type.yaml b/tests/asyncapi-2.0/AsyncAPI Object/Fields Types/invalid-components-type.yaml new file mode 100644 index 00000000..d0f3849f --- /dev/null +++ b/tests/asyncapi-2.0/AsyncAPI Object/Fields Types/invalid-components-type.yaml @@ -0,0 +1,18 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + +components: 123 diff --git a/tests/asyncapi-2.0/AsyncAPI Object/Fields Types/invalid-externalDocs-type.yaml b/tests/asyncapi-2.0/AsyncAPI Object/Fields Types/invalid-externalDocs-type.yaml new file mode 100644 index 00000000..45fe07fa --- /dev/null +++ b/tests/asyncapi-2.0/AsyncAPI Object/Fields Types/invalid-externalDocs-type.yaml @@ -0,0 +1,18 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + +externalDocs: 123 diff --git a/tests/asyncapi-2.0/AsyncAPI Object/Fields Types/invalid-id-type.yaml b/tests/asyncapi-2.0/AsyncAPI Object/Fields Types/invalid-id-type.yaml new file mode 100644 index 00000000..3d6fd04e --- /dev/null +++ b/tests/asyncapi-2.0/AsyncAPI Object/Fields Types/invalid-id-type.yaml @@ -0,0 +1,19 @@ +asyncapi: 2.0.0 + +id: + prop: 1 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/AsyncAPI Object/Fields Types/invalid-info-type.yaml b/tests/asyncapi-2.0/AsyncAPI Object/Fields Types/invalid-info-type.yaml new file mode 100644 index 00000000..0c894d94 --- /dev/null +++ b/tests/asyncapi-2.0/AsyncAPI Object/Fields Types/invalid-info-type.yaml @@ -0,0 +1,14 @@ +asyncapi: 2.0.0 + +info: 123 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/AsyncAPI Object/Fields Types/invalid-servers-type.yaml b/tests/asyncapi-2.0/AsyncAPI Object/Fields Types/invalid-servers-type.yaml new file mode 100644 index 00000000..bf8aa30c --- /dev/null +++ b/tests/asyncapi-2.0/AsyncAPI Object/Fields Types/invalid-servers-type.yaml @@ -0,0 +1,18 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +servers: 123 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/AsyncAPI Object/Fields Types/invalid-tags-type.yaml b/tests/asyncapi-2.0/AsyncAPI Object/Fields Types/invalid-tags-type.yaml new file mode 100644 index 00000000..b014d9e8 --- /dev/null +++ b/tests/asyncapi-2.0/AsyncAPI Object/Fields Types/invalid-tags-type.yaml @@ -0,0 +1,18 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + +tags: 123 diff --git a/tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-bindingVersion-type.yaml b/tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-bindingVersion-type.yaml new file mode 100644 index 00000000..50aa83c0 --- /dev/null +++ b/tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-bindingVersion-type.yaml @@ -0,0 +1,29 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: string + bindings: + amqp: + is: routingKey + queue: + name: my-queue-name + durable: true + exclusive: true + autoDelete: false + vhost: / + exchange: + name: myExchange + type: topic + durable: true + autoDelete: false + vhost: / + bindingVersion: + prop: 1 diff --git a/tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-exchange-autoDelete-type.yaml b/tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-exchange-autoDelete-type.yaml new file mode 100644 index 00000000..16a1a487 --- /dev/null +++ b/tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-exchange-autoDelete-type.yaml @@ -0,0 +1,28 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: string + bindings: + amqp: + is: routingKey + queue: + name: my-queue-name + durable: true + exclusive: true + autoDelete: false + vhost: / + exchange: + name: myExchange + type: topic + durable: true + autoDelete: qwe + vhost: / + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-exchange-durable-type.yaml b/tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-exchange-durable-type.yaml new file mode 100644 index 00000000..dcdd16ef --- /dev/null +++ b/tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-exchange-durable-type.yaml @@ -0,0 +1,28 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: string + bindings: + amqp: + is: routingKey + queue: + name: my-queue-name + durable: true + exclusive: true + autoDelete: false + vhost: / + exchange: + name: myExchange + type: topic + durable: qwe + autoDelete: false + vhost: / + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-exchange-name-type.yaml b/tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-exchange-name-type.yaml new file mode 100644 index 00000000..9d3efb97 --- /dev/null +++ b/tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-exchange-name-type.yaml @@ -0,0 +1,29 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: string + bindings: + amqp: + is: routingKey + queue: + name: my-queue-name + durable: true + exclusive: true + autoDelete: false + vhost: / + exchange: + name: + prop: 1 + type: topic + durable: true + autoDelete: false + vhost: / + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-exchange-type-type.yaml b/tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-exchange-type-type.yaml new file mode 100644 index 00000000..e749a3a7 --- /dev/null +++ b/tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-exchange-type-type.yaml @@ -0,0 +1,29 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: string + bindings: + amqp: + is: routingKey + queue: + name: my-queue-name + durable: true + exclusive: true + autoDelete: false + vhost: / + exchange: + name: myExchange + type: + prop: 1 + durable: true + autoDelete: false + vhost: / + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-exchange-type.yaml b/tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-exchange-type.yaml new file mode 100644 index 00000000..f9daf6fa --- /dev/null +++ b/tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-exchange-type.yaml @@ -0,0 +1,23 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: string + bindings: + amqp: + is: routingKey + queue: + name: my-queue-name + durable: true + exclusive: true + autoDelete: false + vhost: / + exchange: 123 + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-exchange-vhost-type.yaml b/tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-exchange-vhost-type.yaml new file mode 100644 index 00000000..f2a3c185 --- /dev/null +++ b/tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-exchange-vhost-type.yaml @@ -0,0 +1,29 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: string + bindings: + amqp: + is: routingKey + queue: + name: my-queue-name + durable: true + exclusive: true + autoDelete: false + vhost: / + exchange: + name: myExchange + type: topic + durable: true + autoDelete: false + vhost: + prop: 1 + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-is-type.yaml b/tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-is-type.yaml new file mode 100644 index 00000000..25940f97 --- /dev/null +++ b/tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-is-type.yaml @@ -0,0 +1,29 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: string + bindings: + amqp: + is: + prop: 1 + queue: + name: my-queue-name + durable: true + exclusive: true + autoDelete: false + vhost: / + exchange: + name: myExchange + type: topic + durable: true + autoDelete: false + vhost: / + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-queue-autoDelete-type.yaml b/tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-queue-autoDelete-type.yaml new file mode 100644 index 00000000..24c13e99 --- /dev/null +++ b/tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-queue-autoDelete-type.yaml @@ -0,0 +1,28 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: string + bindings: + amqp: + is: routingKey + queue: + name: my-queue-name + durable: true + exclusive: true + autoDelete: qwe + vhost: / + exchange: + name: myExchange + type: topic + durable: true + autoDelete: false + vhost: / + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-queue-durable-type.yaml b/tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-queue-durable-type.yaml new file mode 100644 index 00000000..7bb205b9 --- /dev/null +++ b/tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-queue-durable-type.yaml @@ -0,0 +1,28 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: string + bindings: + amqp: + is: routingKey + queue: + name: my-queue-name + durable: qwe + exclusive: true + autoDelete: false + vhost: / + exchange: + name: myExchange + type: topic + durable: true + autoDelete: false + vhost: / + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-queue-exclusive-type.yaml b/tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-queue-exclusive-type.yaml new file mode 100644 index 00000000..02cf54c1 --- /dev/null +++ b/tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-queue-exclusive-type.yaml @@ -0,0 +1,28 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: string + bindings: + amqp: + is: routingKey + queue: + name: my-queue-name + durable: true + exclusive: qwe + autoDelete: false + vhost: / + exchange: + name: myExchange + type: topic + durable: true + autoDelete: false + vhost: / + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-queue-name-type.yaml b/tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-queue-name-type.yaml new file mode 100644 index 00000000..c15c3c3d --- /dev/null +++ b/tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-queue-name-type.yaml @@ -0,0 +1,29 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: string + bindings: + amqp: + is: routingKey + queue: + name: + prop: 1 + durable: true + exclusive: true + autoDelete: false + vhost: / + exchange: + name: myExchange + type: topic + durable: true + autoDelete: false + vhost: / + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-queue-type.yaml b/tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-queue-type.yaml new file mode 100644 index 00000000..fc58ae1e --- /dev/null +++ b/tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-queue-type.yaml @@ -0,0 +1,23 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: string + bindings: + amqp: + is: routingKey + queue: 123 + exchange: + name: myExchange + type: topic + durable: true + autoDelete: false + vhost: / + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-queue-vhost-type.yaml b/tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-queue-vhost-type.yaml new file mode 100644 index 00000000..856c8eb1 --- /dev/null +++ b/tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-queue-vhost-type.yaml @@ -0,0 +1,29 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: string + bindings: + amqp: + is: routingKey + queue: + name: my-queue-name + durable: true + exclusive: true + autoDelete: false + vhost: + prop: 1 + exchange: + name: myExchange + type: topic + durable: true + autoDelete: false + vhost: / + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Channel Bindings Object/ws/Fields Types/invalid-bindingVersion-type.yaml b/tests/asyncapi-2.0/Channel Bindings Object/ws/Fields Types/invalid-bindingVersion-type.yaml new file mode 100644 index 00000000..4d77ff09 --- /dev/null +++ b/tests/asyncapi-2.0/Channel Bindings Object/ws/Fields Types/invalid-bindingVersion-type.yaml @@ -0,0 +1,27 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: string + bindings: + ws: + method: GET + query: + type: object + properties: + userId: + type: string + headers: + type: object + properties: + UserType: + type: string + bindingVersion: + prop: 1 diff --git a/tests/asyncapi-2.0/Channel Bindings Object/ws/Fields Types/invalid-headers-type.yaml b/tests/asyncapi-2.0/Channel Bindings Object/ws/Fields Types/invalid-headers-type.yaml new file mode 100644 index 00000000..86982a05 --- /dev/null +++ b/tests/asyncapi-2.0/Channel Bindings Object/ws/Fields Types/invalid-headers-type.yaml @@ -0,0 +1,22 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: string + bindings: + ws: + method: GET + query: + type: object + properties: + userId: + type: string + headers: 123 + bindingVersion: '1.1.1' diff --git a/tests/asyncapi-2.0/Channel Bindings Object/ws/Fields Types/invalid-method-type.yaml b/tests/asyncapi-2.0/Channel Bindings Object/ws/Fields Types/invalid-method-type.yaml new file mode 100644 index 00000000..58a9faf7 --- /dev/null +++ b/tests/asyncapi-2.0/Channel Bindings Object/ws/Fields Types/invalid-method-type.yaml @@ -0,0 +1,27 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: string + bindings: + ws: + method: + prop: 1 + query: + type: object + properties: + userId: + type: string + headers: + type: object + properties: + UserType: + type: string + bindingVersion: '1.1.1' diff --git a/tests/asyncapi-2.0/Channel Bindings Object/ws/Fields Types/invalid-query-type.yaml b/tests/asyncapi-2.0/Channel Bindings Object/ws/Fields Types/invalid-query-type.yaml new file mode 100644 index 00000000..2f4a81c2 --- /dev/null +++ b/tests/asyncapi-2.0/Channel Bindings Object/ws/Fields Types/invalid-query-type.yaml @@ -0,0 +1,22 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: string + bindings: + ws: + method: GET + query: 123 + headers: + type: object + properties: + UserType: + type: string + bindingVersion: '1.1.1' diff --git a/tests/asyncapi-2.0/Channel Item Object/Fields Types/invalid-bindings-type.yaml b/tests/asyncapi-2.0/Channel Item Object/Fields Types/invalid-bindings-type.yaml new file mode 100644 index 00000000..b6c94121 --- /dev/null +++ b/tests/asyncapi-2.0/Channel Item Object/Fields Types/invalid-bindings-type.yaml @@ -0,0 +1,18 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + description: hello + bindings: 123 + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/Channel Item Object/Fields Types/invalid-description-type.yaml b/tests/asyncapi-2.0/Channel Item Object/Fields Types/invalid-description-type.yaml new file mode 100644 index 00000000..68db6edd --- /dev/null +++ b/tests/asyncapi-2.0/Channel Item Object/Fields Types/invalid-description-type.yaml @@ -0,0 +1,18 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + description: + prop: 1 + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/Channel Item Object/Fields Types/invalid-parameters-type.yaml b/tests/asyncapi-2.0/Channel Item Object/Fields Types/invalid-parameters-type.yaml new file mode 100644 index 00000000..139c2050 --- /dev/null +++ b/tests/asyncapi-2.0/Channel Item Object/Fields Types/invalid-parameters-type.yaml @@ -0,0 +1,18 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup/{id}: + description: hello + parameters: 123 + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/Channel Item Object/Fields Types/invalid-publish-type.yaml b/tests/asyncapi-2.0/Channel Item Object/Fields Types/invalid-publish-type.yaml new file mode 100644 index 00000000..d258def8 --- /dev/null +++ b/tests/asyncapi-2.0/Channel Item Object/Fields Types/invalid-publish-type.yaml @@ -0,0 +1,9 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: 123 diff --git a/tests/asyncapi-2.0/Channel Item Object/Fields Types/invalid-ref-type.yaml b/tests/asyncapi-2.0/Channel Item Object/Fields Types/invalid-ref-type.yaml new file mode 100644 index 00000000..bc95d5d5 --- /dev/null +++ b/tests/asyncapi-2.0/Channel Item Object/Fields Types/invalid-ref-type.yaml @@ -0,0 +1,10 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + $ref: + prop: 1 diff --git a/tests/asyncapi-2.0/Channel Item Object/Fields Types/invalid-subscribe-type.yaml b/tests/asyncapi-2.0/Channel Item Object/Fields Types/invalid-subscribe-type.yaml new file mode 100644 index 00000000..234d735d --- /dev/null +++ b/tests/asyncapi-2.0/Channel Item Object/Fields Types/invalid-subscribe-type.yaml @@ -0,0 +1,9 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: 123 diff --git a/tests/asyncapi-2.0/Channels Object/Fields Types/invalid-channel-type.yaml b/tests/asyncapi-2.0/Channels Object/Fields Types/invalid-channel-type.yaml new file mode 100644 index 00000000..4135f8db --- /dev/null +++ b/tests/asyncapi-2.0/Channels Object/Fields Types/invalid-channel-type.yaml @@ -0,0 +1,8 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: 123 diff --git a/tests/asyncapi-2.0/Contact Object/Fields Types/invalid-email-type.yaml b/tests/asyncapi-2.0/Contact Object/Fields Types/invalid-email-type.yaml new file mode 100644 index 00000000..3e399c97 --- /dev/null +++ b/tests/asyncapi-2.0/Contact Object/Fields Types/invalid-email-type.yaml @@ -0,0 +1,21 @@ +asyncapi: 2.0.0 + +info: + title: AsyncAPI Sample App + version: 1.0.1 + contact: + name: API Support + url: http://www.asyncapi.org/support + email: + prop: 1 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/Contact Object/Fields Types/invalid-name-type.yaml b/tests/asyncapi-2.0/Contact Object/Fields Types/invalid-name-type.yaml new file mode 100644 index 00000000..dec0be63 --- /dev/null +++ b/tests/asyncapi-2.0/Contact Object/Fields Types/invalid-name-type.yaml @@ -0,0 +1,21 @@ +asyncapi: 2.0.0 + +info: + title: AsyncAPI Sample App + version: 1.0.1 + contact: + name: + prop: 1 + url: http://www.asyncapi.org/support + email: support@asyncapi.org + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/Contact Object/Fields Types/invalid-url-type.yaml b/tests/asyncapi-2.0/Contact Object/Fields Types/invalid-url-type.yaml new file mode 100644 index 00000000..36474747 --- /dev/null +++ b/tests/asyncapi-2.0/Contact Object/Fields Types/invalid-url-type.yaml @@ -0,0 +1,21 @@ +asyncapi: 2.0.0 + +info: + title: AsyncAPI Sample App + version: 1.0.1 + contact: + name: API Support + url: + prop: 1 + email: support@asyncapi.org + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/Info Object/Fields Types/invalid-contact-type.yaml b/tests/asyncapi-2.0/Info Object/Fields Types/invalid-contact-type.yaml new file mode 100644 index 00000000..d06ce429 --- /dev/null +++ b/tests/asyncapi-2.0/Info Object/Fields Types/invalid-contact-type.yaml @@ -0,0 +1,18 @@ +asyncapi: 2.0.0 + +info: + title: AsyncAPI Sample App + version: 1.0.1 + description: This is a sample server. + contact: 123 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/Info Object/Fields Types/invalid-description-type.yaml b/tests/asyncapi-2.0/Info Object/Fields Types/invalid-description-type.yaml new file mode 100644 index 00000000..e93cc5f7 --- /dev/null +++ b/tests/asyncapi-2.0/Info Object/Fields Types/invalid-description-type.yaml @@ -0,0 +1,19 @@ +asyncapi: 2.0.0 + +info: + title: AsyncAPI Sample App + version: 1.0.1 + description: + prop: 1 + termsOfService: http://asyncapi.org/terms/ + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/Info Object/Fields Types/invalid-license-type.yaml b/tests/asyncapi-2.0/Info Object/Fields Types/invalid-license-type.yaml new file mode 100644 index 00000000..b3f12db1 --- /dev/null +++ b/tests/asyncapi-2.0/Info Object/Fields Types/invalid-license-type.yaml @@ -0,0 +1,18 @@ +asyncapi: 2.0.0 + +info: + title: AsyncAPI Sample App + version: 1.0.1 + description: This is a sample server. + license: 123 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/Info Object/Fields Types/invalid-termsOfService-type.yaml b/tests/asyncapi-2.0/Info Object/Fields Types/invalid-termsOfService-type.yaml new file mode 100644 index 00000000..b005f8da --- /dev/null +++ b/tests/asyncapi-2.0/Info Object/Fields Types/invalid-termsOfService-type.yaml @@ -0,0 +1,19 @@ +asyncapi: 2.0.0 + +info: + title: AsyncAPI Sample App + version: 1.0.1 + description: This is a sample server. + termsOfService: + prop: 1 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/Info Object/Fields Types/invalid-title-type.yaml b/tests/asyncapi-2.0/Info Object/Fields Types/invalid-title-type.yaml new file mode 100644 index 00000000..5f2550fe --- /dev/null +++ b/tests/asyncapi-2.0/Info Object/Fields Types/invalid-title-type.yaml @@ -0,0 +1,19 @@ +asyncapi: 2.0.0 + +info: + title: + prop: 1 + version: 1.0.1 + description: This is a sample server. + termsOfService: http://asyncapi.org/terms/ + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/Info Object/Fields Types/invalid-version-type.yaml b/tests/asyncapi-2.0/Info Object/Fields Types/invalid-version-type.yaml new file mode 100644 index 00000000..6455d576 --- /dev/null +++ b/tests/asyncapi-2.0/Info Object/Fields Types/invalid-version-type.yaml @@ -0,0 +1,19 @@ +asyncapi: 2.0.0 + +info: + title: AsyncAPI Sample App + version: + prop: 1 + description: This is a sample server. + termsOfService: http://asyncapi.org/terms/ + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/License Object/Fields Types/invalid-name-type.yaml b/tests/asyncapi-2.0/License Object/Fields Types/invalid-name-type.yaml new file mode 100644 index 00000000..61fb64c9 --- /dev/null +++ b/tests/asyncapi-2.0/License Object/Fields Types/invalid-name-type.yaml @@ -0,0 +1,20 @@ +asyncapi: 2.0.0 + +info: + title: AsyncAPI Sample App + version: 1.0.1 + license: + name: + prop: 1 + url: http://www.apache.org/licenses/LICENSE-2.0.html + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/License Object/Fields Types/invalid-url-type.yaml b/tests/asyncapi-2.0/License Object/Fields Types/invalid-url-type.yaml new file mode 100644 index 00000000..754a84b6 --- /dev/null +++ b/tests/asyncapi-2.0/License Object/Fields Types/invalid-url-type.yaml @@ -0,0 +1,20 @@ +asyncapi: 2.0.0 + +info: + title: AsyncAPI Sample App + version: 1.0.1 + license: + name: Apache 2.0 + url: + prop: 1 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/Operation Object/Fields Types/invalid-bindings-type.yaml b/tests/asyncapi-2.0/Operation Object/Fields Types/invalid-bindings-type.yaml new file mode 100644 index 00000000..fecbf052 --- /dev/null +++ b/tests/asyncapi-2.0/Operation Object/Fields Types/invalid-bindings-type.yaml @@ -0,0 +1,27 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: user signed up to load some data + message: + payload: + type: object + properties: + email: + type: string + format: email + tags: + - name: user + description: user signed up + - name: signup + externalDocs: + description: Find more info here + url: https://example.com + bindings: 123 diff --git a/tests/asyncapi-2.0/Operation Object/Fields Types/invalid-description-type.yaml b/tests/asyncapi-2.0/Operation Object/Fields Types/invalid-description-type.yaml new file mode 100644 index 00000000..10fd1cb4 --- /dev/null +++ b/tests/asyncapi-2.0/Operation Object/Fields Types/invalid-description-type.yaml @@ -0,0 +1,27 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: + prop: 1 + message: + payload: + type: object + properties: + email: + type: string + format: email + tags: + - name: user + description: user signed up + - name: signup + externalDocs: + description: Find more info here + url: https://example.com diff --git a/tests/asyncapi-2.0/Operation Object/Fields Types/invalid-externalDocs-type.yaml b/tests/asyncapi-2.0/Operation Object/Fields Types/invalid-externalDocs-type.yaml new file mode 100644 index 00000000..7309a471 --- /dev/null +++ b/tests/asyncapi-2.0/Operation Object/Fields Types/invalid-externalDocs-type.yaml @@ -0,0 +1,24 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: user signed up to load some data + message: + payload: + type: object + properties: + email: + type: string + format: email + tags: + - name: user + description: user signed up + - name: signup + externalDocs: 123 diff --git a/tests/asyncapi-2.0/Operation Object/Fields Types/invalid-message-type.yaml b/tests/asyncapi-2.0/Operation Object/Fields Types/invalid-message-type.yaml new file mode 100644 index 00000000..eeb2e340 --- /dev/null +++ b/tests/asyncapi-2.0/Operation Object/Fields Types/invalid-message-type.yaml @@ -0,0 +1,20 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: user signed up to load some data + message: 123 + tags: + - name: user + description: user signed up + - name: signup + externalDocs: + description: Find more info here + url: https://example.com diff --git a/tests/asyncapi-2.0/Operation Object/Fields Types/invalid-operationId-type.yaml b/tests/asyncapi-2.0/Operation Object/Fields Types/invalid-operationId-type.yaml new file mode 100644 index 00000000..b0005e42 --- /dev/null +++ b/tests/asyncapi-2.0/Operation Object/Fields Types/invalid-operationId-type.yaml @@ -0,0 +1,27 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: + prop: 1 + summary: user signed up + description: user signed up to load some data + message: + payload: + type: object + properties: + email: + type: string + format: email + tags: + - name: user + description: user signed up + - name: signup + externalDocs: + description: Find more info here + url: https://example.com diff --git a/tests/asyncapi-2.0/Operation Object/Fields Types/invalid-summary-type.yaml b/tests/asyncapi-2.0/Operation Object/Fields Types/invalid-summary-type.yaml new file mode 100644 index 00000000..70bb052d --- /dev/null +++ b/tests/asyncapi-2.0/Operation Object/Fields Types/invalid-summary-type.yaml @@ -0,0 +1,27 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: + prop: 1 + description: user signed up to load some data + message: + payload: + type: object + properties: + email: + type: string + format: email + tags: + - name: user + description: user signed up + - name: signup + externalDocs: + description: Find more info here + url: https://example.com diff --git a/tests/asyncapi-2.0/Operation Object/Fields Types/invalid-tags-type.yaml b/tests/asyncapi-2.0/Operation Object/Fields Types/invalid-tags-type.yaml new file mode 100644 index 00000000..39e69ab4 --- /dev/null +++ b/tests/asyncapi-2.0/Operation Object/Fields Types/invalid-tags-type.yaml @@ -0,0 +1,23 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: user signed up to load some data + message: + payload: + type: object + properties: + email: + type: string + format: email + tags: 123 + externalDocs: + description: Find more info here + url: https://example.com diff --git a/tests/asyncapi-2.0/Operation Object/Fields Types/invalid-traits-type.yaml b/tests/asyncapi-2.0/Operation Object/Fields Types/invalid-traits-type.yaml new file mode 100644 index 00000000..97b137b0 --- /dev/null +++ b/tests/asyncapi-2.0/Operation Object/Fields Types/invalid-traits-type.yaml @@ -0,0 +1,27 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: user signed up to load some data + message: + payload: + type: object + properties: + email: + type: string + format: email + tags: + - name: user + description: user signed up + - name: signup + externalDocs: + description: Find more info here + url: https://example.com + traits: 123 diff --git a/tests/asyncapi-2.0/Operation Trait Object/Fields Types/invalid-bindings-type.yaml b/tests/asyncapi-2.0/Operation Trait Object/Fields Types/invalid-bindings-type.yaml new file mode 100644 index 00000000..7d96d77d --- /dev/null +++ b/tests/asyncapi-2.0/Operation Trait Object/Fields Types/invalid-bindings-type.yaml @@ -0,0 +1,35 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + traits: + - $ref: "#/components/operationTraits/userSignedUpTrait" + - $ref: "#/components/operationTraits/userSignedUpDescTrait" + +components: + operationTraits: + userSignedUpTrait: + operationId: userSignedUp + tags: + - name: user + description: user signed up + - name: signup + externalDocs: + description: Find more info here + url: https://example.com + summary: hello + userSignedUpDescTrait: + description: user signed up to load some data + bindings: 123 diff --git a/tests/asyncapi-2.0/Operation Trait Object/Fields Types/invalid-description-type.yaml b/tests/asyncapi-2.0/Operation Trait Object/Fields Types/invalid-description-type.yaml new file mode 100644 index 00000000..b00af5b0 --- /dev/null +++ b/tests/asyncapi-2.0/Operation Trait Object/Fields Types/invalid-description-type.yaml @@ -0,0 +1,35 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + traits: + - $ref: "#/components/operationTraits/userSignedUpTrait" + - $ref: "#/components/operationTraits/userSignedUpDescTrait" + +components: + operationTraits: + userSignedUpTrait: + operationId: userSignedUp + tags: + - name: user + description: user signed up + - name: signup + externalDocs: + description: Find more info here + url: https://example.com + summary: user signed up + userSignedUpDescTrait: + description: + prop: 1 diff --git a/tests/asyncapi-2.0/Operation Trait Object/Fields Types/invalid-externalDocs-type.yaml b/tests/asyncapi-2.0/Operation Trait Object/Fields Types/invalid-externalDocs-type.yaml new file mode 100644 index 00000000..7ae54dd7 --- /dev/null +++ b/tests/asyncapi-2.0/Operation Trait Object/Fields Types/invalid-externalDocs-type.yaml @@ -0,0 +1,32 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + traits: + - $ref: "#/components/operationTraits/userSignedUpTrait" + - $ref: "#/components/operationTraits/userSignedUpDescTrait" + +components: + operationTraits: + userSignedUpTrait: + operationId: userSignedUp + tags: + - name: user + description: user signed up + - name: signup + externalDocs: 123 + summary: hello + userSignedUpDescTrait: + description: user signed up to load some data diff --git a/tests/asyncapi-2.0/Operation Trait Object/Fields Types/invalid-operationId-type.yaml b/tests/asyncapi-2.0/Operation Trait Object/Fields Types/invalid-operationId-type.yaml new file mode 100644 index 00000000..f6d37eab --- /dev/null +++ b/tests/asyncapi-2.0/Operation Trait Object/Fields Types/invalid-operationId-type.yaml @@ -0,0 +1,35 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + traits: + - $ref: "#/components/operationTraits/userSignedUpTrait" + - $ref: "#/components/operationTraits/userSignedUpDescTrait" + +components: + operationTraits: + userSignedUpTrait: + operationId: + prop: 1 + tags: + - name: user + description: user signed up + - name: signup + externalDocs: + description: Find more info here + url: https://example.com + summary: user signed up + userSignedUpDescTrait: + description: user signed up to load some data diff --git a/tests/asyncapi-2.0/Operation Trait Object/Fields Types/invalid-summary-type.yaml b/tests/asyncapi-2.0/Operation Trait Object/Fields Types/invalid-summary-type.yaml new file mode 100644 index 00000000..d3ffbc32 --- /dev/null +++ b/tests/asyncapi-2.0/Operation Trait Object/Fields Types/invalid-summary-type.yaml @@ -0,0 +1,35 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + traits: + - $ref: "#/components/operationTraits/userSignedUpTrait" + - $ref: "#/components/operationTraits/userSignedUpDescTrait" + +components: + operationTraits: + userSignedUpTrait: + operationId: userSignedUp + tags: + - name: user + description: user signed up + - name: signup + externalDocs: + description: Find more info here + url: https://example.com + summary: + prop: 1 + userSignedUpDescTrait: + description: user signed up to load some data diff --git a/tests/asyncapi-2.0/Operation Trait Object/Fields Types/invalid-tags-type.yaml b/tests/asyncapi-2.0/Operation Trait Object/Fields Types/invalid-tags-type.yaml new file mode 100644 index 00000000..9ade788e --- /dev/null +++ b/tests/asyncapi-2.0/Operation Trait Object/Fields Types/invalid-tags-type.yaml @@ -0,0 +1,31 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + traits: + - $ref: "#/components/operationTraits/userSignedUpTrait" + - $ref: "#/components/operationTraits/userSignedUpDescTrait" + +components: + operationTraits: + userSignedUpTrait: + operationId: userSignedUp + tags: 123 + externalDocs: + description: Find more info here + url: https://example.com + summary: hello + userSignedUpDescTrait: + description: user signed up to load some data diff --git a/tests/asyncapi-2.0/Parameter Object/Fields Types/invalid-description-type.yaml b/tests/asyncapi-2.0/Parameter Object/Fields Types/invalid-description-type.yaml new file mode 100644 index 00000000..f9690aeb --- /dev/null +++ b/tests/asyncapi-2.0/Parameter Object/Fields Types/invalid-description-type.yaml @@ -0,0 +1,19 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + user/{userId}/signup: + parameters: + userId: + description: + prop: 1 + schema: + type: string + location: $message.payload#/user/id + publish: + message: + payload: + type: string diff --git a/tests/asyncapi-2.0/Parameter Object/Fields Types/invalid-location-type.yaml b/tests/asyncapi-2.0/Parameter Object/Fields Types/invalid-location-type.yaml new file mode 100644 index 00000000..3ccb0124 --- /dev/null +++ b/tests/asyncapi-2.0/Parameter Object/Fields Types/invalid-location-type.yaml @@ -0,0 +1,19 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + user/{userId}/signup: + parameters: + userId: + description: Id of the user. + schema: + type: string + location: + prop: 1 + publish: + message: + payload: + type: string diff --git a/tests/asyncapi-2.0/Parameter Object/Fields Types/invalid-schema-type.yaml b/tests/asyncapi-2.0/Parameter Object/Fields Types/invalid-schema-type.yaml new file mode 100644 index 00000000..19b512ac --- /dev/null +++ b/tests/asyncapi-2.0/Parameter Object/Fields Types/invalid-schema-type.yaml @@ -0,0 +1,17 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + user/{userId}/signup: + parameters: + userId: + description: Id of the user. + schema: 123 + location: $message.payload#/user/id + publish: + message: + payload: + type: string diff --git a/tests/asyncapi-2.0/Parameters Object/Fields Types/invalid-parameter-type.yaml b/tests/asyncapi-2.0/Parameters Object/Fields Types/invalid-parameter-type.yaml new file mode 100644 index 00000000..85491b68 --- /dev/null +++ b/tests/asyncapi-2.0/Parameters Object/Fields Types/invalid-parameter-type.yaml @@ -0,0 +1,13 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + user/{userId}/signup: + parameters: 123 + publish: + message: + payload: + type: string diff --git a/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-bindingVersion-type.yaml b/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-bindingVersion-type.yaml new file mode 100644 index 00000000..4e26ed24 --- /dev/null +++ b/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-bindingVersion-type.yaml @@ -0,0 +1,28 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: mqtt + bindings: + mqtt: + clientId: guest + cleanSession: true + lastWill: + topic: /last-wills + qos: 1 + retain: false + keepAlive: 60 + bindingVersion: + prop: 1 diff --git a/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-cleanSession-type.yaml b/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-cleanSession-type.yaml new file mode 100644 index 00000000..798481c7 --- /dev/null +++ b/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-cleanSession-type.yaml @@ -0,0 +1,27 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: mqtt + bindings: + mqtt: + clientId: guest + cleanSession: 123 + lastWill: + topic: /last-wills + qos: 2 + retain: false + keepAlive: 60 + bindingVersion: 0.1.0 diff --git a/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-clientId-type.yaml b/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-clientId-type.yaml new file mode 100644 index 00000000..5bb8b252 --- /dev/null +++ b/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-clientId-type.yaml @@ -0,0 +1,28 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: mqtt + bindings: + mqtt: + clientId: + prop: 1 + cleanSession: true + lastWill: + topic: /last-wills + qos: 2 + retain: false + keepAlive: 60 + bindingVersion: 0.1.0 diff --git a/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-keepAlive-type.yaml b/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-keepAlive-type.yaml new file mode 100644 index 00000000..a403da68 --- /dev/null +++ b/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-keepAlive-type.yaml @@ -0,0 +1,27 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: mqtt + bindings: + mqtt: + clientId: guest + cleanSession: true + lastWill: + topic: /last-wills + qos: 1 + retain: false + keepAlive: qwe + bindingVersion: 0.1.0 diff --git a/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-qos-type.yaml b/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-qos-type.yaml new file mode 100644 index 00000000..2bfe5a52 --- /dev/null +++ b/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-qos-type.yaml @@ -0,0 +1,28 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: mqtt + bindings: + mqtt: + clientId: guest + cleanSession: true + lastWill: + topic: /last-wills + qos: + prop: 1 + retain: false + keepAlive: 60 + bindingVersion: 0.1.0 diff --git a/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-retain-type.yaml b/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-retain-type.yaml new file mode 100644 index 00000000..73cc5bf6 --- /dev/null +++ b/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-retain-type.yaml @@ -0,0 +1,27 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: mqtt + bindings: + mqtt: + clientId: guest + cleanSession: true + lastWill: + topic: /last-wills + qos: 1 + retain: qwe + keepAlive: 60 + bindingVersion: 0.1.0 diff --git a/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-topic-type.yaml b/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-topic-type.yaml new file mode 100644 index 00000000..cc7843d0 --- /dev/null +++ b/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-topic-type.yaml @@ -0,0 +1,28 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: mqtt + bindings: + mqtt: + clientId: guest + cleanSession: true + lastWill: + topic: + prop: 1 + qos: 2 + retain: false + keepAlive: 60 + bindingVersion: 0.1.0 diff --git a/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-type.yaml b/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-type.yaml new file mode 100644 index 00000000..23c60d55 --- /dev/null +++ b/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-type.yaml @@ -0,0 +1,24 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: mqtt + bindings: + mqtt: + clientId: guest + cleanSession: true + lastWill: 123 + keepAlive: 60 + bindingVersion: 0.1.0 diff --git a/tests/asyncapi-2.0/Server Bindings Object/mqtt/invalid-extra-properties.yaml b/tests/asyncapi-2.0/Server Bindings Object/mqtt/invalid-extra-properties.yaml index 4a1d7af1..674e8b61 100644 --- a/tests/asyncapi-2.0/Server Bindings Object/mqtt/invalid-extra-properties.yaml +++ b/tests/asyncapi-2.0/Server Bindings Object/mqtt/invalid-extra-properties.yaml @@ -23,7 +23,6 @@ servers: lastWill: topic: /last-wills qos: 2 - message: Guest gone offline. retain: false keepAlive: 60 bindingVersion: 0.1.0 diff --git a/tests/asyncapi-2.0/Server Bindings Object/mqtt/valid.yaml b/tests/asyncapi-2.0/Server Bindings Object/mqtt/valid.yaml index 37d5df62..48ff8c0f 100644 --- a/tests/asyncapi-2.0/Server Bindings Object/mqtt/valid.yaml +++ b/tests/asyncapi-2.0/Server Bindings Object/mqtt/valid.yaml @@ -22,7 +22,6 @@ servers: lastWill: topic: /last-wills qos: 2 - message: Guest gone offline. retain: false keepAlive: 60 bindingVersion: 0.1.0 diff --git a/tests/asyncapi-2.0/Server Object/Fields Types/invalid-bindings-type.yaml b/tests/asyncapi-2.0/Server Object/Fields Types/invalid-bindings-type.yaml new file mode 100644 index 00000000..3f35a320 --- /dev/null +++ b/tests/asyncapi-2.0/Server Object/Fields Types/invalid-bindings-type.yaml @@ -0,0 +1,20 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com/{id} + protocol: kafka + protocolVersion: '1.0.0' + description: Development server + bindings: 123 diff --git a/tests/asyncapi-2.0/Server Object/Fields Types/invalid-description-type.yaml b/tests/asyncapi-2.0/Server Object/Fields Types/invalid-description-type.yaml new file mode 100644 index 00000000..73cfcf19 --- /dev/null +++ b/tests/asyncapi-2.0/Server Object/Fields Types/invalid-description-type.yaml @@ -0,0 +1,20 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + protocolVersion: '1.0.0' + description: + prop: 1 diff --git a/tests/asyncapi-2.0/Server Object/Fields Types/invalid-protocol-type.yaml b/tests/asyncapi-2.0/Server Object/Fields Types/invalid-protocol-type.yaml new file mode 100644 index 00000000..85c53525 --- /dev/null +++ b/tests/asyncapi-2.0/Server Object/Fields Types/invalid-protocol-type.yaml @@ -0,0 +1,20 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: + prop: 1 + protocolVersion: '1.0.0' + description: Development server diff --git a/tests/asyncapi-2.0/Server Object/Fields Types/invalid-protocolVersion-type.yaml b/tests/asyncapi-2.0/Server Object/Fields Types/invalid-protocolVersion-type.yaml new file mode 100644 index 00000000..de1c5e51 --- /dev/null +++ b/tests/asyncapi-2.0/Server Object/Fields Types/invalid-protocolVersion-type.yaml @@ -0,0 +1,20 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + protocolVersion: + prop: 1 + description: Development server diff --git a/tests/asyncapi-2.0/Server Object/Fields Types/invalid-security-type.yaml b/tests/asyncapi-2.0/Server Object/Fields Types/invalid-security-type.yaml new file mode 100644 index 00000000..93fdf965 --- /dev/null +++ b/tests/asyncapi-2.0/Server Object/Fields Types/invalid-security-type.yaml @@ -0,0 +1,20 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + protocolVersion: '1.0.0' + description: Development server + security: 123 diff --git a/tests/asyncapi-2.0/Server Object/Fields Types/invalid-url-type.yaml b/tests/asyncapi-2.0/Server Object/Fields Types/invalid-url-type.yaml new file mode 100644 index 00000000..f64c0dd8 --- /dev/null +++ b/tests/asyncapi-2.0/Server Object/Fields Types/invalid-url-type.yaml @@ -0,0 +1,20 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: + prop: 1 + protocol: kafka + protocolVersion: '1.0.0' + description: Development server diff --git a/tests/asyncapi-2.0/Server Object/Fields Types/invalid-variables-type.yaml b/tests/asyncapi-2.0/Server Object/Fields Types/invalid-variables-type.yaml new file mode 100644 index 00000000..8adf5e56 --- /dev/null +++ b/tests/asyncapi-2.0/Server Object/Fields Types/invalid-variables-type.yaml @@ -0,0 +1,20 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com/{id} + protocol: kafka + protocolVersion: '1.0.0' + description: Development server + variables: 123 diff --git a/tests/asyncapi-2.0/Server Variable Object/Fields Types/invalid-default-type.yaml b/tests/asyncapi-2.0/Server Variable Object/Fields Types/invalid-default-type.yaml new file mode 100644 index 00000000..4114218b --- /dev/null +++ b/tests/asyncapi-2.0/Server Variable Object/Fields Types/invalid-default-type.yaml @@ -0,0 +1,35 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + +servers: + production: + url: '{username}.gigantic-server.com:{port}' + description: The production API server + protocol: secure-mqtt + variables: + username: + default: demo + description: Active user name + examples: + - 'admin' + - 'user123' + port: + enum: + - '8883' + - '8884' + default: + prop: 1 diff --git a/tests/asyncapi-2.0/Server Variable Object/Fields Types/invalid-description-type.yaml b/tests/asyncapi-2.0/Server Variable Object/Fields Types/invalid-description-type.yaml new file mode 100644 index 00000000..70851aa0 --- /dev/null +++ b/tests/asyncapi-2.0/Server Variable Object/Fields Types/invalid-description-type.yaml @@ -0,0 +1,35 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + +servers: + production: + url: '{username}.gigantic-server.com:{port}' + description: The production API server + protocol: secure-mqtt + variables: + username: + default: demo + description: + prop: 1 + examples: + - 'admin' + - 'user123' + port: + enum: + - '8883' + - '8884' + default: '8883' diff --git a/tests/asyncapi-2.0/Server Variable Object/Fields Types/invalid-enum-type.yaml b/tests/asyncapi-2.0/Server Variable Object/Fields Types/invalid-enum-type.yaml new file mode 100644 index 00000000..1e111a8c --- /dev/null +++ b/tests/asyncapi-2.0/Server Variable Object/Fields Types/invalid-enum-type.yaml @@ -0,0 +1,32 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + +servers: + production: + url: '{username}.gigantic-server.com:{port}' + description: The production API server + protocol: secure-mqtt + variables: + username: + default: demo + description: Active user name + examples: + - 'admin' + - 'user123' + port: + enum: 123 + default: '8883' diff --git a/tests/asyncapi-2.0/Server Variable Object/Fields Types/invalid-examples-type.yaml b/tests/asyncapi-2.0/Server Variable Object/Fields Types/invalid-examples-type.yaml new file mode 100644 index 00000000..784a95a6 --- /dev/null +++ b/tests/asyncapi-2.0/Server Variable Object/Fields Types/invalid-examples-type.yaml @@ -0,0 +1,32 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + +servers: + production: + url: '{username}.gigantic-server.com:{port}' + description: The production API server + protocol: secure-mqtt + variables: + username: + default: demo + description: Active user name + examples: 123 + port: + enum: + - '8883' + - '8884' + default: '8883' From d398092fd119fd2971e2bbd748737cb186a087fb Mon Sep 17 00:00:00 2001 From: Artem Kostiuk Date: Fri, 17 Jan 2020 09:46:15 +0200 Subject: [PATCH 13/26] Finish adding tests for fields types --- .../Fields Types/invalid- messages-type.yaml | 15 +++++ .../invalid-channelBindings-type.yaml | 15 +++++ .../invalid-correlationIds-type.yaml | 15 +++++ .../invalid-messageBindings-type.yaml | 15 +++++ .../invalid-messageTraits-type.yaml | 15 +++++ .../invalid-operationBindings-type.yaml | 15 +++++ .../invalid-operationTraits-type.yaml | 15 +++++ .../Fields Types/invalid-parameters-type.yaml | 15 +++++ .../Fields Types/invalid-schemas-type.yaml | 15 +++++ .../invalid-securitySchemes-type.yaml | 15 +++++ .../invalid-serverBindings-type.yaml | 15 +++++ .../invalid-messageBindings-key.yaml | 2 +- .../invalid-operationBindings-key.yaml | 2 +- .../invalid-serverBindings-key.yaml | 2 +- .../Components Object/valid-complete.yaml | 6 +- .../invalid-description-type.yaml | 32 +++++++++++ .../Fields Types/invalid-location-type.yaml | 32 +++++++++++ .../invalid-description-type.yaml | 21 +++++++ .../Fields Types/invalid-url-type.yaml | 21 +++++++ .../invalid-bindingVersion-type.yaml | 22 ++++++++ .../invalid-contentEncoding-type.yaml | 22 ++++++++ .../invalid-messageType-type.yaml | 22 ++++++++ .../amqp/invalid-extra-properties.yaml | 2 +- .../Message Bindings Object/amqp/valid.yaml | 2 +- .../invalid-bindingVersion-type.yaml | 26 +++++++++ .../Fields Types/invalid-headers-type.yaml | 20 +++++++ .../http/invalid-extra-properties.yaml | 3 +- .../http/invalid-headers-type.yaml | 3 +- .../Message Bindings Object/http/valid.yaml | 3 +- .../invalid-bindingVersion-type.yaml | 21 +++++++ .../kafka/Fields Types/invalid-key-type.yaml | 21 +++++++ .../invalid-bindingVersion-type.yaml | 20 +++++++ .../Fields Types/invalid-bindings-type.yaml | 50 +++++++++++++++++ .../invalid-contentType-type.yaml | 50 +++++++++++++++++ .../invalid-correlationId-type.yaml | 47 ++++++++++++++++ .../invalid-description-type.yaml | 50 +++++++++++++++++ .../Fields Types/invalid-examples-type.yaml | 45 +++++++++++++++ .../invalid-externalDocs-type.yaml | 47 ++++++++++++++++ .../Fields Types/invalid-headers-type.yaml | 41 ++++++++++++++ .../Fields Types/invalid-name-type.yaml | 50 +++++++++++++++++ .../invalid-schemaFormat-type.yaml | 50 +++++++++++++++++ .../Fields Types/invalid-summary-type.yaml | 50 +++++++++++++++++ .../Fields Types/invalid-tags-type.yaml | 46 +++++++++++++++ .../Fields Types/invalid-title-type.yaml | 50 +++++++++++++++++ .../Fields Types/invalid-traits-type.yaml | 50 +++++++++++++++++ .../Fields Types/invalid-bindings-type.yaml | 56 +++++++++++++++++++ .../invalid-contentType-type.yaml | 56 +++++++++++++++++++ .../invalid-correlationId-type.yaml | 53 ++++++++++++++++++ .../invalid-description-type.yaml | 56 +++++++++++++++++++ .../Fields Types/invalid-examples-type.yaml | 51 +++++++++++++++++ .../invalid-externalDocs-type.yaml | 53 ++++++++++++++++++ .../Fields Types/invalid-headers-type.yaml | 47 ++++++++++++++++ .../invalid-schemaFormat-type.yaml | 56 +++++++++++++++++++ .../Fields Types/invalid-summary-type.yaml | 56 +++++++++++++++++++ .../Fields Types/invalid-tags-type.yaml | 52 +++++++++++++++++ .../Fields Types/invalid-title-type.yaml | 56 +++++++++++++++++++ .../amqp/Fields Types/invalid-ack-type.yaml | 29 ++++++++++ .../amqp/Fields Types/invalid-bcc-type.yaml | 29 ++++++++++ .../invalid-bindingVersion-type.yaml | 30 ++++++++++ .../amqp/Fields Types/invalid-cc-type.yaml | 29 ++++++++++ .../invalid-deliveryMode-type.yaml | 29 ++++++++++ .../Fields Types/invalid-expiration-type.yaml | 29 ++++++++++ .../Fields Types/invalid-mandatory-type.yaml | 29 ++++++++++ .../Fields Types/invalid-priority-type.yaml | 29 ++++++++++ .../Fields Types/invalid-replyTo-type.yaml | 30 ++++++++++ .../Fields Types/invalid-timestamp-type.yaml | 29 ++++++++++ .../Fields Types/invalid-userId-type.yaml | 30 ++++++++++ .../amqp/invalid-deliveryMode-value.yaml | 2 +- .../amqp/invalid-expiration-below-zero.yaml | 2 +- .../amqp/invalid-extra-properties.yaml | 2 +- .../Operation Bindings Object/amqp/valid.yaml | 2 +- .../invalid-bindingVersion-type.yaml | 32 +++++++++++ .../Fields Types/invalid-method-type.yaml | 32 +++++++++++ .../http/Fields Types/invalid-query-type.yaml | 22 ++++++++ .../http/Fields Types/invalid-type-type.yaml | 32 +++++++++++ ...-method.yaml => invalid-method-value.yaml} | 0 ...pe.yaml => invalid-query-schema-type.yaml} | 0 ...alid-type.yaml => invalid-type-value.yaml} | 0 .../invalid-bindingVersion-type.yaml | 22 ++++++++ .../Fields Types/invalid-clientId-type.yaml | 22 ++++++++ .../Fields Types/invalid-groupId-type.yaml | 22 ++++++++ .../invalid-bindingVersion-type.yaml | 22 ++++++++ .../mqtt/Fields Types/invalid-qos-type.yaml | 21 +++++++ .../Fields Types/invalid-retain-type.yaml | 21 +++++++ .../mqtt/invalid-extra-properties.yaml | 2 +- .../mqtt/invalid-qos-value.yaml | 2 +- .../Operation Bindings Object/mqtt/valid.yaml | 2 +- .../Fields Types/invalid-ref-type.yaml | 22 ++++++++ tests/asyncapi-2.0/Reference Object/lib.yaml | 6 +- .../Fields Types/invalid-name-type.yaml | 26 +++++++++ .../invalid-bearerFormat-type.yaml | 27 +++++++++ .../invalid-description-type.yaml | 28 ++++++++++ .../Fields Types/invalid-flows-type.yaml | 27 +++++++++ .../Fields Types/invalid-in-type.yaml | 37 ++++++++++++ .../Fields Types/invalid-name-type.yaml | 37 ++++++++++++ .../invalid-openIdConnectUrl-type.yaml | 28 ++++++++++ .../Fields Types/invalid-scheme-type.yaml | 27 +++++++++ .../Fields Types/invalid-type-type.yaml | 27 +++++++++ .../invalid-authorizationCode-type.yaml | 46 +++++++++++++++ .../invalid-authorizationUrl-type.yaml | 35 ++++++++++++ .../invalid-clientCredentials-type.yaml | 47 ++++++++++++++++ .../Fields Types/invalid-implicit-type.yaml | 47 ++++++++++++++++ .../Fields Types/invalid-password-type.yaml | 47 ++++++++++++++++ .../Fields Types/invalid-refreshUrl-type.yaml | 35 ++++++++++++ .../Fields Types/invalid-scopes-type.yaml | 32 +++++++++++ .../Fields Types/invalid-tokenUrl-type.yaml | 35 ++++++++++++ .../invalid-cleanSession-type.yaml | 2 +- .../Fields Types/invalid-clientId-type.yaml | 2 +- .../Fields Types/invalid-keepAlive-type.yaml | 2 +- .../invalid-lastWill-qos-type.yaml | 2 +- .../invalid-lastWill-retain-type.yaml | 2 +- .../invalid-lastWill-topic-type.yaml | 2 +- .../Fields Types/invalid-lastWill-type.yaml | 2 +- .../mqtt/invalid-extra-properties.yaml | 2 +- .../Server Bindings Object/mqtt/valid.yaml | 2 +- .../invalid-description-type.yaml | 26 +++++++++ .../invalid-externalDocs-type.yaml | 23 ++++++++ .../Fields Types/invalid-name-type.yaml | 26 +++++++++ 118 files changed, 2948 insertions(+), 33 deletions(-) create mode 100644 tests/asyncapi-2.0/Components Object/Fields Types/invalid- messages-type.yaml create mode 100644 tests/asyncapi-2.0/Components Object/Fields Types/invalid-channelBindings-type.yaml create mode 100644 tests/asyncapi-2.0/Components Object/Fields Types/invalid-correlationIds-type.yaml create mode 100644 tests/asyncapi-2.0/Components Object/Fields Types/invalid-messageBindings-type.yaml create mode 100644 tests/asyncapi-2.0/Components Object/Fields Types/invalid-messageTraits-type.yaml create mode 100644 tests/asyncapi-2.0/Components Object/Fields Types/invalid-operationBindings-type.yaml create mode 100644 tests/asyncapi-2.0/Components Object/Fields Types/invalid-operationTraits-type.yaml create mode 100644 tests/asyncapi-2.0/Components Object/Fields Types/invalid-parameters-type.yaml create mode 100644 tests/asyncapi-2.0/Components Object/Fields Types/invalid-schemas-type.yaml create mode 100644 tests/asyncapi-2.0/Components Object/Fields Types/invalid-securitySchemes-type.yaml create mode 100644 tests/asyncapi-2.0/Components Object/Fields Types/invalid-serverBindings-type.yaml create mode 100644 tests/asyncapi-2.0/Correlation ID Object/Fields Types/invalid-description-type.yaml create mode 100644 tests/asyncapi-2.0/Correlation ID Object/Fields Types/invalid-location-type.yaml create mode 100644 tests/asyncapi-2.0/External Documentation Object/Fields Types/invalid-description-type.yaml create mode 100644 tests/asyncapi-2.0/External Documentation Object/Fields Types/invalid-url-type.yaml create mode 100644 tests/asyncapi-2.0/Message Bindings Object/amqp/Fields Types/invalid-bindingVersion-type.yaml create mode 100644 tests/asyncapi-2.0/Message Bindings Object/amqp/Fields Types/invalid-contentEncoding-type.yaml create mode 100644 tests/asyncapi-2.0/Message Bindings Object/amqp/Fields Types/invalid-messageType-type.yaml create mode 100644 tests/asyncapi-2.0/Message Bindings Object/http/Fields Types/invalid-bindingVersion-type.yaml create mode 100644 tests/asyncapi-2.0/Message Bindings Object/http/Fields Types/invalid-headers-type.yaml create mode 100644 tests/asyncapi-2.0/Message Bindings Object/kafka/Fields Types/invalid-bindingVersion-type.yaml create mode 100644 tests/asyncapi-2.0/Message Bindings Object/kafka/Fields Types/invalid-key-type.yaml create mode 100644 tests/asyncapi-2.0/Message Bindings Object/mqtt/Fields Types/invalid-bindingVersion-type.yaml create mode 100644 tests/asyncapi-2.0/Message Object/Fields Types/invalid-bindings-type.yaml create mode 100644 tests/asyncapi-2.0/Message Object/Fields Types/invalid-contentType-type.yaml create mode 100644 tests/asyncapi-2.0/Message Object/Fields Types/invalid-correlationId-type.yaml create mode 100644 tests/asyncapi-2.0/Message Object/Fields Types/invalid-description-type.yaml create mode 100644 tests/asyncapi-2.0/Message Object/Fields Types/invalid-examples-type.yaml create mode 100644 tests/asyncapi-2.0/Message Object/Fields Types/invalid-externalDocs-type.yaml create mode 100644 tests/asyncapi-2.0/Message Object/Fields Types/invalid-headers-type.yaml create mode 100644 tests/asyncapi-2.0/Message Object/Fields Types/invalid-name-type.yaml create mode 100644 tests/asyncapi-2.0/Message Object/Fields Types/invalid-schemaFormat-type.yaml create mode 100644 tests/asyncapi-2.0/Message Object/Fields Types/invalid-summary-type.yaml create mode 100644 tests/asyncapi-2.0/Message Object/Fields Types/invalid-tags-type.yaml create mode 100644 tests/asyncapi-2.0/Message Object/Fields Types/invalid-title-type.yaml create mode 100644 tests/asyncapi-2.0/Message Object/Fields Types/invalid-traits-type.yaml create mode 100644 tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-bindings-type.yaml create mode 100644 tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-contentType-type.yaml create mode 100644 tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-correlationId-type.yaml create mode 100644 tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-description-type.yaml create mode 100644 tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-examples-type.yaml create mode 100644 tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-externalDocs-type.yaml create mode 100644 tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-headers-type.yaml create mode 100644 tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-schemaFormat-type.yaml create mode 100644 tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-summary-type.yaml create mode 100644 tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-tags-type.yaml create mode 100644 tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-title-type.yaml create mode 100644 tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-ack-type.yaml create mode 100644 tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-bcc-type.yaml create mode 100644 tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-bindingVersion-type.yaml create mode 100644 tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-cc-type.yaml create mode 100644 tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-deliveryMode-type.yaml create mode 100644 tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-expiration-type.yaml create mode 100644 tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-mandatory-type.yaml create mode 100644 tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-priority-type.yaml create mode 100644 tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-replyTo-type.yaml create mode 100644 tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-timestamp-type.yaml create mode 100644 tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-userId-type.yaml create mode 100644 tests/asyncapi-2.0/Operation Bindings Object/http/Fields Types/invalid-bindingVersion-type.yaml create mode 100644 tests/asyncapi-2.0/Operation Bindings Object/http/Fields Types/invalid-method-type.yaml create mode 100644 tests/asyncapi-2.0/Operation Bindings Object/http/Fields Types/invalid-query-type.yaml create mode 100644 tests/asyncapi-2.0/Operation Bindings Object/http/Fields Types/invalid-type-type.yaml rename tests/asyncapi-2.0/Operation Bindings Object/http/{invalid-method.yaml => invalid-method-value.yaml} (100%) rename tests/asyncapi-2.0/Operation Bindings Object/http/{invalid-query-type.yaml => invalid-query-schema-type.yaml} (100%) rename tests/asyncapi-2.0/Operation Bindings Object/http/{invalid-type.yaml => invalid-type-value.yaml} (100%) create mode 100644 tests/asyncapi-2.0/Operation Bindings Object/kafka/Fields Types/invalid-bindingVersion-type.yaml create mode 100644 tests/asyncapi-2.0/Operation Bindings Object/kafka/Fields Types/invalid-clientId-type.yaml create mode 100644 tests/asyncapi-2.0/Operation Bindings Object/kafka/Fields Types/invalid-groupId-type.yaml create mode 100644 tests/asyncapi-2.0/Operation Bindings Object/mqtt/Fields Types/invalid-bindingVersion-type.yaml create mode 100644 tests/asyncapi-2.0/Operation Bindings Object/mqtt/Fields Types/invalid-qos-type.yaml create mode 100644 tests/asyncapi-2.0/Operation Bindings Object/mqtt/Fields Types/invalid-retain-type.yaml create mode 100644 tests/asyncapi-2.0/Reference Object/Fields Types/invalid-ref-type.yaml create mode 100644 tests/asyncapi-2.0/Security Requirement Object/Fields Types/invalid-name-type.yaml create mode 100644 tests/asyncapi-2.0/Security Scheme Object/Fields Types/invalid-bearerFormat-type.yaml create mode 100644 tests/asyncapi-2.0/Security Scheme Object/Fields Types/invalid-description-type.yaml create mode 100644 tests/asyncapi-2.0/Security Scheme Object/Fields Types/invalid-flows-type.yaml create mode 100644 tests/asyncapi-2.0/Security Scheme Object/Fields Types/invalid-in-type.yaml create mode 100644 tests/asyncapi-2.0/Security Scheme Object/Fields Types/invalid-name-type.yaml create mode 100644 tests/asyncapi-2.0/Security Scheme Object/Fields Types/invalid-openIdConnectUrl-type.yaml create mode 100644 tests/asyncapi-2.0/Security Scheme Object/Fields Types/invalid-scheme-type.yaml create mode 100644 tests/asyncapi-2.0/Security Scheme Object/Fields Types/invalid-type-type.yaml create mode 100644 tests/asyncapi-2.0/Security Scheme Object/oauth2/Fields Types/invalid-authorizationCode-type.yaml create mode 100644 tests/asyncapi-2.0/Security Scheme Object/oauth2/Fields Types/invalid-authorizationUrl-type.yaml create mode 100644 tests/asyncapi-2.0/Security Scheme Object/oauth2/Fields Types/invalid-clientCredentials-type.yaml create mode 100644 tests/asyncapi-2.0/Security Scheme Object/oauth2/Fields Types/invalid-implicit-type.yaml create mode 100644 tests/asyncapi-2.0/Security Scheme Object/oauth2/Fields Types/invalid-password-type.yaml create mode 100644 tests/asyncapi-2.0/Security Scheme Object/oauth2/Fields Types/invalid-refreshUrl-type.yaml create mode 100644 tests/asyncapi-2.0/Security Scheme Object/oauth2/Fields Types/invalid-scopes-type.yaml create mode 100644 tests/asyncapi-2.0/Security Scheme Object/oauth2/Fields Types/invalid-tokenUrl-type.yaml create mode 100644 tests/asyncapi-2.0/Tag Object/Fields Types/invalid-description-type.yaml create mode 100644 tests/asyncapi-2.0/Tag Object/Fields Types/invalid-externalDocs-type.yaml create mode 100644 tests/asyncapi-2.0/Tag Object/Fields Types/invalid-name-type.yaml diff --git a/tests/asyncapi-2.0/Components Object/Fields Types/invalid- messages-type.yaml b/tests/asyncapi-2.0/Components Object/Fields Types/invalid- messages-type.yaml new file mode 100644 index 00000000..9e8f473c --- /dev/null +++ b/tests/asyncapi-2.0/Components Object/Fields Types/invalid- messages-type.yaml @@ -0,0 +1,15 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +components: + messages: 123 diff --git a/tests/asyncapi-2.0/Components Object/Fields Types/invalid-channelBindings-type.yaml b/tests/asyncapi-2.0/Components Object/Fields Types/invalid-channelBindings-type.yaml new file mode 100644 index 00000000..2a7eae49 --- /dev/null +++ b/tests/asyncapi-2.0/Components Object/Fields Types/invalid-channelBindings-type.yaml @@ -0,0 +1,15 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +components: + channelBindings: 123 diff --git a/tests/asyncapi-2.0/Components Object/Fields Types/invalid-correlationIds-type.yaml b/tests/asyncapi-2.0/Components Object/Fields Types/invalid-correlationIds-type.yaml new file mode 100644 index 00000000..a198c3c7 --- /dev/null +++ b/tests/asyncapi-2.0/Components Object/Fields Types/invalid-correlationIds-type.yaml @@ -0,0 +1,15 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +components: + correlationIds: 123 diff --git a/tests/asyncapi-2.0/Components Object/Fields Types/invalid-messageBindings-type.yaml b/tests/asyncapi-2.0/Components Object/Fields Types/invalid-messageBindings-type.yaml new file mode 100644 index 00000000..ee0b3d28 --- /dev/null +++ b/tests/asyncapi-2.0/Components Object/Fields Types/invalid-messageBindings-type.yaml @@ -0,0 +1,15 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +components: + messageBindings: 123 diff --git a/tests/asyncapi-2.0/Components Object/Fields Types/invalid-messageTraits-type.yaml b/tests/asyncapi-2.0/Components Object/Fields Types/invalid-messageTraits-type.yaml new file mode 100644 index 00000000..d912e6aa --- /dev/null +++ b/tests/asyncapi-2.0/Components Object/Fields Types/invalid-messageTraits-type.yaml @@ -0,0 +1,15 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +components: + messageTraits: 123 diff --git a/tests/asyncapi-2.0/Components Object/Fields Types/invalid-operationBindings-type.yaml b/tests/asyncapi-2.0/Components Object/Fields Types/invalid-operationBindings-type.yaml new file mode 100644 index 00000000..53dc317e --- /dev/null +++ b/tests/asyncapi-2.0/Components Object/Fields Types/invalid-operationBindings-type.yaml @@ -0,0 +1,15 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +components: + operationBindings: 123 diff --git a/tests/asyncapi-2.0/Components Object/Fields Types/invalid-operationTraits-type.yaml b/tests/asyncapi-2.0/Components Object/Fields Types/invalid-operationTraits-type.yaml new file mode 100644 index 00000000..ace3b205 --- /dev/null +++ b/tests/asyncapi-2.0/Components Object/Fields Types/invalid-operationTraits-type.yaml @@ -0,0 +1,15 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +components: + operationTraits: 123 diff --git a/tests/asyncapi-2.0/Components Object/Fields Types/invalid-parameters-type.yaml b/tests/asyncapi-2.0/Components Object/Fields Types/invalid-parameters-type.yaml new file mode 100644 index 00000000..376a0b3c --- /dev/null +++ b/tests/asyncapi-2.0/Components Object/Fields Types/invalid-parameters-type.yaml @@ -0,0 +1,15 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +components: + parameters: 123 diff --git a/tests/asyncapi-2.0/Components Object/Fields Types/invalid-schemas-type.yaml b/tests/asyncapi-2.0/Components Object/Fields Types/invalid-schemas-type.yaml new file mode 100644 index 00000000..ef15d710 --- /dev/null +++ b/tests/asyncapi-2.0/Components Object/Fields Types/invalid-schemas-type.yaml @@ -0,0 +1,15 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +components: + schemas: 123 diff --git a/tests/asyncapi-2.0/Components Object/Fields Types/invalid-securitySchemes-type.yaml b/tests/asyncapi-2.0/Components Object/Fields Types/invalid-securitySchemes-type.yaml new file mode 100644 index 00000000..87581e29 --- /dev/null +++ b/tests/asyncapi-2.0/Components Object/Fields Types/invalid-securitySchemes-type.yaml @@ -0,0 +1,15 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +components: + securitySchemes: 123 diff --git a/tests/asyncapi-2.0/Components Object/Fields Types/invalid-serverBindings-type.yaml b/tests/asyncapi-2.0/Components Object/Fields Types/invalid-serverBindings-type.yaml new file mode 100644 index 00000000..a4005c99 --- /dev/null +++ b/tests/asyncapi-2.0/Components Object/Fields Types/invalid-serverBindings-type.yaml @@ -0,0 +1,15 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +components: + serverBindings: 123 diff --git a/tests/asyncapi-2.0/Components Object/invalid-messageBindings-key.yaml b/tests/asyncapi-2.0/Components Object/invalid-messageBindings-key.yaml index bd0bf262..92cab67f 100644 --- a/tests/asyncapi-2.0/Components Object/invalid-messageBindings-key.yaml +++ b/tests/asyncapi-2.0/Components Object/invalid-messageBindings-key.yaml @@ -21,4 +21,4 @@ components: amqp: contentEncoding: gzip messageType: 'user.signup' - bindingVersion: 0.1.0 + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Components Object/invalid-operationBindings-key.yaml b/tests/asyncapi-2.0/Components Object/invalid-operationBindings-key.yaml index 956bdad9..37af3c0c 100644 --- a/tests/asyncapi-2.0/Components Object/invalid-operationBindings-key.yaml +++ b/tests/asyncapi-2.0/Components Object/invalid-operationBindings-key.yaml @@ -29,4 +29,4 @@ components: replyTo: user.signedup timestamp: true ack: false - bindingVersion: 0.1.0 + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Components Object/invalid-serverBindings-key.yaml b/tests/asyncapi-2.0/Components Object/invalid-serverBindings-key.yaml index ea43d5c1..dcb383c4 100644 --- a/tests/asyncapi-2.0/Components Object/invalid-serverBindings-key.yaml +++ b/tests/asyncapi-2.0/Components Object/invalid-serverBindings-key.yaml @@ -27,4 +27,4 @@ components: message: Guest gone offline. retain: false keepAlive: 60 - bindingVersion: 0.1.0 + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Components Object/valid-complete.yaml b/tests/asyncapi-2.0/Components Object/valid-complete.yaml index 194e6510..5f2ad1a1 100644 --- a/tests/asyncapi-2.0/Components Object/valid-complete.yaml +++ b/tests/asyncapi-2.0/Components Object/valid-complete.yaml @@ -109,7 +109,7 @@ components: message: Guest gone offline. retain: false keepAlive: 60 - bindingVersion: 0.1.0 + bindingVersion: '0.1.0' channelBindings: myChannelBindings: amqp: @@ -140,10 +140,10 @@ components: replyTo: user.signedup timestamp: true ack: false - bindingVersion: 0.1.0 + bindingVersion: '0.1.0' messageBindings: myMessageBindings: amqp: contentEncoding: gzip messageType: 'user.signup' - bindingVersion: 0.1.0 + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Correlation ID Object/Fields Types/invalid-description-type.yaml b/tests/asyncapi-2.0/Correlation ID Object/Fields Types/invalid-description-type.yaml new file mode 100644 index 00000000..70ad8437 --- /dev/null +++ b/tests/asyncapi-2.0/Correlation ID Object/Fields Types/invalid-description-type.yaml @@ -0,0 +1,32 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: user signed up to load some data + message: + name: UserSignup + title: User signup + contentType: application/json + schemaFormat: application/vnd.oai.openapi;version=3.0.0 + correlationId: + $ref: "#/components/correlationIds/userSignedUpCorId" + payload: + type: object + properties: + email: + type: string + format: email + +components: + correlationIds: + userSignedUpCorId: + description: + prop: 1 + location: $message.header#/correlationId diff --git a/tests/asyncapi-2.0/Correlation ID Object/Fields Types/invalid-location-type.yaml b/tests/asyncapi-2.0/Correlation ID Object/Fields Types/invalid-location-type.yaml new file mode 100644 index 00000000..40b7044f --- /dev/null +++ b/tests/asyncapi-2.0/Correlation ID Object/Fields Types/invalid-location-type.yaml @@ -0,0 +1,32 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: user signed up to load some data + message: + name: UserSignup + title: User signup + contentType: application/json + schemaFormat: application/vnd.oai.openapi;version=3.0.0 + correlationId: + $ref: "#/components/correlationIds/userSignedUpCorId" + payload: + type: object + properties: + email: + type: string + format: email + +components: + correlationIds: + userSignedUpCorId: + description: Default Correlation ID + location: + prop: 1 diff --git a/tests/asyncapi-2.0/External Documentation Object/Fields Types/invalid-description-type.yaml b/tests/asyncapi-2.0/External Documentation Object/Fields Types/invalid-description-type.yaml new file mode 100644 index 00000000..682a80f8 --- /dev/null +++ b/tests/asyncapi-2.0/External Documentation Object/Fields Types/invalid-description-type.yaml @@ -0,0 +1,21 @@ +asyncapi: 2.0.0 + +externalDocs: + description: + prop: 1 + url: https://example.com + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/External Documentation Object/Fields Types/invalid-url-type.yaml b/tests/asyncapi-2.0/External Documentation Object/Fields Types/invalid-url-type.yaml new file mode 100644 index 00000000..e7d67b90 --- /dev/null +++ b/tests/asyncapi-2.0/External Documentation Object/Fields Types/invalid-url-type.yaml @@ -0,0 +1,21 @@ +asyncapi: 2.0.0 + +externalDocs: + description: Find more info here + url: + prop: 1 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/Message Bindings Object/amqp/Fields Types/invalid-bindingVersion-type.yaml b/tests/asyncapi-2.0/Message Bindings Object/amqp/Fields Types/invalid-bindingVersion-type.yaml new file mode 100644 index 00000000..4f61df1b --- /dev/null +++ b/tests/asyncapi-2.0/Message Bindings Object/amqp/Fields Types/invalid-bindingVersion-type.yaml @@ -0,0 +1,22 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: object + properties: + email: + type: string + format: email + bindings: + amqp: + contentEncoding: gzip + messageType: 'user.signup' + bindingVersion: + prop: 1 diff --git a/tests/asyncapi-2.0/Message Bindings Object/amqp/Fields Types/invalid-contentEncoding-type.yaml b/tests/asyncapi-2.0/Message Bindings Object/amqp/Fields Types/invalid-contentEncoding-type.yaml new file mode 100644 index 00000000..ac14dff9 --- /dev/null +++ b/tests/asyncapi-2.0/Message Bindings Object/amqp/Fields Types/invalid-contentEncoding-type.yaml @@ -0,0 +1,22 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: object + properties: + email: + type: string + format: email + bindings: + amqp: + contentEncoding: + prop: 1 + messageType: 'user.signup' + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Message Bindings Object/amqp/Fields Types/invalid-messageType-type.yaml b/tests/asyncapi-2.0/Message Bindings Object/amqp/Fields Types/invalid-messageType-type.yaml new file mode 100644 index 00000000..bcee1c98 --- /dev/null +++ b/tests/asyncapi-2.0/Message Bindings Object/amqp/Fields Types/invalid-messageType-type.yaml @@ -0,0 +1,22 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: object + properties: + email: + type: string + format: email + bindings: + amqp: + contentEncoding: gzip + messageType: + prop: 1 + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Message Bindings Object/amqp/invalid-extra-properties.yaml b/tests/asyncapi-2.0/Message Bindings Object/amqp/invalid-extra-properties.yaml index 936f1768..7bed1c3c 100644 --- a/tests/asyncapi-2.0/Message Bindings Object/amqp/invalid-extra-properties.yaml +++ b/tests/asyncapi-2.0/Message Bindings Object/amqp/invalid-extra-properties.yaml @@ -19,4 +19,4 @@ channels: hello: 1 contentEncoding: gzip messageType: 'user.signup' - bindingVersion: 0.1.0 + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Message Bindings Object/amqp/valid.yaml b/tests/asyncapi-2.0/Message Bindings Object/amqp/valid.yaml index b724e621..6d60c166 100644 --- a/tests/asyncapi-2.0/Message Bindings Object/amqp/valid.yaml +++ b/tests/asyncapi-2.0/Message Bindings Object/amqp/valid.yaml @@ -18,4 +18,4 @@ channels: amqp: contentEncoding: gzip messageType: 'user.signup' - bindingVersion: 0.1.0 + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Message Bindings Object/http/Fields Types/invalid-bindingVersion-type.yaml b/tests/asyncapi-2.0/Message Bindings Object/http/Fields Types/invalid-bindingVersion-type.yaml new file mode 100644 index 00000000..dc036314 --- /dev/null +++ b/tests/asyncapi-2.0/Message Bindings Object/http/Fields Types/invalid-bindingVersion-type.yaml @@ -0,0 +1,26 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: object + properties: + email: + type: string + format: email + bindings: + http: + headers: + type: object + properties: + Content-Type: + type: string + enum: ['application/json'] + bindingVersion: + prop: 1 diff --git a/tests/asyncapi-2.0/Message Bindings Object/http/Fields Types/invalid-headers-type.yaml b/tests/asyncapi-2.0/Message Bindings Object/http/Fields Types/invalid-headers-type.yaml new file mode 100644 index 00000000..9b92b4f7 --- /dev/null +++ b/tests/asyncapi-2.0/Message Bindings Object/http/Fields Types/invalid-headers-type.yaml @@ -0,0 +1,20 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: object + properties: + email: + type: string + format: email + bindings: + http: + headers: 123 + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Message Bindings Object/http/invalid-extra-properties.yaml b/tests/asyncapi-2.0/Message Bindings Object/http/invalid-extra-properties.yaml index b85acfb3..b7858756 100644 --- a/tests/asyncapi-2.0/Message Bindings Object/http/invalid-extra-properties.yaml +++ b/tests/asyncapi-2.0/Message Bindings Object/http/invalid-extra-properties.yaml @@ -23,5 +23,4 @@ channels: Content-Type: type: string enum: ['application/json'] - meta: - version: '0.1.0' + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Message Bindings Object/http/invalid-headers-type.yaml b/tests/asyncapi-2.0/Message Bindings Object/http/invalid-headers-type.yaml index 9368c28d..a88e6b70 100644 --- a/tests/asyncapi-2.0/Message Bindings Object/http/invalid-headers-type.yaml +++ b/tests/asyncapi-2.0/Message Bindings Object/http/invalid-headers-type.yaml @@ -18,5 +18,4 @@ channels: http: headers: type: string - meta: - version: '0.1.0' + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Message Bindings Object/http/valid.yaml b/tests/asyncapi-2.0/Message Bindings Object/http/valid.yaml index 7517b7e2..382ed48f 100644 --- a/tests/asyncapi-2.0/Message Bindings Object/http/valid.yaml +++ b/tests/asyncapi-2.0/Message Bindings Object/http/valid.yaml @@ -22,5 +22,4 @@ channels: Content-Type: type: string enum: ['application/json'] - meta: - version: '0.1.0' + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Message Bindings Object/kafka/Fields Types/invalid-bindingVersion-type.yaml b/tests/asyncapi-2.0/Message Bindings Object/kafka/Fields Types/invalid-bindingVersion-type.yaml new file mode 100644 index 00000000..ae1ed134 --- /dev/null +++ b/tests/asyncapi-2.0/Message Bindings Object/kafka/Fields Types/invalid-bindingVersion-type.yaml @@ -0,0 +1,21 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: object + properties: + email: + type: string + format: email + bindings: + kafka: + key: myKey + bindingVersion: + prop: 1 diff --git a/tests/asyncapi-2.0/Message Bindings Object/kafka/Fields Types/invalid-key-type.yaml b/tests/asyncapi-2.0/Message Bindings Object/kafka/Fields Types/invalid-key-type.yaml new file mode 100644 index 00000000..37b9ad37 --- /dev/null +++ b/tests/asyncapi-2.0/Message Bindings Object/kafka/Fields Types/invalid-key-type.yaml @@ -0,0 +1,21 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: object + properties: + email: + type: string + format: email + bindings: + kafka: + key: + prop: 1 + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Message Bindings Object/mqtt/Fields Types/invalid-bindingVersion-type.yaml b/tests/asyncapi-2.0/Message Bindings Object/mqtt/Fields Types/invalid-bindingVersion-type.yaml new file mode 100644 index 00000000..1611b209 --- /dev/null +++ b/tests/asyncapi-2.0/Message Bindings Object/mqtt/Fields Types/invalid-bindingVersion-type.yaml @@ -0,0 +1,20 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: object + properties: + email: + type: string + format: email + bindings: + mqtt: + bindingVersion: + prop: 1 diff --git a/tests/asyncapi-2.0/Message Object/Fields Types/invalid-bindings-type.yaml b/tests/asyncapi-2.0/Message Object/Fields Types/invalid-bindings-type.yaml new file mode 100644 index 00000000..6cabcde5 --- /dev/null +++ b/tests/asyncapi-2.0/Message Object/Fields Types/invalid-bindings-type.yaml @@ -0,0 +1,50 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: user signed up to load some data + message: + name: UserSignup + title: User signup + summary: qwe + description: qwe + contentType: application/json + schemaFormat: application/vnd.oai.openapi;version=3.0.0 + correlationId: + description: Default Correlation ID + location: $message.header#/correlationId + headers: qwe + type: object + properties: + correlationId: + description: Correlation ID set by application + type: string + applicationInstanceId: + description: Unique identifier for a given instance of the publishing application + type: string + tags: + - name: user + description: user signed up + - name: signup + bindings: 123 + externalDocs: + description: Find more info here + url: https://example.com + payload: + type: object + properties: + email: + type: string + format: email + examples: + - one: + email: hello@foo.bar + - two: + email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Object/Fields Types/invalid-contentType-type.yaml b/tests/asyncapi-2.0/Message Object/Fields Types/invalid-contentType-type.yaml new file mode 100644 index 00000000..cae15bdc --- /dev/null +++ b/tests/asyncapi-2.0/Message Object/Fields Types/invalid-contentType-type.yaml @@ -0,0 +1,50 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: user signed up to load some data + message: + name: UserSignup + title: User signup + summary: Action to sign a user up. + description: A longer description + contentType: + prop: 1 + schemaFormat: application/vnd.oai.openapi;version=3.0.0 + correlationId: + description: Default Correlation ID + location: $message.header#/correlationId + headers: qwe + type: object + properties: + correlationId: + description: Correlation ID set by application + type: string + applicationInstanceId: + description: Unique identifier for a given instance of the publishing application + type: string + tags: + - name: user + description: user signed up + - name: signup + externalDocs: + description: Find more info here + url: https://example.com + payload: + type: object + properties: + email: + type: string + format: email + examples: + - one: + email: hello@foo.bar + - two: + email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Object/Fields Types/invalid-correlationId-type.yaml b/tests/asyncapi-2.0/Message Object/Fields Types/invalid-correlationId-type.yaml new file mode 100644 index 00000000..84e07d96 --- /dev/null +++ b/tests/asyncapi-2.0/Message Object/Fields Types/invalid-correlationId-type.yaml @@ -0,0 +1,47 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: user signed up to load some data + message: + name: UserSignup + title: User signup + summary: Action to sign a user up. + description: A longer description + contentType: application/json + schemaFormat: application/vnd.oai.openapi;version=3.0.0 + correlationId: 123 + headers: qwe + type: object + properties: + correlationId: + description: Correlation ID set by application + type: string + applicationInstanceId: + description: Unique identifier for a given instance of the publishing application + type: string + tags: + - name: user + description: user signed up + - name: signup + externalDocs: + description: Find more info here + url: https://example.com + payload: + type: object + properties: + email: + type: string + format: email + examples: + - one: + email: hello@foo.bar + - two: + email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Object/Fields Types/invalid-description-type.yaml b/tests/asyncapi-2.0/Message Object/Fields Types/invalid-description-type.yaml new file mode 100644 index 00000000..d1589b93 --- /dev/null +++ b/tests/asyncapi-2.0/Message Object/Fields Types/invalid-description-type.yaml @@ -0,0 +1,50 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: user signed up to load some data + message: + name: UserSignup + title: User signup + summary: qwe + description: + prop: 1 + contentType: application/json + schemaFormat: application/vnd.oai.openapi;version=3.0.0 + correlationId: + description: Default Correlation ID + location: $message.header#/correlationId + headers: qwe + type: object + properties: + correlationId: + description: Correlation ID set by application + type: string + applicationInstanceId: + description: Unique identifier for a given instance of the publishing application + type: string + tags: + - name: user + description: user signed up + - name: signup + externalDocs: + description: Find more info here + url: https://example.com + payload: + type: object + properties: + email: + type: string + format: email + examples: + - one: + email: hello@foo.bar + - two: + email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Object/Fields Types/invalid-examples-type.yaml b/tests/asyncapi-2.0/Message Object/Fields Types/invalid-examples-type.yaml new file mode 100644 index 00000000..fc2a08eb --- /dev/null +++ b/tests/asyncapi-2.0/Message Object/Fields Types/invalid-examples-type.yaml @@ -0,0 +1,45 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: user signed up to load some data + message: + name: UserSignup + title: User signup + summary: qwe + description: qwe + contentType: application/json + schemaFormat: application/vnd.oai.openapi;version=3.0.0 + correlationId: + description: Default Correlation ID + location: $message.header#/correlationId + headers: qwe + type: object + properties: + correlationId: + description: Correlation ID set by application + type: string + applicationInstanceId: + description: Unique identifier for a given instance of the publishing application + type: string + tags: + - name: user + description: user signed up + - name: signup + externalDocs: + description: Find more info here + url: https://example.com + payload: + type: object + properties: + email: + type: string + format: email + examples: 123 diff --git a/tests/asyncapi-2.0/Message Object/Fields Types/invalid-externalDocs-type.yaml b/tests/asyncapi-2.0/Message Object/Fields Types/invalid-externalDocs-type.yaml new file mode 100644 index 00000000..49348562 --- /dev/null +++ b/tests/asyncapi-2.0/Message Object/Fields Types/invalid-externalDocs-type.yaml @@ -0,0 +1,47 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: user signed up to load some data + message: + name: UserSignup + title: User signup + summary: qwe + description: qwe + contentType: application/json + schemaFormat: application/vnd.oai.openapi;version=3.0.0 + correlationId: + description: Default Correlation ID + location: $message.header#/correlationId + headers: qwe + type: object + properties: + correlationId: + description: Correlation ID set by application + type: string + applicationInstanceId: + description: Unique identifier for a given instance of the publishing application + type: string + tags: + - name: user + description: user signed up + - name: signup + externalDocs: 123 + payload: + type: object + properties: + email: + type: string + format: email + examples: + - one: + email: hello@foo.bar + - two: + email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Object/Fields Types/invalid-headers-type.yaml b/tests/asyncapi-2.0/Message Object/Fields Types/invalid-headers-type.yaml new file mode 100644 index 00000000..123e7722 --- /dev/null +++ b/tests/asyncapi-2.0/Message Object/Fields Types/invalid-headers-type.yaml @@ -0,0 +1,41 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: user signed up to load some data + message: + name: UserSignup + title: User signup + summary: Action to sign a user up. + description: A longer description + contentType: application/json + schemaFormat: application/vnd.oai.openapi;version=3.0.0 + correlationId: + description: Default Correlation ID + location: $message.header#/correlationId + headers: qwe + tags: + - name: user + description: user signed up + - name: signup + externalDocs: + description: Find more info here + url: https://example.com + payload: + type: object + properties: + email: + type: string + format: email + examples: + - one: + email: hello@foo.bar + - two: + email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Object/Fields Types/invalid-name-type.yaml b/tests/asyncapi-2.0/Message Object/Fields Types/invalid-name-type.yaml new file mode 100644 index 00000000..c89c30cc --- /dev/null +++ b/tests/asyncapi-2.0/Message Object/Fields Types/invalid-name-type.yaml @@ -0,0 +1,50 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: user signed up to load some data + message: + name: + prop: 1 + title: User signup + summary: Action to sign a user up. + description: A longer description + contentType: application/json + schemaFormat: application/vnd.oai.openapi;version=3.0.0 + correlationId: + description: Default Correlation ID + location: $message.header#/correlationId + headers: qwe + type: object + properties: + correlationId: + description: Correlation ID set by application + type: string + applicationInstanceId: + description: Unique identifier for a given instance of the publishing application + type: string + tags: + - name: user + description: user signed up + - name: signup + externalDocs: + description: Find more info here + url: https://example.com + payload: + type: object + properties: + email: + type: string + format: email + examples: + - one: + email: hello@foo.bar + - two: + email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Object/Fields Types/invalid-schemaFormat-type.yaml b/tests/asyncapi-2.0/Message Object/Fields Types/invalid-schemaFormat-type.yaml new file mode 100644 index 00000000..0b47b142 --- /dev/null +++ b/tests/asyncapi-2.0/Message Object/Fields Types/invalid-schemaFormat-type.yaml @@ -0,0 +1,50 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: user signed up to load some data + message: + name: UserSignup + title: User signup + summary: Action to sign a user up. + description: A longer description + contentType: application/json + schemaFormat: + prop: 1 + correlationId: + description: Default Correlation ID + location: $message.header#/correlationId + headers: qwe + type: object + properties: + correlationId: + description: Correlation ID set by application + type: string + applicationInstanceId: + description: Unique identifier for a given instance of the publishing application + type: string + tags: + - name: user + description: user signed up + - name: signup + externalDocs: + description: Find more info here + url: https://example.com + payload: + type: object + properties: + email: + type: string + format: email + examples: + - one: + email: hello@foo.bar + - two: + email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Object/Fields Types/invalid-summary-type.yaml b/tests/asyncapi-2.0/Message Object/Fields Types/invalid-summary-type.yaml new file mode 100644 index 00000000..f4ce75ee --- /dev/null +++ b/tests/asyncapi-2.0/Message Object/Fields Types/invalid-summary-type.yaml @@ -0,0 +1,50 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: user signed up to load some data + message: + name: UserSignup + title: User signup + summary: + prop: 1 + description: A longer description + contentType: application/json + schemaFormat: application/vnd.oai.openapi;version=3.0.0 + correlationId: + description: Default Correlation ID + location: $message.header#/correlationId + headers: qwe + type: object + properties: + correlationId: + description: Correlation ID set by application + type: string + applicationInstanceId: + description: Unique identifier for a given instance of the publishing application + type: string + tags: + - name: user + description: user signed up + - name: signup + externalDocs: + description: Find more info here + url: https://example.com + payload: + type: object + properties: + email: + type: string + format: email + examples: + - one: + email: hello@foo.bar + - two: + email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Object/Fields Types/invalid-tags-type.yaml b/tests/asyncapi-2.0/Message Object/Fields Types/invalid-tags-type.yaml new file mode 100644 index 00000000..b0cf9d53 --- /dev/null +++ b/tests/asyncapi-2.0/Message Object/Fields Types/invalid-tags-type.yaml @@ -0,0 +1,46 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: user signed up to load some data + message: + name: UserSignup + title: User signup + summary: qwe + description: qwe + contentType: application/json + schemaFormat: application/vnd.oai.openapi;version=3.0.0 + correlationId: + description: Default Correlation ID + location: $message.header#/correlationId + headers: qwe + type: object + properties: + correlationId: + description: Correlation ID set by application + type: string + applicationInstanceId: + description: Unique identifier for a given instance of the publishing application + type: string + tags: 123 + externalDocs: + description: Find more info here + url: https://example.com + payload: + type: object + properties: + email: + type: string + format: email + examples: + - one: + email: hello@foo.bar + - two: + email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Object/Fields Types/invalid-title-type.yaml b/tests/asyncapi-2.0/Message Object/Fields Types/invalid-title-type.yaml new file mode 100644 index 00000000..57dd1dfc --- /dev/null +++ b/tests/asyncapi-2.0/Message Object/Fields Types/invalid-title-type.yaml @@ -0,0 +1,50 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: user signed up to load some data + message: + name: UserSignup + title: + prop: 1 + summary: Action to sign a user up. + description: A longer description + contentType: application/json + schemaFormat: application/vnd.oai.openapi;version=3.0.0 + correlationId: + description: Default Correlation ID + location: $message.header#/correlationId + headers: qwe + type: object + properties: + correlationId: + description: Correlation ID set by application + type: string + applicationInstanceId: + description: Unique identifier for a given instance of the publishing application + type: string + tags: + - name: user + description: user signed up + - name: signup + externalDocs: + description: Find more info here + url: https://example.com + payload: + type: object + properties: + email: + type: string + format: email + examples: + - one: + email: hello@foo.bar + - two: + email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Object/Fields Types/invalid-traits-type.yaml b/tests/asyncapi-2.0/Message Object/Fields Types/invalid-traits-type.yaml new file mode 100644 index 00000000..1e83bf05 --- /dev/null +++ b/tests/asyncapi-2.0/Message Object/Fields Types/invalid-traits-type.yaml @@ -0,0 +1,50 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: user signed up to load some data + message: + name: UserSignup + title: User signup + summary: qwe + description: qwe + contentType: application/json + schemaFormat: application/vnd.oai.openapi;version=3.0.0 + correlationId: + description: Default Correlation ID + location: $message.header#/correlationId + headers: qwe + type: object + properties: + correlationId: + description: Correlation ID set by application + type: string + applicationInstanceId: + description: Unique identifier for a given instance of the publishing application + type: string + tags: + - name: user + description: user signed up + - name: signup + externalDocs: + description: Find more info here + url: https://example.com + payload: + type: object + properties: + email: + type: string + format: email + traits: 123 + examples: + - one: + email: hello@foo.bar + - two: + email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-bindings-type.yaml b/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-bindings-type.yaml new file mode 100644 index 00000000..34a3feac --- /dev/null +++ b/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-bindings-type.yaml @@ -0,0 +1,56 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: user signed up to load some data + message: + payload: + type: object + properties: + email: + type: string + format: email + traits: + - $ref: "#/components/messageTraits/signedUpMessage" + +components: + messageTraits: + signedUpMessage: + tags: + - name: user + description: user signed up + - name: signup + externalDocs: + description: Find more info here + url: https://example.com + bindings: 123 + name: qwe + title: qwe + summary: qwe + description: qwe + contentType: qwe + schemaFormat: application/vnd.oai.openapi;version=3.0.0 + correlationId: + description: Default Correlation ID + location: $message.header#/correlationId + headers: + type: object + properties: + correlationId: + description: Correlation ID set by application + type: string + applicationInstanceId: + description: Unique identifier for a given instance of the publishing application + type: string + examples: + - one: + email: hello@foo.bar + - two: + email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-contentType-type.yaml b/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-contentType-type.yaml new file mode 100644 index 00000000..7f39ec64 --- /dev/null +++ b/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-contentType-type.yaml @@ -0,0 +1,56 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: user signed up to load some data + message: + payload: + type: object + properties: + email: + type: string + format: email + traits: + - $ref: "#/components/messageTraits/signedUpMessage" + +components: + messageTraits: + signedUpMessage: + tags: + - name: user + description: user signed up + - name: signup + externalDocs: + description: Find more info here + url: https://example.com + name: + prop: 1 + title: User signup + summary: Action to sign a user up. + description: A longer description + contentType: qwe + schemaFormat: application/vnd.oai.openapi;version=3.0.0 + correlationId: + description: Default Correlation ID + location: $message.header#/correlationId + headers: + type: object + properties: + correlationId: + description: Correlation ID set by application + type: string + applicationInstanceId: + description: Unique identifier for a given instance of the publishing application + type: string + examples: + - one: + email: hello@foo.bar + - two: + email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-correlationId-type.yaml b/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-correlationId-type.yaml new file mode 100644 index 00000000..993a47a2 --- /dev/null +++ b/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-correlationId-type.yaml @@ -0,0 +1,53 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: user signed up to load some data + message: + payload: + type: object + properties: + email: + type: string + format: email + traits: + - $ref: "#/components/messageTraits/signedUpMessage" + +components: + messageTraits: + signedUpMessage: + tags: + - name: user + description: user signed up + - name: signup + externalDocs: + description: Find more info here + url: https://example.com + name: UserSignup + title: User signup + summary: Action to sign a user up. + description: A longer description + contentType: application/json + schemaFormat: application/vnd.oai.openapi;version=3.0.0 + correlationId: 123 + headers: + type: object + properties: + correlationId: + description: Correlation ID set by application + type: string + applicationInstanceId: + description: Unique identifier for a given instance of the publishing application + type: string + examples: + - one: + email: hello@foo.bar + - two: + email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-description-type.yaml b/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-description-type.yaml new file mode 100644 index 00000000..b25a9e8c --- /dev/null +++ b/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-description-type.yaml @@ -0,0 +1,56 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: user signed up to load some data + message: + payload: + type: object + properties: + email: + type: string + format: email + traits: + - $ref: "#/components/messageTraits/signedUpMessage" + +components: + messageTraits: + signedUpMessage: + tags: + - name: user + description: user signed up + - name: signup + externalDocs: + description: Find more info here + url: https://example.com + name: qwe + title: qwe + summary: qwe + description: + prop: 1 + contentType: qwe + schemaFormat: application/vnd.oai.openapi;version=3.0.0 + correlationId: + description: Default Correlation ID + location: $message.header#/correlationId + headers: + type: object + properties: + correlationId: + description: Correlation ID set by application + type: string + applicationInstanceId: + description: Unique identifier for a given instance of the publishing application + type: string + examples: + - one: + email: hello@foo.bar + - two: + email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-examples-type.yaml b/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-examples-type.yaml new file mode 100644 index 00000000..30a820ab --- /dev/null +++ b/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-examples-type.yaml @@ -0,0 +1,51 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: user signed up to load some data + message: + payload: + type: object + properties: + email: + type: string + format: email + traits: + - $ref: "#/components/messageTraits/signedUpMessage" + +components: + messageTraits: + signedUpMessage: + tags: + - name: user + description: user signed up + - name: signup + externalDocs: + description: Find more info here + url: https://example.com + name: qwe + title: qwe + summary: qwe + description: qwe + contentType: qwe + schemaFormat: application/vnd.oai.openapi;version=3.0.0 + correlationId: + description: Default Correlation ID + location: $message.header#/correlationId + headers: + type: object + properties: + correlationId: + description: Correlation ID set by application + type: string + applicationInstanceId: + description: Unique identifier for a given instance of the publishing application + type: string + examples: 123 diff --git a/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-externalDocs-type.yaml b/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-externalDocs-type.yaml new file mode 100644 index 00000000..3d23af10 --- /dev/null +++ b/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-externalDocs-type.yaml @@ -0,0 +1,53 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: user signed up to load some data + message: + payload: + type: object + properties: + email: + type: string + format: email + traits: + - $ref: "#/components/messageTraits/signedUpMessage" + +components: + messageTraits: + signedUpMessage: + tags: + - name: user + description: user signed up + - name: signup + externalDocs: 123 + name: qwe + title: qwe + summary: qwe + description: qwe + contentType: qwe + schemaFormat: application/vnd.oai.openapi;version=3.0.0 + correlationId: + description: Default Correlation ID + location: $message.header#/correlationId + headers: + type: object + properties: + correlationId: + description: Correlation ID set by application + type: string + applicationInstanceId: + description: Unique identifier for a given instance of the publishing application + type: string + examples: + - one: + email: hello@foo.bar + - two: + email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-headers-type.yaml b/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-headers-type.yaml new file mode 100644 index 00000000..09ab4414 --- /dev/null +++ b/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-headers-type.yaml @@ -0,0 +1,47 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: user signed up to load some data + message: + payload: + type: object + properties: + email: + type: string + format: email + traits: + - $ref: "#/components/messageTraits/signedUpMessage" + +components: + messageTraits: + signedUpMessage: + tags: + - name: user + description: user signed up + - name: signup + externalDocs: + description: Find more info here + url: https://example.com + name: UserSignup + title: User signup + summary: Action to sign a user up. + description: A longer description + contentType: application/json + schemaFormat: application/vnd.oai.openapi;version=3.0.0 + correlationId: + description: Default Correlation ID + location: $message.header#/correlationId + headers: 123 + examples: + - one: + email: hello@foo.bar + - two: + email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-schemaFormat-type.yaml b/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-schemaFormat-type.yaml new file mode 100644 index 00000000..2a622de4 --- /dev/null +++ b/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-schemaFormat-type.yaml @@ -0,0 +1,56 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: user signed up to load some data + message: + payload: + type: object + properties: + email: + type: string + format: email + traits: + - $ref: "#/components/messageTraits/signedUpMessage" + +components: + messageTraits: + signedUpMessage: + tags: + - name: user + description: user signed up + - name: signup + externalDocs: + description: Find more info here + url: https://example.com + name: UserSignup + title: User signup + summary: Action to sign a user up. + description: A longer description + contentType: application/json + schemaFormat: + prop: 1 + correlationId: + description: Default Correlation ID + location: $message.header#/correlationId + headers: + type: object + properties: + correlationId: + description: Correlation ID set by application + type: string + applicationInstanceId: + description: Unique identifier for a given instance of the publishing application + type: string + examples: + - one: + email: hello@foo.bar + - two: + email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-summary-type.yaml b/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-summary-type.yaml new file mode 100644 index 00000000..ca701c0a --- /dev/null +++ b/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-summary-type.yaml @@ -0,0 +1,56 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: user signed up to load some data + message: + payload: + type: object + properties: + email: + type: string + format: email + traits: + - $ref: "#/components/messageTraits/signedUpMessage" + +components: + messageTraits: + signedUpMessage: + tags: + - name: user + description: user signed up + - name: signup + externalDocs: + description: Find more info here + url: https://example.com + name: qwe + title: qwe + summary: + prop: 1 + description: A longer description + contentType: qwe + schemaFormat: application/vnd.oai.openapi;version=3.0.0 + correlationId: + description: Default Correlation ID + location: $message.header#/correlationId + headers: + type: object + properties: + correlationId: + description: Correlation ID set by application + type: string + applicationInstanceId: + description: Unique identifier for a given instance of the publishing application + type: string + examples: + - one: + email: hello@foo.bar + - two: + email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-tags-type.yaml b/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-tags-type.yaml new file mode 100644 index 00000000..e70009ed --- /dev/null +++ b/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-tags-type.yaml @@ -0,0 +1,52 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: user signed up to load some data + message: + payload: + type: object + properties: + email: + type: string + format: email + traits: + - $ref: "#/components/messageTraits/signedUpMessage" + +components: + messageTraits: + signedUpMessage: + tags: 123 + externalDocs: + description: Find more info here + url: https://example.com + name: qwe + title: qwe + summary: qwe + description: qwe + contentType: qwe + schemaFormat: application/vnd.oai.openapi;version=3.0.0 + correlationId: + description: Default Correlation ID + location: $message.header#/correlationId + headers: + type: object + properties: + correlationId: + description: Correlation ID set by application + type: string + applicationInstanceId: + description: Unique identifier for a given instance of the publishing application + type: string + examples: + - one: + email: hello@foo.bar + - two: + email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-title-type.yaml b/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-title-type.yaml new file mode 100644 index 00000000..5405c8e4 --- /dev/null +++ b/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-title-type.yaml @@ -0,0 +1,56 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: user signed up to load some data + message: + payload: + type: object + properties: + email: + type: string + format: email + traits: + - $ref: "#/components/messageTraits/signedUpMessage" + +components: + messageTraits: + signedUpMessage: + tags: + - name: user + description: user signed up + - name: signup + externalDocs: + description: Find more info here + url: https://example.com + name: qwe + title: + prop: 1 + summary: Action to sign a user up. + description: A longer description + contentType: qwe + schemaFormat: application/vnd.oai.openapi;version=3.0.0 + correlationId: + description: Default Correlation ID + location: $message.header#/correlationId + headers: + type: object + properties: + correlationId: + description: Correlation ID set by application + type: string + applicationInstanceId: + description: Unique identifier for a given instance of the publishing application + type: string + examples: + - one: + email: hello@foo.bar + - two: + email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-ack-type.yaml b/tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-ack-type.yaml new file mode 100644 index 00000000..0c10ceb0 --- /dev/null +++ b/tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-ack-type.yaml @@ -0,0 +1,29 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: object + properties: + email: + type: string + format: email + bindings: + amqp: + expiration: 100000 + userId: guest + cc: ['user.logs'] + priority: 10 + deliveryMode: 2 + mandatory: false + bcc: ['external.audit'] + replyTo: user.signedup + timestamp: true + ack: qwe + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-bcc-type.yaml b/tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-bcc-type.yaml new file mode 100644 index 00000000..17ea7151 --- /dev/null +++ b/tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-bcc-type.yaml @@ -0,0 +1,29 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: object + properties: + email: + type: string + format: email + bindings: + amqp: + expiration: 100000 + userId: guest + cc: ['user.logs'] + priority: 10 + deliveryMode: 2 + mandatory: false + bcc: 123 + replyTo: user.signedup + timestamp: true + ack: false + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-bindingVersion-type.yaml b/tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-bindingVersion-type.yaml new file mode 100644 index 00000000..807db2d1 --- /dev/null +++ b/tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-bindingVersion-type.yaml @@ -0,0 +1,30 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: object + properties: + email: + type: string + format: email + bindings: + amqp: + expiration: 100000 + userId: guest + cc: ['user.logs'] + priority: 10 + deliveryMode: 2 + mandatory: false + bcc: ['external.audit'] + replyTo: user.signedup + timestamp: true + ack: false + bindingVersion: + prop: 1 diff --git a/tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-cc-type.yaml b/tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-cc-type.yaml new file mode 100644 index 00000000..dd78f673 --- /dev/null +++ b/tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-cc-type.yaml @@ -0,0 +1,29 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: object + properties: + email: + type: string + format: email + bindings: + amqp: + expiration: 100000 + userId: guest + cc: 123 + priority: 10 + deliveryMode: 2 + mandatory: false + bcc: ['external.audit'] + replyTo: user.signedup + timestamp: true + ack: false + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-deliveryMode-type.yaml b/tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-deliveryMode-type.yaml new file mode 100644 index 00000000..9a014303 --- /dev/null +++ b/tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-deliveryMode-type.yaml @@ -0,0 +1,29 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: object + properties: + email: + type: string + format: email + bindings: + amqp: + expiration: 100000 + userId: guest + cc: ['user.logs'] + priority: 10 + deliveryMode: qweqwe + mandatory: false + bcc: ['external.audit'] + replyTo: user.signedup + timestamp: true + ack: false + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-expiration-type.yaml b/tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-expiration-type.yaml new file mode 100644 index 00000000..d03d8fa5 --- /dev/null +++ b/tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-expiration-type.yaml @@ -0,0 +1,29 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: object + properties: + email: + type: string + format: email + bindings: + amqp: + expiration: qweqwe + userId: guest + cc: ['user.logs'] + priority: 10 + deliveryMode: 2 + mandatory: false + bcc: ['external.audit'] + replyTo: user.signedup + timestamp: true + ack: false + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-mandatory-type.yaml b/tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-mandatory-type.yaml new file mode 100644 index 00000000..8c221f47 --- /dev/null +++ b/tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-mandatory-type.yaml @@ -0,0 +1,29 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: object + properties: + email: + type: string + format: email + bindings: + amqp: + expiration: 100000 + userId: guest + cc: ['user.logs'] + priority: 10 + deliveryMode: 2 + mandatory: qwe + bcc: ['external.audit'] + replyTo: user.signedup + timestamp: true + ack: false + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-priority-type.yaml b/tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-priority-type.yaml new file mode 100644 index 00000000..b16e6ab5 --- /dev/null +++ b/tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-priority-type.yaml @@ -0,0 +1,29 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: object + properties: + email: + type: string + format: email + bindings: + amqp: + expiration: 100000 + userId: guest + cc: ['user.logs'] + priority: qweqwe + deliveryMode: 2 + mandatory: false + bcc: ['external.audit'] + replyTo: user.signedup + timestamp: true + ack: false + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-replyTo-type.yaml b/tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-replyTo-type.yaml new file mode 100644 index 00000000..8890280d --- /dev/null +++ b/tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-replyTo-type.yaml @@ -0,0 +1,30 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: object + properties: + email: + type: string + format: email + bindings: + amqp: + expiration: 100000 + userId: guest + cc: ['user.logs'] + priority: 10 + deliveryMode: 2 + mandatory: false + bcc: ['external.audit'] + replyTo: + prop: 1 + timestamp: true + ack: false + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-timestamp-type.yaml b/tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-timestamp-type.yaml new file mode 100644 index 00000000..c00cef20 --- /dev/null +++ b/tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-timestamp-type.yaml @@ -0,0 +1,29 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: object + properties: + email: + type: string + format: email + bindings: + amqp: + expiration: 100000 + userId: guest + cc: ['user.logs'] + priority: 10 + deliveryMode: 2 + mandatory: false + bcc: ['external.audit'] + replyTo: user.signedup + timestamp: qwe + ack: false + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-userId-type.yaml b/tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-userId-type.yaml new file mode 100644 index 00000000..d39e3260 --- /dev/null +++ b/tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-userId-type.yaml @@ -0,0 +1,30 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: object + properties: + email: + type: string + format: email + bindings: + amqp: + expiration: 100000 + userId: + prop: 1 + cc: ['user.logs'] + priority: 10 + deliveryMode: 2 + mandatory: false + bcc: ['external.audit'] + replyTo: user.signedup + timestamp: true + ack: false + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Operation Bindings Object/amqp/invalid-deliveryMode-value.yaml b/tests/asyncapi-2.0/Operation Bindings Object/amqp/invalid-deliveryMode-value.yaml index 1069d587..4c002ace 100644 --- a/tests/asyncapi-2.0/Operation Bindings Object/amqp/invalid-deliveryMode-value.yaml +++ b/tests/asyncapi-2.0/Operation Bindings Object/amqp/invalid-deliveryMode-value.yaml @@ -26,4 +26,4 @@ channels: replyTo: user.signedup timestamp: true ack: false - bindingVersion: 0.1.0 + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Operation Bindings Object/amqp/invalid-expiration-below-zero.yaml b/tests/asyncapi-2.0/Operation Bindings Object/amqp/invalid-expiration-below-zero.yaml index 8226614a..6502270b 100644 --- a/tests/asyncapi-2.0/Operation Bindings Object/amqp/invalid-expiration-below-zero.yaml +++ b/tests/asyncapi-2.0/Operation Bindings Object/amqp/invalid-expiration-below-zero.yaml @@ -26,4 +26,4 @@ channels: replyTo: user.signedup timestamp: true ack: false - bindingVersion: 0.1.0 + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Operation Bindings Object/amqp/invalid-extra-properties.yaml b/tests/asyncapi-2.0/Operation Bindings Object/amqp/invalid-extra-properties.yaml index 8fea0bc6..6ddb22f4 100644 --- a/tests/asyncapi-2.0/Operation Bindings Object/amqp/invalid-extra-properties.yaml +++ b/tests/asyncapi-2.0/Operation Bindings Object/amqp/invalid-extra-properties.yaml @@ -27,4 +27,4 @@ channels: replyTo: user.signedup timestamp: true ack: false - bindingVersion: 0.1.0 + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Operation Bindings Object/amqp/valid.yaml b/tests/asyncapi-2.0/Operation Bindings Object/amqp/valid.yaml index 698fa16b..d8808a36 100644 --- a/tests/asyncapi-2.0/Operation Bindings Object/amqp/valid.yaml +++ b/tests/asyncapi-2.0/Operation Bindings Object/amqp/valid.yaml @@ -26,4 +26,4 @@ channels: replyTo: user.signedup timestamp: true ack: false - bindingVersion: 0.1.0 + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Operation Bindings Object/http/Fields Types/invalid-bindingVersion-type.yaml b/tests/asyncapi-2.0/Operation Bindings Object/http/Fields Types/invalid-bindingVersion-type.yaml new file mode 100644 index 00000000..17cac158 --- /dev/null +++ b/tests/asyncapi-2.0/Operation Bindings Object/http/Fields Types/invalid-bindingVersion-type.yaml @@ -0,0 +1,32 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + bindings: + http: + type: request + method: GET + query: + type: object + required: + - companyId + properties: + companyId: + type: number + minimum: 1 + description: The Id of the company. + additionalProperties: false + bindingVersion: + prop: 1 diff --git a/tests/asyncapi-2.0/Operation Bindings Object/http/Fields Types/invalid-method-type.yaml b/tests/asyncapi-2.0/Operation Bindings Object/http/Fields Types/invalid-method-type.yaml new file mode 100644 index 00000000..d721b75c --- /dev/null +++ b/tests/asyncapi-2.0/Operation Bindings Object/http/Fields Types/invalid-method-type.yaml @@ -0,0 +1,32 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + bindings: + http: + type: request + method: + prop: 1 + query: + type: object + required: + - companyId + properties: + companyId: + type: number + minimum: 1 + description: The Id of the company. + additionalProperties: false + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Operation Bindings Object/http/Fields Types/invalid-query-type.yaml b/tests/asyncapi-2.0/Operation Bindings Object/http/Fields Types/invalid-query-type.yaml new file mode 100644 index 00000000..a180e84a --- /dev/null +++ b/tests/asyncapi-2.0/Operation Bindings Object/http/Fields Types/invalid-query-type.yaml @@ -0,0 +1,22 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + bindings: + http: + type: request + method: GET + query: qwe + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Operation Bindings Object/http/Fields Types/invalid-type-type.yaml b/tests/asyncapi-2.0/Operation Bindings Object/http/Fields Types/invalid-type-type.yaml new file mode 100644 index 00000000..d52bebd6 --- /dev/null +++ b/tests/asyncapi-2.0/Operation Bindings Object/http/Fields Types/invalid-type-type.yaml @@ -0,0 +1,32 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + bindings: + http: + type: + prop: 1 + method: GET + query: + type: object + required: + - companyId + properties: + companyId: + type: number + minimum: 1 + description: The Id of the company. + additionalProperties: false + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Operation Bindings Object/http/invalid-method.yaml b/tests/asyncapi-2.0/Operation Bindings Object/http/invalid-method-value.yaml similarity index 100% rename from tests/asyncapi-2.0/Operation Bindings Object/http/invalid-method.yaml rename to tests/asyncapi-2.0/Operation Bindings Object/http/invalid-method-value.yaml diff --git a/tests/asyncapi-2.0/Operation Bindings Object/http/invalid-query-type.yaml b/tests/asyncapi-2.0/Operation Bindings Object/http/invalid-query-schema-type.yaml similarity index 100% rename from tests/asyncapi-2.0/Operation Bindings Object/http/invalid-query-type.yaml rename to tests/asyncapi-2.0/Operation Bindings Object/http/invalid-query-schema-type.yaml diff --git a/tests/asyncapi-2.0/Operation Bindings Object/http/invalid-type.yaml b/tests/asyncapi-2.0/Operation Bindings Object/http/invalid-type-value.yaml similarity index 100% rename from tests/asyncapi-2.0/Operation Bindings Object/http/invalid-type.yaml rename to tests/asyncapi-2.0/Operation Bindings Object/http/invalid-type-value.yaml diff --git a/tests/asyncapi-2.0/Operation Bindings Object/kafka/Fields Types/invalid-bindingVersion-type.yaml b/tests/asyncapi-2.0/Operation Bindings Object/kafka/Fields Types/invalid-bindingVersion-type.yaml new file mode 100644 index 00000000..c2bea38b --- /dev/null +++ b/tests/asyncapi-2.0/Operation Bindings Object/kafka/Fields Types/invalid-bindingVersion-type.yaml @@ -0,0 +1,22 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + bindings: + kafka: + groupId: myGroupId + clientId: myClientId + bindingVersion: + prop: 1 diff --git a/tests/asyncapi-2.0/Operation Bindings Object/kafka/Fields Types/invalid-clientId-type.yaml b/tests/asyncapi-2.0/Operation Bindings Object/kafka/Fields Types/invalid-clientId-type.yaml new file mode 100644 index 00000000..fcb79d3a --- /dev/null +++ b/tests/asyncapi-2.0/Operation Bindings Object/kafka/Fields Types/invalid-clientId-type.yaml @@ -0,0 +1,22 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + bindings: + kafka: + groupId: myGroupId + clientId: + prop: 1 + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Operation Bindings Object/kafka/Fields Types/invalid-groupId-type.yaml b/tests/asyncapi-2.0/Operation Bindings Object/kafka/Fields Types/invalid-groupId-type.yaml new file mode 100644 index 00000000..95626ee4 --- /dev/null +++ b/tests/asyncapi-2.0/Operation Bindings Object/kafka/Fields Types/invalid-groupId-type.yaml @@ -0,0 +1,22 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + bindings: + kafka: + groupId: + prop: 1 + clientId: myClientId + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Operation Bindings Object/mqtt/Fields Types/invalid-bindingVersion-type.yaml b/tests/asyncapi-2.0/Operation Bindings Object/mqtt/Fields Types/invalid-bindingVersion-type.yaml new file mode 100644 index 00000000..a8aaf9a0 --- /dev/null +++ b/tests/asyncapi-2.0/Operation Bindings Object/mqtt/Fields Types/invalid-bindingVersion-type.yaml @@ -0,0 +1,22 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: object + properties: + email: + type: string + format: email + bindings: + mqtt: + qos: 2 + retain: true + bindingVersion: + prop: 1 diff --git a/tests/asyncapi-2.0/Operation Bindings Object/mqtt/Fields Types/invalid-qos-type.yaml b/tests/asyncapi-2.0/Operation Bindings Object/mqtt/Fields Types/invalid-qos-type.yaml new file mode 100644 index 00000000..e52e64b1 --- /dev/null +++ b/tests/asyncapi-2.0/Operation Bindings Object/mqtt/Fields Types/invalid-qos-type.yaml @@ -0,0 +1,21 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: object + properties: + email: + type: string + format: email + bindings: + mqtt: + qos: qwe + retain: true + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Operation Bindings Object/mqtt/Fields Types/invalid-retain-type.yaml b/tests/asyncapi-2.0/Operation Bindings Object/mqtt/Fields Types/invalid-retain-type.yaml new file mode 100644 index 00000000..55053ec7 --- /dev/null +++ b/tests/asyncapi-2.0/Operation Bindings Object/mqtt/Fields Types/invalid-retain-type.yaml @@ -0,0 +1,21 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: object + properties: + email: + type: string + format: email + bindings: + mqtt: + qos: 2 + retain: qwe + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Operation Bindings Object/mqtt/invalid-extra-properties.yaml b/tests/asyncapi-2.0/Operation Bindings Object/mqtt/invalid-extra-properties.yaml index d98b39e6..46219c62 100644 --- a/tests/asyncapi-2.0/Operation Bindings Object/mqtt/invalid-extra-properties.yaml +++ b/tests/asyncapi-2.0/Operation Bindings Object/mqtt/invalid-extra-properties.yaml @@ -19,4 +19,4 @@ channels: hello: 1 qos: 1 retain: true - bindingVersion: 0.1.0 + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Operation Bindings Object/mqtt/invalid-qos-value.yaml b/tests/asyncapi-2.0/Operation Bindings Object/mqtt/invalid-qos-value.yaml index 0d7ea664..c9ff0de6 100644 --- a/tests/asyncapi-2.0/Operation Bindings Object/mqtt/invalid-qos-value.yaml +++ b/tests/asyncapi-2.0/Operation Bindings Object/mqtt/invalid-qos-value.yaml @@ -18,4 +18,4 @@ channels: mqtt: qos: 124 retain: true - bindingVersion: 0.1.0 + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Operation Bindings Object/mqtt/valid.yaml b/tests/asyncapi-2.0/Operation Bindings Object/mqtt/valid.yaml index d7b04ee6..cd6aa777 100644 --- a/tests/asyncapi-2.0/Operation Bindings Object/mqtt/valid.yaml +++ b/tests/asyncapi-2.0/Operation Bindings Object/mqtt/valid.yaml @@ -18,4 +18,4 @@ channels: mqtt: qos: 2 retain: true - bindingVersion: 0.1.0 + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Reference Object/Fields Types/invalid-ref-type.yaml b/tests/asyncapi-2.0/Reference Object/Fields Types/invalid-ref-type.yaml new file mode 100644 index 00000000..f19e120f --- /dev/null +++ b/tests/asyncapi-2.0/Reference Object/Fields Types/invalid-ref-type.yaml @@ -0,0 +1,22 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + +components: + messages: + myMessage: + $ref: + prop: 1 diff --git a/tests/asyncapi-2.0/Reference Object/lib.yaml b/tests/asyncapi-2.0/Reference Object/lib.yaml index 38fe6fb5..31e761bc 100644 --- a/tests/asyncapi-2.0/Reference Object/lib.yaml +++ b/tests/asyncapi-2.0/Reference Object/lib.yaml @@ -91,7 +91,7 @@ myServerBindings: message: Guest gone offline. retain: false keepAlive: 60 - bindingVersion: 0.1.0 + bindingVersion: '0.1.0' myChannelBindings: amqp: @@ -122,10 +122,10 @@ myOperationBindings: replyTo: user.signedup timestamp: true ack: false - bindingVersion: 0.1.0 + bindingVersion: '0.1.0' myMessageBindings: amqp: contentEncoding: gzip messageType: 'user.signup' - bindingVersion: 0.1.0 + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Security Requirement Object/Fields Types/invalid-name-type.yaml b/tests/asyncapi-2.0/Security Requirement Object/Fields Types/invalid-name-type.yaml new file mode 100644 index 00000000..01e771d7 --- /dev/null +++ b/tests/asyncapi-2.0/Security Requirement Object/Fields Types/invalid-name-type.yaml @@ -0,0 +1,26 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + security: + - mainSecurity: not an array + +components: + securitySchemes: + mainSecurity: + type: http + scheme: bearer + bearerFormat: a hint diff --git a/tests/asyncapi-2.0/Security Scheme Object/Fields Types/invalid-bearerFormat-type.yaml b/tests/asyncapi-2.0/Security Scheme Object/Fields Types/invalid-bearerFormat-type.yaml new file mode 100644 index 00000000..d46b5898 --- /dev/null +++ b/tests/asyncapi-2.0/Security Scheme Object/Fields Types/invalid-bearerFormat-type.yaml @@ -0,0 +1,27 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + security: + - mainSecurity: [] + +components: + securitySchemes: + mainSecurity: + type: http + scheme: bearer + bearerFormat: + prop: 1 diff --git a/tests/asyncapi-2.0/Security Scheme Object/Fields Types/invalid-description-type.yaml b/tests/asyncapi-2.0/Security Scheme Object/Fields Types/invalid-description-type.yaml new file mode 100644 index 00000000..ea4af67a --- /dev/null +++ b/tests/asyncapi-2.0/Security Scheme Object/Fields Types/invalid-description-type.yaml @@ -0,0 +1,28 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + security: + - mainSecurity: [] + +components: + securitySchemes: + mainSecurity: + type: http + description: + prop: 1 + scheme: bearer + bearerFormat: a hint diff --git a/tests/asyncapi-2.0/Security Scheme Object/Fields Types/invalid-flows-type.yaml b/tests/asyncapi-2.0/Security Scheme Object/Fields Types/invalid-flows-type.yaml new file mode 100644 index 00000000..7e177046 --- /dev/null +++ b/tests/asyncapi-2.0/Security Scheme Object/Fields Types/invalid-flows-type.yaml @@ -0,0 +1,27 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + security: + - mainSecurity: + - write:pets + - read:pets + +components: + securitySchemes: + mainSecurity: + type: oauth2 + flows: 123 diff --git a/tests/asyncapi-2.0/Security Scheme Object/Fields Types/invalid-in-type.yaml b/tests/asyncapi-2.0/Security Scheme Object/Fields Types/invalid-in-type.yaml new file mode 100644 index 00000000..004941de --- /dev/null +++ b/tests/asyncapi-2.0/Security Scheme Object/Fields Types/invalid-in-type.yaml @@ -0,0 +1,37 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + security: + - mainSecurity: [] + - secondarySecurity: [] + - thirdSecurity: [] + +components: + securitySchemes: + mainSecurity: + type: httpApiKey + name: "My-Key-Header" + in: + prop: 1 + secondarySecurity: + type: httpApiKey + name: "My-Key-Cookie" + in: cookie + thirdSecurity: + type: httpApiKey + name: "My-Key-Query" + in: query diff --git a/tests/asyncapi-2.0/Security Scheme Object/Fields Types/invalid-name-type.yaml b/tests/asyncapi-2.0/Security Scheme Object/Fields Types/invalid-name-type.yaml new file mode 100644 index 00000000..b067134a --- /dev/null +++ b/tests/asyncapi-2.0/Security Scheme Object/Fields Types/invalid-name-type.yaml @@ -0,0 +1,37 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + security: + - mainSecurity: [] + - secondarySecurity: [] + - thirdSecurity: [] + +components: + securitySchemes: + mainSecurity: + type: httpApiKey + name: + prop: 1 + in: header + secondarySecurity: + type: httpApiKey + name: "My-Key-Cookie" + in: cookie + thirdSecurity: + type: httpApiKey + name: "My-Key-Query" + in: query diff --git a/tests/asyncapi-2.0/Security Scheme Object/Fields Types/invalid-openIdConnectUrl-type.yaml b/tests/asyncapi-2.0/Security Scheme Object/Fields Types/invalid-openIdConnectUrl-type.yaml new file mode 100644 index 00000000..05039f87 --- /dev/null +++ b/tests/asyncapi-2.0/Security Scheme Object/Fields Types/invalid-openIdConnectUrl-type.yaml @@ -0,0 +1,28 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + security: + - mainSecurity: + - write:pets + - read:pets + +components: + securitySchemes: + mainSecurity: + type: openIdConnect + openIdConnectUrl: + prop: 1 diff --git a/tests/asyncapi-2.0/Security Scheme Object/Fields Types/invalid-scheme-type.yaml b/tests/asyncapi-2.0/Security Scheme Object/Fields Types/invalid-scheme-type.yaml new file mode 100644 index 00000000..5c8d1f78 --- /dev/null +++ b/tests/asyncapi-2.0/Security Scheme Object/Fields Types/invalid-scheme-type.yaml @@ -0,0 +1,27 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + security: + - mainSecurity: [] + +components: + securitySchemes: + mainSecurity: + type: http + scheme: + prop: 1 + bearerFormat: a hint diff --git a/tests/asyncapi-2.0/Security Scheme Object/Fields Types/invalid-type-type.yaml b/tests/asyncapi-2.0/Security Scheme Object/Fields Types/invalid-type-type.yaml new file mode 100644 index 00000000..17ae3e06 --- /dev/null +++ b/tests/asyncapi-2.0/Security Scheme Object/Fields Types/invalid-type-type.yaml @@ -0,0 +1,27 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + security: + - mainSecurity: [] + +components: + securitySchemes: + mainSecurity: + type: + prop: 1 + scheme: bearer + bearerFormat: a hint diff --git a/tests/asyncapi-2.0/Security Scheme Object/oauth2/Fields Types/invalid-authorizationCode-type.yaml b/tests/asyncapi-2.0/Security Scheme Object/oauth2/Fields Types/invalid-authorizationCode-type.yaml new file mode 100644 index 00000000..2d3a61d8 --- /dev/null +++ b/tests/asyncapi-2.0/Security Scheme Object/oauth2/Fields Types/invalid-authorizationCode-type.yaml @@ -0,0 +1,46 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + security: + - mainSecurity: + - write:pets + - read:pets + +components: + securitySchemes: + mainSecurity: + type: oauth2 + flows: + implicit: + authorizationUrl: https://example.com/api/oauth/auth + refreshUrl: https://example.com/api/oauth/refresh + scopes: + write:pets: modify pets in your account + read:pets: read your pets + password: + tokenUrl: https://example.com/api/oauth/token + refreshUrl: https://example.com/api/oauth/refresh + scopes: + write:pets: modify pets in your account + read:pets: read your pets + clientCredentials: + tokenUrl: https://example.com/api/oauth/token + refreshUrl: https://example.com/api/oauth/refresh + scopes: + write:pets: modify pets in your account + read:pets: read your pets + authorizationCode: 123 diff --git a/tests/asyncapi-2.0/Security Scheme Object/oauth2/Fields Types/invalid-authorizationUrl-type.yaml b/tests/asyncapi-2.0/Security Scheme Object/oauth2/Fields Types/invalid-authorizationUrl-type.yaml new file mode 100644 index 00000000..af8b3349 --- /dev/null +++ b/tests/asyncapi-2.0/Security Scheme Object/oauth2/Fields Types/invalid-authorizationUrl-type.yaml @@ -0,0 +1,35 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + security: + - mainSecurity: + - write:pets + - read:pets + +components: + securitySchemes: + mainSecurity: + type: oauth2 + flows: + authorizationCode: + authorizationUrl: + prop: 1 + tokenUrl: https://example.com/api/oauth/token + refreshUrl: https://example.com/api/oauth/refresh + scopes: + write:pets: modify pets in your account + read:pets: read your pets diff --git a/tests/asyncapi-2.0/Security Scheme Object/oauth2/Fields Types/invalid-clientCredentials-type.yaml b/tests/asyncapi-2.0/Security Scheme Object/oauth2/Fields Types/invalid-clientCredentials-type.yaml new file mode 100644 index 00000000..98ecd9b7 --- /dev/null +++ b/tests/asyncapi-2.0/Security Scheme Object/oauth2/Fields Types/invalid-clientCredentials-type.yaml @@ -0,0 +1,47 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + security: + - mainSecurity: + - write:pets + - read:pets + +components: + securitySchemes: + mainSecurity: + type: oauth2 + flows: + implicit: + authorizationUrl: https://example.com/api/oauth/auth + refreshUrl: https://example.com/api/oauth/refresh + scopes: + write:pets: modify pets in your account + read:pets: read your pets + password: + tokenUrl: https://example.com/api/oauth/token + refreshUrl: https://example.com/api/oauth/refresh + scopes: + write:pets: modify pets in your account + read:pets: read your pets + clientCredentials: 123 + authorizationCode: + authorizationUrl: https://example.com/api/oauth/auth + tokenUrl: https://example.com/api/oauth/token + refreshUrl: https://example.com/api/oauth/refresh + scopes: + write:pets: modify pets in your account + read:pets: read your pets diff --git a/tests/asyncapi-2.0/Security Scheme Object/oauth2/Fields Types/invalid-implicit-type.yaml b/tests/asyncapi-2.0/Security Scheme Object/oauth2/Fields Types/invalid-implicit-type.yaml new file mode 100644 index 00000000..c2e25e85 --- /dev/null +++ b/tests/asyncapi-2.0/Security Scheme Object/oauth2/Fields Types/invalid-implicit-type.yaml @@ -0,0 +1,47 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + security: + - mainSecurity: + - write:pets + - read:pets + +components: + securitySchemes: + mainSecurity: + type: oauth2 + flows: + implicit: 123 + password: + tokenUrl: https://example.com/api/oauth/token + refreshUrl: https://example.com/api/oauth/refresh + scopes: + write:pets: modify pets in your account + read:pets: read your pets + clientCredentials: + tokenUrl: https://example.com/api/oauth/token + refreshUrl: https://example.com/api/oauth/refresh + scopes: + write:pets: modify pets in your account + read:pets: read your pets + authorizationCode: + authorizationUrl: https://example.com/api/oauth/auth + tokenUrl: https://example.com/api/oauth/token + refreshUrl: https://example.com/api/oauth/refresh + scopes: + write:pets: modify pets in your account + read:pets: read your pets diff --git a/tests/asyncapi-2.0/Security Scheme Object/oauth2/Fields Types/invalid-password-type.yaml b/tests/asyncapi-2.0/Security Scheme Object/oauth2/Fields Types/invalid-password-type.yaml new file mode 100644 index 00000000..addcf337 --- /dev/null +++ b/tests/asyncapi-2.0/Security Scheme Object/oauth2/Fields Types/invalid-password-type.yaml @@ -0,0 +1,47 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + security: + - mainSecurity: + - write:pets + - read:pets + +components: + securitySchemes: + mainSecurity: + type: oauth2 + flows: + implicit: + authorizationUrl: https://example.com/api/oauth/auth + refreshUrl: https://example.com/api/oauth/refresh + scopes: + write:pets: modify pets in your account + read:pets: read your pets + password: 123 + clientCredentials: + tokenUrl: https://example.com/api/oauth/token + refreshUrl: https://example.com/api/oauth/refresh + scopes: + write:pets: modify pets in your account + read:pets: read your pets + authorizationCode: + authorizationUrl: https://example.com/api/oauth/auth + tokenUrl: https://example.com/api/oauth/token + refreshUrl: https://example.com/api/oauth/refresh + scopes: + write:pets: modify pets in your account + read:pets: read your pets diff --git a/tests/asyncapi-2.0/Security Scheme Object/oauth2/Fields Types/invalid-refreshUrl-type.yaml b/tests/asyncapi-2.0/Security Scheme Object/oauth2/Fields Types/invalid-refreshUrl-type.yaml new file mode 100644 index 00000000..1522da41 --- /dev/null +++ b/tests/asyncapi-2.0/Security Scheme Object/oauth2/Fields Types/invalid-refreshUrl-type.yaml @@ -0,0 +1,35 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + security: + - mainSecurity: + - write:pets + - read:pets + +components: + securitySchemes: + mainSecurity: + type: oauth2 + flows: + authorizationCode: + authorizationUrl: https://example.com/api/oauth/auth + tokenUrl: https://example.com/api/oauth/token + refreshUrl: + prop: 1 + scopes: + write:pets: modify pets in your account + read:pets: read your pets diff --git a/tests/asyncapi-2.0/Security Scheme Object/oauth2/Fields Types/invalid-scopes-type.yaml b/tests/asyncapi-2.0/Security Scheme Object/oauth2/Fields Types/invalid-scopes-type.yaml new file mode 100644 index 00000000..6a0fd5af --- /dev/null +++ b/tests/asyncapi-2.0/Security Scheme Object/oauth2/Fields Types/invalid-scopes-type.yaml @@ -0,0 +1,32 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + security: + - mainSecurity: + - write:pets + - read:pets + +components: + securitySchemes: + mainSecurity: + type: oauth2 + flows: + authorizationCode: + authorizationUrl: https://example.com/api/oauth/auth + tokenUrl: https://example.com/api/oauth/token + refreshUrl: https://example.com/api/oauth/refresh + scopes: 123 diff --git a/tests/asyncapi-2.0/Security Scheme Object/oauth2/Fields Types/invalid-tokenUrl-type.yaml b/tests/asyncapi-2.0/Security Scheme Object/oauth2/Fields Types/invalid-tokenUrl-type.yaml new file mode 100644 index 00000000..418a80d1 --- /dev/null +++ b/tests/asyncapi-2.0/Security Scheme Object/oauth2/Fields Types/invalid-tokenUrl-type.yaml @@ -0,0 +1,35 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + security: + - mainSecurity: + - write:pets + - read:pets + +components: + securitySchemes: + mainSecurity: + type: oauth2 + flows: + authorizationCode: + authorizationUrl: https://example.com/api/oauth/auth + tokenUrl: + prop: 1 + refreshUrl: https://example.com/api/oauth/refresh + scopes: + write:pets: modify pets in your account + read:pets: read your pets diff --git a/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-cleanSession-type.yaml b/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-cleanSession-type.yaml index 798481c7..3c6000a2 100644 --- a/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-cleanSession-type.yaml +++ b/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-cleanSession-type.yaml @@ -24,4 +24,4 @@ servers: qos: 2 retain: false keepAlive: 60 - bindingVersion: 0.1.0 + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-clientId-type.yaml b/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-clientId-type.yaml index 5bb8b252..18ecbd52 100644 --- a/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-clientId-type.yaml +++ b/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-clientId-type.yaml @@ -25,4 +25,4 @@ servers: qos: 2 retain: false keepAlive: 60 - bindingVersion: 0.1.0 + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-keepAlive-type.yaml b/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-keepAlive-type.yaml index a403da68..b0bbb2bd 100644 --- a/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-keepAlive-type.yaml +++ b/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-keepAlive-type.yaml @@ -24,4 +24,4 @@ servers: qos: 1 retain: false keepAlive: qwe - bindingVersion: 0.1.0 + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-qos-type.yaml b/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-qos-type.yaml index 2bfe5a52..cfad012a 100644 --- a/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-qos-type.yaml +++ b/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-qos-type.yaml @@ -25,4 +25,4 @@ servers: prop: 1 retain: false keepAlive: 60 - bindingVersion: 0.1.0 + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-retain-type.yaml b/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-retain-type.yaml index 73cc5bf6..bb818af5 100644 --- a/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-retain-type.yaml +++ b/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-retain-type.yaml @@ -24,4 +24,4 @@ servers: qos: 1 retain: qwe keepAlive: 60 - bindingVersion: 0.1.0 + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-topic-type.yaml b/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-topic-type.yaml index cc7843d0..b6f15857 100644 --- a/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-topic-type.yaml +++ b/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-topic-type.yaml @@ -25,4 +25,4 @@ servers: qos: 2 retain: false keepAlive: 60 - bindingVersion: 0.1.0 + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-type.yaml b/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-type.yaml index 23c60d55..36de3a91 100644 --- a/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-type.yaml +++ b/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-type.yaml @@ -21,4 +21,4 @@ servers: cleanSession: true lastWill: 123 keepAlive: 60 - bindingVersion: 0.1.0 + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Server Bindings Object/mqtt/invalid-extra-properties.yaml b/tests/asyncapi-2.0/Server Bindings Object/mqtt/invalid-extra-properties.yaml index 674e8b61..3c5e8454 100644 --- a/tests/asyncapi-2.0/Server Bindings Object/mqtt/invalid-extra-properties.yaml +++ b/tests/asyncapi-2.0/Server Bindings Object/mqtt/invalid-extra-properties.yaml @@ -25,4 +25,4 @@ servers: qos: 2 retain: false keepAlive: 60 - bindingVersion: 0.1.0 + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Server Bindings Object/mqtt/valid.yaml b/tests/asyncapi-2.0/Server Bindings Object/mqtt/valid.yaml index 48ff8c0f..e44dae8e 100644 --- a/tests/asyncapi-2.0/Server Bindings Object/mqtt/valid.yaml +++ b/tests/asyncapi-2.0/Server Bindings Object/mqtt/valid.yaml @@ -24,4 +24,4 @@ servers: qos: 2 retain: false keepAlive: 60 - bindingVersion: 0.1.0 + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Tag Object/Fields Types/invalid-description-type.yaml b/tests/asyncapi-2.0/Tag Object/Fields Types/invalid-description-type.yaml new file mode 100644 index 00000000..787f32a0 --- /dev/null +++ b/tests/asyncapi-2.0/Tag Object/Fields Types/invalid-description-type.yaml @@ -0,0 +1,26 @@ +asyncapi: 2.0.0 + +tags: + - name: qwe + description: + prop: 1 + - name: signup + externalDocs: + description: Find more info here + url: https://example.com + - name: register + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/Tag Object/Fields Types/invalid-externalDocs-type.yaml b/tests/asyncapi-2.0/Tag Object/Fields Types/invalid-externalDocs-type.yaml new file mode 100644 index 00000000..a985b7d7 --- /dev/null +++ b/tests/asyncapi-2.0/Tag Object/Fields Types/invalid-externalDocs-type.yaml @@ -0,0 +1,23 @@ +asyncapi: 2.0.0 + +tags: + - name: user + description: user signed up + - name: signup + externalDocs: 123 + - name: register + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/Tag Object/Fields Types/invalid-name-type.yaml b/tests/asyncapi-2.0/Tag Object/Fields Types/invalid-name-type.yaml new file mode 100644 index 00000000..f19190c4 --- /dev/null +++ b/tests/asyncapi-2.0/Tag Object/Fields Types/invalid-name-type.yaml @@ -0,0 +1,26 @@ +asyncapi: 2.0.0 + +tags: + - name: + prop: 1 + description: user signed up + - name: signup + externalDocs: + description: Find more info here + url: https://example.com + - name: register + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email From ef2323f1ede6b333781c2fbcd913016d4f05f998 Mon Sep 17 00:00:00 2001 From: Artem Kostiuk Date: Fri, 17 Jan 2020 10:19:33 +0200 Subject: [PATCH 14/26] Implement manifest gen. Generate manifest --- CONTRIBUTING.md | 11 ++ README.md | 17 ++- genmanifest.js | 155 +++++++++++++++++++ manifest.json | 368 ++++++++++++++++++++++++++++++++++++++++++++++ package-lock.json | 21 +++ package.json | 22 +++ 6 files changed, 593 insertions(+), 1 deletion(-) create mode 100644 CONTRIBUTING.md create mode 100644 genmanifest.js create mode 100644 manifest.json create mode 100644 package-lock.json create mode 100644 package.json diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..c0dd96ff --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,11 @@ +# Contributing + +Each test case should contain the following files: +* A valid `*valid*.yaml` file showcasing valid use of the feature under test +* An invalid `*invalid*.yaml` files showcasing invalid use of the feature under test + +Please place new tests in one of `tests/asyncapi-2.0` sub-folders. Name of the target folder should correspond to the name of the feature your tests test. E.g. if your new `.yaml` tests `Info Object`, place it in `tests/asyncapi-2.0/Info Object`. + +## Running tests + +We've created a separate project called [yaml-tck-runner](https://github.com/yaml-org/yaml-tck-runner) to run all the tests contained in the RAML TCK. By following the instructions on that repository, you should be able to test any new test case that you may want to contribute against the different projects that this [yaml-tck-runner](https://github.com/yaml-org/yaml-tck-runner) covers. diff --git a/README.md b/README.md index f738dc77..41960e31 100644 --- a/README.md +++ b/README.md @@ -1 +1,16 @@ -# tck +# AsyncAPI tck + +AsyncAPI's Test Compatibility Kit (AsyncAPI TCK) provides a way for any AsyncAPI processor to test its compliance with the AsyncAPI 2.0 Spec. AsyncAPI TCK contains a set of AsyncAPI documents meant to be used to test correct and incorrect usage of each AsyncAPI feature. + +## Naming convention + +- `*valid*.yaml`: valid AsyncAPI file expected to be successfully processed +- `*invalid*.yaml`: invalid AsyncAPI file with syntax/semantic/spec error(s), expected to be unsuccessfully processed (error or exit code returned) + +Note that this repository contains a [manifest file](./manifest.json) that lists all tests in the order their respective tested features appear in the AsyncAPI 2.0 Specification. + +Names of folders' tests reside in correspond to AsyncAPI 2.0 Specification sections names. + +## Contributing + +We welcome contributions! If you have a new test case in mind, feel free to submit a pull request. More info on how to do that [here](./CONTRIBUTING.md). diff --git a/genmanifest.js b/genmanifest.js new file mode 100644 index 00000000..5a8d6f68 --- /dev/null +++ b/genmanifest.js @@ -0,0 +1,155 @@ +const path = require('path') +const fs = require('fs') +const walk = require('walk') + +// Features listed in order they appear in the spec spec. +const FEATURES_PRIORITY = [ + 'Format', + 'File Structure', + 'AsyncAPI Object', + 'AsyncAPI Version String', + 'Identifier', + 'Info Object', + 'Contact Object', + 'License Object', + 'Servers Object', + 'Server Object', + 'Server Variable Object', + 'Channels Object', + 'Channel Item Object', + 'Operation Object', + 'Operation Trait Object', + 'Message Object', + 'Message Trait Object', + 'Tags Object', + 'Tag Object', + 'External Documentation Object', + 'Components Object', + 'Reference Object', + 'Schema Object', + 'Security Scheme Object', + 'Security Requirement Object', + 'Parameters Object', + 'Parameter Object', + 'Server Bindings Object', + 'Channel Bindings Object', + 'Operation Bindings Object', + 'Message Bindings Object', + 'Correlation ID Object', + 'Specification Extensions' +] + +const EXT = '.yaml' + +function main () { + const projRoot = path.resolve(__dirname) + const inputRoot = getInputDirPath() + let filesPaths = listFiles(inputRoot) + filesPaths = sortFilesPaths(inputRoot, filesPaths) + filesPaths = makePathsRelative(projRoot, filesPaths) + generateManifest(projRoot, filesPaths) +} + +// Gets absolute path of input folder +function getInputDirPath () { + let dirPath = process.argv[2] + + if (!fs.existsSync(dirPath)) { + console.error(`'${dirPath}' not found`) + return + } + + dirPath = path.resolve(dirPath) + if (!fs.lstatSync(dirPath).isDirectory()) { + console.error(`'${dirPath}' is not a directory`) + return + } + return dirPath +} + +// Lists files with a particular extension under directory path +function listFiles (dirPath) { + let files = [] + const options = { + listeners: { + file: (root, fileStats, next) => { + if (fileStats.name.indexOf(EXT) >= 0) { + files.push(path.join(root, fileStats.name)) + } + next() + } + } + } + walk.walkSync(dirPath, options) + return files +} + +// Sorts string filesPaths according to features definition order in a spec +function sortFilesPaths (filesRoot, filesPaths) { + const pathObjs = extendWithPriority( + filesRoot, filesPaths, FEATURES_PRIORITY.slice()) + const sortedPathObjs = pathObjs.sort((obj1, obj2) => { + return obj1.priority - obj2.priority + }) + return sortedPathObjs.map((obj) => { + return obj.path + }) +} + +// Makes fiels paths relative to a directory +function makePathsRelative (dirPath, filesPaths) { + return filesPaths.map((pth) => { + return path.relative(dirPath, pth) + }) +} + +// Turns plain file paths into objects of type {priority: INT, path: STRING} +// E.g.: +// > let featuresPriority = ['methodresponses', 'overlays'] +// > extendWithPriority('/foo/bar', '/foo/bar/Overlays/some/file.ext') +// > {priority: 2, path: '/foo/bar/Overlays/some/file.ext'} +// > extendWithPriority('/foo/bar', '/foo/bar/qweqwe/some/file.ext') +// > {priority: 3, path: '/foo/bar/qweqwe/some/file.ext'} +// +// Override this to change logic of picking priority. +function extendWithPriority (filesRoot, filesPaths, featuresPriority) { + featuresPriority = featuresPriority.map(x => x.toLowerCase()) + return filesPaths.map((pth) => { + const piece = getFirstPathPiece(filesRoot, pth).toLowerCase() + let priority = featuresPriority.findIndex(el => el === piece) + + // Feature name not found. Adding it to the list allows sorting not + // found features. + if (priority === -1) { + featuresPriority.push(piece) + priority = featuresPriority.length - 1 + } + priority += 1 // Make 1-based + return {path: pth, priority: priority} + }) +} + +// Gets relative folder 'root' name of files file path. +// E.g.: +// > const filesRoot = '/foo/bar' +// > const fielPath = '/foo/bar/MethodResponses/some/file.ext' +// > getFirstPathPiece(filesRoot, fielPath) +// > 'methodresponses' +function getFirstPathPiece (filesRoot, fielPath) { + const relPath = path.relative(filesRoot, fielPath) + return relPath.split(path.sep)[0].toLowerCase() +} + +// Generates and writes manifest file +function generateManifest (dirPath, filesPaths) { + const data = { + description: 'Files listed in order corresponding AsyncAPI ' + + 'feature appears in AsyncAPI 2.0 Specification', + filePaths: filesPaths + } + const manifestPath = path.join(dirPath, 'manifest.json') + console.log(`Writing manifest file to ${manifestPath}`) + fs.writeFileSync(manifestPath, JSON.stringify(data, null, 4)) +} + +main() diff --git a/manifest.json b/manifest.json new file mode 100644 index 00000000..a3216358 --- /dev/null +++ b/manifest.json @@ -0,0 +1,368 @@ +{ + "description": "Files listed in order corresponding AsyncAPI feature appears in AsyncAPI 2.0 Specification", + "filePaths": [ + "tests/asyncapi-2.0/Format/invalid-case-sensitive.yaml", + "tests/asyncapi-2.0/Format/invalid-integer-key.yaml", + "tests/asyncapi-2.0/Format/invalid-json-schema-tag.yaml", + "tests/asyncapi-2.0/Format/invalid-syntax.yaml", + "tests/asyncapi-2.0/Format/valid.yaml", + "tests/asyncapi-2.0/File Structure/common.yaml", + "tests/asyncapi-2.0/File Structure/invalid-inexisting-file-ref.yaml", + "tests/asyncapi-2.0/File Structure/valid.yaml", + "tests/asyncapi-2.0/AsyncAPI Object/invalid-duplicate-tags.yaml", + "tests/asyncapi-2.0/AsyncAPI Object/invalid-missing-asyncapi.yaml", + "tests/asyncapi-2.0/AsyncAPI Object/invalid-missing-channels.yaml", + "tests/asyncapi-2.0/AsyncAPI Object/invalid-missing-info.yaml", + "tests/asyncapi-2.0/AsyncAPI Object/valid.yaml", + "tests/asyncapi-2.0/AsyncAPI Object/Fields Types/invalid-asyncapi-type.yaml", + "tests/asyncapi-2.0/AsyncAPI Object/Fields Types/invalid-channels-type.yaml", + "tests/asyncapi-2.0/AsyncAPI Object/Fields Types/invalid-components-type.yaml", + "tests/asyncapi-2.0/AsyncAPI Object/Fields Types/invalid-externalDocs-type.yaml", + "tests/asyncapi-2.0/AsyncAPI Object/Fields Types/invalid-id-type.yaml", + "tests/asyncapi-2.0/AsyncAPI Object/Fields Types/invalid-info-type.yaml", + "tests/asyncapi-2.0/AsyncAPI Object/Fields Types/invalid-servers-type.yaml", + "tests/asyncapi-2.0/AsyncAPI Object/Fields Types/invalid-tags-type.yaml", + "tests/asyncapi-2.0/AsyncAPI Version String/invalid-version-string-format.yaml", + "tests/asyncapi-2.0/AsyncAPI Version String/valid-major-minor-patch.yaml", + "tests/asyncapi-2.0/AsyncAPI Version String/valid-major-minor.yaml", + "tests/asyncapi-2.0/AsyncAPI Version String/valid-with-hyphen.yaml", + "tests/asyncapi-2.0/Identifier/invalid-uri-format.yaml", + "tests/asyncapi-2.0/Identifier/valid-uri.yaml", + "tests/asyncapi-2.0/Identifier/valid-urn.yaml", + "tests/asyncapi-2.0/Info Object/invalid-missing-title.yaml", + "tests/asyncapi-2.0/Info Object/invalid-missing-version.yaml", + "tests/asyncapi-2.0/Info Object/invalid-termsofservice-url-format.yaml", + "tests/asyncapi-2.0/Info Object/valid.yaml", + "tests/asyncapi-2.0/Info Object/Fields Types/invalid-contact-type.yaml", + "tests/asyncapi-2.0/Info Object/Fields Types/invalid-description-type.yaml", + "tests/asyncapi-2.0/Info Object/Fields Types/invalid-license-type.yaml", + "tests/asyncapi-2.0/Info Object/Fields Types/invalid-termsOfService-type.yaml", + "tests/asyncapi-2.0/Info Object/Fields Types/invalid-title-type.yaml", + "tests/asyncapi-2.0/Info Object/Fields Types/invalid-version-type.yaml", + "tests/asyncapi-2.0/Contact Object/invalid-email-format.yaml", + "tests/asyncapi-2.0/Contact Object/invalid-url-format.yaml", + "tests/asyncapi-2.0/Contact Object/valid.yaml", + "tests/asyncapi-2.0/Contact Object/Fields Types/invalid-email-type.yaml", + "tests/asyncapi-2.0/Contact Object/Fields Types/invalid-name-type.yaml", + "tests/asyncapi-2.0/Contact Object/Fields Types/invalid-url-type.yaml", + "tests/asyncapi-2.0/License Object/invalid-missing-name.yaml", + "tests/asyncapi-2.0/License Object/invalid-url-format.yaml", + "tests/asyncapi-2.0/License Object/valid.yaml", + "tests/asyncapi-2.0/License Object/Fields Types/invalid-name-type.yaml", + "tests/asyncapi-2.0/License Object/Fields Types/invalid-url-type.yaml", + "tests/asyncapi-2.0/Servers Object/invalid-patterned-field.yaml", + "tests/asyncapi-2.0/Servers Object/valid.yaml", + "tests/asyncapi-2.0/Server Object/invalid-inexisting-security-scheme.yaml", + "tests/asyncapi-2.0/Server Object/invalid-missing-protocol.yaml", + "tests/asyncapi-2.0/Server Object/invalid-missing-url.yaml", + "tests/asyncapi-2.0/Server Object/valid-multiple-servers.yaml", + "tests/asyncapi-2.0/Server Object/valid-not-official-protocol.yaml", + "tests/asyncapi-2.0/Server Object/valid-relative-url.yaml", + "tests/asyncapi-2.0/Server Object/valid-security.yaml", + "tests/asyncapi-2.0/Server Object/valid.yaml", + "tests/asyncapi-2.0/Server Object/Fields Types/invalid-bindings-type.yaml", + "tests/asyncapi-2.0/Server Object/Fields Types/invalid-description-type.yaml", + "tests/asyncapi-2.0/Server Object/Fields Types/invalid-protocol-type.yaml", + "tests/asyncapi-2.0/Server Object/Fields Types/invalid-protocolVersion-type.yaml", + "tests/asyncapi-2.0/Server Object/Fields Types/invalid-security-type.yaml", + "tests/asyncapi-2.0/Server Object/Fields Types/invalid-url-type.yaml", + "tests/asyncapi-2.0/Server Object/Fields Types/invalid-variables-type.yaml", + "tests/asyncapi-2.0/Server Variable Object/valid.yaml", + "tests/asyncapi-2.0/Server Variable Object/Fields Types/invalid-default-type.yaml", + "tests/asyncapi-2.0/Server Variable Object/Fields Types/invalid-description-type.yaml", + "tests/asyncapi-2.0/Server Variable Object/Fields Types/invalid-enum-type.yaml", + "tests/asyncapi-2.0/Server Variable Object/Fields Types/invalid-examples-type.yaml", + "tests/asyncapi-2.0/Channels Object/invalid-absolute-path.yaml", + "tests/asyncapi-2.0/Channels Object/invalid-fragment-used.yaml", + "tests/asyncapi-2.0/Channels Object/invalid-query-param-used.yaml", + "tests/asyncapi-2.0/Channels Object/valid.yaml", + "tests/asyncapi-2.0/Channels Object/Fields Types/invalid-channel-type.yaml", + "tests/asyncapi-2.0/Channel Item Object/invalid-external-ref-structure.yaml", + "tests/asyncapi-2.0/Channel Item Object/referenced.yaml", + "tests/asyncapi-2.0/Channel Item Object/referencedInvalid.yaml", + "tests/asyncapi-2.0/Channel Item Object/valid-external-ref.yaml", + "tests/asyncapi-2.0/Channel Item Object/valid-publish.yaml", + "tests/asyncapi-2.0/Channel Item Object/valid-subscribe.yaml", + "tests/asyncapi-2.0/Channel Item Object/Fields Types/invalid-bindings-type.yaml", + "tests/asyncapi-2.0/Channel Item Object/Fields Types/invalid-description-type.yaml", + "tests/asyncapi-2.0/Channel Item Object/Fields Types/invalid-parameters-type.yaml", + "tests/asyncapi-2.0/Channel Item Object/Fields Types/invalid-publish-type.yaml", + "tests/asyncapi-2.0/Channel Item Object/Fields Types/invalid-ref-type.yaml", + "tests/asyncapi-2.0/Channel Item Object/Fields Types/invalid-subscribe-type.yaml", + "tests/asyncapi-2.0/Operation Object/invalid-duplicate-operationId.yaml", + "tests/asyncapi-2.0/Operation Object/invalid-duplicate-tags.yaml", + "tests/asyncapi-2.0/Operation Object/valid-bare-minimum.yaml", + "tests/asyncapi-2.0/Operation Object/valid-case-sensitive-operationId.yaml", + "tests/asyncapi-2.0/Operation Object/valid-multiple-messages.yaml", + "tests/asyncapi-2.0/Operation Object/valid.yaml", + "tests/asyncapi-2.0/Operation Object/Fields Types/invalid-bindings-type.yaml", + "tests/asyncapi-2.0/Operation Object/Fields Types/invalid-description-type.yaml", + "tests/asyncapi-2.0/Operation Object/Fields Types/invalid-externalDocs-type.yaml", + "tests/asyncapi-2.0/Operation Object/Fields Types/invalid-message-type.yaml", + "tests/asyncapi-2.0/Operation Object/Fields Types/invalid-operationId-type.yaml", + "tests/asyncapi-2.0/Operation Object/Fields Types/invalid-summary-type.yaml", + "tests/asyncapi-2.0/Operation Object/Fields Types/invalid-tags-type.yaml", + "tests/asyncapi-2.0/Operation Object/Fields Types/invalid-traits-type.yaml", + "tests/asyncapi-2.0/Operation Trait Object/invalid-duplicate-operationId.yaml", + "tests/asyncapi-2.0/Operation Trait Object/invalid-duplicate-tags.yaml", + "tests/asyncapi-2.0/Operation Trait Object/invalid-trait-with-message.yaml", + "tests/asyncapi-2.0/Operation Trait Object/invalid-trait-with-traits.yaml", + "tests/asyncapi-2.0/Operation Trait Object/valid-case-sensetive-operationId.yaml", + "tests/asyncapi-2.0/Operation Trait Object/valid-empty-trait.yaml", + "tests/asyncapi-2.0/Operation Trait Object/valid.yaml", + "tests/asyncapi-2.0/Operation Trait Object/Fields Types/invalid-bindings-type.yaml", + "tests/asyncapi-2.0/Operation Trait Object/Fields Types/invalid-description-type.yaml", + "tests/asyncapi-2.0/Operation Trait Object/Fields Types/invalid-externalDocs-type.yaml", + "tests/asyncapi-2.0/Operation Trait Object/Fields Types/invalid-operationId-type.yaml", + "tests/asyncapi-2.0/Operation Trait Object/Fields Types/invalid-summary-type.yaml", + "tests/asyncapi-2.0/Operation Trait Object/Fields Types/invalid-tags-type.yaml", + "tests/asyncapi-2.0/Message Object/invalid-duplicate-tags.yaml", + "tests/asyncapi-2.0/Message Object/invalid-headers-type.yaml", + "tests/asyncapi-2.0/Message Object/invalid-missing-contentType.yaml", + "tests/asyncapi-2.0/Message Object/valid-internal-ref-correlationId.yaml", + "tests/asyncapi-2.0/Message Object/valid-internal-ref-header.yaml", + "tests/asyncapi-2.0/Message Object/valid.yaml", + "tests/asyncapi-2.0/Message Object/Fields Types/invalid-bindings-type.yaml", + "tests/asyncapi-2.0/Message Object/Fields Types/invalid-contentType-type.yaml", + "tests/asyncapi-2.0/Message Object/Fields Types/invalid-correlationId-type.yaml", + "tests/asyncapi-2.0/Message Object/Fields Types/invalid-description-type.yaml", + "tests/asyncapi-2.0/Message Object/Fields Types/invalid-examples-type.yaml", + "tests/asyncapi-2.0/Message Object/Fields Types/invalid-externalDocs-type.yaml", + "tests/asyncapi-2.0/Message Object/Fields Types/invalid-headers-type.yaml", + "tests/asyncapi-2.0/Message Object/Fields Types/invalid-name-type.yaml", + "tests/asyncapi-2.0/Message Object/Fields Types/invalid-schemaFormat-type.yaml", + "tests/asyncapi-2.0/Message Object/Fields Types/invalid-summary-type.yaml", + "tests/asyncapi-2.0/Message Object/Fields Types/invalid-tags-type.yaml", + "tests/asyncapi-2.0/Message Object/Fields Types/invalid-title-type.yaml", + "tests/asyncapi-2.0/Message Object/Fields Types/invalid-traits-type.yaml", + "tests/asyncapi-2.0/Message Trait Object/invalid-defines-payload.yaml", + "tests/asyncapi-2.0/Message Trait Object/invalid-defines-traits.yaml", + "tests/asyncapi-2.0/Message Trait Object/invalid-duplicate-tags.yaml", + "tests/asyncapi-2.0/Message Trait Object/invalid-headers-type.yaml", + "tests/asyncapi-2.0/Message Trait Object/invalid-missing-content-type.yaml", + "tests/asyncapi-2.0/Message Trait Object/valid-internal-ref-correlationId.yaml", + "tests/asyncapi-2.0/Message Trait Object/valid-internal-ref-header.yaml", + "tests/asyncapi-2.0/Message Trait Object/valid.yaml", + "tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-bindings-type.yaml", + "tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-contentType-type.yaml", + "tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-correlationId-type.yaml", + "tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-description-type.yaml", + "tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-examples-type.yaml", + "tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-externalDocs-type.yaml", + "tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-headers-type.yaml", + "tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-schemaFormat-type.yaml", + "tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-summary-type.yaml", + "tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-tags-type.yaml", + "tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-title-type.yaml", + "tests/asyncapi-2.0/Tag Object/invalid-missing-name.yaml", + "tests/asyncapi-2.0/Tag Object/valid.yaml", + "tests/asyncapi-2.0/Tag Object/Fields Types/invalid-description-type.yaml", + "tests/asyncapi-2.0/Tag Object/Fields Types/invalid-externalDocs-type.yaml", + "tests/asyncapi-2.0/Tag Object/Fields Types/invalid-name-type.yaml", + "tests/asyncapi-2.0/External Documentation Object/invalid-missing-url.yaml", + "tests/asyncapi-2.0/External Documentation Object/invalid-url-format.yaml", + "tests/asyncapi-2.0/External Documentation Object/valid.yaml", + "tests/asyncapi-2.0/External Documentation Object/Fields Types/invalid-description-type.yaml", + "tests/asyncapi-2.0/External Documentation Object/Fields Types/invalid-url-type.yaml", + "tests/asyncapi-2.0/Components Object/invalid-channelBindings-key.yaml", + "tests/asyncapi-2.0/Components Object/invalid-correlationIds-key.yaml", + "tests/asyncapi-2.0/Components Object/invalid-messageBindings-key.yaml", + "tests/asyncapi-2.0/Components Object/invalid-messageTraits-key.yaml", + "tests/asyncapi-2.0/Components Object/invalid-messages-key.yaml", + "tests/asyncapi-2.0/Components Object/invalid-operationBindings-key.yaml", + "tests/asyncapi-2.0/Components Object/invalid-operationTraits-key.yaml", + "tests/asyncapi-2.0/Components Object/invalid-parameters-key.yaml", + "tests/asyncapi-2.0/Components Object/invalid-schemas-key.yaml", + "tests/asyncapi-2.0/Components Object/invalid-securitySchemes-key.yaml", + "tests/asyncapi-2.0/Components Object/invalid-serverBindings-key.yaml", + "tests/asyncapi-2.0/Components Object/valid-complete.yaml", + "tests/asyncapi-2.0/Components Object/Fields Types/invalid- messages-type.yaml", + "tests/asyncapi-2.0/Components Object/Fields Types/invalid-channelBindings-type.yaml", + "tests/asyncapi-2.0/Components Object/Fields Types/invalid-correlationIds-type.yaml", + "tests/asyncapi-2.0/Components Object/Fields Types/invalid-messageBindings-type.yaml", + "tests/asyncapi-2.0/Components Object/Fields Types/invalid-messageTraits-type.yaml", + "tests/asyncapi-2.0/Components Object/Fields Types/invalid-operationBindings-type.yaml", + "tests/asyncapi-2.0/Components Object/Fields Types/invalid-operationTraits-type.yaml", + "tests/asyncapi-2.0/Components Object/Fields Types/invalid-parameters-type.yaml", + "tests/asyncapi-2.0/Components Object/Fields Types/invalid-schemas-type.yaml", + "tests/asyncapi-2.0/Components Object/Fields Types/invalid-securitySchemes-type.yaml", + "tests/asyncapi-2.0/Components Object/Fields Types/invalid-serverBindings-type.yaml", + "tests/asyncapi-2.0/Reference Object/lib.yaml", + "tests/asyncapi-2.0/Reference Object/valid-external-ref-channelBindings.yaml", + "tests/asyncapi-2.0/Reference Object/valid-external-ref-correlationId.yaml", + "tests/asyncapi-2.0/Reference Object/valid-external-ref-message.yaml", + "tests/asyncapi-2.0/Reference Object/valid-external-ref-messageBindings.yaml", + "tests/asyncapi-2.0/Reference Object/valid-external-ref-messageTraits.yaml", + "tests/asyncapi-2.0/Reference Object/valid-external-ref-operationBindings.yaml", + "tests/asyncapi-2.0/Reference Object/valid-external-ref-operationTraits.yaml", + "tests/asyncapi-2.0/Reference Object/valid-external-ref-parameter.yaml", + "tests/asyncapi-2.0/Reference Object/valid-external-ref-schema.yaml", + "tests/asyncapi-2.0/Reference Object/valid-external-ref-securityScheme.yaml", + "tests/asyncapi-2.0/Reference Object/valid-external-ref-serverBindings.yaml", + "tests/asyncapi-2.0/Reference Object/Fields Types/invalid-ref-type.yaml", + "tests/asyncapi-2.0/Schema Object/invalid-polymorphism-missing-discriminator.yaml", + "tests/asyncapi-2.0/Schema Object/valid-composition.yaml", + "tests/asyncapi-2.0/Schema Object/valid-polymorphism.yaml", + "tests/asyncapi-2.0/Schema Object/valid.yaml", + "tests/asyncapi-2.0/Security Scheme Object/userPassword/invalid-missing-type.yaml", + "tests/asyncapi-2.0/Security Scheme Object/userPassword/valid.yaml", + "tests/asyncapi-2.0/Security Scheme Object/symmetricEncryption/valid.yaml", + "tests/asyncapi-2.0/Security Scheme Object/openIdConnect/valid.yaml", + "tests/asyncapi-2.0/Security Scheme Object/oauth2/invalid-authorizationUrl-format.yaml", + "tests/asyncapi-2.0/Security Scheme Object/oauth2/invalid-missing-authorizationCode-authrozationUrl.yaml", + "tests/asyncapi-2.0/Security Scheme Object/oauth2/invalid-missing-authorizationCode-tokenUrl.yaml", + "tests/asyncapi-2.0/Security Scheme Object/oauth2/invalid-missing-clientCredentials-tokenUrl.yaml", + "tests/asyncapi-2.0/Security Scheme Object/oauth2/invalid-missing-flows.yaml", + "tests/asyncapi-2.0/Security Scheme Object/oauth2/invalid-missing-implicit-authorizationUrl.yaml", + "tests/asyncapi-2.0/Security Scheme Object/oauth2/invalid-missing-scopes.yaml", + "tests/asyncapi-2.0/Security Scheme Object/oauth2/invalid-password-missing-tokenUrl.yaml", + "tests/asyncapi-2.0/Security Scheme Object/oauth2/invalid-refreshUrl-format.yaml", + "tests/asyncapi-2.0/Security Scheme Object/oauth2/invalid-tokenUrl-format.yaml", + "tests/asyncapi-2.0/Security Scheme Object/oauth2/valid.yaml", + "tests/asyncapi-2.0/Security Scheme Object/oauth2/Fields Types/invalid-authorizationCode-type.yaml", + "tests/asyncapi-2.0/Security Scheme Object/oauth2/Fields Types/invalid-authorizationUrl-type.yaml", + "tests/asyncapi-2.0/Security Scheme Object/oauth2/Fields Types/invalid-clientCredentials-type.yaml", + "tests/asyncapi-2.0/Security Scheme Object/oauth2/Fields Types/invalid-implicit-type.yaml", + "tests/asyncapi-2.0/Security Scheme Object/oauth2/Fields Types/invalid-password-type.yaml", + "tests/asyncapi-2.0/Security Scheme Object/oauth2/Fields Types/invalid-refreshUrl-type.yaml", + "tests/asyncapi-2.0/Security Scheme Object/oauth2/Fields Types/invalid-scopes-type.yaml", + "tests/asyncapi-2.0/Security Scheme Object/oauth2/Fields Types/invalid-tokenUrl-type.yaml", + "tests/asyncapi-2.0/Security Scheme Object/httpApiKey/invalid-in-value.yaml", + "tests/asyncapi-2.0/Security Scheme Object/httpApiKey/invalid-missing-in-property.yaml", + "tests/asyncapi-2.0/Security Scheme Object/httpApiKey/invalid-missing-name.yaml", + "tests/asyncapi-2.0/Security Scheme Object/httpApiKey/valid.yaml", + "tests/asyncapi-2.0/Security Scheme Object/http/invalid-missing-scheme.yaml", + "tests/asyncapi-2.0/Security Scheme Object/http/valid.yaml", + "tests/asyncapi-2.0/Security Scheme Object/asymmetricEncryption/valid.yaml", + "tests/asyncapi-2.0/Security Scheme Object/apiKey/invalid-in-value.yaml", + "tests/asyncapi-2.0/Security Scheme Object/apiKey/invalid-missing-in-property.yaml", + "tests/asyncapi-2.0/Security Scheme Object/apiKey/valid.yaml", + "tests/asyncapi-2.0/Security Scheme Object/X509/valid.yaml", + "tests/asyncapi-2.0/Security Scheme Object/Fields Types/invalid-bearerFormat-type.yaml", + "tests/asyncapi-2.0/Security Scheme Object/Fields Types/invalid-description-type.yaml", + "tests/asyncapi-2.0/Security Scheme Object/Fields Types/invalid-flows-type.yaml", + "tests/asyncapi-2.0/Security Scheme Object/Fields Types/invalid-in-type.yaml", + "tests/asyncapi-2.0/Security Scheme Object/Fields Types/invalid-name-type.yaml", + "tests/asyncapi-2.0/Security Scheme Object/Fields Types/invalid-openIdConnectUrl-type.yaml", + "tests/asyncapi-2.0/Security Scheme Object/Fields Types/invalid-scheme-type.yaml", + "tests/asyncapi-2.0/Security Scheme Object/Fields Types/invalid-type-type.yaml", + "tests/asyncapi-2.0/Security Requirement Object/invalid-X509-non-empty-array.yaml", + "tests/asyncapi-2.0/Security Requirement Object/invalid-apiKey-non-empty-array.yaml", + "tests/asyncapi-2.0/Security Requirement Object/invalid-asymmetricEncryption-non-empty-array.yaml", + "tests/asyncapi-2.0/Security Requirement Object/invalid-http-non-empty-array.yaml", + "tests/asyncapi-2.0/Security Requirement Object/invalid-httpApiKey-non-empty-array.yaml", + "tests/asyncapi-2.0/Security Requirement Object/invalid-inexisting-scheme.yaml", + "tests/asyncapi-2.0/Security Requirement Object/invalid-oauth2-without-scopes.yaml", + "tests/asyncapi-2.0/Security Requirement Object/invalid-openIdConnect-without-scopes.yaml", + "tests/asyncapi-2.0/Security Requirement Object/invalid-symmetricEncryption-non-empty-array.yaml", + "tests/asyncapi-2.0/Security Requirement Object/invalid-userPassword-non-empty-array.yaml", + "tests/asyncapi-2.0/Security Requirement Object/Fields Types/invalid-name-type.yaml", + "tests/asyncapi-2.0/Parameters Object/invalid-not-matching-param-name.yaml", + "tests/asyncapi-2.0/Parameters Object/invalid-pattern-field.yaml", + "tests/asyncapi-2.0/Parameters Object/valid-internal-ref.yaml", + "tests/asyncapi-2.0/Parameters Object/valid.yaml", + "tests/asyncapi-2.0/Parameters Object/Fields Types/invalid-parameter-type.yaml", + "tests/asyncapi-2.0/Parameter Object/invalid-runtime-expression.yaml", + "tests/asyncapi-2.0/Parameter Object/valid-ref-schema.yaml", + "tests/asyncapi-2.0/Parameter Object/valid.yaml", + "tests/asyncapi-2.0/Parameter Object/Fields Types/invalid-description-type.yaml", + "tests/asyncapi-2.0/Parameter Object/Fields Types/invalid-location-type.yaml", + "tests/asyncapi-2.0/Parameter Object/Fields Types/invalid-schema-type.yaml", + "tests/asyncapi-2.0/Server Bindings Object/mqtt/invalid-extra-properties.yaml", + "tests/asyncapi-2.0/Server Bindings Object/mqtt/valid.yaml", + "tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-bindingVersion-type.yaml", + "tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-cleanSession-type.yaml", + "tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-clientId-type.yaml", + "tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-keepAlive-type.yaml", + "tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-qos-type.yaml", + "tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-retain-type.yaml", + "tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-topic-type.yaml", + "tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-type.yaml", + "tests/asyncapi-2.0/Channel Bindings Object/ws/invalid-extra-properties.yaml", + "tests/asyncapi-2.0/Channel Bindings Object/ws/invalid-headers-type.yaml", + "tests/asyncapi-2.0/Channel Bindings Object/ws/invalid-method.yaml", + "tests/asyncapi-2.0/Channel Bindings Object/ws/invalid-query-type.yaml", + "tests/asyncapi-2.0/Channel Bindings Object/ws/valid.yaml", + "tests/asyncapi-2.0/Channel Bindings Object/ws/Fields Types/invalid-bindingVersion-type.yaml", + "tests/asyncapi-2.0/Channel Bindings Object/ws/Fields Types/invalid-headers-type.yaml", + "tests/asyncapi-2.0/Channel Bindings Object/ws/Fields Types/invalid-method-type.yaml", + "tests/asyncapi-2.0/Channel Bindings Object/ws/Fields Types/invalid-query-type.yaml", + "tests/asyncapi-2.0/Channel Bindings Object/amqp/invalid-exchange-name-length.yaml.yaml", + "tests/asyncapi-2.0/Channel Bindings Object/amqp/invalid-exchange-type.yaml", + "tests/asyncapi-2.0/Channel Bindings Object/amqp/invalid-is-value.yaml", + "tests/asyncapi-2.0/Channel Bindings Object/amqp/invalid-queue-name-length.yaml", + "tests/asyncapi-2.0/Channel Bindings Object/amqp/valid.yaml", + "tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-bindingVersion-type.yaml", + "tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-exchange-autoDelete-type.yaml", + "tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-exchange-durable-type.yaml", + "tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-exchange-name-type.yaml", + "tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-exchange-type-type.yaml", + "tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-exchange-type.yaml", + "tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-exchange-vhost-type.yaml", + "tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-is-type.yaml", + "tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-queue-autoDelete-type.yaml", + "tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-queue-durable-type.yaml", + "tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-queue-exclusive-type.yaml", + "tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-queue-name-type.yaml", + "tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-queue-type.yaml", + "tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-queue-vhost-type.yaml", + "tests/asyncapi-2.0/Operation Bindings Object/mqtt/invalid-extra-properties.yaml", + "tests/asyncapi-2.0/Operation Bindings Object/mqtt/invalid-qos-value.yaml", + "tests/asyncapi-2.0/Operation Bindings Object/mqtt/valid.yaml", + "tests/asyncapi-2.0/Operation Bindings Object/mqtt/Fields Types/invalid-bindingVersion-type.yaml", + "tests/asyncapi-2.0/Operation Bindings Object/mqtt/Fields Types/invalid-qos-type.yaml", + "tests/asyncapi-2.0/Operation Bindings Object/mqtt/Fields Types/invalid-retain-type.yaml", + "tests/asyncapi-2.0/Operation Bindings Object/kafka/invalid-extra-properties.yaml", + "tests/asyncapi-2.0/Operation Bindings Object/kafka/valid.yaml", + "tests/asyncapi-2.0/Operation Bindings Object/kafka/Fields Types/invalid-bindingVersion-type.yaml", + "tests/asyncapi-2.0/Operation Bindings Object/kafka/Fields Types/invalid-clientId-type.yaml", + "tests/asyncapi-2.0/Operation Bindings Object/kafka/Fields Types/invalid-groupId-type.yaml", + "tests/asyncapi-2.0/Operation Bindings Object/http/invalid-method-value.yaml", + "tests/asyncapi-2.0/Operation Bindings Object/http/invalid-missing-type.yaml", + "tests/asyncapi-2.0/Operation Bindings Object/http/invalid-query-schema-type.yaml", + "tests/asyncapi-2.0/Operation Bindings Object/http/invalid-type-value.yaml", + "tests/asyncapi-2.0/Operation Bindings Object/http/valid.yaml", + "tests/asyncapi-2.0/Operation Bindings Object/http/Fields Types/invalid-bindingVersion-type.yaml", + "tests/asyncapi-2.0/Operation Bindings Object/http/Fields Types/invalid-method-type.yaml", + "tests/asyncapi-2.0/Operation Bindings Object/http/Fields Types/invalid-query-type.yaml", + "tests/asyncapi-2.0/Operation Bindings Object/http/Fields Types/invalid-type-type.yaml", + "tests/asyncapi-2.0/Operation Bindings Object/amqp/invalid-deliveryMode-value.yaml", + "tests/asyncapi-2.0/Operation Bindings Object/amqp/invalid-expiration-below-zero.yaml", + "tests/asyncapi-2.0/Operation Bindings Object/amqp/invalid-extra-properties.yaml", + "tests/asyncapi-2.0/Operation Bindings Object/amqp/valid.yaml", + "tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-ack-type.yaml", + "tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-bcc-type.yaml", + "tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-bindingVersion-type.yaml", + "tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-cc-type.yaml", + "tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-deliveryMode-type.yaml", + "tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-expiration-type.yaml", + "tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-mandatory-type.yaml", + "tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-priority-type.yaml", + "tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-replyTo-type.yaml", + "tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-timestamp-type.yaml", + "tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-userId-type.yaml", + "tests/asyncapi-2.0/Message Bindings Object/mqtt/invalid-extra-properties.yaml", + "tests/asyncapi-2.0/Message Bindings Object/mqtt/valid.yaml", + "tests/asyncapi-2.0/Message Bindings Object/mqtt/Fields Types/invalid-bindingVersion-type.yaml", + "tests/asyncapi-2.0/Message Bindings Object/kafka/invalid-extra-properties.yaml", + "tests/asyncapi-2.0/Message Bindings Object/kafka/valid.yaml", + "tests/asyncapi-2.0/Message Bindings Object/kafka/Fields Types/invalid-bindingVersion-type.yaml", + "tests/asyncapi-2.0/Message Bindings Object/kafka/Fields Types/invalid-key-type.yaml", + "tests/asyncapi-2.0/Message Bindings Object/http/invalid-extra-properties.yaml", + "tests/asyncapi-2.0/Message Bindings Object/http/invalid-headers-type.yaml", + "tests/asyncapi-2.0/Message Bindings Object/http/valid.yaml", + "tests/asyncapi-2.0/Message Bindings Object/http/Fields Types/invalid-bindingVersion-type.yaml", + "tests/asyncapi-2.0/Message Bindings Object/http/Fields Types/invalid-headers-type.yaml", + "tests/asyncapi-2.0/Message Bindings Object/amqp/invalid-extra-properties.yaml", + "tests/asyncapi-2.0/Message Bindings Object/amqp/valid.yaml", + "tests/asyncapi-2.0/Message Bindings Object/amqp/Fields Types/invalid-bindingVersion-type.yaml", + "tests/asyncapi-2.0/Message Bindings Object/amqp/Fields Types/invalid-contentEncoding-type.yaml", + "tests/asyncapi-2.0/Message Bindings Object/amqp/Fields Types/invalid-messageType-type.yaml", + "tests/asyncapi-2.0/Correlation ID Object/invalid-location-expression.yaml", + "tests/asyncapi-2.0/Correlation ID Object/invalid-missing-location.yaml", + "tests/asyncapi-2.0/Correlation ID Object/valid.yaml", + "tests/asyncapi-2.0/Correlation ID Object/Fields Types/invalid-description-type.yaml", + "tests/asyncapi-2.0/Correlation ID Object/Fields Types/invalid-location-type.yaml", + "tests/asyncapi-2.0/Specification Extensions/valid.yaml" + ] +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 00000000..21333589 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,21 @@ +{ + "name": "tck", + "version": "1.1.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "foreachasync": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/foreachasync/-/foreachasync-3.0.0.tgz", + "integrity": "sha1-VQKYfchxS+M5IJfzLgBxyd7gfPY=" + }, + "walk": { + "version": "2.3.14", + "resolved": "https://registry.npmjs.org/walk/-/walk-2.3.14.tgz", + "integrity": "sha512-5skcWAUmySj6hkBdH6B6+3ddMjVQYH5Qy9QGbPmN8kVmLteXk+yVXg+yfk1nbX30EYakahLrr8iPcCxJQSCBeg==", + "requires": { + "foreachasync": "^3.0.0" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 00000000..a0776b83 --- /dev/null +++ b/package.json @@ -0,0 +1,22 @@ +{ + "name": "tck", + "description": "AsyncAPI test compatibility kit", + "version": "1.1.0", + "main": "genmanifest.js tests/asyncapi-2.0", + "private": true, + "repository": { + "type": "git", + "url": "git@github.com:asyncapi/tck.git" + }, + "keywords": [ + "asyncapi", + "test framework" + ], + "license": "Apache-2.0", + "dependencies": { + "walk": "^2.3.14" + }, + "scripts": { + "gen-manifest": "node genmanifest.js tests/asyncapi-2.0" + } +} From cf85aa9b929c872860a575119e16b577d9d409e6 Mon Sep 17 00:00:00 2001 From: Artem Kostiuk Date: Fri, 17 Jan 2020 11:20:16 +0200 Subject: [PATCH 15/26] Port initial version of tck runner --- CONTRIBUTING.md | 2 +- package.json | 1 + runner/.gitignore | 68 ++++ runner/Makefile | 45 +++ runner/README.md | 22 ++ runner/html-reporter/README.md | 10 + runner/html-reporter/package-lock.json | 5 + runner/html-reporter/package.json | 14 + runner/html-reporter/src/index.js | 144 ++++++++ .../templates/detailed_report.mustache | 89 +++++ .../templates/features_stats.mustache | 44 +++ runner/html-reporter/templates/index.mustache | 45 +++ runner/js/.eslintrc.json | 3 + runner/js/.gitignore | 61 ++++ runner/js/README.md | 42 +++ runner/js/package-lock.json | 309 ++++++++++++++++++ runner/js/package.json | 27 ++ runner/js/src/index.js | 55 ++++ runner/js/src/parsers.js | 37 +++ runner/js/src/utils.js | 22 ++ runner/reports/html/bootstrap.min.css | 14 + runner/reports/html/custom.css | 7 + 22 files changed, 1065 insertions(+), 1 deletion(-) create mode 100644 runner/.gitignore create mode 100644 runner/Makefile create mode 100644 runner/README.md create mode 100644 runner/html-reporter/README.md create mode 100644 runner/html-reporter/package-lock.json create mode 100644 runner/html-reporter/package.json create mode 100644 runner/html-reporter/src/index.js create mode 100644 runner/html-reporter/templates/detailed_report.mustache create mode 100644 runner/html-reporter/templates/features_stats.mustache create mode 100644 runner/html-reporter/templates/index.mustache create mode 100644 runner/js/.eslintrc.json create mode 100644 runner/js/.gitignore create mode 100644 runner/js/README.md create mode 100644 runner/js/package-lock.json create mode 100644 runner/js/package.json create mode 100644 runner/js/src/index.js create mode 100644 runner/js/src/parsers.js create mode 100644 runner/js/src/utils.js create mode 100644 runner/reports/html/bootstrap.min.css create mode 100644 runner/reports/html/custom.css diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c0dd96ff..534d7fe2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -8,4 +8,4 @@ Please place new tests in one of `tests/asyncapi-2.0` sub-folders. Name of the t ## Running tests -We've created a separate project called [yaml-tck-runner](https://github.com/yaml-org/yaml-tck-runner) to run all the tests contained in the RAML TCK. By following the instructions on that repository, you should be able to test any new test case that you may want to contribute against the different projects that this [yaml-tck-runner](https://github.com/yaml-org/yaml-tck-runner) covers. +We've created a separate project called [tck runner](./runner) to run all the tests contained in the AsyncAPI TCK. By following the instructions on that directory, you should be able to test any new test case that you may want to contribute against the different projects that this runner covers. diff --git a/package.json b/package.json index a0776b83..2054ad6b 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "version": "1.1.0", "main": "genmanifest.js tests/asyncapi-2.0", "private": true, + "author": "AsyncAPI Team", "repository": { "type": "git", "url": "git@github.com:asyncapi/tck.git" diff --git a/runner/.gitignore b/runner/.gitignore new file mode 100644 index 00000000..9904b6f5 --- /dev/null +++ b/runner/.gitignore @@ -0,0 +1,68 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env + +# next.js build output +.next + +# Java runner +.gradle +java/build/ + +reports/json/ +reports/html/*.html diff --git a/runner/Makefile b/runner/Makefile new file mode 100644 index 00000000..07010773 --- /dev/null +++ b/runner/Makefile @@ -0,0 +1,45 @@ +ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) +REPORTER_DIR:=$(ROOT_DIR)/html-reporter +REPORTS_JSON:=$(ROOT_DIR)/reports/json +JS_RUNNER_DIR:=$(ROOT_DIR)/js + + +# asyncapi/tck branch with manifest.json in its root +TCK_BRANCH:=add_tck_tests + + +.ONESHELL: +all: clean install report generate-html + +all-js: install-html-reporter \ + install-js \ + report-js \ + generate-html + +install: install-html-reporter \ + install-js + +install-html-reporter: + cd $(REPORTER_DIR) + npm install . + +install-js: clean-js + cd $(JS_RUNNER_DIR) + npm install . + +report: report-js + +report-js: + cd $(JS_RUNNER_DIR) + node src/index.js --parser asyncapi-parser --outdir $(REPORTS_JSON) --branch $(TCK_BRANCH) +# node src/index.js --parser amf-client-js --outdir $(REPORTS_JSON) --branch $(TCK_BRANCH) + +generate-html: + cd $(REPORTER_DIR) + node src/index.js + +clean: clean-js + rm -f $(REPORTS_JSON)/* + +clean-js: + rm -rf $(JS_RUNNER_DIR)/node_modules diff --git a/runner/README.md b/runner/README.md new file mode 100644 index 00000000..01d9a7f1 --- /dev/null +++ b/runner/README.md @@ -0,0 +1,22 @@ +# asyncapi/tck/runner +Run several AsyncAPI parsers/validators against https://github.com/asyncapi/tck + +## Generating report + +Following command will install all runners, run them and generate HTML report: +```sh +$ make +``` + +Then you can open generated HTML report (`reports/html/index.html`) in your browser. + +## JavaScript +Parsers tested: +* [asyncapi-parser](https://github.com/asyncapi/parser-js) +* [amf-client-js](https://github.com/aml-org/amf) + +To generate only JS parsers report: +```sh +$ make clean +$ make all-js +``` diff --git a/runner/html-reporter/README.md b/runner/html-reporter/README.md new file mode 100644 index 00000000..7b167ac4 --- /dev/null +++ b/runner/html-reporter/README.md @@ -0,0 +1,10 @@ +## Install and run + +1. Generate parsers json reports + +2. +```sh +$ npm install . +$ node src/index.js +$ browse ../reports/html/index.html +``` diff --git a/runner/html-reporter/package-lock.json b/runner/html-reporter/package-lock.json new file mode 100644 index 00000000..9c86ccab --- /dev/null +++ b/runner/html-reporter/package-lock.json @@ -0,0 +1,5 @@ +{ + "name": "asyncapi/tck/runner/reporter", + "version": "1.0.0", + "lockfileVersion": 1 +} diff --git a/runner/html-reporter/package.json b/runner/html-reporter/package.json new file mode 100644 index 00000000..29a0626c --- /dev/null +++ b/runner/html-reporter/package.json @@ -0,0 +1,14 @@ +{ + "name": "asyncapi/tck/runner/reporter", + "version": "1.0.0", + "description": "", + "main": "src/index.js", + "scripts": {}, + "keywords": [], + "author": "AsyncAPI Team", + "license": "Apache-2.0", + "dependencies": { + "mustache": "^3.0.1" + }, + "devDependencies": {} +} diff --git a/runner/html-reporter/src/index.js b/runner/html-reporter/src/index.js new file mode 100644 index 00000000..462e6ba4 --- /dev/null +++ b/runner/html-reporter/src/index.js @@ -0,0 +1,144 @@ +const path = require('path') +const fs = require('fs') +const Mustache = require('mustache') + +/* Runs all the logic */ +function main () { + const reportsDir = path.join(__dirname, '..', '..', 'reports', 'json') + let stats = [] + fs.readdirSync(reportsDir).forEach(fpath => { + if (!fpath.endsWith('.json')) { + return + } + let fullPath = path.join(reportsDir, fpath) + console.log(`Processing report: ${fullPath}`) + let report = JSON.parse(fs.readFileSync(fullPath)) + interpretReport(report) + stats.push(composeReportStats(report)) + renderTemplate( + report, 'detailed_report', + `${report.parser}_detailed_report`) + + let featuresStats = composeFeaturesStats(report) + renderTemplate( + featuresStats, 'features_stats', + `${report.parser}_features_stats`) + }) + renderTemplate({stats: stats}, 'index', 'index') +} + +/* + * Inverts invalid files parsing results; + * Composes repo url from relative file path; + * Extracts "feature" name from file path; +*/ +function interpretReport (report) { + const repo = `https://github.com/asyncapi/tck/tree/${report.branch}` + report.results.forEach(result => { + result.invalid = shouldFail(result.file) + if (result.invalid) { + delete result.error + result.success = !result.success + if (!result.success) { + result.error = 'Parsing expected to fail but succeeded' + } + } + result.file = result.file.startsWith('/') + ? result.file.slice(1) + : result.file + result.fileUrl = `${repo}/${result.file}` + + // Pick first 3 directories names as a feature name + result.feature = path.dirname(result.file) + .split('/').slice(0, 3).join('/') + }) +} + +/* + Composes single parser report stats: + * number of successfully passed/total valid/invalid files tests; + * % of passed files tests; +*/ +function composeReportStats (report) { + let stats = { + parser: report.parser, + valid: {success: 0, total: 0, successPerc: 0}, + invalid: {success: 0, total: 0, successPerc: 0}, + all: {success: 0, total: report.results.length, successPerc: 0} + } + const invalid = report.results.filter(r => { return r.invalid }) + const invalidSuccess = invalid.filter(r => { return r.success }) + stats.invalid.total = invalid.length + stats.invalid.success = invalidSuccess.length + stats.invalid.successPerc = calculateSuccessPerc(stats.invalid) + + const valid = report.results.filter(r => { return !r.invalid }) + const validSuccess = valid.filter(r => { return r.success }) + stats.valid.total = valid.length + stats.valid.success = validSuccess.length + stats.valid.successPerc = calculateSuccessPerc(stats.valid) + + stats.all.success = invalidSuccess.length + validSuccess.length + stats.all.successPerc = calculateSuccessPerc(stats.all) + + return stats +} + +/* Calculates success percentage */ +function calculateSuccessPerc (data) { + let successPerc = Math.round((data.success / data.total) * 100) + if (isNaN(successPerc)) { + successPerc = 100 + } + return successPerc +} + +/* + Composes single parser features report. + It includes features names and number of passed/all valid/invalid + files for each parser. +*/ +function composeFeaturesStats (report) { + let frep = { + parser: report.parser, + stats: [] + } + // Group by feature name + let grouped = {} + report.results.forEach(result => { + if (grouped[result.feature] === undefined) { + grouped[result.feature] = [] + } + grouped[result.feature].push(result) + }) + // Compose stats for each feature + for (var featureName in grouped) { + if (grouped.hasOwnProperty(featureName)) { + let stats = composeReportStats({ + results: grouped[featureName] + }) + stats.feature = featureName + frep.stats.push(stats) + } + } + return frep +} + +/* Renders single Mustache template with data and writes it to html file */ +function renderTemplate (data, tmplName, htmlName) { + const inPath = path.join( + __dirname, '..', 'templates', `${tmplName}.mustache`) + const tmplStr = fs.readFileSync(inPath, 'utf-8') + const htmlStr = Mustache.render(tmplStr, data) + const outDir = path.join(__dirname, '..', '..', 'reports', 'html') + const outPath = path.join(outDir, `${htmlName}.html`) + fs.writeFileSync(outPath, htmlStr) + console.log(`Rendered HTML: ${outPath}`) +} + +/* Checks whether a file is expected to fail */ +function shouldFail (fpath) { + return fpath.toLowerCase().includes('invalid') +} + +main() diff --git a/runner/html-reporter/templates/detailed_report.mustache b/runner/html-reporter/templates/detailed_report.mustache new file mode 100644 index 00000000..d71fbcd5 --- /dev/null +++ b/runner/html-reporter/templates/detailed_report.mustache @@ -0,0 +1,89 @@ + + + + Detailed report: {{parser}} + + + + + + + +
+

Overview > Detailed report: {{parser}}

+ + + + + + + + + {{#results}} + + + + + {{#error}} + + + + {{/error}} + {{/results}} + +
File + Success
+ + +
+ {{file}} + + {{#success}}Yes{{/success}} + {{^success}}No{{/success}} +
{{error}}
+
+ + diff --git a/runner/html-reporter/templates/features_stats.mustache b/runner/html-reporter/templates/features_stats.mustache new file mode 100644 index 00000000..9b9f362d --- /dev/null +++ b/runner/html-reporter/templates/features_stats.mustache @@ -0,0 +1,44 @@ + + + + Features stats: {{parser}} + + + + + + +
+

Overview > Features stats: {{parser}}

+ + + + + + + + + + + {{#stats}} + + + + + + + {{/stats}} + +
FeatureValid Files (passed/all)Invalid Files (passed/all)Total (passed/all)
{{feature}} + {{valid.successPerc}}% + ({{valid.success}}/{{valid.total}}) + + {{invalid.successPerc}}% + ({{invalid.success}}/{{invalid.total}}) + + {{all.successPerc}}% + ({{all.success}}/{{all.total}}) +
+
+ + diff --git a/runner/html-reporter/templates/index.mustache b/runner/html-reporter/templates/index.mustache new file mode 100644 index 00000000..b093456a --- /dev/null +++ b/runner/html-reporter/templates/index.mustache @@ -0,0 +1,45 @@ + + + + AsyncAPI Parsers Overview + + + + + + +
+

Overview

+ + + + + + + + + + + + {{#stats}} + + + + + + + + + {{/stats}} + +
ParserValid Files (passed/all)Invalid Files (passed/all)Total (passed/all)
{{parser}} + {{valid.successPerc}}% + ({{valid.success}}/{{valid.total}}) + + {{invalid.successPerc}}% + ({{invalid.success}}/{{invalid.total}}) + {{all.successPerc}}% + ({{all.success}}/{{all.total}})Detailed reportFeatures stats
+
+ + diff --git a/runner/js/.eslintrc.json b/runner/js/.eslintrc.json new file mode 100644 index 00000000..d6582362 --- /dev/null +++ b/runner/js/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "standard" +} \ No newline at end of file diff --git a/runner/js/.gitignore b/runner/js/.gitignore new file mode 100644 index 00000000..ad46b308 --- /dev/null +++ b/runner/js/.gitignore @@ -0,0 +1,61 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env + +# next.js build output +.next diff --git a/runner/js/README.md b/runner/js/README.md new file mode 100644 index 00000000..35545144 --- /dev/null +++ b/runner/js/README.md @@ -0,0 +1,42 @@ +## About + +Simple test of few AsyncAPI JS parsers. Tests simply try to parse a set of examples and report if parser returned an error. + +Running tests produces JSON reports. + +A fine collection of AsyncAPI files can be composed each containing one/few AsyncAPI features to test those in isolation. + +Uses [AsyncAPI/tck](https://github.com/asyncapi/tck/tests/asyncapi-2.0) as a source of AsyncAPI for tests. + +NOTE: If file name contains "invalid" parsing of it is expected to fail. + +## Install + +```sh +$ git clone git@github.com:asyncapi/tck.git +$ cd tck/runner/js +$ npm install . +``` + +## Run + +```sh +$ node src/index.js --parser PARSER_NAME --outdir ./reports/json --branch develop +``` + +## Options + +Parser: +```sh +$ node src/index.js --parser asyncapi-parser/amf-client-js +``` + +Output JSON report directory (defaults to `./`): +```sh +$ node src/index.js --parser asyncapi-parser --outdir ./reports/json --branch develop +``` + +AsyncAPI/tck branch to load AsyncAPI files from: +```sh +$ node src/index.js --parser asyncapi-parser --branch develop +``` diff --git a/runner/js/package-lock.json b/runner/js/package-lock.json new file mode 100644 index 00000000..eba03f53 --- /dev/null +++ b/runner/js/package-lock.json @@ -0,0 +1,309 @@ +{ + "name": "asyncapi/tck/runner/js", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "ajv": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.2.tgz", + "integrity": "sha512-hOs7GfvI6tUI1LfZddH82ky6mOMyTuY0mk7kE2pWpmhhUSkumzaTO5vbVwij39MdwPQWCV4Zv57Eo06NtL/GVA==", + "requires": { + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.1" + } + }, + "amf-client-js": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/amf-client-js/-/amf-client-js-4.0.4.tgz", + "integrity": "sha512-2WsNFrLCa6oJTRHeMu80NKVD4b8vNfL37iUDLtxPp4n8ChdR4o39F2yuT4/V9qRBDgW2cLB1FXzvO8ZCHIHclg==", + "requires": { + "ajv": "6.5.2", + "amf-shacl-node": "1.1.1" + } + }, + "amf-shacl-node": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/amf-shacl-node/-/amf-shacl-node-1.1.1.tgz", + "integrity": "sha512-CoW08R+Y5VluBhC0IT11yJMJqVfuYVa8JHKopL4sXXCgTjtKikn1dyfOmY/b/u0WVKmx787JVDb/HnTzOEVoiA==" + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "asyncapi": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/asyncapi/-/asyncapi-2.6.1.tgz", + "integrity": "sha512-ROszLQMYzyp/CzPyLhuT/9NpJXxI7wrjv6yW8JpA/XVMEWCqyVXr9jajJhs9d/863+ispS+ptGhg1PC17AnIzQ==" + }, + "asyncapi-parser": { + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/asyncapi-parser/-/asyncapi-parser-0.13.0.tgz", + "integrity": "sha512-UTj9W8tfm0VKA5xkUbc8OBSLMrFOO3bXW4Rdrx6WTIiZjK1Mve3qkwOOXI15d4oCkTMhWjmh6AvHd51/61eemA==", + "requires": { + "ajv": "^6.10.1", + "asyncapi": "^2.6.1", + "js-yaml": "^3.13.1", + "json-schema-ref-parser": "^7.1.0", + "node-fetch": "^2.6.0", + "openapi-schema-to-json-schema": "^2.2.0", + "tiny-merge-patch": "^0.1.2" + }, + "dependencies": { + "ajv": { + "version": "6.10.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", + "integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==", + "requires": { + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + } + } + }, + "call-me-maybe": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz", + "integrity": "sha1-JtII6onje1y95gJQoV8DHBak1ms=" + }, + "deep-equal": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.1.tgz", + "integrity": "sha512-yd9c5AdiqVcR+JjcwUQb9DkhJc8ngNr0MahEBGvDiJw8puWab2yZlh+nkasOnZP+EGTAP6rRp2JzJhJZzvNF8g==", + "requires": { + "is-arguments": "^1.0.4", + "is-date-object": "^1.0.1", + "is-regex": "^1.0.4", + "object-is": "^1.0.1", + "object-keys": "^1.1.1", + "regexp.prototype.flags": "^1.2.0" + } + }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "requires": { + "object-keys": "^1.0.12" + } + }, + "es-abstract": { + "version": "1.17.2", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.2.tgz", + "integrity": "sha512-YoKuru3Lyoy7yVTBSH2j7UxTqe/je3dWAruC0sHvZX1GNd5zX8SSLvQqEgO9b3Ex8IW+goFI9arEEsFIbulhOw==", + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.1.5", + "is-regex": "^1.0.5", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimleft": "^2.1.1", + "string.prototype.trimright": "^2.1.1" + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" + }, + "fast-deep-equal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=" + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==" + }, + "is-arguments": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.0.4.tgz", + "integrity": "sha512-xPh0Rmt8NE65sNzvyUmWgI1tz3mKq74lGA0mL8LYZcoIzKOzDh6HmrYm3d18k60nHerC8A9Km8kYu87zfSFnLA==" + }, + "is-callable": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.5.tgz", + "integrity": "sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q==" + }, + "is-date-object": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", + "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==" + }, + "is-regex": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz", + "integrity": "sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ==", + "requires": { + "has": "^1.0.3" + } + }, + "is-symbol": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", + "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", + "requires": { + "has-symbols": "^1.0.1" + } + }, + "js-yaml": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "json-schema-ref-parser": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/json-schema-ref-parser/-/json-schema-ref-parser-7.1.3.tgz", + "integrity": "sha512-/Lmyl0PW27dOmCO03PI339+1gs4Z2PlqIyUgzIOtoRp08zkkMCB30TRbdppbPO7WWzZX0uT98HqkDiZSujkmbA==", + "requires": { + "call-me-maybe": "^1.0.1", + "js-yaml": "^3.13.1", + "ono": "^6.0.0" + } + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, + "node-fetch": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz", + "integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==" + }, + "object-inspect": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.7.0.tgz", + "integrity": "sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw==" + }, + "object-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.0.2.tgz", + "integrity": "sha512-Epah+btZd5wrrfjkJZq1AOB9O6OxUQto45hzFd7lXGrpHPGE0W1k+426yrZV+k6NJOzLNNW/nVsmZdIWsAqoOQ==" + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" + }, + "object.assign": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", + "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "requires": { + "define-properties": "^1.1.2", + "function-bind": "^1.1.1", + "has-symbols": "^1.0.0", + "object-keys": "^1.0.11" + } + }, + "ono": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ono/-/ono-6.0.1.tgz", + "integrity": "sha512-5rdYW/106kHqLeG22GE2MHKq+FlsxMERZev9DCzQX1zwkxnFwBivSn5i17a5O/rDmOJOdf4Wyt80UZljzx9+DA==" + }, + "openapi-schema-to-json-schema": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/openapi-schema-to-json-schema/-/openapi-schema-to-json-schema-2.2.0.tgz", + "integrity": "sha512-a8ouPAEl7U4MCpQBje+9cDIDSL6xCtWBPat/2i2Py42D5q9EPuB0IkXh4mNRc/cECjHjsgsEn2+GTeMvgE58+w==", + "requires": { + "deep-equal": "^1.0.1" + } + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + }, + "regexp.prototype.flags": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.3.0.tgz", + "integrity": "sha512-2+Q0C5g951OlYlJz6yu5/M33IcsESLlLfsyIaLJaG4FA2r4yP8MvVMJUUP/fVBkSpbbbZlS5gynbEWLipiiXiQ==", + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1" + } + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" + }, + "string.prototype.trimleft": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.1.tgz", + "integrity": "sha512-iu2AGd3PuP5Rp7x2kEZCrB2Nf41ehzh+goo8TV7z8/XDBbsvc6HQIlUl9RjkZ4oyrW1XM5UwlGl1oVEaDjg6Ag==", + "requires": { + "define-properties": "^1.1.3", + "function-bind": "^1.1.1" + } + }, + "string.prototype.trimright": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.1.tgz", + "integrity": "sha512-qFvWL3/+QIgZXVmJBfpHmxLB7xsUXz6HsUmP8+5dRaC3Q7oKUv9Vo6aMCRZC1smrtyECFsIT30PqBJ1gTjAs+g==", + "requires": { + "define-properties": "^1.1.3", + "function-bind": "^1.1.1" + } + }, + "tiny-merge-patch": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/tiny-merge-patch/-/tiny-merge-patch-0.1.2.tgz", + "integrity": "sha1-Lo3tGcVuoV29OtTtXbHI5a1UTDw=" + }, + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "requires": { + "punycode": "^2.1.0" + } + } + } +} diff --git a/runner/js/package.json b/runner/js/package.json new file mode 100644 index 00000000..cff3f305 --- /dev/null +++ b/runner/js/package.json @@ -0,0 +1,27 @@ +{ + "name": "asyncapi/tck/runner/js", + "version": "1.0.0", + "description": "Simple test of few AsyncAPI JS parsers.", + "main": "src/index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "lint": "./node_modules/.bin/eslint .eslintrc.json ./src" + }, + "keywords": [], + "author": "MuleSoft", + "license": "ISC", + "dependencies": { + "amf-client-js": "^4.0.4", + "asyncapi-parser": "^0.13.0", + "minimist": "^1.2.0", + "mustache": "^3.0.1" + }, + "devDependencies": { + "eslint": "^5.0.1", + "eslint-config-standard": "^11.0.0", + "eslint-plugin-import": "^2.13.0", + "eslint-plugin-node": "^6.0.1", + "eslint-plugin-promise": "^3.8.0", + "eslint-plugin-standard": "^3.1.0" + } +} diff --git a/runner/js/src/index.js b/runner/js/src/index.js new file mode 100644 index 00000000..1d08c0b8 --- /dev/null +++ b/runner/js/src/index.js @@ -0,0 +1,55 @@ +const parseArgs = require('minimist') +const path = require('path') +const parsers = require('./parsers') +const utils = require('./utils') + +const TCK_DIR = path.resolve(path.join( + __dirname, // tck/runner/js/src + '..', // tck/runner/js + '..', // tck/runner + '..', // tck + 'tests', // tck/tests + 'asyncapi-2.0' // tck/tests/asyncapi-2.0 +)) + +const PARSERS = { + 'amf-client-js': parsers.amfParse, + 'asyncapi-parser': parsers.asyncapiParse +} + +async function main () { + const argv = parseArgs(process.argv.slice(2)) + const parserFunc = PARSERS[argv.parser] + if (parserFunc === undefined) { + console.log(`Not supported parser: ${argv.parser}`) + return + } + + const fileList = utils.listFiles(TCK_DIR) + let report = { + parser: argv.parser + '(js)', + results: [], + branch: argv.branch + } + + for (let i = 0; i < fileList.length; i++) { + let fpath = fileList[i] + let success = true + let error + try { + await parserFunc(fpath) + } catch (e) { + success = false + error = e + } + report.results.push({ + file: fpath.replace(TCK_DIR, ''), + success: success, + error: error ? error.toString() : error + }) + } + + utils.saveReport(report, argv.outdir || './') +} + +main() diff --git a/runner/js/src/parsers.js b/runner/js/src/parsers.js new file mode 100644 index 00000000..d56cf201 --- /dev/null +++ b/runner/js/src/parsers.js @@ -0,0 +1,37 @@ +const fs = require('fs') + +const asyncapi = require('asyncapi-parser') +const amf = require('amf-client-js') + +// https://github.com/asyncapi/parser-js +async function asyncapiParse (fpath) { + const content = fs.readFileSync(fpath).toString() + // According to parser's API, it: + // "Parses and validate an AsyncAPI document from YAML or JSON" + try { + await asyncapi.parse(content) + } catch (e) { + throw new Error(e.message || e.toString()) + } +} + +// https://github.com/aml-org/amf +async function amfParse (fpath) { + await amf.AMF.init() + const parser = amf.AMF.raml10Parser() + const model = await parser.parseFileAsync(`file://${fpath}`) + const report = await amf.AMF.validate( + model, amf.ProfileNames.RAML10, amf.MessageStyles.RAML) + if (!report.conforms) { + report.results.map(res => { + if (res.level.toLowerCase() === 'violation') { + throw new Error(res.message) + } + }) + } +} + +module.exports = { + asyncapiParse: asyncapiParse, + amfParse: amfParse +} diff --git a/runner/js/src/utils.js b/runner/js/src/utils.js new file mode 100644 index 00000000..beeaca65 --- /dev/null +++ b/runner/js/src/utils.js @@ -0,0 +1,22 @@ +const path = require('path') +const fs = require('fs') + +/* Lists spec files in folder */ +function listFiles (foldPath) { + const manifestPath = path.join(foldPath, 'manifest.json') + const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8')) + return manifest.filePaths.map(fp => path.join(foldPath, fp)) +} + +/* Writes JSON report to output folder */ +function saveReport (report, outdir) { + outdir = path.resolve(outdir) + try { fs.mkdirSync(outdir) } catch (e) {} + const fpath = path.join(outdir, `${report.parser}.json`) + fs.writeFileSync(fpath, JSON.stringify(report, null, 2)) +} + +module.exports = { + listFiles: listFiles, + saveReport: saveReport +} diff --git a/runner/reports/html/bootstrap.min.css b/runner/reports/html/bootstrap.min.css new file mode 100644 index 00000000..6c098131 --- /dev/null +++ b/runner/reports/html/bootstrap.min.css @@ -0,0 +1,14 @@ +/*! + * Bootstrap v3.3.7 (http://getbootstrap.com) + * Copyright 2011-2018 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + */ + +/*! + * Generated using the Bootstrap Customizer () + * Config saved to config.json and + *//*! + * Bootstrap v3.3.7 (http://getbootstrap.com) + * Copyright 2011-2016 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + *//*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:0.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace, monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}*:before,*:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:10px;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.42857143;color:#333;background-color:#fff}input,button,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#337ab7;text-decoration:none}a:hover,a:focus{color:#23527c;text-decoration:underline}a:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.img-responsive{display:block;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{padding:4px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out;display:inline-block;max-width:100%;height:auto}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}[role="button"]{cursor:pointer}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;border-radius:4px}kbd{padding:2px 4px;font-size:90%;color:#fff;background-color:#333;border-radius:3px;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.25);box-shadow:inset 0 -1px 0 rgba(0,0,0,0.25)}kbd kbd{padding:0;font-size:100%;font-weight:bold;-webkit-box-shadow:none;box-shadow:none}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.42857143;word-break:break-all;word-wrap:break-word;color:#333;background-color:#f5f5f5;border:1px solid #ccc;border-radius:4px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.container-fluid{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}.row{margin-left:-15px;margin-right:-15px}.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12{position:relative;min-height:1px;padding-left:15px;padding-right:15px}.col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-0{right:auto}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666667%}.col-xs-push-10{left:83.33333333%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666667%}.col-xs-push-7{left:58.33333333%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666667%}.col-xs-push-4{left:33.33333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.66666667%}.col-xs-push-1{left:8.33333333%}.col-xs-push-0{left:auto}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-0{margin-left:0}@media (min-width:768px){.col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:auto}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:auto}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0}}@media (min-width:992px){.col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:auto}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666667%}.col-md-push-10{left:83.33333333%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666667%}.col-md-push-7{left:58.33333333%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666667%}.col-md-push-4{left:33.33333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.66666667%}.col-md-push-1{left:8.33333333%}.col-md-push-0{left:auto}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-0{margin-left:0}}@media (min-width:1200px){.col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-0{right:auto}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666667%}.col-lg-push-10{left:83.33333333%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666667%}.col-lg-push-7{left:58.33333333%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666667%}.col-lg-push-4{left:33.33333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.66666667%}.col-lg-push-1{left:8.33333333%}.col-lg-push-0{left:auto}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-0{margin-left:0}}table{background-color:transparent}caption{padding-top:8px;padding-bottom:8px;color:#777;text-align:left}th{text-align:left}.table{width:100%;max-width:100%;margin-bottom:20px}.table>thead>tr>th,.table>tbody>tr>th,.table>tfoot>tr>th,.table>thead>tr>td,.table>tbody>tr>td,.table>tfoot>tr>td{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ddd}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>th,.table>caption+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>td,.table>thead:first-child>tr:first-child>td{border-top:0}.table>tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed>thead>tr>th,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>tbody>tr>td,.table-condensed>tfoot>tr>td{padding:5px}.table-bordered{border:1px solid #ddd}.table-bordered>thead>tr>th,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>tbody>tr>td,.table-bordered>tfoot>tr>td{border:1px solid #ddd}.table-bordered>thead>tr>th,.table-bordered>thead>tr>td{border-bottom-width:2px}.table-striped>tbody>tr:nth-of-type(odd){background-color:#f9f9f9}.table-hover>tbody>tr:hover{background-color:#f5f5f5}table col[class*="col-"]{position:static;float:none;display:table-column}table td[class*="col-"],table th[class*="col-"]{position:static;float:none;display:table-cell}.table>thead>tr>td.active,.table>tbody>tr>td.active,.table>tfoot>tr>td.active,.table>thead>tr>th.active,.table>tbody>tr>th.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>tbody>tr.active>td,.table>tfoot>tr.active>td,.table>thead>tr.active>th,.table>tbody>tr.active>th,.table>tfoot>tr.active>th{background-color:#f5f5f5}.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover,.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr:hover>.active,.table-hover>tbody>tr.active:hover>th{background-color:#e8e8e8}.table>thead>tr>td.success,.table>tbody>tr>td.success,.table>tfoot>tr>td.success,.table>thead>tr>th.success,.table>tbody>tr>th.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>tbody>tr.success>td,.table>tfoot>tr.success>td,.table>thead>tr.success>th,.table>tbody>tr.success>th,.table>tfoot>tr.success>th{background-color:#dff0d8}.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover,.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr:hover>.success,.table-hover>tbody>tr.success:hover>th{background-color:#d0e9c6}.table>thead>tr>td.info,.table>tbody>tr>td.info,.table>tfoot>tr>td.info,.table>thead>tr>th.info,.table>tbody>tr>th.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>tbody>tr.info>td,.table>tfoot>tr.info>td,.table>thead>tr.info>th,.table>tbody>tr.info>th,.table>tfoot>tr.info>th{background-color:#d9edf7}.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover,.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr:hover>.info,.table-hover>tbody>tr.info:hover>th{background-color:#c4e3f3}.table>thead>tr>td.warning,.table>tbody>tr>td.warning,.table>tfoot>tr>td.warning,.table>thead>tr>th.warning,.table>tbody>tr>th.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>tbody>tr.warning>td,.table>tfoot>tr.warning>td,.table>thead>tr.warning>th,.table>tbody>tr.warning>th,.table>tfoot>tr.warning>th{background-color:#fcf8e3}.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover,.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr:hover>.warning,.table-hover>tbody>tr.warning:hover>th{background-color:#faf2cc}.table>thead>tr>td.danger,.table>tbody>tr>td.danger,.table>tfoot>tr>td.danger,.table>thead>tr>th.danger,.table>tbody>tr>th.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>tbody>tr.danger>td,.table>tfoot>tr.danger>td,.table>thead>tr.danger>th,.table>tbody>tr.danger>th,.table>tfoot>tr.danger>th{background-color:#f2dede}.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover,.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr:hover>.danger,.table-hover>tbody>tr.danger:hover>th{background-color:#ebcccc}.table-responsive{overflow-x:auto;min-height:0.01%}@media screen and (max-width:767px){.table-responsive{width:100%;margin-bottom:15px;overflow-y:hidden;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #ddd}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>thead>tr>th,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tfoot>tr>td{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>thead>tr>th:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.table-responsive>.table-bordered>thead>tr>th:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>th,.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>td{border-bottom:0}}.clearfix:before,.clearfix:after,.container:before,.container:after,.container-fluid:before,.container-fluid:after,.row:before,.row:after{content:" ";display:table}.clearfix:after,.container:after,.container-fluid:after,.row:after{clear:both}.center-block{display:block;margin-left:auto;margin-right:auto}.pull-right{float:right !important}.pull-left{float:left !important}.hide{display:none !important}.show{display:block !important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none !important}.affix{position:fixed} \ No newline at end of file diff --git a/runner/reports/html/custom.css b/runner/reports/html/custom.css new file mode 100644 index 00000000..38735b86 --- /dev/null +++ b/runner/reports/html/custom.css @@ -0,0 +1,7 @@ +.stat-nums { + color: #afafaf; + opacity: 0; +} +tr:hover .stat-nums { + opacity: 1; +} \ No newline at end of file From f6cb689d8ab036be7a4935fc94eae5375dc9e1ea Mon Sep 17 00:00:00 2001 From: Artem Kostiuk Date: Fri, 17 Jan 2020 11:40:36 +0200 Subject: [PATCH 16/26] Use .yml extension for reffered files --- CONTRIBUTING.md | 2 ++ README.md | 2 ++ manifest.json | 4 ---- .../Channel Item Object/invalid-external-ref-structure.yaml | 2 +- .../Channel Item Object/{referenced.yaml => referenced.yml} | 0 .../{referencedInvalid.yaml => referencedInvalid.yml} | 0 .../asyncapi-2.0/Channel Item Object/valid-external-ref.yaml | 2 +- tests/asyncapi-2.0/File Structure/{common.yaml => common.yml} | 0 .../File Structure/invalid-inexisting-file-ref.yaml | 2 +- tests/asyncapi-2.0/File Structure/valid.yaml | 2 +- tests/asyncapi-2.0/Reference Object/{lib.yaml => lib.yml} | 0 .../Reference Object/valid-external-ref-channelBindings.yaml | 2 +- .../Reference Object/valid-external-ref-correlationId.yaml | 2 +- .../Reference Object/valid-external-ref-message.yaml | 2 +- .../Reference Object/valid-external-ref-messageBindings.yaml | 2 +- .../Reference Object/valid-external-ref-messageTraits.yaml | 2 +- .../valid-external-ref-operationBindings.yaml | 2 +- .../Reference Object/valid-external-ref-operationTraits.yaml | 2 +- .../Reference Object/valid-external-ref-parameter.yaml | 2 +- .../Reference Object/valid-external-ref-schema.yaml | 2 +- .../Reference Object/valid-external-ref-securityScheme.yaml | 2 +- .../Reference Object/valid-external-ref-serverBindings.yaml | 2 +- 22 files changed, 19 insertions(+), 19 deletions(-) rename tests/asyncapi-2.0/Channel Item Object/{referenced.yaml => referenced.yml} (100%) rename tests/asyncapi-2.0/Channel Item Object/{referencedInvalid.yaml => referencedInvalid.yml} (100%) rename tests/asyncapi-2.0/File Structure/{common.yaml => common.yml} (100%) rename tests/asyncapi-2.0/Reference Object/{lib.yaml => lib.yml} (100%) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 534d7fe2..f499eedb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,6 +6,8 @@ Each test case should contain the following files: Please place new tests in one of `tests/asyncapi-2.0` sub-folders. Name of the target folder should correspond to the name of the feature your tests test. E.g. if your new `.yaml` tests `Info Object`, place it in `tests/asyncapi-2.0/Info Object`. +Non-AsyncAPI files (libraries, extensions, etc.) must have a `.yml` extension instead of `.yaml`. + ## Running tests We've created a separate project called [tck runner](./runner) to run all the tests contained in the AsyncAPI TCK. By following the instructions on that directory, you should be able to test any new test case that you may want to contribute against the different projects that this runner covers. diff --git a/README.md b/README.md index 41960e31..82d2db46 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,8 @@ Note that this repository contains a [manifest file](./manifest.json) that lists Names of folders' tests reside in correspond to AsyncAPI 2.0 Specification sections names. +Non-AsyncAPI files (libraries, extensions, etc.) must have a `.yml` extension instead of `.yaml`. + ## Contributing We welcome contributions! If you have a new test case in mind, feel free to submit a pull request. More info on how to do that [here](./CONTRIBUTING.md). diff --git a/manifest.json b/manifest.json index a3216358..e7f7940b 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,6 @@ "tests/asyncapi-2.0/Format/invalid-json-schema-tag.yaml", "tests/asyncapi-2.0/Format/invalid-syntax.yaml", "tests/asyncapi-2.0/Format/valid.yaml", - "tests/asyncapi-2.0/File Structure/common.yaml", "tests/asyncapi-2.0/File Structure/invalid-inexisting-file-ref.yaml", "tests/asyncapi-2.0/File Structure/valid.yaml", "tests/asyncapi-2.0/AsyncAPI Object/invalid-duplicate-tags.yaml", @@ -78,8 +77,6 @@ "tests/asyncapi-2.0/Channels Object/valid.yaml", "tests/asyncapi-2.0/Channels Object/Fields Types/invalid-channel-type.yaml", "tests/asyncapi-2.0/Channel Item Object/invalid-external-ref-structure.yaml", - "tests/asyncapi-2.0/Channel Item Object/referenced.yaml", - "tests/asyncapi-2.0/Channel Item Object/referencedInvalid.yaml", "tests/asyncapi-2.0/Channel Item Object/valid-external-ref.yaml", "tests/asyncapi-2.0/Channel Item Object/valid-publish.yaml", "tests/asyncapi-2.0/Channel Item Object/valid-subscribe.yaml", @@ -187,7 +184,6 @@ "tests/asyncapi-2.0/Components Object/Fields Types/invalid-schemas-type.yaml", "tests/asyncapi-2.0/Components Object/Fields Types/invalid-securitySchemes-type.yaml", "tests/asyncapi-2.0/Components Object/Fields Types/invalid-serverBindings-type.yaml", - "tests/asyncapi-2.0/Reference Object/lib.yaml", "tests/asyncapi-2.0/Reference Object/valid-external-ref-channelBindings.yaml", "tests/asyncapi-2.0/Reference Object/valid-external-ref-correlationId.yaml", "tests/asyncapi-2.0/Reference Object/valid-external-ref-message.yaml", diff --git a/tests/asyncapi-2.0/Channel Item Object/invalid-external-ref-structure.yaml b/tests/asyncapi-2.0/Channel Item Object/invalid-external-ref-structure.yaml index 2320835d..c8c29ee0 100644 --- a/tests/asyncapi-2.0/Channel Item Object/invalid-external-ref-structure.yaml +++ b/tests/asyncapi-2.0/Channel Item Object/invalid-external-ref-structure.yaml @@ -6,4 +6,4 @@ info: channels: /user/signedup: - $ref: referencedInvalid.yaml + $ref: referencedInvalid.yml diff --git a/tests/asyncapi-2.0/Channel Item Object/referenced.yaml b/tests/asyncapi-2.0/Channel Item Object/referenced.yml similarity index 100% rename from tests/asyncapi-2.0/Channel Item Object/referenced.yaml rename to tests/asyncapi-2.0/Channel Item Object/referenced.yml diff --git a/tests/asyncapi-2.0/Channel Item Object/referencedInvalid.yaml b/tests/asyncapi-2.0/Channel Item Object/referencedInvalid.yml similarity index 100% rename from tests/asyncapi-2.0/Channel Item Object/referencedInvalid.yaml rename to tests/asyncapi-2.0/Channel Item Object/referencedInvalid.yml diff --git a/tests/asyncapi-2.0/Channel Item Object/valid-external-ref.yaml b/tests/asyncapi-2.0/Channel Item Object/valid-external-ref.yaml index 656486ee..607b02aa 100644 --- a/tests/asyncapi-2.0/Channel Item Object/valid-external-ref.yaml +++ b/tests/asyncapi-2.0/Channel Item Object/valid-external-ref.yaml @@ -6,4 +6,4 @@ info: channels: /user/signedup: - $ref: referenced.yaml + $ref: referenced.yml diff --git a/tests/asyncapi-2.0/File Structure/common.yaml b/tests/asyncapi-2.0/File Structure/common.yml similarity index 100% rename from tests/asyncapi-2.0/File Structure/common.yaml rename to tests/asyncapi-2.0/File Structure/common.yml diff --git a/tests/asyncapi-2.0/File Structure/invalid-inexisting-file-ref.yaml b/tests/asyncapi-2.0/File Structure/invalid-inexisting-file-ref.yaml index 39c1582a..5fd828a4 100644 --- a/tests/asyncapi-2.0/File Structure/invalid-inexisting-file-ref.yaml +++ b/tests/asyncapi-2.0/File Structure/invalid-inexisting-file-ref.yaml @@ -9,4 +9,4 @@ channels: subscribe: message: payload: - $ref: inexistingFile.yaml/#userSignUp + $ref: inexistingFile.yml/#userSignUp diff --git a/tests/asyncapi-2.0/File Structure/valid.yaml b/tests/asyncapi-2.0/File Structure/valid.yaml index fba512dc..1e741940 100644 --- a/tests/asyncapi-2.0/File Structure/valid.yaml +++ b/tests/asyncapi-2.0/File Structure/valid.yaml @@ -9,4 +9,4 @@ channels: subscribe: message: payload: - $ref: common.yaml/#userSignUp + $ref: common.yml/#userSignUp diff --git a/tests/asyncapi-2.0/Reference Object/lib.yaml b/tests/asyncapi-2.0/Reference Object/lib.yml similarity index 100% rename from tests/asyncapi-2.0/Reference Object/lib.yaml rename to tests/asyncapi-2.0/Reference Object/lib.yml diff --git a/tests/asyncapi-2.0/Reference Object/valid-external-ref-channelBindings.yaml b/tests/asyncapi-2.0/Reference Object/valid-external-ref-channelBindings.yaml index 34206c51..07cadf9d 100644 --- a/tests/asyncapi-2.0/Reference Object/valid-external-ref-channelBindings.yaml +++ b/tests/asyncapi-2.0/Reference Object/valid-external-ref-channelBindings.yaml @@ -18,4 +18,4 @@ channels: components: channelBindings: myChannelBindings: - $ref: "lib.yaml#/myChannelBindings" + $ref: "lib.yml#/myChannelBindings" diff --git a/tests/asyncapi-2.0/Reference Object/valid-external-ref-correlationId.yaml b/tests/asyncapi-2.0/Reference Object/valid-external-ref-correlationId.yaml index 970b16f0..1eba2d29 100644 --- a/tests/asyncapi-2.0/Reference Object/valid-external-ref-correlationId.yaml +++ b/tests/asyncapi-2.0/Reference Object/valid-external-ref-correlationId.yaml @@ -18,4 +18,4 @@ channels: components: correlationIds: myCorrelationId: - $ref: "lib.yaml#/myCorrelationId" + $ref: "lib.yml#/myCorrelationId" diff --git a/tests/asyncapi-2.0/Reference Object/valid-external-ref-message.yaml b/tests/asyncapi-2.0/Reference Object/valid-external-ref-message.yaml index 39e54ace..80981156 100644 --- a/tests/asyncapi-2.0/Reference Object/valid-external-ref-message.yaml +++ b/tests/asyncapi-2.0/Reference Object/valid-external-ref-message.yaml @@ -18,4 +18,4 @@ channels: components: messages: myMessage: - $ref: "lib.yaml#/myMessage" + $ref: "lib.yml#/myMessage" diff --git a/tests/asyncapi-2.0/Reference Object/valid-external-ref-messageBindings.yaml b/tests/asyncapi-2.0/Reference Object/valid-external-ref-messageBindings.yaml index 159ba7bc..d0de7af3 100644 --- a/tests/asyncapi-2.0/Reference Object/valid-external-ref-messageBindings.yaml +++ b/tests/asyncapi-2.0/Reference Object/valid-external-ref-messageBindings.yaml @@ -18,4 +18,4 @@ channels: components: messageBindings: myMessageBindings: - $ref: "lib.yaml#/myMessageBindings" + $ref: "lib.yml#/myMessageBindings" diff --git a/tests/asyncapi-2.0/Reference Object/valid-external-ref-messageTraits.yaml b/tests/asyncapi-2.0/Reference Object/valid-external-ref-messageTraits.yaml index e348b80d..3ff7741f 100644 --- a/tests/asyncapi-2.0/Reference Object/valid-external-ref-messageTraits.yaml +++ b/tests/asyncapi-2.0/Reference Object/valid-external-ref-messageTraits.yaml @@ -18,4 +18,4 @@ channels: components: messageTraits: myMessageTrait: - $ref: "lib.yaml#/myMessageTrait" + $ref: "lib.yml#/myMessageTrait" diff --git a/tests/asyncapi-2.0/Reference Object/valid-external-ref-operationBindings.yaml b/tests/asyncapi-2.0/Reference Object/valid-external-ref-operationBindings.yaml index c2a4de2f..fd53e969 100644 --- a/tests/asyncapi-2.0/Reference Object/valid-external-ref-operationBindings.yaml +++ b/tests/asyncapi-2.0/Reference Object/valid-external-ref-operationBindings.yaml @@ -18,4 +18,4 @@ channels: components: operationBindings: myOperationBindings: - $ref: "lib.yaml#/myOperationBindings" + $ref: "lib.yml#/myOperationBindings" diff --git a/tests/asyncapi-2.0/Reference Object/valid-external-ref-operationTraits.yaml b/tests/asyncapi-2.0/Reference Object/valid-external-ref-operationTraits.yaml index d9e16667..5a086ec3 100644 --- a/tests/asyncapi-2.0/Reference Object/valid-external-ref-operationTraits.yaml +++ b/tests/asyncapi-2.0/Reference Object/valid-external-ref-operationTraits.yaml @@ -18,4 +18,4 @@ channels: components: operationTraits: myOperationTrait: - $ref: "lib.yaml#/myOperationTrait" + $ref: "lib.yml#/myOperationTrait" diff --git a/tests/asyncapi-2.0/Reference Object/valid-external-ref-parameter.yaml b/tests/asyncapi-2.0/Reference Object/valid-external-ref-parameter.yaml index f317eb21..3d76d9ce 100644 --- a/tests/asyncapi-2.0/Reference Object/valid-external-ref-parameter.yaml +++ b/tests/asyncapi-2.0/Reference Object/valid-external-ref-parameter.yaml @@ -18,4 +18,4 @@ channels: components: parameters: myParam: - $ref: "lib.yaml#/myParam" + $ref: "lib.yml#/myParam" diff --git a/tests/asyncapi-2.0/Reference Object/valid-external-ref-schema.yaml b/tests/asyncapi-2.0/Reference Object/valid-external-ref-schema.yaml index 48efe816..4e038875 100644 --- a/tests/asyncapi-2.0/Reference Object/valid-external-ref-schema.yaml +++ b/tests/asyncapi-2.0/Reference Object/valid-external-ref-schema.yaml @@ -18,4 +18,4 @@ channels: components: schemas: mySchema: - $ref: "lib.yaml#/mySchema" + $ref: "lib.yml#/mySchema" diff --git a/tests/asyncapi-2.0/Reference Object/valid-external-ref-securityScheme.yaml b/tests/asyncapi-2.0/Reference Object/valid-external-ref-securityScheme.yaml index 5132fc0d..84ef959b 100644 --- a/tests/asyncapi-2.0/Reference Object/valid-external-ref-securityScheme.yaml +++ b/tests/asyncapi-2.0/Reference Object/valid-external-ref-securityScheme.yaml @@ -18,4 +18,4 @@ channels: components: securitySchemes: simple: - $ref: "lib.yaml#/mySecurityScheme" + $ref: "lib.yml#/mySecurityScheme" diff --git a/tests/asyncapi-2.0/Reference Object/valid-external-ref-serverBindings.yaml b/tests/asyncapi-2.0/Reference Object/valid-external-ref-serverBindings.yaml index b2f9d1dd..878ca7d0 100644 --- a/tests/asyncapi-2.0/Reference Object/valid-external-ref-serverBindings.yaml +++ b/tests/asyncapi-2.0/Reference Object/valid-external-ref-serverBindings.yaml @@ -18,4 +18,4 @@ channels: components: serverBindings: myServerBindings: - $ref: "lib.yaml#/myServerBindings" + $ref: "lib.yml#/myServerBindings" From 81d46c2f876df87bc78304951fe455ab9f5251ea Mon Sep 17 00:00:00 2001 From: Artem Kostiuk Date: Fri, 17 Jan 2020 11:46:07 +0200 Subject: [PATCH 17/26] Fix tck file issue --- tests/asyncapi-2.0/Schema Object/valid.yaml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/asyncapi-2.0/Schema Object/valid.yaml b/tests/asyncapi-2.0/Schema Object/valid.yaml index f87294a1..ce6f1ff8 100644 --- a/tests/asyncapi-2.0/Schema Object/valid.yaml +++ b/tests/asyncapi-2.0/Schema Object/valid.yaml @@ -58,23 +58,23 @@ components: const: hello oneOfProp: oneOf: - type: string - type: number + - type: string + - type: number allOfProp: allOf: - type: string - type: number + - type: string + - type: number notProp: allOf: - type: string - not: + - type: string + - not: type: number stringProp: type: string title: String property minLength: 1 maxLength: 10 - pattern: ^[a-zA-Z0-9\.\-_]+$ + pattern: '^[a-zA-Z0-9\.\-_]+$' enum: - John - Doe @@ -94,8 +94,8 @@ components: then: properties: postal_code: - pattern: [0-9]{5}(-[0-9]{4})? + pattern: '[0-9]{5}(-[0-9]{4})?' else: properties: postal_code: - pattern: [A-Z][0-9][A-Z] [0-9][A-Z][0-9] + pattern: '[A-Z][0-9][A-Z] [0-9][A-Z][0-9]' From fb68e0748d1fae899f20e1b998cf46edadd2c0af Mon Sep 17 00:00:00 2001 From: Artem Kostiuk Date: Fri, 17 Jan 2020 12:04:35 +0200 Subject: [PATCH 18/26] Add/fix js runners code --- runner/Makefile | 2 +- runner/html-reporter/package-lock.json | 12 ++++++++++-- runner/html-reporter/package.json | 2 +- runner/js/.eslintrc.json | 3 --- runner/js/package-lock.json | 12 +++++++++++- runner/js/package.json | 14 +++----------- runner/js/src/index.js | 4 +--- runner/js/src/parsers.js | 4 ++-- 8 files changed, 29 insertions(+), 24 deletions(-) delete mode 100644 runner/js/.eslintrc.json diff --git a/runner/Makefile b/runner/Makefile index 07010773..443d7b10 100644 --- a/runner/Makefile +++ b/runner/Makefile @@ -32,7 +32,7 @@ report: report-js report-js: cd $(JS_RUNNER_DIR) node src/index.js --parser asyncapi-parser --outdir $(REPORTS_JSON) --branch $(TCK_BRANCH) -# node src/index.js --parser amf-client-js --outdir $(REPORTS_JSON) --branch $(TCK_BRANCH) + node src/index.js --parser amf-client-js --outdir $(REPORTS_JSON) --branch $(TCK_BRANCH) generate-html: cd $(REPORTER_DIR) diff --git a/runner/html-reporter/package-lock.json b/runner/html-reporter/package-lock.json index 9c86ccab..970e896c 100644 --- a/runner/html-reporter/package-lock.json +++ b/runner/html-reporter/package-lock.json @@ -1,5 +1,13 @@ { - "name": "asyncapi/tck/runner/reporter", + "name": "asyncapi-tck-runner-reporter", "version": "1.0.0", - "lockfileVersion": 1 + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "mustache": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/mustache/-/mustache-3.2.1.tgz", + "integrity": "sha512-RERvMFdLpaFfSRIEe632yDm5nsd0SDKn8hGmcUwswnyiE5mtdZLDybtHAz6hjJhawokF0hXvGLtx9mrQfm6FkA==" + } + } } diff --git a/runner/html-reporter/package.json b/runner/html-reporter/package.json index 29a0626c..1975134a 100644 --- a/runner/html-reporter/package.json +++ b/runner/html-reporter/package.json @@ -1,5 +1,5 @@ { - "name": "asyncapi/tck/runner/reporter", + "name": "asyncapi-tck-runner-reporter", "version": "1.0.0", "description": "", "main": "src/index.js", diff --git a/runner/js/.eslintrc.json b/runner/js/.eslintrc.json deleted file mode 100644 index d6582362..00000000 --- a/runner/js/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "standard" -} \ No newline at end of file diff --git a/runner/js/package-lock.json b/runner/js/package-lock.json index eba03f53..ec80291c 100644 --- a/runner/js/package-lock.json +++ b/runner/js/package-lock.json @@ -1,5 +1,5 @@ { - "name": "asyncapi/tck/runner/js", + "name": "asyncapi-tck-runner-js", "version": "1.0.0", "lockfileVersion": 1, "requires": true, @@ -211,6 +211,16 @@ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" + }, + "mustache": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/mustache/-/mustache-3.2.1.tgz", + "integrity": "sha512-RERvMFdLpaFfSRIEe632yDm5nsd0SDKn8hGmcUwswnyiE5mtdZLDybtHAz6hjJhawokF0hXvGLtx9mrQfm6FkA==" + }, "node-fetch": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz", diff --git a/runner/js/package.json b/runner/js/package.json index cff3f305..f2742213 100644 --- a/runner/js/package.json +++ b/runner/js/package.json @@ -1,11 +1,10 @@ { - "name": "asyncapi/tck/runner/js", + "name": "asyncapi-tck-runner-js", "version": "1.0.0", "description": "Simple test of few AsyncAPI JS parsers.", "main": "src/index.js", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1", - "lint": "./node_modules/.bin/eslint .eslintrc.json ./src" + "test": "echo \"Error: no test specified\" && exit 1" }, "keywords": [], "author": "MuleSoft", @@ -16,12 +15,5 @@ "minimist": "^1.2.0", "mustache": "^3.0.1" }, - "devDependencies": { - "eslint": "^5.0.1", - "eslint-config-standard": "^11.0.0", - "eslint-plugin-import": "^2.13.0", - "eslint-plugin-node": "^6.0.1", - "eslint-plugin-promise": "^3.8.0", - "eslint-plugin-standard": "^3.1.0" - } + "devDependencies": {} } diff --git a/runner/js/src/index.js b/runner/js/src/index.js index 1d08c0b8..127440bd 100644 --- a/runner/js/src/index.js +++ b/runner/js/src/index.js @@ -7,9 +7,7 @@ const TCK_DIR = path.resolve(path.join( __dirname, // tck/runner/js/src '..', // tck/runner/js '..', // tck/runner - '..', // tck - 'tests', // tck/tests - 'asyncapi-2.0' // tck/tests/asyncapi-2.0 + '..' // tck )) const PARSERS = { diff --git a/runner/js/src/parsers.js b/runner/js/src/parsers.js index d56cf201..e26baa3a 100644 --- a/runner/js/src/parsers.js +++ b/runner/js/src/parsers.js @@ -18,10 +18,10 @@ async function asyncapiParse (fpath) { // https://github.com/aml-org/amf async function amfParse (fpath) { await amf.AMF.init() - const parser = amf.AMF.raml10Parser() + const parser = amf.Core.parser('ASYNC 2.0', 'application/yaml') const model = await parser.parseFileAsync(`file://${fpath}`) const report = await amf.AMF.validate( - model, amf.ProfileNames.RAML10, amf.MessageStyles.RAML) + model, amf.ProfileNames.ASYNC20, amf.MessageStyles.ASYNC) if (!report.conforms) { report.results.map(res => { if (res.level.toLowerCase() === 'violation') { From a64dcbdefb05406c01fb7927982ee64b9daaecba Mon Sep 17 00:00:00 2001 From: Artem Kostiuk Date: Fri, 17 Jan 2020 12:06:49 +0200 Subject: [PATCH 19/26] Add development note --- runner/js/README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/runner/js/README.md b/runner/js/README.md index 35545144..3404a0b3 100644 --- a/runner/js/README.md +++ b/runner/js/README.md @@ -18,6 +18,11 @@ $ cd tck/runner/js $ npm install . ``` +For testing parsers in local development, link them after the installation finishes: +```sh +$ npm link ~/projects/my-parser/ +``` + ## Run ```sh From 601fa9da2e93a2202ce83b1f98358716cf0b0f95 Mon Sep 17 00:00:00 2001 From: Artem Kostiuk Date: Fri, 17 Jan 2020 12:20:49 +0200 Subject: [PATCH 20/26] Add gen-manifest note to contrib --- CONTRIBUTING.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f499eedb..4bba944e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -8,6 +8,11 @@ Please place new tests in one of `tests/asyncapi-2.0` sub-folders. Name of the t Non-AsyncAPI files (libraries, extensions, etc.) must have a `.yml` extension instead of `.yaml`. +After adding/moving/deleting tck files, manifest has to be regenerated with: +```sh +npm run gen-manifest +``` + ## Running tests We've created a separate project called [tck runner](./runner) to run all the tests contained in the AsyncAPI TCK. By following the instructions on that directory, you should be able to test any new test case that you may want to contribute against the different projects that this runner covers. From 67d941ccc79696fee997345e2d9e194b923ec9fc Mon Sep 17 00:00:00 2001 From: Artem Kostiuk Date: Mon, 27 Jan 2020 10:37:51 +0200 Subject: [PATCH 21/26] Add more tests to address initial notes --- manifest.json | 23 ++++++++ tests/asyncapi-2.0/AsyncAPI Object/valid.yaml | 2 + .../valid-empty-object.yaml | 13 +++++ .../valid-empty-object.yaml | 8 +++ .../Contact Object/valid-empty-object.yaml | 17 ++++++ tests/asyncapi-2.0/Format/valid.json | 1 + .../Message Bindings Object/kafka/valid.yaml | 4 +- .../valid-empty-object.yaml | 17 ++++++ .../Message Object/invalid-examples-item.yaml | 47 ++++++++++++++++ .../Message Object/valid-empty-object.yaml | 13 +++++ .../valid-using-defaultContentType.yaml | 33 ++++++++++++ .../invalid-examples-item.yaml | 53 +++++++++++++++++++ .../valid-empty-object.yaml | 25 +++++++++ .../valid-using-defaultContentType.yaml | 49 +++++++++++++++++ .../kafka/valid.yaml | 8 ++- .../valid-empty-object.yaml | 17 ++++++ .../Operation Object/valid-empty-object.yaml | 9 ++++ .../valid-empty-object.yaml | 23 ++++++++ .../Parameter Object/valid-empty-object.yaml | 14 +++++ .../valid-extra-parameter.yaml | 22 ++++++++ .../valid-parameter-not-defined.yaml | 18 +++++++ .../oauth2/valid-empty-flows.yaml | 27 ++++++++++ .../invalid-bindingVersion-type.yaml | 1 + .../invalid-cleanSession-type.yaml | 1 + .../Fields Types/invalid-clientId-type.yaml | 1 + .../Fields Types/invalid-keepAlive-type.yaml | 1 + .../invalid-lastWill-message-type.yaml | 29 ++++++++++ .../invalid-lastWill-qos-type.yaml | 1 + .../invalid-lastWill-retain-type.yaml | 1 + .../invalid-lastWill-topic-type.yaml | 1 + .../mqtt/invalid-extra-properties.yaml | 1 + .../Server Bindings Object/mqtt/valid.yaml | 1 + .../valid-empty-object.yaml | 18 +++++++ .../invalid-examples-item.yaml | 35 ++++++++++++ .../valid-empty-object.yaml | 24 +++++++++ .../valid-extra-variable.yaml | 37 +++++++++++++ .../valid-variable-not-defined.yaml | 29 ++++++++++ 37 files changed, 621 insertions(+), 3 deletions(-) create mode 100644 tests/asyncapi-2.0/Channel Bindings Object/valid-empty-object.yaml create mode 100644 tests/asyncapi-2.0/Channel Item Object/valid-empty-object.yaml create mode 100644 tests/asyncapi-2.0/Contact Object/valid-empty-object.yaml create mode 100644 tests/asyncapi-2.0/Message Bindings Object/valid-empty-object.yaml create mode 100644 tests/asyncapi-2.0/Message Object/invalid-examples-item.yaml create mode 100644 tests/asyncapi-2.0/Message Object/valid-empty-object.yaml create mode 100644 tests/asyncapi-2.0/Message Object/valid-using-defaultContentType.yaml create mode 100644 tests/asyncapi-2.0/Message Trait Object/invalid-examples-item.yaml create mode 100644 tests/asyncapi-2.0/Message Trait Object/valid-empty-object.yaml create mode 100644 tests/asyncapi-2.0/Message Trait Object/valid-using-defaultContentType.yaml create mode 100644 tests/asyncapi-2.0/Operation Bindings Object/valid-empty-object.yaml create mode 100644 tests/asyncapi-2.0/Operation Object/valid-empty-object.yaml create mode 100644 tests/asyncapi-2.0/Operation Trait Object/valid-empty-object.yaml create mode 100644 tests/asyncapi-2.0/Parameter Object/valid-empty-object.yaml create mode 100644 tests/asyncapi-2.0/Parameter Object/valid-extra-parameter.yaml create mode 100644 tests/asyncapi-2.0/Parameter Object/valid-parameter-not-defined.yaml create mode 100644 tests/asyncapi-2.0/Security Scheme Object/oauth2/valid-empty-flows.yaml create mode 100644 tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-message-type.yaml create mode 100644 tests/asyncapi-2.0/Server Bindings Object/valid-empty-object.yaml create mode 100644 tests/asyncapi-2.0/Server Variable Object/invalid-examples-item.yaml create mode 100644 tests/asyncapi-2.0/Server Variable Object/valid-empty-object.yaml create mode 100644 tests/asyncapi-2.0/Server Variable Object/valid-extra-variable.yaml create mode 100644 tests/asyncapi-2.0/Server Variable Object/valid-variable-not-defined.yaml diff --git a/manifest.json b/manifest.json index e7f7940b..92265a05 100644 --- a/manifest.json +++ b/manifest.json @@ -40,6 +40,7 @@ "tests/asyncapi-2.0/Info Object/Fields Types/invalid-version-type.yaml", "tests/asyncapi-2.0/Contact Object/invalid-email-format.yaml", "tests/asyncapi-2.0/Contact Object/invalid-url-format.yaml", + "tests/asyncapi-2.0/Contact Object/valid-empty-object.yaml", "tests/asyncapi-2.0/Contact Object/valid.yaml", "tests/asyncapi-2.0/Contact Object/Fields Types/invalid-email-type.yaml", "tests/asyncapi-2.0/Contact Object/Fields Types/invalid-name-type.yaml", @@ -66,6 +67,10 @@ "tests/asyncapi-2.0/Server Object/Fields Types/invalid-security-type.yaml", "tests/asyncapi-2.0/Server Object/Fields Types/invalid-url-type.yaml", "tests/asyncapi-2.0/Server Object/Fields Types/invalid-variables-type.yaml", + "tests/asyncapi-2.0/Server Variable Object/invalid-examples-item.yaml", + "tests/asyncapi-2.0/Server Variable Object/valid-empty-object.yaml", + "tests/asyncapi-2.0/Server Variable Object/valid-extra-variable.yaml", + "tests/asyncapi-2.0/Server Variable Object/valid-variable-not-defined.yaml", "tests/asyncapi-2.0/Server Variable Object/valid.yaml", "tests/asyncapi-2.0/Server Variable Object/Fields Types/invalid-default-type.yaml", "tests/asyncapi-2.0/Server Variable Object/Fields Types/invalid-description-type.yaml", @@ -77,6 +82,7 @@ "tests/asyncapi-2.0/Channels Object/valid.yaml", "tests/asyncapi-2.0/Channels Object/Fields Types/invalid-channel-type.yaml", "tests/asyncapi-2.0/Channel Item Object/invalid-external-ref-structure.yaml", + "tests/asyncapi-2.0/Channel Item Object/valid-empty-object.yaml", "tests/asyncapi-2.0/Channel Item Object/valid-external-ref.yaml", "tests/asyncapi-2.0/Channel Item Object/valid-publish.yaml", "tests/asyncapi-2.0/Channel Item Object/valid-subscribe.yaml", @@ -90,6 +96,7 @@ "tests/asyncapi-2.0/Operation Object/invalid-duplicate-tags.yaml", "tests/asyncapi-2.0/Operation Object/valid-bare-minimum.yaml", "tests/asyncapi-2.0/Operation Object/valid-case-sensitive-operationId.yaml", + "tests/asyncapi-2.0/Operation Object/valid-empty-object.yaml", "tests/asyncapi-2.0/Operation Object/valid-multiple-messages.yaml", "tests/asyncapi-2.0/Operation Object/valid.yaml", "tests/asyncapi-2.0/Operation Object/Fields Types/invalid-bindings-type.yaml", @@ -105,6 +112,7 @@ "tests/asyncapi-2.0/Operation Trait Object/invalid-trait-with-message.yaml", "tests/asyncapi-2.0/Operation Trait Object/invalid-trait-with-traits.yaml", "tests/asyncapi-2.0/Operation Trait Object/valid-case-sensetive-operationId.yaml", + "tests/asyncapi-2.0/Operation Trait Object/valid-empty-object.yaml", "tests/asyncapi-2.0/Operation Trait Object/valid-empty-trait.yaml", "tests/asyncapi-2.0/Operation Trait Object/valid.yaml", "tests/asyncapi-2.0/Operation Trait Object/Fields Types/invalid-bindings-type.yaml", @@ -114,10 +122,13 @@ "tests/asyncapi-2.0/Operation Trait Object/Fields Types/invalid-summary-type.yaml", "tests/asyncapi-2.0/Operation Trait Object/Fields Types/invalid-tags-type.yaml", "tests/asyncapi-2.0/Message Object/invalid-duplicate-tags.yaml", + "tests/asyncapi-2.0/Message Object/invalid-examples-item.yaml", "tests/asyncapi-2.0/Message Object/invalid-headers-type.yaml", "tests/asyncapi-2.0/Message Object/invalid-missing-contentType.yaml", + "tests/asyncapi-2.0/Message Object/valid-empty-object.yaml", "tests/asyncapi-2.0/Message Object/valid-internal-ref-correlationId.yaml", "tests/asyncapi-2.0/Message Object/valid-internal-ref-header.yaml", + "tests/asyncapi-2.0/Message Object/valid-using-defaultContentType.yaml", "tests/asyncapi-2.0/Message Object/valid.yaml", "tests/asyncapi-2.0/Message Object/Fields Types/invalid-bindings-type.yaml", "tests/asyncapi-2.0/Message Object/Fields Types/invalid-contentType-type.yaml", @@ -135,10 +146,13 @@ "tests/asyncapi-2.0/Message Trait Object/invalid-defines-payload.yaml", "tests/asyncapi-2.0/Message Trait Object/invalid-defines-traits.yaml", "tests/asyncapi-2.0/Message Trait Object/invalid-duplicate-tags.yaml", + "tests/asyncapi-2.0/Message Trait Object/invalid-examples-item.yaml", "tests/asyncapi-2.0/Message Trait Object/invalid-headers-type.yaml", "tests/asyncapi-2.0/Message Trait Object/invalid-missing-content-type.yaml", + "tests/asyncapi-2.0/Message Trait Object/valid-empty-object.yaml", "tests/asyncapi-2.0/Message Trait Object/valid-internal-ref-correlationId.yaml", "tests/asyncapi-2.0/Message Trait Object/valid-internal-ref-header.yaml", + "tests/asyncapi-2.0/Message Trait Object/valid-using-defaultContentType.yaml", "tests/asyncapi-2.0/Message Trait Object/valid.yaml", "tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-bindings-type.yaml", "tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-contentType-type.yaml", @@ -214,6 +228,7 @@ "tests/asyncapi-2.0/Security Scheme Object/oauth2/invalid-password-missing-tokenUrl.yaml", "tests/asyncapi-2.0/Security Scheme Object/oauth2/invalid-refreshUrl-format.yaml", "tests/asyncapi-2.0/Security Scheme Object/oauth2/invalid-tokenUrl-format.yaml", + "tests/asyncapi-2.0/Security Scheme Object/oauth2/valid-empty-flows.yaml", "tests/asyncapi-2.0/Security Scheme Object/oauth2/valid.yaml", "tests/asyncapi-2.0/Security Scheme Object/oauth2/Fields Types/invalid-authorizationCode-type.yaml", "tests/asyncapi-2.0/Security Scheme Object/oauth2/Fields Types/invalid-authorizationUrl-type.yaml", @@ -259,21 +274,27 @@ "tests/asyncapi-2.0/Parameters Object/valid.yaml", "tests/asyncapi-2.0/Parameters Object/Fields Types/invalid-parameter-type.yaml", "tests/asyncapi-2.0/Parameter Object/invalid-runtime-expression.yaml", + "tests/asyncapi-2.0/Parameter Object/valid-empty-object.yaml", + "tests/asyncapi-2.0/Parameter Object/valid-extra-parameter.yaml", + "tests/asyncapi-2.0/Parameter Object/valid-parameter-not-defined.yaml", "tests/asyncapi-2.0/Parameter Object/valid-ref-schema.yaml", "tests/asyncapi-2.0/Parameter Object/valid.yaml", "tests/asyncapi-2.0/Parameter Object/Fields Types/invalid-description-type.yaml", "tests/asyncapi-2.0/Parameter Object/Fields Types/invalid-location-type.yaml", "tests/asyncapi-2.0/Parameter Object/Fields Types/invalid-schema-type.yaml", + "tests/asyncapi-2.0/Server Bindings Object/valid-empty-object.yaml", "tests/asyncapi-2.0/Server Bindings Object/mqtt/invalid-extra-properties.yaml", "tests/asyncapi-2.0/Server Bindings Object/mqtt/valid.yaml", "tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-bindingVersion-type.yaml", "tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-cleanSession-type.yaml", "tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-clientId-type.yaml", "tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-keepAlive-type.yaml", + "tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-message-type.yaml", "tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-qos-type.yaml", "tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-retain-type.yaml", "tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-topic-type.yaml", "tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-type.yaml", + "tests/asyncapi-2.0/Channel Bindings Object/valid-empty-object.yaml", "tests/asyncapi-2.0/Channel Bindings Object/ws/invalid-extra-properties.yaml", "tests/asyncapi-2.0/Channel Bindings Object/ws/invalid-headers-type.yaml", "tests/asyncapi-2.0/Channel Bindings Object/ws/invalid-method.yaml", @@ -302,6 +323,7 @@ "tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-queue-name-type.yaml", "tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-queue-type.yaml", "tests/asyncapi-2.0/Channel Bindings Object/amqp/Fields Types/invalid-queue-vhost-type.yaml", + "tests/asyncapi-2.0/Operation Bindings Object/valid-empty-object.yaml", "tests/asyncapi-2.0/Operation Bindings Object/mqtt/invalid-extra-properties.yaml", "tests/asyncapi-2.0/Operation Bindings Object/mqtt/invalid-qos-value.yaml", "tests/asyncapi-2.0/Operation Bindings Object/mqtt/valid.yaml", @@ -337,6 +359,7 @@ "tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-replyTo-type.yaml", "tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-timestamp-type.yaml", "tests/asyncapi-2.0/Operation Bindings Object/amqp/Fields Types/invalid-userId-type.yaml", + "tests/asyncapi-2.0/Message Bindings Object/valid-empty-object.yaml", "tests/asyncapi-2.0/Message Bindings Object/mqtt/invalid-extra-properties.yaml", "tests/asyncapi-2.0/Message Bindings Object/mqtt/valid.yaml", "tests/asyncapi-2.0/Message Bindings Object/mqtt/Fields Types/invalid-bindingVersion-type.yaml", diff --git a/tests/asyncapi-2.0/AsyncAPI Object/valid.yaml b/tests/asyncapi-2.0/AsyncAPI Object/valid.yaml index ca441bfb..4e33bd5a 100644 --- a/tests/asyncapi-2.0/AsyncAPI Object/valid.yaml +++ b/tests/asyncapi-2.0/AsyncAPI Object/valid.yaml @@ -1,5 +1,7 @@ asyncapi: 2.0.0 +defaultContentType: application/json + externalDocs: description: Find more info here url: https://example.com diff --git a/tests/asyncapi-2.0/Channel Bindings Object/valid-empty-object.yaml b/tests/asyncapi-2.0/Channel Bindings Object/valid-empty-object.yaml new file mode 100644 index 00000000..2d2ff9b7 --- /dev/null +++ b/tests/asyncapi-2.0/Channel Bindings Object/valid-empty-object.yaml @@ -0,0 +1,13 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: string + bindings: diff --git a/tests/asyncapi-2.0/Channel Item Object/valid-empty-object.yaml b/tests/asyncapi-2.0/Channel Item Object/valid-empty-object.yaml new file mode 100644 index 00000000..d5b46d94 --- /dev/null +++ b/tests/asyncapi-2.0/Channel Item Object/valid-empty-object.yaml @@ -0,0 +1,8 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: diff --git a/tests/asyncapi-2.0/Contact Object/valid-empty-object.yaml b/tests/asyncapi-2.0/Contact Object/valid-empty-object.yaml new file mode 100644 index 00000000..906e3444 --- /dev/null +++ b/tests/asyncapi-2.0/Contact Object/valid-empty-object.yaml @@ -0,0 +1,17 @@ +asyncapi: 2.0.0 + +info: + title: AsyncAPI Sample App + version: 1.0.1 + contact: + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email diff --git a/tests/asyncapi-2.0/Format/valid.json b/tests/asyncapi-2.0/Format/valid.json index 02edc2f1..2f326489 100644 --- a/tests/asyncapi-2.0/Format/valid.json +++ b/tests/asyncapi-2.0/Format/valid.json @@ -1,5 +1,6 @@ { "asyncapi": "2.0.0", + "defaultContentType": "application/json", "info": { "title": "Signup service example (internal)", "version": "0.1.0" diff --git a/tests/asyncapi-2.0/Message Bindings Object/kafka/valid.yaml b/tests/asyncapi-2.0/Message Bindings Object/kafka/valid.yaml index 1b451c02..b0f6b0c0 100644 --- a/tests/asyncapi-2.0/Message Bindings Object/kafka/valid.yaml +++ b/tests/asyncapi-2.0/Message Bindings Object/kafka/valid.yaml @@ -16,5 +16,7 @@ channels: format: email bindings: kafka: - key: myKey + key: + type: string + enum: ['myKey'] bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Message Bindings Object/valid-empty-object.yaml b/tests/asyncapi-2.0/Message Bindings Object/valid-empty-object.yaml new file mode 100644 index 00000000..a6597c9a --- /dev/null +++ b/tests/asyncapi-2.0/Message Bindings Object/valid-empty-object.yaml @@ -0,0 +1,17 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + publish: + message: + payload: + type: object + properties: + email: + type: string + format: email + bindings: diff --git a/tests/asyncapi-2.0/Message Object/invalid-examples-item.yaml b/tests/asyncapi-2.0/Message Object/invalid-examples-item.yaml new file mode 100644 index 00000000..08093fb7 --- /dev/null +++ b/tests/asyncapi-2.0/Message Object/invalid-examples-item.yaml @@ -0,0 +1,47 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: user signed up to load some data + message: + name: UserSignup + title: User signup + summary: Action to sign a user up. + description: A longer description + contentType: application/json + schemaFormat: application/vnd.oai.openapi;version=3.0.0 + correlationId: + description: Default Correlation ID + location: $message.header#/correlationId + headers: + type: object + properties: + correlationId: + description: Correlation ID set by application + type: string + applicationInstanceId: + description: Unique identifier for a given instance of the publishing application + type: string + tags: + - name: user + description: user signed up + - name: signup + externalDocs: + description: Find more info here + url: https://example.com + payload: + type: object + properties: + email: + type: string + format: email + examples: + - one: + foobar: 123 diff --git a/tests/asyncapi-2.0/Message Object/valid-empty-object.yaml b/tests/asyncapi-2.0/Message Object/valid-empty-object.yaml new file mode 100644 index 00000000..888b0bd7 --- /dev/null +++ b/tests/asyncapi-2.0/Message Object/valid-empty-object.yaml @@ -0,0 +1,13 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: user signed up to load some data + message: diff --git a/tests/asyncapi-2.0/Message Object/valid-using-defaultContentType.yaml b/tests/asyncapi-2.0/Message Object/valid-using-defaultContentType.yaml new file mode 100644 index 00000000..db6517f4 --- /dev/null +++ b/tests/asyncapi-2.0/Message Object/valid-using-defaultContentType.yaml @@ -0,0 +1,33 @@ +asyncapi: 2.0.0 + +defaultContentType: application/json + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: user signed up to load some data + message: + name: UserSignup + title: User signup + summary: Action to sign a user up. + description: A longer description + schemaFormat: application/vnd.oai.openapi;version=3.0.0 + headers: + type: string + payload: + type: object + properties: + email: + type: string + format: email + examples: + - one: + email: hello@foo.bar + - two: + email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Trait Object/invalid-examples-item.yaml b/tests/asyncapi-2.0/Message Trait Object/invalid-examples-item.yaml new file mode 100644 index 00000000..21cf79a3 --- /dev/null +++ b/tests/asyncapi-2.0/Message Trait Object/invalid-examples-item.yaml @@ -0,0 +1,53 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: user signed up to load some data + message: + payload: + type: object + properties: + email: + type: string + format: email + traits: + - $ref: "#/components/messageTraits/signedUpMessage" + +components: + messageTraits: + signedUpMessage: + tags: + - name: user + description: user signed up + - name: signup + externalDocs: + description: Find more info here + url: https://example.com + name: UserSignup + title: User signup + summary: Action to sign a user up. + description: A longer description + contentType: application/json + schemaFormat: application/vnd.oai.openapi;version=3.0.0 + correlationId: + description: Default Correlation ID + location: $message.header#/correlationId + headers: + type: object + properties: + correlationId: + description: Correlation ID set by application + type: string + applicationInstanceId: + description: Unique identifier for a given instance of the publishing application + type: string + examples: + - one: + foobar: 123 diff --git a/tests/asyncapi-2.0/Message Trait Object/valid-empty-object.yaml b/tests/asyncapi-2.0/Message Trait Object/valid-empty-object.yaml new file mode 100644 index 00000000..4e55ea80 --- /dev/null +++ b/tests/asyncapi-2.0/Message Trait Object/valid-empty-object.yaml @@ -0,0 +1,25 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: user signed up to load some data + message: + payload: + type: object + properties: + email: + type: string + format: email + traits: + - $ref: "#/components/messageTraits/signedUpMessage" + +components: + messageTraits: + signedUpMessage: diff --git a/tests/asyncapi-2.0/Message Trait Object/valid-using-defaultContentType.yaml b/tests/asyncapi-2.0/Message Trait Object/valid-using-defaultContentType.yaml new file mode 100644 index 00000000..1f3c2b4b --- /dev/null +++ b/tests/asyncapi-2.0/Message Trait Object/valid-using-defaultContentType.yaml @@ -0,0 +1,49 @@ +asyncapi: 2.0.0 + +defaultContentType: application/json + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + operationId: userSignedUp + summary: user signed up + description: user signed up to load some data + message: + payload: + type: object + properties: + email: + type: string + format: email + traits: + - $ref: "#/components/messageTraits/signedUpMessage" + +components: + messageTraits: + signedUpMessage: + name: UserSignup + title: User signup + summary: Action to sign a user up. + description: A longer description + schemaFormat: application/vnd.oai.openapi;version=3.0.0 + correlationId: + description: Default Correlation ID + location: $message.header#/correlationId + headers: + type: object + properties: + correlationId: + description: Correlation ID set by application + type: string + applicationInstanceId: + description: Unique identifier for a given instance of the publishing application + type: string + examples: + - one: + email: hello@foo.bar + - two: + email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Operation Bindings Object/kafka/valid.yaml b/tests/asyncapi-2.0/Operation Bindings Object/kafka/valid.yaml index e4338868..40f0a130 100644 --- a/tests/asyncapi-2.0/Operation Bindings Object/kafka/valid.yaml +++ b/tests/asyncapi-2.0/Operation Bindings Object/kafka/valid.yaml @@ -16,6 +16,10 @@ channels: format: email bindings: kafka: - groupId: myGroupId - clientId: myClientId + groupId: + type: string + enum: ['myGroupId'] + clientId: + type: string + enum: ['myClientId'] bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Operation Bindings Object/valid-empty-object.yaml b/tests/asyncapi-2.0/Operation Bindings Object/valid-empty-object.yaml new file mode 100644 index 00000000..74f3a33d --- /dev/null +++ b/tests/asyncapi-2.0/Operation Bindings Object/valid-empty-object.yaml @@ -0,0 +1,17 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + bindings: diff --git a/tests/asyncapi-2.0/Operation Object/valid-empty-object.yaml b/tests/asyncapi-2.0/Operation Object/valid-empty-object.yaml new file mode 100644 index 00000000..059133b6 --- /dev/null +++ b/tests/asyncapi-2.0/Operation Object/valid-empty-object.yaml @@ -0,0 +1,9 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: diff --git a/tests/asyncapi-2.0/Operation Trait Object/valid-empty-object.yaml b/tests/asyncapi-2.0/Operation Trait Object/valid-empty-object.yaml new file mode 100644 index 00000000..951928b7 --- /dev/null +++ b/tests/asyncapi-2.0/Operation Trait Object/valid-empty-object.yaml @@ -0,0 +1,23 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + traits: + - $ref: "#/components/operationTraits/userSignedUpTrait" + - $ref: "#/components/operationTraits/userSignedUpDescTrait" + +components: + operationTraits: + userSignedUpTrait: diff --git a/tests/asyncapi-2.0/Parameter Object/valid-empty-object.yaml b/tests/asyncapi-2.0/Parameter Object/valid-empty-object.yaml new file mode 100644 index 00000000..eb7eadba --- /dev/null +++ b/tests/asyncapi-2.0/Parameter Object/valid-empty-object.yaml @@ -0,0 +1,14 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + user/{userId}/signup: + parameters: + userId: + publish: + message: + payload: + type: string diff --git a/tests/asyncapi-2.0/Parameter Object/valid-extra-parameter.yaml b/tests/asyncapi-2.0/Parameter Object/valid-extra-parameter.yaml new file mode 100644 index 00000000..5066d068 --- /dev/null +++ b/tests/asyncapi-2.0/Parameter Object/valid-extra-parameter.yaml @@ -0,0 +1,22 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + user/{userId}/signup: + parameters: + userId: + description: Id of the user. + schema: + type: string + location: $message.payload#/user/id + userToken: + schema: + type: string + location: $message.payload#/user/token + publish: + message: + payload: + type: string diff --git a/tests/asyncapi-2.0/Parameter Object/valid-parameter-not-defined.yaml b/tests/asyncapi-2.0/Parameter Object/valid-parameter-not-defined.yaml new file mode 100644 index 00000000..9767361e --- /dev/null +++ b/tests/asyncapi-2.0/Parameter Object/valid-parameter-not-defined.yaml @@ -0,0 +1,18 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + user/{userId}/{userToken}/signup: + parameters: + userId: + description: Id of the user. + schema: + type: string + location: $message.payload#/user/id + publish: + message: + payload: + type: string diff --git a/tests/asyncapi-2.0/Security Scheme Object/oauth2/valid-empty-flows.yaml b/tests/asyncapi-2.0/Security Scheme Object/oauth2/valid-empty-flows.yaml new file mode 100644 index 00000000..a1942fea --- /dev/null +++ b/tests/asyncapi-2.0/Security Scheme Object/oauth2/valid-empty-flows.yaml @@ -0,0 +1,27 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: kafka + security: + - mainSecurity: + - write:pets + - read:pets + +components: + securitySchemes: + mainSecurity: + type: oauth2 + flows: diff --git a/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-bindingVersion-type.yaml b/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-bindingVersion-type.yaml index 4e26ed24..e4045662 100644 --- a/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-bindingVersion-type.yaml +++ b/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-bindingVersion-type.yaml @@ -22,6 +22,7 @@ servers: lastWill: topic: /last-wills qos: 1 + message: Guest gone offline. retain: false keepAlive: 60 bindingVersion: diff --git a/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-cleanSession-type.yaml b/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-cleanSession-type.yaml index 3c6000a2..f916bb5c 100644 --- a/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-cleanSession-type.yaml +++ b/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-cleanSession-type.yaml @@ -22,6 +22,7 @@ servers: lastWill: topic: /last-wills qos: 2 + message: Guest gone offline. retain: false keepAlive: 60 bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-clientId-type.yaml b/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-clientId-type.yaml index 18ecbd52..caa0ae6e 100644 --- a/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-clientId-type.yaml +++ b/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-clientId-type.yaml @@ -23,6 +23,7 @@ servers: lastWill: topic: /last-wills qos: 2 + message: Guest gone offline. retain: false keepAlive: 60 bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-keepAlive-type.yaml b/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-keepAlive-type.yaml index b0bbb2bd..b9544a2a 100644 --- a/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-keepAlive-type.yaml +++ b/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-keepAlive-type.yaml @@ -22,6 +22,7 @@ servers: lastWill: topic: /last-wills qos: 1 + message: Guest gone offline. retain: false keepAlive: qwe bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-message-type.yaml b/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-message-type.yaml new file mode 100644 index 00000000..0430cb34 --- /dev/null +++ b/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-message-type.yaml @@ -0,0 +1,29 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: mqtt + bindings: + mqtt: + clientId: guest + cleanSession: true + lastWill: + topic: /last-wills + qos: 2 + message: + prop: 1 + retain: false + keepAlive: 60 + bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-qos-type.yaml b/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-qos-type.yaml index cfad012a..69520c72 100644 --- a/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-qos-type.yaml +++ b/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-qos-type.yaml @@ -23,6 +23,7 @@ servers: topic: /last-wills qos: prop: 1 + message: Guest gone offline. retain: false keepAlive: 60 bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-retain-type.yaml b/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-retain-type.yaml index bb818af5..02e2b9e0 100644 --- a/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-retain-type.yaml +++ b/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-retain-type.yaml @@ -22,6 +22,7 @@ servers: lastWill: topic: /last-wills qos: 1 + message: Guest gone offline. retain: qwe keepAlive: 60 bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-topic-type.yaml b/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-topic-type.yaml index b6f15857..dccbfffd 100644 --- a/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-topic-type.yaml +++ b/tests/asyncapi-2.0/Server Bindings Object/mqtt/Fields Types/invalid-lastWill-topic-type.yaml @@ -23,6 +23,7 @@ servers: topic: prop: 1 qos: 2 + message: Guest gone offline. retain: false keepAlive: 60 bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Server Bindings Object/mqtt/invalid-extra-properties.yaml b/tests/asyncapi-2.0/Server Bindings Object/mqtt/invalid-extra-properties.yaml index 3c5e8454..dc5f53c7 100644 --- a/tests/asyncapi-2.0/Server Bindings Object/mqtt/invalid-extra-properties.yaml +++ b/tests/asyncapi-2.0/Server Bindings Object/mqtt/invalid-extra-properties.yaml @@ -23,6 +23,7 @@ servers: lastWill: topic: /last-wills qos: 2 + message: Guest gone offline. retain: false keepAlive: 60 bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Server Bindings Object/mqtt/valid.yaml b/tests/asyncapi-2.0/Server Bindings Object/mqtt/valid.yaml index e44dae8e..1a720ddd 100644 --- a/tests/asyncapi-2.0/Server Bindings Object/mqtt/valid.yaml +++ b/tests/asyncapi-2.0/Server Bindings Object/mqtt/valid.yaml @@ -22,6 +22,7 @@ servers: lastWill: topic: /last-wills qos: 2 + message: Guest gone offline. retain: false keepAlive: 60 bindingVersion: '0.1.0' diff --git a/tests/asyncapi-2.0/Server Bindings Object/valid-empty-object.yaml b/tests/asyncapi-2.0/Server Bindings Object/valid-empty-object.yaml new file mode 100644 index 00000000..aeaf0f61 --- /dev/null +++ b/tests/asyncapi-2.0/Server Bindings Object/valid-empty-object.yaml @@ -0,0 +1,18 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: string + +servers: + production: + url: development.gigantic-server.com + protocol: mqtt + bindings: diff --git a/tests/asyncapi-2.0/Server Variable Object/invalid-examples-item.yaml b/tests/asyncapi-2.0/Server Variable Object/invalid-examples-item.yaml new file mode 100644 index 00000000..2d5686a7 --- /dev/null +++ b/tests/asyncapi-2.0/Server Variable Object/invalid-examples-item.yaml @@ -0,0 +1,35 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + +servers: + production: + url: '{username}.gigantic-server.com:{port}' + description: The production API server + protocol: secure-mqtt + variables: + username: + default: demo + description: Active user name + examples: + - 'admin' + - 'user123' + port: + enum: + - '8883' + - '8884' + examples: + - '123123' diff --git a/tests/asyncapi-2.0/Server Variable Object/valid-empty-object.yaml b/tests/asyncapi-2.0/Server Variable Object/valid-empty-object.yaml new file mode 100644 index 00000000..fbc2b86a --- /dev/null +++ b/tests/asyncapi-2.0/Server Variable Object/valid-empty-object.yaml @@ -0,0 +1,24 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + +servers: + production: + url: '{username}.gigantic-server.com:{port}' + description: The production API server + protocol: secure-mqtt + variables: + username: diff --git a/tests/asyncapi-2.0/Server Variable Object/valid-extra-variable.yaml b/tests/asyncapi-2.0/Server Variable Object/valid-extra-variable.yaml new file mode 100644 index 00000000..10b6cfd7 --- /dev/null +++ b/tests/asyncapi-2.0/Server Variable Object/valid-extra-variable.yaml @@ -0,0 +1,37 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + +servers: + production: + url: '{username}.gigantic-server.com:{port}' + description: The production API server + protocol: secure-mqtt + variables: + username: + default: demo + description: Active user name + examples: + - 'admin' + - 'user123' + port: + enum: + - '8883' + - '8884' + default: '8883' + userToken: + enum: + - '8883' diff --git a/tests/asyncapi-2.0/Server Variable Object/valid-variable-not-defined.yaml b/tests/asyncapi-2.0/Server Variable Object/valid-variable-not-defined.yaml new file mode 100644 index 00000000..7de6c9d0 --- /dev/null +++ b/tests/asyncapi-2.0/Server Variable Object/valid-variable-not-defined.yaml @@ -0,0 +1,29 @@ +asyncapi: 2.0.0 + +info: + title: Signup service example (internal) + version: 0.1.0 + +channels: + /user/signedup: + subscribe: + message: + payload: + type: object + properties: + email: + type: string + format: email + +servers: + production: + url: '{username}.gigantic-server.com:{port}' + description: The production API server + protocol: secure-mqtt + variables: + username: + default: demo + description: Active user name + examples: + - 'admin' + - 'user123' From 03653bd30d58ab18c7077ae34045d4553df813bb Mon Sep 17 00:00:00 2001 From: Artem Kostiuk Date: Tue, 28 Jan 2020 11:49:09 +0200 Subject: [PATCH 22/26] Add gh actions workflow to publish to gh-pages --- .github/workflows/publish-gh-pages.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/publish-gh-pages.yml diff --git a/.github/workflows/publish-gh-pages.yml b/.github/workflows/publish-gh-pages.yml new file mode 100644 index 00000000..cf9a8e00 --- /dev/null +++ b/.github/workflows/publish-gh-pages.yml @@ -0,0 +1,22 @@ +name: Publish Github Pages + +on: + push: + branches: + - add_tck_tests + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Build tck runner reports + run: make + working-directory: ./runner + - name: Create .nojekyll file + run: touch runner/reports/html/.nojekyll + - uses: JamesIves/github-pages-deploy-action@releases/v3 + with: + ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} + BRANCH: gh-pages # The branch the action should deploy to. + FOLDER: runner/reports/html/ # The folder the action should deploy. From 3e92f60f194bac6d51975f40c641c6d87ec42a77 Mon Sep 17 00:00:00 2001 From: Artem Kostiuk Date: Wed, 29 Jan 2020 12:19:46 +0200 Subject: [PATCH 23/26] Rework GH Actions workflow to use SSH --- .github/workflows/publish-gh-pages.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish-gh-pages.yml b/.github/workflows/publish-gh-pages.yml index cf9a8e00..1494e1b2 100644 --- a/.github/workflows/publish-gh-pages.yml +++ b/.github/workflows/publish-gh-pages.yml @@ -9,14 +9,20 @@ jobs: publish: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - name: Checkout repository + uses: actions/checkout@v2 - name: Build tck runner reports run: make working-directory: ./runner - name: Create .nojekyll file run: touch runner/reports/html/.nojekyll - - uses: JamesIves/github-pages-deploy-action@releases/v3 + - name: Install SSH Client + uses: webfactory/ssh-agent@v0.2.0 with: - ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} + ssh-private-key: ${{ secrets.DEPLOY_KEY }} + - name: Deploy to Github Pages + uses: JamesIves/github-pages-deploy-action@releases/v3 + with: + SSH: true BRANCH: gh-pages # The branch the action should deploy to. FOLDER: runner/reports/html/ # The folder the action should deploy. From f0e1b4fa0f90fb8038e4cefa395170864b3f61de Mon Sep 17 00:00:00 2001 From: Artem Kostiuk Date: Wed, 4 Mar 2020 10:38:43 +0200 Subject: [PATCH 24/26] Address initial PR review notes --- manifest.json | 8 ++-- ...-minor.yaml => invalid-missing-patch.yaml} | 0 .../ws/invalid-extra-properties.yaml | 2 +- .../invalid-absolute-path.yaml | 16 -------- .../invalid-fragment-used.yaml | 16 -------- ...s-type.yaml => invalid-messages-type.yaml} | 0 .../invalid-channelBindings-key.yaml | 2 +- .../Format/invalid-case-sensitive.json | 24 ----------- ...alid-integer-key.yaml => invalid-key.yaml} | 2 +- tests/asyncapi-2.0/Format/invalid-syntax.json | 5 --- tests/asyncapi-2.0/Format/valid.json | 25 ------------ .../Fields Types/invalid-bindings-type.yaml | 38 ------------------ .../invalid-contentType-type.yaml | 38 ------------------ .../invalid-correlationId-type.yaml | 35 ---------------- .../invalid-description-type.yaml | 39 +----------------- .../Fields Types/invalid-examples-type.yaml | 33 --------------- .../invalid-externalDocs-type.yaml | 35 ---------------- .../Fields Types/invalid-headers-type.yaml | 29 -------------- .../Fields Types/invalid-name-type.yaml | 39 +----------------- .../invalid-schemaFormat-type.yaml | 37 ----------------- .../Fields Types/invalid-summary-type.yaml | 39 +----------------- .../Fields Types/invalid-tags-type.yaml | 34 ---------------- .../Fields Types/invalid-title-type.yaml | 39 +----------------- .../Fields Types/invalid-traits-type.yaml | 38 ------------------ .../invalid-duplicate-tags.yaml | 31 -------------- .../Message Object/invalid-examples-item.yaml | 33 --------------- .../Message Object/invalid-headers-type.yaml | 19 --------- .../valid-using-defaultContentType.yaml | 21 ---------- .../Fields Types/invalid-bindings-type.yaml | 40 +------------------ .../invalid-contentType-type.yaml | 40 +------------------ .../invalid-correlationId-type.yaml | 35 ---------------- .../invalid-description-type.yaml | 39 +----------------- .../Fields Types/invalid-examples-type.yaml | 35 +--------------- .../invalid-externalDocs-type.yaml | 37 +---------------- .../Fields Types/invalid-headers-type.yaml | 29 -------------- .../invalid-schemaFormat-type.yaml | 37 ----------------- .../Fields Types/invalid-summary-type.yaml | 39 +----------------- .../Fields Types/invalid-tags-type.yaml | 36 +---------------- .../Fields Types/invalid-title-type.yaml | 39 +----------------- .../invalid-defines-payload.yaml | 31 -------------- .../invalid-defines-traits.yaml | 31 -------------- .../invalid-duplicate-tags.yaml | 31 -------------- .../invalid-examples-item.yaml | 33 --------------- .../invalid-headers-type.yaml | 22 ---------- 44 files changed, 18 insertions(+), 1213 deletions(-) rename tests/asyncapi-2.0/AsyncAPI Version String/{valid-major-minor.yaml => invalid-missing-patch.yaml} (100%) delete mode 100644 tests/asyncapi-2.0/Channels Object/invalid-absolute-path.yaml delete mode 100644 tests/asyncapi-2.0/Channels Object/invalid-fragment-used.yaml rename tests/asyncapi-2.0/Components Object/Fields Types/{invalid- messages-type.yaml => invalid-messages-type.yaml} (100%) delete mode 100644 tests/asyncapi-2.0/Format/invalid-case-sensitive.json rename tests/asyncapi-2.0/Format/{invalid-integer-key.yaml => invalid-key.yaml} (96%) delete mode 100644 tests/asyncapi-2.0/Format/invalid-syntax.json delete mode 100644 tests/asyncapi-2.0/Format/valid.json diff --git a/manifest.json b/manifest.json index 92265a05..d97fa391 100644 --- a/manifest.json +++ b/manifest.json @@ -2,8 +2,8 @@ "description": "Files listed in order corresponding AsyncAPI feature appears in AsyncAPI 2.0 Specification", "filePaths": [ "tests/asyncapi-2.0/Format/invalid-case-sensitive.yaml", - "tests/asyncapi-2.0/Format/invalid-integer-key.yaml", "tests/asyncapi-2.0/Format/invalid-json-schema-tag.yaml", + "tests/asyncapi-2.0/Format/invalid-key.yaml", "tests/asyncapi-2.0/Format/invalid-syntax.yaml", "tests/asyncapi-2.0/Format/valid.yaml", "tests/asyncapi-2.0/File Structure/invalid-inexisting-file-ref.yaml", @@ -21,9 +21,9 @@ "tests/asyncapi-2.0/AsyncAPI Object/Fields Types/invalid-info-type.yaml", "tests/asyncapi-2.0/AsyncAPI Object/Fields Types/invalid-servers-type.yaml", "tests/asyncapi-2.0/AsyncAPI Object/Fields Types/invalid-tags-type.yaml", + "tests/asyncapi-2.0/AsyncAPI Version String/invalid-missing-patch.yaml", "tests/asyncapi-2.0/AsyncAPI Version String/invalid-version-string-format.yaml", "tests/asyncapi-2.0/AsyncAPI Version String/valid-major-minor-patch.yaml", - "tests/asyncapi-2.0/AsyncAPI Version String/valid-major-minor.yaml", "tests/asyncapi-2.0/AsyncAPI Version String/valid-with-hyphen.yaml", "tests/asyncapi-2.0/Identifier/invalid-uri-format.yaml", "tests/asyncapi-2.0/Identifier/valid-uri.yaml", @@ -76,8 +76,6 @@ "tests/asyncapi-2.0/Server Variable Object/Fields Types/invalid-description-type.yaml", "tests/asyncapi-2.0/Server Variable Object/Fields Types/invalid-enum-type.yaml", "tests/asyncapi-2.0/Server Variable Object/Fields Types/invalid-examples-type.yaml", - "tests/asyncapi-2.0/Channels Object/invalid-absolute-path.yaml", - "tests/asyncapi-2.0/Channels Object/invalid-fragment-used.yaml", "tests/asyncapi-2.0/Channels Object/invalid-query-param-used.yaml", "tests/asyncapi-2.0/Channels Object/valid.yaml", "tests/asyncapi-2.0/Channels Object/Fields Types/invalid-channel-type.yaml", @@ -187,11 +185,11 @@ "tests/asyncapi-2.0/Components Object/invalid-securitySchemes-key.yaml", "tests/asyncapi-2.0/Components Object/invalid-serverBindings-key.yaml", "tests/asyncapi-2.0/Components Object/valid-complete.yaml", - "tests/asyncapi-2.0/Components Object/Fields Types/invalid- messages-type.yaml", "tests/asyncapi-2.0/Components Object/Fields Types/invalid-channelBindings-type.yaml", "tests/asyncapi-2.0/Components Object/Fields Types/invalid-correlationIds-type.yaml", "tests/asyncapi-2.0/Components Object/Fields Types/invalid-messageBindings-type.yaml", "tests/asyncapi-2.0/Components Object/Fields Types/invalid-messageTraits-type.yaml", + "tests/asyncapi-2.0/Components Object/Fields Types/invalid-messages-type.yaml", "tests/asyncapi-2.0/Components Object/Fields Types/invalid-operationBindings-type.yaml", "tests/asyncapi-2.0/Components Object/Fields Types/invalid-operationTraits-type.yaml", "tests/asyncapi-2.0/Components Object/Fields Types/invalid-parameters-type.yaml", diff --git a/tests/asyncapi-2.0/AsyncAPI Version String/valid-major-minor.yaml b/tests/asyncapi-2.0/AsyncAPI Version String/invalid-missing-patch.yaml similarity index 100% rename from tests/asyncapi-2.0/AsyncAPI Version String/valid-major-minor.yaml rename to tests/asyncapi-2.0/AsyncAPI Version String/invalid-missing-patch.yaml diff --git a/tests/asyncapi-2.0/Channel Bindings Object/ws/invalid-extra-properties.yaml b/tests/asyncapi-2.0/Channel Bindings Object/ws/invalid-extra-properties.yaml index 413c7f0d..3f221ea2 100644 --- a/tests/asyncapi-2.0/Channel Bindings Object/ws/invalid-extra-properties.yaml +++ b/tests/asyncapi-2.0/Channel Bindings Object/ws/invalid-extra-properties.yaml @@ -12,7 +12,7 @@ channels: type: string bindings: ws: - method: OPTIONS + method: GET query: type: object properties: diff --git a/tests/asyncapi-2.0/Channels Object/invalid-absolute-path.yaml b/tests/asyncapi-2.0/Channels Object/invalid-absolute-path.yaml deleted file mode 100644 index aacd35e8..00000000 --- a/tests/asyncapi-2.0/Channels Object/invalid-absolute-path.yaml +++ /dev/null @@ -1,16 +0,0 @@ -asyncapi: 2.0.0 - -info: - title: Signup service example (internal) - version: 0.1.0 - -channels: - https://example.som/user/signedup: - subscribe: - message: - payload: - type: object - properties: - email: - type: string - format: email diff --git a/tests/asyncapi-2.0/Channels Object/invalid-fragment-used.yaml b/tests/asyncapi-2.0/Channels Object/invalid-fragment-used.yaml deleted file mode 100644 index 4cbd01c2..00000000 --- a/tests/asyncapi-2.0/Channels Object/invalid-fragment-used.yaml +++ /dev/null @@ -1,16 +0,0 @@ -asyncapi: 2.0.0 - -info: - title: Signup service example (internal) - version: 0.1.0 - -channels: - /user/signedup#something: - subscribe: - message: - payload: - type: object - properties: - email: - type: string - format: email diff --git a/tests/asyncapi-2.0/Components Object/Fields Types/invalid- messages-type.yaml b/tests/asyncapi-2.0/Components Object/Fields Types/invalid-messages-type.yaml similarity index 100% rename from tests/asyncapi-2.0/Components Object/Fields Types/invalid- messages-type.yaml rename to tests/asyncapi-2.0/Components Object/Fields Types/invalid-messages-type.yaml diff --git a/tests/asyncapi-2.0/Components Object/invalid-channelBindings-key.yaml b/tests/asyncapi-2.0/Components Object/invalid-channelBindings-key.yaml index 62bbb063..e81b12eb 100644 --- a/tests/asyncapi-2.0/Components Object/invalid-channelBindings-key.yaml +++ b/tests/asyncapi-2.0/Components Object/invalid-channelBindings-key.yaml @@ -16,7 +16,7 @@ channels: format: email components: - serverBindings: + channelBindings: inval#d: amqp: is: routingKey diff --git a/tests/asyncapi-2.0/Format/invalid-case-sensitive.json b/tests/asyncapi-2.0/Format/invalid-case-sensitive.json deleted file mode 100644 index 3659b02c..00000000 --- a/tests/asyncapi-2.0/Format/invalid-case-sensitive.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "asyncapi": "2.0.0", - "INFO": { - "title": "Signup service example (internal)", - "version": "0.1.0" - }, - "channels": { - "/user/signedup": { - "SUBSCRIBE": { - "MESSAGE": { - "payload": { - "type": "object", - "properties": { - "email": { - "type": "string", - "format": "email" - } - } - } - } - } - } - } -} \ No newline at end of file diff --git a/tests/asyncapi-2.0/Format/invalid-integer-key.yaml b/tests/asyncapi-2.0/Format/invalid-key.yaml similarity index 96% rename from tests/asyncapi-2.0/Format/invalid-integer-key.yaml rename to tests/asyncapi-2.0/Format/invalid-key.yaml index a65bdd83..daa4ef15 100644 --- a/tests/asyncapi-2.0/Format/invalid-integer-key.yaml +++ b/tests/asyncapi-2.0/Format/invalid-key.yaml @@ -12,7 +12,7 @@ channels: components: messages: - 1: + @#@#@#: payload: type: object properties: diff --git a/tests/asyncapi-2.0/Format/invalid-syntax.json b/tests/asyncapi-2.0/Format/invalid-syntax.json deleted file mode 100644 index 1d03796c..00000000 --- a/tests/asyncapi-2.0/Format/invalid-syntax.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "asyncapi": "2.0.0", - "info": { - "servers": { -} diff --git a/tests/asyncapi-2.0/Format/valid.json b/tests/asyncapi-2.0/Format/valid.json deleted file mode 100644 index 2f326489..00000000 --- a/tests/asyncapi-2.0/Format/valid.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "asyncapi": "2.0.0", - "defaultContentType": "application/json", - "info": { - "title": "Signup service example (internal)", - "version": "0.1.0" - }, - "channels": { - "/user/signedup": { - "subscribe": { - "message": { - "payload": { - "type": "object", - "properties": { - "email": { - "type": "string", - "format": "email" - } - } - } - } - } - } - } -} \ No newline at end of file diff --git a/tests/asyncapi-2.0/Message Object/Fields Types/invalid-bindings-type.yaml b/tests/asyncapi-2.0/Message Object/Fields Types/invalid-bindings-type.yaml index 6cabcde5..23f8839c 100644 --- a/tests/asyncapi-2.0/Message Object/Fields Types/invalid-bindings-type.yaml +++ b/tests/asyncapi-2.0/Message Object/Fields Types/invalid-bindings-type.yaml @@ -7,44 +7,6 @@ info: channels: /user/signedup: subscribe: - operationId: userSignedUp - summary: user signed up - description: user signed up to load some data message: - name: UserSignup - title: User signup - summary: qwe - description: qwe contentType: application/json - schemaFormat: application/vnd.oai.openapi;version=3.0.0 - correlationId: - description: Default Correlation ID - location: $message.header#/correlationId - headers: qwe - type: object - properties: - correlationId: - description: Correlation ID set by application - type: string - applicationInstanceId: - description: Unique identifier for a given instance of the publishing application - type: string - tags: - - name: user - description: user signed up - - name: signup bindings: 123 - externalDocs: - description: Find more info here - url: https://example.com - payload: - type: object - properties: - email: - type: string - format: email - examples: - - one: - email: hello@foo.bar - - two: - email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Object/Fields Types/invalid-contentType-type.yaml b/tests/asyncapi-2.0/Message Object/Fields Types/invalid-contentType-type.yaml index cae15bdc..d32a2f05 100644 --- a/tests/asyncapi-2.0/Message Object/Fields Types/invalid-contentType-type.yaml +++ b/tests/asyncapi-2.0/Message Object/Fields Types/invalid-contentType-type.yaml @@ -7,44 +7,6 @@ info: channels: /user/signedup: subscribe: - operationId: userSignedUp - summary: user signed up - description: user signed up to load some data message: - name: UserSignup - title: User signup - summary: Action to sign a user up. - description: A longer description contentType: prop: 1 - schemaFormat: application/vnd.oai.openapi;version=3.0.0 - correlationId: - description: Default Correlation ID - location: $message.header#/correlationId - headers: qwe - type: object - properties: - correlationId: - description: Correlation ID set by application - type: string - applicationInstanceId: - description: Unique identifier for a given instance of the publishing application - type: string - tags: - - name: user - description: user signed up - - name: signup - externalDocs: - description: Find more info here - url: https://example.com - payload: - type: object - properties: - email: - type: string - format: email - examples: - - one: - email: hello@foo.bar - - two: - email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Object/Fields Types/invalid-correlationId-type.yaml b/tests/asyncapi-2.0/Message Object/Fields Types/invalid-correlationId-type.yaml index 84e07d96..6cd9c0ec 100644 --- a/tests/asyncapi-2.0/Message Object/Fields Types/invalid-correlationId-type.yaml +++ b/tests/asyncapi-2.0/Message Object/Fields Types/invalid-correlationId-type.yaml @@ -7,41 +7,6 @@ info: channels: /user/signedup: subscribe: - operationId: userSignedUp - summary: user signed up - description: user signed up to load some data message: - name: UserSignup - title: User signup - summary: Action to sign a user up. - description: A longer description contentType: application/json - schemaFormat: application/vnd.oai.openapi;version=3.0.0 correlationId: 123 - headers: qwe - type: object - properties: - correlationId: - description: Correlation ID set by application - type: string - applicationInstanceId: - description: Unique identifier for a given instance of the publishing application - type: string - tags: - - name: user - description: user signed up - - name: signup - externalDocs: - description: Find more info here - url: https://example.com - payload: - type: object - properties: - email: - type: string - format: email - examples: - - one: - email: hello@foo.bar - - two: - email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Object/Fields Types/invalid-description-type.yaml b/tests/asyncapi-2.0/Message Object/Fields Types/invalid-description-type.yaml index d1589b93..4113db1a 100644 --- a/tests/asyncapi-2.0/Message Object/Fields Types/invalid-description-type.yaml +++ b/tests/asyncapi-2.0/Message Object/Fields Types/invalid-description-type.yaml @@ -7,44 +7,7 @@ info: channels: /user/signedup: subscribe: - operationId: userSignedUp - summary: user signed up - description: user signed up to load some data message: - name: UserSignup - title: User signup - summary: qwe + contentType: application/json description: prop: 1 - contentType: application/json - schemaFormat: application/vnd.oai.openapi;version=3.0.0 - correlationId: - description: Default Correlation ID - location: $message.header#/correlationId - headers: qwe - type: object - properties: - correlationId: - description: Correlation ID set by application - type: string - applicationInstanceId: - description: Unique identifier for a given instance of the publishing application - type: string - tags: - - name: user - description: user signed up - - name: signup - externalDocs: - description: Find more info here - url: https://example.com - payload: - type: object - properties: - email: - type: string - format: email - examples: - - one: - email: hello@foo.bar - - two: - email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Object/Fields Types/invalid-examples-type.yaml b/tests/asyncapi-2.0/Message Object/Fields Types/invalid-examples-type.yaml index fc2a08eb..da49e4e7 100644 --- a/tests/asyncapi-2.0/Message Object/Fields Types/invalid-examples-type.yaml +++ b/tests/asyncapi-2.0/Message Object/Fields Types/invalid-examples-type.yaml @@ -7,39 +7,6 @@ info: channels: /user/signedup: subscribe: - operationId: userSignedUp - summary: user signed up - description: user signed up to load some data message: - name: UserSignup - title: User signup - summary: qwe - description: qwe contentType: application/json - schemaFormat: application/vnd.oai.openapi;version=3.0.0 - correlationId: - description: Default Correlation ID - location: $message.header#/correlationId - headers: qwe - type: object - properties: - correlationId: - description: Correlation ID set by application - type: string - applicationInstanceId: - description: Unique identifier for a given instance of the publishing application - type: string - tags: - - name: user - description: user signed up - - name: signup - externalDocs: - description: Find more info here - url: https://example.com - payload: - type: object - properties: - email: - type: string - format: email examples: 123 diff --git a/tests/asyncapi-2.0/Message Object/Fields Types/invalid-externalDocs-type.yaml b/tests/asyncapi-2.0/Message Object/Fields Types/invalid-externalDocs-type.yaml index 49348562..74ed032c 100644 --- a/tests/asyncapi-2.0/Message Object/Fields Types/invalid-externalDocs-type.yaml +++ b/tests/asyncapi-2.0/Message Object/Fields Types/invalid-externalDocs-type.yaml @@ -7,41 +7,6 @@ info: channels: /user/signedup: subscribe: - operationId: userSignedUp - summary: user signed up - description: user signed up to load some data message: - name: UserSignup - title: User signup - summary: qwe - description: qwe contentType: application/json - schemaFormat: application/vnd.oai.openapi;version=3.0.0 - correlationId: - description: Default Correlation ID - location: $message.header#/correlationId - headers: qwe - type: object - properties: - correlationId: - description: Correlation ID set by application - type: string - applicationInstanceId: - description: Unique identifier for a given instance of the publishing application - type: string - tags: - - name: user - description: user signed up - - name: signup externalDocs: 123 - payload: - type: object - properties: - email: - type: string - format: email - examples: - - one: - email: hello@foo.bar - - two: - email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Object/Fields Types/invalid-headers-type.yaml b/tests/asyncapi-2.0/Message Object/Fields Types/invalid-headers-type.yaml index 123e7722..3ca8cec6 100644 --- a/tests/asyncapi-2.0/Message Object/Fields Types/invalid-headers-type.yaml +++ b/tests/asyncapi-2.0/Message Object/Fields Types/invalid-headers-type.yaml @@ -7,35 +7,6 @@ info: channels: /user/signedup: subscribe: - operationId: userSignedUp - summary: user signed up - description: user signed up to load some data message: - name: UserSignup - title: User signup - summary: Action to sign a user up. - description: A longer description contentType: application/json - schemaFormat: application/vnd.oai.openapi;version=3.0.0 - correlationId: - description: Default Correlation ID - location: $message.header#/correlationId headers: qwe - tags: - - name: user - description: user signed up - - name: signup - externalDocs: - description: Find more info here - url: https://example.com - payload: - type: object - properties: - email: - type: string - format: email - examples: - - one: - email: hello@foo.bar - - two: - email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Object/Fields Types/invalid-name-type.yaml b/tests/asyncapi-2.0/Message Object/Fields Types/invalid-name-type.yaml index c89c30cc..3aa86fca 100644 --- a/tests/asyncapi-2.0/Message Object/Fields Types/invalid-name-type.yaml +++ b/tests/asyncapi-2.0/Message Object/Fields Types/invalid-name-type.yaml @@ -7,44 +7,7 @@ info: channels: /user/signedup: subscribe: - operationId: userSignedUp - summary: user signed up - description: user signed up to load some data message: + contentType: application/json name: prop: 1 - title: User signup - summary: Action to sign a user up. - description: A longer description - contentType: application/json - schemaFormat: application/vnd.oai.openapi;version=3.0.0 - correlationId: - description: Default Correlation ID - location: $message.header#/correlationId - headers: qwe - type: object - properties: - correlationId: - description: Correlation ID set by application - type: string - applicationInstanceId: - description: Unique identifier for a given instance of the publishing application - type: string - tags: - - name: user - description: user signed up - - name: signup - externalDocs: - description: Find more info here - url: https://example.com - payload: - type: object - properties: - email: - type: string - format: email - examples: - - one: - email: hello@foo.bar - - two: - email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Object/Fields Types/invalid-schemaFormat-type.yaml b/tests/asyncapi-2.0/Message Object/Fields Types/invalid-schemaFormat-type.yaml index 0b47b142..6ad4097e 100644 --- a/tests/asyncapi-2.0/Message Object/Fields Types/invalid-schemaFormat-type.yaml +++ b/tests/asyncapi-2.0/Message Object/Fields Types/invalid-schemaFormat-type.yaml @@ -7,44 +7,7 @@ info: channels: /user/signedup: subscribe: - operationId: userSignedUp - summary: user signed up - description: user signed up to load some data message: - name: UserSignup - title: User signup - summary: Action to sign a user up. - description: A longer description contentType: application/json schemaFormat: prop: 1 - correlationId: - description: Default Correlation ID - location: $message.header#/correlationId - headers: qwe - type: object - properties: - correlationId: - description: Correlation ID set by application - type: string - applicationInstanceId: - description: Unique identifier for a given instance of the publishing application - type: string - tags: - - name: user - description: user signed up - - name: signup - externalDocs: - description: Find more info here - url: https://example.com - payload: - type: object - properties: - email: - type: string - format: email - examples: - - one: - email: hello@foo.bar - - two: - email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Object/Fields Types/invalid-summary-type.yaml b/tests/asyncapi-2.0/Message Object/Fields Types/invalid-summary-type.yaml index f4ce75ee..694711d5 100644 --- a/tests/asyncapi-2.0/Message Object/Fields Types/invalid-summary-type.yaml +++ b/tests/asyncapi-2.0/Message Object/Fields Types/invalid-summary-type.yaml @@ -7,44 +7,7 @@ info: channels: /user/signedup: subscribe: - operationId: userSignedUp - summary: user signed up - description: user signed up to load some data message: - name: UserSignup - title: User signup + contentType: application/json summary: prop: 1 - description: A longer description - contentType: application/json - schemaFormat: application/vnd.oai.openapi;version=3.0.0 - correlationId: - description: Default Correlation ID - location: $message.header#/correlationId - headers: qwe - type: object - properties: - correlationId: - description: Correlation ID set by application - type: string - applicationInstanceId: - description: Unique identifier for a given instance of the publishing application - type: string - tags: - - name: user - description: user signed up - - name: signup - externalDocs: - description: Find more info here - url: https://example.com - payload: - type: object - properties: - email: - type: string - format: email - examples: - - one: - email: hello@foo.bar - - two: - email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Object/Fields Types/invalid-tags-type.yaml b/tests/asyncapi-2.0/Message Object/Fields Types/invalid-tags-type.yaml index b0cf9d53..9c168e72 100644 --- a/tests/asyncapi-2.0/Message Object/Fields Types/invalid-tags-type.yaml +++ b/tests/asyncapi-2.0/Message Object/Fields Types/invalid-tags-type.yaml @@ -7,40 +7,6 @@ info: channels: /user/signedup: subscribe: - operationId: userSignedUp - summary: user signed up - description: user signed up to load some data message: - name: UserSignup - title: User signup - summary: qwe - description: qwe contentType: application/json - schemaFormat: application/vnd.oai.openapi;version=3.0.0 - correlationId: - description: Default Correlation ID - location: $message.header#/correlationId - headers: qwe - type: object - properties: - correlationId: - description: Correlation ID set by application - type: string - applicationInstanceId: - description: Unique identifier for a given instance of the publishing application - type: string tags: 123 - externalDocs: - description: Find more info here - url: https://example.com - payload: - type: object - properties: - email: - type: string - format: email - examples: - - one: - email: hello@foo.bar - - two: - email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Object/Fields Types/invalid-title-type.yaml b/tests/asyncapi-2.0/Message Object/Fields Types/invalid-title-type.yaml index 57dd1dfc..44a943d8 100644 --- a/tests/asyncapi-2.0/Message Object/Fields Types/invalid-title-type.yaml +++ b/tests/asyncapi-2.0/Message Object/Fields Types/invalid-title-type.yaml @@ -7,44 +7,7 @@ info: channels: /user/signedup: subscribe: - operationId: userSignedUp - summary: user signed up - description: user signed up to load some data message: - name: UserSignup + contentType: application/json title: prop: 1 - summary: Action to sign a user up. - description: A longer description - contentType: application/json - schemaFormat: application/vnd.oai.openapi;version=3.0.0 - correlationId: - description: Default Correlation ID - location: $message.header#/correlationId - headers: qwe - type: object - properties: - correlationId: - description: Correlation ID set by application - type: string - applicationInstanceId: - description: Unique identifier for a given instance of the publishing application - type: string - tags: - - name: user - description: user signed up - - name: signup - externalDocs: - description: Find more info here - url: https://example.com - payload: - type: object - properties: - email: - type: string - format: email - examples: - - one: - email: hello@foo.bar - - two: - email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Object/Fields Types/invalid-traits-type.yaml b/tests/asyncapi-2.0/Message Object/Fields Types/invalid-traits-type.yaml index 1e83bf05..e5bb11af 100644 --- a/tests/asyncapi-2.0/Message Object/Fields Types/invalid-traits-type.yaml +++ b/tests/asyncapi-2.0/Message Object/Fields Types/invalid-traits-type.yaml @@ -7,44 +7,6 @@ info: channels: /user/signedup: subscribe: - operationId: userSignedUp - summary: user signed up - description: user signed up to load some data message: - name: UserSignup - title: User signup - summary: qwe - description: qwe contentType: application/json - schemaFormat: application/vnd.oai.openapi;version=3.0.0 - correlationId: - description: Default Correlation ID - location: $message.header#/correlationId - headers: qwe - type: object - properties: - correlationId: - description: Correlation ID set by application - type: string - applicationInstanceId: - description: Unique identifier for a given instance of the publishing application - type: string - tags: - - name: user - description: user signed up - - name: signup - externalDocs: - description: Find more info here - url: https://example.com - payload: - type: object - properties: - email: - type: string - format: email traits: 123 - examples: - - one: - email: hello@foo.bar - - two: - email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Object/invalid-duplicate-tags.yaml b/tests/asyncapi-2.0/Message Object/invalid-duplicate-tags.yaml index 52c66ecd..b606c581 100644 --- a/tests/asyncapi-2.0/Message Object/invalid-duplicate-tags.yaml +++ b/tests/asyncapi-2.0/Message Object/invalid-duplicate-tags.yaml @@ -7,40 +7,9 @@ info: channels: /user/signedup: subscribe: - operationId: userSignedUp - summary: user signed up - description: user signed up to load some data message: - name: UserSignup - title: User signup - summary: Action to sign a user up. - description: A longer description contentType: application/json - schemaFormat: application/vnd.oai.openapi;version=3.0.0 - correlationId: - description: Default Correlation ID - location: $message.header#/correlationId - headers: - type: object - properties: - correlationId: - description: Correlation ID set by application - type: string - applicationInstanceId: - description: Unique identifier for a given instance of the publishing application - type: string tags: - name: user description: user signed up - name: user - payload: - type: object - properties: - email: - type: string - format: email - examples: - - one: - email: hello@foo.bar - - two: - email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Object/invalid-examples-item.yaml b/tests/asyncapi-2.0/Message Object/invalid-examples-item.yaml index 08093fb7..00dceb6d 100644 --- a/tests/asyncapi-2.0/Message Object/invalid-examples-item.yaml +++ b/tests/asyncapi-2.0/Message Object/invalid-examples-item.yaml @@ -7,41 +7,8 @@ info: channels: /user/signedup: subscribe: - operationId: userSignedUp - summary: user signed up - description: user signed up to load some data message: - name: UserSignup - title: User signup - summary: Action to sign a user up. - description: A longer description contentType: application/json - schemaFormat: application/vnd.oai.openapi;version=3.0.0 - correlationId: - description: Default Correlation ID - location: $message.header#/correlationId - headers: - type: object - properties: - correlationId: - description: Correlation ID set by application - type: string - applicationInstanceId: - description: Unique identifier for a given instance of the publishing application - type: string - tags: - - name: user - description: user signed up - - name: signup - externalDocs: - description: Find more info here - url: https://example.com - payload: - type: object - properties: - email: - type: string - format: email examples: - one: foobar: 123 diff --git a/tests/asyncapi-2.0/Message Object/invalid-headers-type.yaml b/tests/asyncapi-2.0/Message Object/invalid-headers-type.yaml index 2a8d0732..3895ad41 100644 --- a/tests/asyncapi-2.0/Message Object/invalid-headers-type.yaml +++ b/tests/asyncapi-2.0/Message Object/invalid-headers-type.yaml @@ -7,26 +7,7 @@ info: channels: /user/signedup: subscribe: - operationId: userSignedUp - summary: user signed up - description: user signed up to load some data message: - name: UserSignup - title: User signup - summary: Action to sign a user up. - description: A longer description contentType: application/json - schemaFormat: application/vnd.oai.openapi;version=3.0.0 headers: type: string - payload: - type: object - properties: - email: - type: string - format: email - examples: - - one: - email: hello@foo.bar - - two: - email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Object/valid-using-defaultContentType.yaml b/tests/asyncapi-2.0/Message Object/valid-using-defaultContentType.yaml index db6517f4..2c15053b 100644 --- a/tests/asyncapi-2.0/Message Object/valid-using-defaultContentType.yaml +++ b/tests/asyncapi-2.0/Message Object/valid-using-defaultContentType.yaml @@ -9,25 +9,4 @@ info: channels: /user/signedup: subscribe: - operationId: userSignedUp - summary: user signed up - description: user signed up to load some data message: - name: UserSignup - title: User signup - summary: Action to sign a user up. - description: A longer description - schemaFormat: application/vnd.oai.openapi;version=3.0.0 - headers: - type: string - payload: - type: object - properties: - email: - type: string - format: email - examples: - - one: - email: hello@foo.bar - - two: - email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-bindings-type.yaml b/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-bindings-type.yaml index 34a3feac..686f2603 100644 --- a/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-bindings-type.yaml +++ b/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-bindings-type.yaml @@ -7,50 +7,12 @@ info: channels: /user/signedup: subscribe: - operationId: userSignedUp - summary: user signed up - description: user signed up to load some data message: - payload: - type: object - properties: - email: - type: string - format: email traits: - $ref: "#/components/messageTraits/signedUpMessage" components: messageTraits: signedUpMessage: - tags: - - name: user - description: user signed up - - name: signup - externalDocs: - description: Find more info here - url: https://example.com bindings: 123 - name: qwe - title: qwe - summary: qwe - description: qwe - contentType: qwe - schemaFormat: application/vnd.oai.openapi;version=3.0.0 - correlationId: - description: Default Correlation ID - location: $message.header#/correlationId - headers: - type: object - properties: - correlationId: - description: Correlation ID set by application - type: string - applicationInstanceId: - description: Unique identifier for a given instance of the publishing application - type: string - examples: - - one: - email: hello@foo.bar - - two: - email: bye@foo.bar + contentType: application/json diff --git a/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-contentType-type.yaml b/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-contentType-type.yaml index 7f39ec64..64498c56 100644 --- a/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-contentType-type.yaml +++ b/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-contentType-type.yaml @@ -7,50 +7,12 @@ info: channels: /user/signedup: subscribe: - operationId: userSignedUp - summary: user signed up - description: user signed up to load some data message: - payload: - type: object - properties: - email: - type: string - format: email traits: - $ref: "#/components/messageTraits/signedUpMessage" components: messageTraits: signedUpMessage: - tags: - - name: user - description: user signed up - - name: signup - externalDocs: - description: Find more info here - url: https://example.com - name: + contentType: prop: 1 - title: User signup - summary: Action to sign a user up. - description: A longer description - contentType: qwe - schemaFormat: application/vnd.oai.openapi;version=3.0.0 - correlationId: - description: Default Correlation ID - location: $message.header#/correlationId - headers: - type: object - properties: - correlationId: - description: Correlation ID set by application - type: string - applicationInstanceId: - description: Unique identifier for a given instance of the publishing application - type: string - examples: - - one: - email: hello@foo.bar - - two: - email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-correlationId-type.yaml b/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-correlationId-type.yaml index 993a47a2..66ed5cf7 100644 --- a/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-correlationId-type.yaml +++ b/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-correlationId-type.yaml @@ -7,47 +7,12 @@ info: channels: /user/signedup: subscribe: - operationId: userSignedUp - summary: user signed up - description: user signed up to load some data message: - payload: - type: object - properties: - email: - type: string - format: email traits: - $ref: "#/components/messageTraits/signedUpMessage" components: messageTraits: signedUpMessage: - tags: - - name: user - description: user signed up - - name: signup - externalDocs: - description: Find more info here - url: https://example.com - name: UserSignup - title: User signup - summary: Action to sign a user up. - description: A longer description contentType: application/json - schemaFormat: application/vnd.oai.openapi;version=3.0.0 correlationId: 123 - headers: - type: object - properties: - correlationId: - description: Correlation ID set by application - type: string - applicationInstanceId: - description: Unique identifier for a given instance of the publishing application - type: string - examples: - - one: - email: hello@foo.bar - - two: - email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-description-type.yaml b/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-description-type.yaml index b25a9e8c..f7ba2247 100644 --- a/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-description-type.yaml +++ b/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-description-type.yaml @@ -7,50 +7,13 @@ info: channels: /user/signedup: subscribe: - operationId: userSignedUp - summary: user signed up - description: user signed up to load some data message: - payload: - type: object - properties: - email: - type: string - format: email traits: - $ref: "#/components/messageTraits/signedUpMessage" components: messageTraits: signedUpMessage: - tags: - - name: user - description: user signed up - - name: signup - externalDocs: - description: Find more info here - url: https://example.com - name: qwe - title: qwe - summary: qwe + contentType: application/json description: prop: 1 - contentType: qwe - schemaFormat: application/vnd.oai.openapi;version=3.0.0 - correlationId: - description: Default Correlation ID - location: $message.header#/correlationId - headers: - type: object - properties: - correlationId: - description: Correlation ID set by application - type: string - applicationInstanceId: - description: Unique identifier for a given instance of the publishing application - type: string - examples: - - one: - email: hello@foo.bar - - two: - email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-examples-type.yaml b/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-examples-type.yaml index 30a820ab..26bf3b45 100644 --- a/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-examples-type.yaml +++ b/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-examples-type.yaml @@ -7,45 +7,12 @@ info: channels: /user/signedup: subscribe: - operationId: userSignedUp - summary: user signed up - description: user signed up to load some data message: - payload: - type: object - properties: - email: - type: string - format: email traits: - $ref: "#/components/messageTraits/signedUpMessage" components: messageTraits: signedUpMessage: - tags: - - name: user - description: user signed up - - name: signup - externalDocs: - description: Find more info here - url: https://example.com - name: qwe - title: qwe - summary: qwe - description: qwe - contentType: qwe - schemaFormat: application/vnd.oai.openapi;version=3.0.0 - correlationId: - description: Default Correlation ID - location: $message.header#/correlationId - headers: - type: object - properties: - correlationId: - description: Correlation ID set by application - type: string - applicationInstanceId: - description: Unique identifier for a given instance of the publishing application - type: string + contentType: application/json examples: 123 diff --git a/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-externalDocs-type.yaml b/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-externalDocs-type.yaml index 3d23af10..bc8c4dfb 100644 --- a/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-externalDocs-type.yaml +++ b/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-externalDocs-type.yaml @@ -7,47 +7,12 @@ info: channels: /user/signedup: subscribe: - operationId: userSignedUp - summary: user signed up - description: user signed up to load some data message: - payload: - type: object - properties: - email: - type: string - format: email traits: - $ref: "#/components/messageTraits/signedUpMessage" components: messageTraits: signedUpMessage: - tags: - - name: user - description: user signed up - - name: signup + contentType: application/json externalDocs: 123 - name: qwe - title: qwe - summary: qwe - description: qwe - contentType: qwe - schemaFormat: application/vnd.oai.openapi;version=3.0.0 - correlationId: - description: Default Correlation ID - location: $message.header#/correlationId - headers: - type: object - properties: - correlationId: - description: Correlation ID set by application - type: string - applicationInstanceId: - description: Unique identifier for a given instance of the publishing application - type: string - examples: - - one: - email: hello@foo.bar - - two: - email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-headers-type.yaml b/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-headers-type.yaml index 09ab4414..30e1da68 100644 --- a/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-headers-type.yaml +++ b/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-headers-type.yaml @@ -7,41 +7,12 @@ info: channels: /user/signedup: subscribe: - operationId: userSignedUp - summary: user signed up - description: user signed up to load some data message: - payload: - type: object - properties: - email: - type: string - format: email traits: - $ref: "#/components/messageTraits/signedUpMessage" components: messageTraits: signedUpMessage: - tags: - - name: user - description: user signed up - - name: signup - externalDocs: - description: Find more info here - url: https://example.com - name: UserSignup - title: User signup - summary: Action to sign a user up. - description: A longer description contentType: application/json - schemaFormat: application/vnd.oai.openapi;version=3.0.0 - correlationId: - description: Default Correlation ID - location: $message.header#/correlationId headers: 123 - examples: - - one: - email: hello@foo.bar - - two: - email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-schemaFormat-type.yaml b/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-schemaFormat-type.yaml index 2a622de4..0ed1e3c8 100644 --- a/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-schemaFormat-type.yaml +++ b/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-schemaFormat-type.yaml @@ -7,50 +7,13 @@ info: channels: /user/signedup: subscribe: - operationId: userSignedUp - summary: user signed up - description: user signed up to load some data message: - payload: - type: object - properties: - email: - type: string - format: email traits: - $ref: "#/components/messageTraits/signedUpMessage" components: messageTraits: signedUpMessage: - tags: - - name: user - description: user signed up - - name: signup - externalDocs: - description: Find more info here - url: https://example.com - name: UserSignup - title: User signup - summary: Action to sign a user up. - description: A longer description contentType: application/json schemaFormat: prop: 1 - correlationId: - description: Default Correlation ID - location: $message.header#/correlationId - headers: - type: object - properties: - correlationId: - description: Correlation ID set by application - type: string - applicationInstanceId: - description: Unique identifier for a given instance of the publishing application - type: string - examples: - - one: - email: hello@foo.bar - - two: - email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-summary-type.yaml b/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-summary-type.yaml index ca701c0a..82c44ec4 100644 --- a/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-summary-type.yaml +++ b/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-summary-type.yaml @@ -7,50 +7,13 @@ info: channels: /user/signedup: subscribe: - operationId: userSignedUp - summary: user signed up - description: user signed up to load some data message: - payload: - type: object - properties: - email: - type: string - format: email traits: - $ref: "#/components/messageTraits/signedUpMessage" components: messageTraits: signedUpMessage: - tags: - - name: user - description: user signed up - - name: signup - externalDocs: - description: Find more info here - url: https://example.com - name: qwe - title: qwe + contentType: application/json summary: prop: 1 - description: A longer description - contentType: qwe - schemaFormat: application/vnd.oai.openapi;version=3.0.0 - correlationId: - description: Default Correlation ID - location: $message.header#/correlationId - headers: - type: object - properties: - correlationId: - description: Correlation ID set by application - type: string - applicationInstanceId: - description: Unique identifier for a given instance of the publishing application - type: string - examples: - - one: - email: hello@foo.bar - - two: - email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-tags-type.yaml b/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-tags-type.yaml index e70009ed..1b64ec86 100644 --- a/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-tags-type.yaml +++ b/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-tags-type.yaml @@ -7,46 +7,12 @@ info: channels: /user/signedup: subscribe: - operationId: userSignedUp - summary: user signed up - description: user signed up to load some data message: - payload: - type: object - properties: - email: - type: string - format: email traits: - $ref: "#/components/messageTraits/signedUpMessage" components: messageTraits: signedUpMessage: + contentType: application/json tags: 123 - externalDocs: - description: Find more info here - url: https://example.com - name: qwe - title: qwe - summary: qwe - description: qwe - contentType: qwe - schemaFormat: application/vnd.oai.openapi;version=3.0.0 - correlationId: - description: Default Correlation ID - location: $message.header#/correlationId - headers: - type: object - properties: - correlationId: - description: Correlation ID set by application - type: string - applicationInstanceId: - description: Unique identifier for a given instance of the publishing application - type: string - examples: - - one: - email: hello@foo.bar - - two: - email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-title-type.yaml b/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-title-type.yaml index 5405c8e4..f464bf6a 100644 --- a/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-title-type.yaml +++ b/tests/asyncapi-2.0/Message Trait Object/Fields Types/invalid-title-type.yaml @@ -7,50 +7,13 @@ info: channels: /user/signedup: subscribe: - operationId: userSignedUp - summary: user signed up - description: user signed up to load some data message: - payload: - type: object - properties: - email: - type: string - format: email traits: - $ref: "#/components/messageTraits/signedUpMessage" components: messageTraits: signedUpMessage: - tags: - - name: user - description: user signed up - - name: signup - externalDocs: - description: Find more info here - url: https://example.com - name: qwe + contentType: application/json title: prop: 1 - summary: Action to sign a user up. - description: A longer description - contentType: qwe - schemaFormat: application/vnd.oai.openapi;version=3.0.0 - correlationId: - description: Default Correlation ID - location: $message.header#/correlationId - headers: - type: object - properties: - correlationId: - description: Correlation ID set by application - type: string - applicationInstanceId: - description: Unique identifier for a given instance of the publishing application - type: string - examples: - - one: - email: hello@foo.bar - - two: - email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Trait Object/invalid-defines-payload.yaml b/tests/asyncapi-2.0/Message Trait Object/invalid-defines-payload.yaml index 44f89f8c..fe9fc227 100644 --- a/tests/asyncapi-2.0/Message Trait Object/invalid-defines-payload.yaml +++ b/tests/asyncapi-2.0/Message Trait Object/invalid-defines-payload.yaml @@ -7,16 +7,7 @@ info: channels: /user/signedup: subscribe: - operationId: userSignedUp - summary: user signed up - description: user signed up to load some data message: - payload: - type: object - properties: - email: - type: string - format: email traits: - $ref: "#/components/messageTraits/signedUpMessage" @@ -25,26 +16,4 @@ components: signedUpMessage: payload: type: string - name: UserSignup - title: User signup - summary: Action to sign a user up. - description: A longer description contentType: application/json - schemaFormat: application/vnd.oai.openapi;version=3.0.0 - correlationId: - description: Default Correlation ID - location: $message.header#/correlationId - headers: - type: object - properties: - correlationId: - description: Correlation ID set by application - type: string - applicationInstanceId: - description: Unique identifier for a given instance of the publishing application - type: string - examples: - - one: - email: hello@foo.bar - - two: - email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Trait Object/invalid-defines-traits.yaml b/tests/asyncapi-2.0/Message Trait Object/invalid-defines-traits.yaml index 78b3bc61..85437945 100644 --- a/tests/asyncapi-2.0/Message Trait Object/invalid-defines-traits.yaml +++ b/tests/asyncapi-2.0/Message Trait Object/invalid-defines-traits.yaml @@ -7,16 +7,7 @@ info: channels: /user/signedup: subscribe: - operationId: userSignedUp - summary: user signed up - description: user signed up to load some data message: - payload: - type: object - properties: - email: - type: string - format: email traits: - $ref: "#/components/messageTraits/signedUpMessage" @@ -25,26 +16,4 @@ components: signedUpMessage: traits: - signedUpMessage - name: UserSignup - title: User signup - summary: Action to sign a user up. - description: A longer description contentType: application/json - schemaFormat: application/vnd.oai.openapi;version=3.0.0 - correlationId: - description: Default Correlation ID - location: $message.header#/correlationId - headers: - type: object - properties: - correlationId: - description: Correlation ID set by application - type: string - applicationInstanceId: - description: Unique identifier for a given instance of the publishing application - type: string - examples: - - one: - email: hello@foo.bar - - two: - email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Trait Object/invalid-duplicate-tags.yaml b/tests/asyncapi-2.0/Message Trait Object/invalid-duplicate-tags.yaml index 28f8d738..a5b043b6 100644 --- a/tests/asyncapi-2.0/Message Trait Object/invalid-duplicate-tags.yaml +++ b/tests/asyncapi-2.0/Message Trait Object/invalid-duplicate-tags.yaml @@ -7,16 +7,7 @@ info: channels: /user/signedup: subscribe: - operationId: userSignedUp - summary: user signed up - description: user signed up to load some data message: - payload: - type: object - properties: - email: - type: string - format: email traits: - $ref: "#/components/messageTraits/signedUpMessage" @@ -27,26 +18,4 @@ components: - name: user description: user signed up - name: user - name: UserSignup - title: User signup - summary: Action to sign a user up. - description: A longer description contentType: application/json - schemaFormat: application/vnd.oai.openapi;version=3.0.0 - correlationId: - description: Default Correlation ID - location: $message.header#/correlationId - headers: - type: object - properties: - correlationId: - description: Correlation ID set by application - type: string - applicationInstanceId: - description: Unique identifier for a given instance of the publishing application - type: string - examples: - - one: - email: hello@foo.bar - - two: - email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Trait Object/invalid-examples-item.yaml b/tests/asyncapi-2.0/Message Trait Object/invalid-examples-item.yaml index 21cf79a3..86ed64ba 100644 --- a/tests/asyncapi-2.0/Message Trait Object/invalid-examples-item.yaml +++ b/tests/asyncapi-2.0/Message Trait Object/invalid-examples-item.yaml @@ -7,47 +7,14 @@ info: channels: /user/signedup: subscribe: - operationId: userSignedUp - summary: user signed up - description: user signed up to load some data message: - payload: - type: object - properties: - email: - type: string - format: email traits: - $ref: "#/components/messageTraits/signedUpMessage" components: messageTraits: signedUpMessage: - tags: - - name: user - description: user signed up - - name: signup - externalDocs: - description: Find more info here - url: https://example.com - name: UserSignup - title: User signup - summary: Action to sign a user up. - description: A longer description contentType: application/json - schemaFormat: application/vnd.oai.openapi;version=3.0.0 - correlationId: - description: Default Correlation ID - location: $message.header#/correlationId - headers: - type: object - properties: - correlationId: - description: Correlation ID set by application - type: string - applicationInstanceId: - description: Unique identifier for a given instance of the publishing application - type: string examples: - one: foobar: 123 diff --git a/tests/asyncapi-2.0/Message Trait Object/invalid-headers-type.yaml b/tests/asyncapi-2.0/Message Trait Object/invalid-headers-type.yaml index 3b1a8fe9..ee02fc49 100644 --- a/tests/asyncapi-2.0/Message Trait Object/invalid-headers-type.yaml +++ b/tests/asyncapi-2.0/Message Trait Object/invalid-headers-type.yaml @@ -7,35 +7,13 @@ info: channels: /user/signedup: subscribe: - operationId: userSignedUp - summary: user signed up - description: user signed up to load some data message: - payload: - type: object - properties: - email: - type: string - format: email traits: - $ref: "#/components/messageTraits/signedUpMessage" components: messageTraits: signedUpMessage: - name: UserSignup - title: User signup - summary: Action to sign a user up. - description: A longer description contentType: application/json - schemaFormat: application/vnd.oai.openapi;version=3.0.0 - correlationId: - description: Default Correlation ID - location: $message.header#/correlationId headers: type: string - examples: - - one: - email: hello@foo.bar - - two: - email: bye@foo.bar From e0d67765f56fa7617172fdaa0da2f6b922c1ee0a Mon Sep 17 00:00:00 2001 From: Artem Kostiuk Date: Wed, 4 Mar 2020 10:56:50 +0200 Subject: [PATCH 25/26] Reduce some tests size --- .../invalid-messageTraits-key.yaml | 14 -------- .../invalid-messages-key.yaml | 35 ------------------- .../invalid-description-type.yaml | 9 ----- .../Fields Types/invalid-location-type.yaml | 9 ----- .../invalid-location-expression.yaml | 9 ----- .../invalid-missing-location.yaml | 9 ----- .../Correlation ID Object/valid.yaml | 9 ----- .../invalid-missing-contentType.yaml | 21 ----------- .../Message Object/valid-empty-object.yaml | 3 -- .../valid-internal-ref-correlationId.yaml | 23 ------------ .../valid-internal-ref-header.yaml | 14 -------- .../invalid-missing-content-type.yaml | 31 ---------------- .../valid-empty-object.yaml | 10 +----- .../valid-internal-ref-correlationId.yaml | 28 --------------- .../valid-internal-ref-header.yaml | 22 ------------ .../valid-using-defaultContentType.yaml | 31 ---------------- .../Fields Types/invalid-bindings-type.yaml | 10 ------ .../invalid-description-type.yaml | 13 ++----- .../invalid-externalDocs-type.yaml | 7 ---- .../Fields Types/invalid-message-type.yaml | 10 ------ .../invalid-operationId-type.yaml | 9 ----- .../Fields Types/invalid-summary-type.yaml | 13 ++----- .../Fields Types/invalid-tags-type.yaml | 6 ---- .../Fields Types/invalid-traits-type.yaml | 10 ------ .../invalid-duplicate-operationId.yaml | 1 - .../invalid-duplicate-tags.yaml | 3 -- .../invalid-trait-with-message.yaml | 2 -- .../invalid-trait-with-traits.yaml | 2 -- 28 files changed, 5 insertions(+), 358 deletions(-) diff --git a/tests/asyncapi-2.0/Components Object/invalid-messageTraits-key.yaml b/tests/asyncapi-2.0/Components Object/invalid-messageTraits-key.yaml index ca25f549..489d2414 100644 --- a/tests/asyncapi-2.0/Components Object/invalid-messageTraits-key.yaml +++ b/tests/asyncapi-2.0/Components Object/invalid-messageTraits-key.yaml @@ -18,18 +18,4 @@ channels: components: messageTraits: inval#d: - name: UserSignup - title: User signup - summary: Action to sign a user up. - description: A longer description contentType: application/json - schemaFormat: application/vnd.oai.openapi;version=3.0.0 - correlationId: - description: Default Correlation ID - location: $message.header#/correlationId - headers: - type: object - properties: - applicationInstanceId: - description: Unique identifier - type: string diff --git a/tests/asyncapi-2.0/Components Object/invalid-messages-key.yaml b/tests/asyncapi-2.0/Components Object/invalid-messages-key.yaml index 538be3df..47826244 100644 --- a/tests/asyncapi-2.0/Components Object/invalid-messages-key.yaml +++ b/tests/asyncapi-2.0/Components Object/invalid-messages-key.yaml @@ -18,39 +18,4 @@ channels: components: messages: inval#d: - name: UserSignup - title: User signup - summary: Action to sign a user up. - description: A longer description contentType: application/json - schemaFormat: application/vnd.oai.openapi;version=3.0.0 - correlationId: - description: Default Correlation ID - location: $message.header#/correlationId - headers: - type: object - properties: - correlationId: - description: Correlation ID set by application - type: string - applicationInstanceId: - description: Unique identifier for a given instance of the publishing application - type: string - tags: - - name: user - description: user signed up - - name: signup - externalDocs: - description: Find more info here - url: https://example.com - payload: - type: object - properties: - email: - type: string - format: email - examples: - - one: - email: hello@foo.bar - - two: - email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Correlation ID Object/Fields Types/invalid-description-type.yaml b/tests/asyncapi-2.0/Correlation ID Object/Fields Types/invalid-description-type.yaml index 70ad8437..63afaba9 100644 --- a/tests/asyncapi-2.0/Correlation ID Object/Fields Types/invalid-description-type.yaml +++ b/tests/asyncapi-2.0/Correlation ID Object/Fields Types/invalid-description-type.yaml @@ -11,18 +11,9 @@ channels: summary: user signed up description: user signed up to load some data message: - name: UserSignup - title: User signup contentType: application/json - schemaFormat: application/vnd.oai.openapi;version=3.0.0 correlationId: $ref: "#/components/correlationIds/userSignedUpCorId" - payload: - type: object - properties: - email: - type: string - format: email components: correlationIds: diff --git a/tests/asyncapi-2.0/Correlation ID Object/Fields Types/invalid-location-type.yaml b/tests/asyncapi-2.0/Correlation ID Object/Fields Types/invalid-location-type.yaml index 40b7044f..ef0bcdd1 100644 --- a/tests/asyncapi-2.0/Correlation ID Object/Fields Types/invalid-location-type.yaml +++ b/tests/asyncapi-2.0/Correlation ID Object/Fields Types/invalid-location-type.yaml @@ -11,18 +11,9 @@ channels: summary: user signed up description: user signed up to load some data message: - name: UserSignup - title: User signup contentType: application/json - schemaFormat: application/vnd.oai.openapi;version=3.0.0 correlationId: $ref: "#/components/correlationIds/userSignedUpCorId" - payload: - type: object - properties: - email: - type: string - format: email components: correlationIds: diff --git a/tests/asyncapi-2.0/Correlation ID Object/invalid-location-expression.yaml b/tests/asyncapi-2.0/Correlation ID Object/invalid-location-expression.yaml index 84b36286..27d052e1 100644 --- a/tests/asyncapi-2.0/Correlation ID Object/invalid-location-expression.yaml +++ b/tests/asyncapi-2.0/Correlation ID Object/invalid-location-expression.yaml @@ -11,18 +11,9 @@ channels: summary: user signed up description: user signed up to load some data message: - name: UserSignup - title: User signup contentType: application/json - schemaFormat: application/vnd.oai.openapi;version=3.0.0 correlationId: $ref: "#/components/correlationIds/userSignedUpCorId" - payload: - type: object - properties: - email: - type: string - format: email components: correlationIds: diff --git a/tests/asyncapi-2.0/Correlation ID Object/invalid-missing-location.yaml b/tests/asyncapi-2.0/Correlation ID Object/invalid-missing-location.yaml index ba682def..856dc569 100644 --- a/tests/asyncapi-2.0/Correlation ID Object/invalid-missing-location.yaml +++ b/tests/asyncapi-2.0/Correlation ID Object/invalid-missing-location.yaml @@ -11,18 +11,9 @@ channels: summary: user signed up description: user signed up to load some data message: - name: UserSignup - title: User signup contentType: application/json - schemaFormat: application/vnd.oai.openapi;version=3.0.0 correlationId: $ref: "#/components/correlationIds/userSignedUpCorId" - payload: - type: object - properties: - email: - type: string - format: email components: correlationIds: diff --git a/tests/asyncapi-2.0/Correlation ID Object/valid.yaml b/tests/asyncapi-2.0/Correlation ID Object/valid.yaml index f8cbac31..50647139 100644 --- a/tests/asyncapi-2.0/Correlation ID Object/valid.yaml +++ b/tests/asyncapi-2.0/Correlation ID Object/valid.yaml @@ -11,18 +11,9 @@ channels: summary: user signed up description: user signed up to load some data message: - name: UserSignup - title: User signup contentType: application/json - schemaFormat: application/vnd.oai.openapi;version=3.0.0 correlationId: $ref: "#/components/correlationIds/userSignedUpCorId" - payload: - type: object - properties: - email: - type: string - format: email components: correlationIds: diff --git a/tests/asyncapi-2.0/Message Object/invalid-missing-contentType.yaml b/tests/asyncapi-2.0/Message Object/invalid-missing-contentType.yaml index c12fb16f..79ae4cd0 100644 --- a/tests/asyncapi-2.0/Message Object/invalid-missing-contentType.yaml +++ b/tests/asyncapi-2.0/Message Object/invalid-missing-contentType.yaml @@ -7,25 +7,4 @@ info: channels: /user/signedup: subscribe: - operationId: userSignedUp - summary: user signed up - description: user signed up to load some data message: - name: UserSignup - title: User signup - summary: Action to sign a user up. - description: A longer description - schemaFormat: application/vnd.oai.openapi;version=3.0.0 - headers: - type: string - payload: - type: object - properties: - email: - type: string - format: email - examples: - - one: - email: hello@foo.bar - - two: - email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Object/valid-empty-object.yaml b/tests/asyncapi-2.0/Message Object/valid-empty-object.yaml index 888b0bd7..79ae4cd0 100644 --- a/tests/asyncapi-2.0/Message Object/valid-empty-object.yaml +++ b/tests/asyncapi-2.0/Message Object/valid-empty-object.yaml @@ -7,7 +7,4 @@ info: channels: /user/signedup: subscribe: - operationId: userSignedUp - summary: user signed up - description: user signed up to load some data message: diff --git a/tests/asyncapi-2.0/Message Object/valid-internal-ref-correlationId.yaml b/tests/asyncapi-2.0/Message Object/valid-internal-ref-correlationId.yaml index 65ed7f2b..e60e1b49 100644 --- a/tests/asyncapi-2.0/Message Object/valid-internal-ref-correlationId.yaml +++ b/tests/asyncapi-2.0/Message Object/valid-internal-ref-correlationId.yaml @@ -7,33 +7,10 @@ info: channels: /user/signedup: subscribe: - operationId: userSignedUp - summary: user signed up - description: user signed up to load some data message: - name: UserSignup - title: User signup - summary: Action to sign a user up. - description: A longer description contentType: application/json - schemaFormat: application/vnd.oai.openapi;version=3.0.0 correlationId: $ref: "#/components/correlationIds/userSignedUpCorId" - headers: - type: object - properties: - correlationId: - description: Correlation ID set by application - type: string - applicationInstanceId: - description: Unique identifier for a given instance of the publishing application - type: string - payload: - type: object - properties: - email: - type: string - format: email components: correlationIds: diff --git a/tests/asyncapi-2.0/Message Object/valid-internal-ref-header.yaml b/tests/asyncapi-2.0/Message Object/valid-internal-ref-header.yaml index c4e2771d..dd5b73a8 100644 --- a/tests/asyncapi-2.0/Message Object/valid-internal-ref-header.yaml +++ b/tests/asyncapi-2.0/Message Object/valid-internal-ref-header.yaml @@ -7,24 +7,10 @@ info: channels: /user/signedup: subscribe: - operationId: userSignedUp - summary: user signed up - description: user signed up to load some data message: - name: UserSignup - title: User signup - summary: Action to sign a user up. - description: A longer description contentType: application/json - schemaFormat: application/vnd.oai.openapi;version=3.0.0 headers: $ref: "#/components/schemas/userSignedUpHeaders" - payload: - type: object - properties: - email: - type: string - format: email components: schemas: diff --git a/tests/asyncapi-2.0/Message Trait Object/invalid-missing-content-type.yaml b/tests/asyncapi-2.0/Message Trait Object/invalid-missing-content-type.yaml index 72037ecc..fadcb1f7 100644 --- a/tests/asyncapi-2.0/Message Trait Object/invalid-missing-content-type.yaml +++ b/tests/asyncapi-2.0/Message Trait Object/invalid-missing-content-type.yaml @@ -7,41 +7,10 @@ info: channels: /user/signedup: subscribe: - operationId: userSignedUp - summary: user signed up - description: user signed up to load some data message: - payload: - type: object - properties: - email: - type: string - format: email traits: - $ref: "#/components/messageTraits/signedUpMessage" components: messageTraits: signedUpMessage: - name: UserSignup - title: User signup - summary: Action to sign a user up. - description: A longer description - schemaFormat: application/vnd.oai.openapi;version=3.0.0 - correlationId: - description: Default Correlation ID - location: $message.header#/correlationId - headers: - type: object - properties: - correlationId: - description: Correlation ID set by application - type: string - applicationInstanceId: - description: Unique identifier for a given instance of the publishing application - type: string - examples: - - one: - email: hello@foo.bar - - two: - email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Message Trait Object/valid-empty-object.yaml b/tests/asyncapi-2.0/Message Trait Object/valid-empty-object.yaml index 4e55ea80..a63c9171 100644 --- a/tests/asyncapi-2.0/Message Trait Object/valid-empty-object.yaml +++ b/tests/asyncapi-2.0/Message Trait Object/valid-empty-object.yaml @@ -7,16 +7,8 @@ info: channels: /user/signedup: subscribe: - operationId: userSignedUp - summary: user signed up - description: user signed up to load some data message: - payload: - type: object - properties: - email: - type: string - format: email + contentType: application/json traits: - $ref: "#/components/messageTraits/signedUpMessage" diff --git a/tests/asyncapi-2.0/Message Trait Object/valid-internal-ref-correlationId.yaml b/tests/asyncapi-2.0/Message Trait Object/valid-internal-ref-correlationId.yaml index 8c5ef8ff..9c73a0b4 100644 --- a/tests/asyncapi-2.0/Message Trait Object/valid-internal-ref-correlationId.yaml +++ b/tests/asyncapi-2.0/Message Trait Object/valid-internal-ref-correlationId.yaml @@ -7,44 +7,16 @@ info: channels: /user/signedup: subscribe: - operationId: userSignedUp - summary: user signed up - description: user signed up to load some data message: - payload: - type: object - properties: - email: - type: string - format: email traits: - $ref: "#/components/messageTraits/signedUpMessage" components: messageTraits: signedUpMessage: - name: UserSignup - title: User signup - summary: Action to sign a user up. - description: A longer description contentType: application/json - schemaFormat: application/vnd.oai.openapi;version=3.0.0 correlationId: $ref: "#/components/correlationIds/userSignedUpCorId" - headers: - type: object - properties: - correlationId: - description: Correlation ID set by application - type: string - applicationInstanceId: - description: Unique identifier for a given instance of the publishing application - type: string - examples: - - one: - email: hello@foo.bar - - two: - email: bye@foo.bar correlationIds: userSignedUpCorId: description: Default Correlation ID diff --git a/tests/asyncapi-2.0/Message Trait Object/valid-internal-ref-header.yaml b/tests/asyncapi-2.0/Message Trait Object/valid-internal-ref-header.yaml index 2ebf1ed2..6a35b099 100644 --- a/tests/asyncapi-2.0/Message Trait Object/valid-internal-ref-header.yaml +++ b/tests/asyncapi-2.0/Message Trait Object/valid-internal-ref-header.yaml @@ -7,38 +7,16 @@ info: channels: /user/signedup: subscribe: - operationId: userSignedUp - summary: user signed up - description: user signed up to load some data message: - payload: - type: object - properties: - email: - type: string - format: email traits: - $ref: "#/components/messageTraits/signedUpMessage" components: messageTraits: signedUpMessage: - name: UserSignup - title: User signup - summary: Action to sign a user up. - description: A longer description contentType: application/json - schemaFormat: application/vnd.oai.openapi;version=3.0.0 - correlationId: - description: Default Correlation ID - location: $message.header#/correlationId headers: $ref: "#/components/schemas/userSignedUpHeaders" - examples: - - one: - email: hello@foo.bar - - two: - email: bye@foo.bar schemas: userSignedUpHeaders: type: object diff --git a/tests/asyncapi-2.0/Message Trait Object/valid-using-defaultContentType.yaml b/tests/asyncapi-2.0/Message Trait Object/valid-using-defaultContentType.yaml index 1f3c2b4b..24c58081 100644 --- a/tests/asyncapi-2.0/Message Trait Object/valid-using-defaultContentType.yaml +++ b/tests/asyncapi-2.0/Message Trait Object/valid-using-defaultContentType.yaml @@ -9,41 +9,10 @@ info: channels: /user/signedup: subscribe: - operationId: userSignedUp - summary: user signed up - description: user signed up to load some data message: - payload: - type: object - properties: - email: - type: string - format: email traits: - $ref: "#/components/messageTraits/signedUpMessage" components: messageTraits: signedUpMessage: - name: UserSignup - title: User signup - summary: Action to sign a user up. - description: A longer description - schemaFormat: application/vnd.oai.openapi;version=3.0.0 - correlationId: - description: Default Correlation ID - location: $message.header#/correlationId - headers: - type: object - properties: - correlationId: - description: Correlation ID set by application - type: string - applicationInstanceId: - description: Unique identifier for a given instance of the publishing application - type: string - examples: - - one: - email: hello@foo.bar - - two: - email: bye@foo.bar diff --git a/tests/asyncapi-2.0/Operation Object/Fields Types/invalid-bindings-type.yaml b/tests/asyncapi-2.0/Operation Object/Fields Types/invalid-bindings-type.yaml index fecbf052..6f9da05e 100644 --- a/tests/asyncapi-2.0/Operation Object/Fields Types/invalid-bindings-type.yaml +++ b/tests/asyncapi-2.0/Operation Object/Fields Types/invalid-bindings-type.yaml @@ -7,9 +7,6 @@ info: channels: /user/signedup: subscribe: - operationId: userSignedUp - summary: user signed up - description: user signed up to load some data message: payload: type: object @@ -17,11 +14,4 @@ channels: email: type: string format: email - tags: - - name: user - description: user signed up - - name: signup - externalDocs: - description: Find more info here - url: https://example.com bindings: 123 diff --git a/tests/asyncapi-2.0/Operation Object/Fields Types/invalid-description-type.yaml b/tests/asyncapi-2.0/Operation Object/Fields Types/invalid-description-type.yaml index 10fd1cb4..7538dd59 100644 --- a/tests/asyncapi-2.0/Operation Object/Fields Types/invalid-description-type.yaml +++ b/tests/asyncapi-2.0/Operation Object/Fields Types/invalid-description-type.yaml @@ -7,10 +7,6 @@ info: channels: /user/signedup: subscribe: - operationId: userSignedUp - summary: user signed up - description: - prop: 1 message: payload: type: object @@ -18,10 +14,5 @@ channels: email: type: string format: email - tags: - - name: user - description: user signed up - - name: signup - externalDocs: - description: Find more info here - url: https://example.com + description: + prop: 1 diff --git a/tests/asyncapi-2.0/Operation Object/Fields Types/invalid-externalDocs-type.yaml b/tests/asyncapi-2.0/Operation Object/Fields Types/invalid-externalDocs-type.yaml index 7309a471..40f25fe5 100644 --- a/tests/asyncapi-2.0/Operation Object/Fields Types/invalid-externalDocs-type.yaml +++ b/tests/asyncapi-2.0/Operation Object/Fields Types/invalid-externalDocs-type.yaml @@ -7,9 +7,6 @@ info: channels: /user/signedup: subscribe: - operationId: userSignedUp - summary: user signed up - description: user signed up to load some data message: payload: type: object @@ -17,8 +14,4 @@ channels: email: type: string format: email - tags: - - name: user - description: user signed up - - name: signup externalDocs: 123 diff --git a/tests/asyncapi-2.0/Operation Object/Fields Types/invalid-message-type.yaml b/tests/asyncapi-2.0/Operation Object/Fields Types/invalid-message-type.yaml index eeb2e340..c79cccc5 100644 --- a/tests/asyncapi-2.0/Operation Object/Fields Types/invalid-message-type.yaml +++ b/tests/asyncapi-2.0/Operation Object/Fields Types/invalid-message-type.yaml @@ -7,14 +7,4 @@ info: channels: /user/signedup: subscribe: - operationId: userSignedUp - summary: user signed up - description: user signed up to load some data message: 123 - tags: - - name: user - description: user signed up - - name: signup - externalDocs: - description: Find more info here - url: https://example.com diff --git a/tests/asyncapi-2.0/Operation Object/Fields Types/invalid-operationId-type.yaml b/tests/asyncapi-2.0/Operation Object/Fields Types/invalid-operationId-type.yaml index b0005e42..193486d9 100644 --- a/tests/asyncapi-2.0/Operation Object/Fields Types/invalid-operationId-type.yaml +++ b/tests/asyncapi-2.0/Operation Object/Fields Types/invalid-operationId-type.yaml @@ -9,8 +9,6 @@ channels: subscribe: operationId: prop: 1 - summary: user signed up - description: user signed up to load some data message: payload: type: object @@ -18,10 +16,3 @@ channels: email: type: string format: email - tags: - - name: user - description: user signed up - - name: signup - externalDocs: - description: Find more info here - url: https://example.com diff --git a/tests/asyncapi-2.0/Operation Object/Fields Types/invalid-summary-type.yaml b/tests/asyncapi-2.0/Operation Object/Fields Types/invalid-summary-type.yaml index 70bb052d..e92bc6f6 100644 --- a/tests/asyncapi-2.0/Operation Object/Fields Types/invalid-summary-type.yaml +++ b/tests/asyncapi-2.0/Operation Object/Fields Types/invalid-summary-type.yaml @@ -7,10 +7,6 @@ info: channels: /user/signedup: subscribe: - operationId: userSignedUp - summary: - prop: 1 - description: user signed up to load some data message: payload: type: object @@ -18,10 +14,5 @@ channels: email: type: string format: email - tags: - - name: user - description: user signed up - - name: signup - externalDocs: - description: Find more info here - url: https://example.com + summary: + prop: 1 diff --git a/tests/asyncapi-2.0/Operation Object/Fields Types/invalid-tags-type.yaml b/tests/asyncapi-2.0/Operation Object/Fields Types/invalid-tags-type.yaml index 39e69ab4..0162a24e 100644 --- a/tests/asyncapi-2.0/Operation Object/Fields Types/invalid-tags-type.yaml +++ b/tests/asyncapi-2.0/Operation Object/Fields Types/invalid-tags-type.yaml @@ -7,9 +7,6 @@ info: channels: /user/signedup: subscribe: - operationId: userSignedUp - summary: user signed up - description: user signed up to load some data message: payload: type: object @@ -18,6 +15,3 @@ channels: type: string format: email tags: 123 - externalDocs: - description: Find more info here - url: https://example.com diff --git a/tests/asyncapi-2.0/Operation Object/Fields Types/invalid-traits-type.yaml b/tests/asyncapi-2.0/Operation Object/Fields Types/invalid-traits-type.yaml index 97b137b0..9bae8e29 100644 --- a/tests/asyncapi-2.0/Operation Object/Fields Types/invalid-traits-type.yaml +++ b/tests/asyncapi-2.0/Operation Object/Fields Types/invalid-traits-type.yaml @@ -7,9 +7,6 @@ info: channels: /user/signedup: subscribe: - operationId: userSignedUp - summary: user signed up - description: user signed up to load some data message: payload: type: object @@ -17,11 +14,4 @@ channels: email: type: string format: email - tags: - - name: user - description: user signed up - - name: signup - externalDocs: - description: Find more info here - url: https://example.com traits: 123 diff --git a/tests/asyncapi-2.0/Operation Trait Object/invalid-duplicate-operationId.yaml b/tests/asyncapi-2.0/Operation Trait Object/invalid-duplicate-operationId.yaml index a5fa324c..19b57b4a 100644 --- a/tests/asyncapi-2.0/Operation Trait Object/invalid-duplicate-operationId.yaml +++ b/tests/asyncapi-2.0/Operation Trait Object/invalid-duplicate-operationId.yaml @@ -26,4 +26,3 @@ components: operationTraits: userSignedUpTrait: operationId: userSignedUp - summary: user signed up diff --git a/tests/asyncapi-2.0/Operation Trait Object/invalid-duplicate-tags.yaml b/tests/asyncapi-2.0/Operation Trait Object/invalid-duplicate-tags.yaml index a0cdc304..f0f1c547 100644 --- a/tests/asyncapi-2.0/Operation Trait Object/invalid-duplicate-tags.yaml +++ b/tests/asyncapi-2.0/Operation Trait Object/invalid-duplicate-tags.yaml @@ -21,11 +21,8 @@ channels: components: operationTraits: userSignedUpTrait: - operationId: userSignedUp tags: - name: user description: user signed up - name: user - summary: user signed up userSignedUpDescTrait: - description: user signed up to load some data diff --git a/tests/asyncapi-2.0/Operation Trait Object/invalid-trait-with-message.yaml b/tests/asyncapi-2.0/Operation Trait Object/invalid-trait-with-message.yaml index ef80e419..8e30216f 100644 --- a/tests/asyncapi-2.0/Operation Trait Object/invalid-trait-with-message.yaml +++ b/tests/asyncapi-2.0/Operation Trait Object/invalid-trait-with-message.yaml @@ -20,8 +20,6 @@ channels: components: operationTraits: userSignedUpTrait: - operationId: userSignedUp - summary: user signed up message: payload: type: string diff --git a/tests/asyncapi-2.0/Operation Trait Object/invalid-trait-with-traits.yaml b/tests/asyncapi-2.0/Operation Trait Object/invalid-trait-with-traits.yaml index 0f7b5c80..45ce77d7 100644 --- a/tests/asyncapi-2.0/Operation Trait Object/invalid-trait-with-traits.yaml +++ b/tests/asyncapi-2.0/Operation Trait Object/invalid-trait-with-traits.yaml @@ -20,7 +20,5 @@ channels: components: operationTraits: userSignedUpTrait: - operationId: userSignedUp - summary: user signed up traits: - $ref: "#/components/operationTraits/userSignedUpTrait" From 969b0aa66621b473a1a36656220073c14f458fd5 Mon Sep 17 00:00:00 2001 From: Artem Kostiuk Date: Thu, 19 Mar 2020 09:53:10 +0200 Subject: [PATCH 26/26] Delete invalid test https://github.com/asyncapi/tck/pull/1#discussion_r394274309 --- manifest.json | 1 - .../invalid-not-matching-param-name.yaml | 16 ---------------- 2 files changed, 17 deletions(-) delete mode 100644 tests/asyncapi-2.0/Parameters Object/invalid-not-matching-param-name.yaml diff --git a/manifest.json b/manifest.json index d97fa391..27df0e87 100644 --- a/manifest.json +++ b/manifest.json @@ -266,7 +266,6 @@ "tests/asyncapi-2.0/Security Requirement Object/invalid-symmetricEncryption-non-empty-array.yaml", "tests/asyncapi-2.0/Security Requirement Object/invalid-userPassword-non-empty-array.yaml", "tests/asyncapi-2.0/Security Requirement Object/Fields Types/invalid-name-type.yaml", - "tests/asyncapi-2.0/Parameters Object/invalid-not-matching-param-name.yaml", "tests/asyncapi-2.0/Parameters Object/invalid-pattern-field.yaml", "tests/asyncapi-2.0/Parameters Object/valid-internal-ref.yaml", "tests/asyncapi-2.0/Parameters Object/valid.yaml", diff --git a/tests/asyncapi-2.0/Parameters Object/invalid-not-matching-param-name.yaml b/tests/asyncapi-2.0/Parameters Object/invalid-not-matching-param-name.yaml deleted file mode 100644 index eaee2a4a..00000000 --- a/tests/asyncapi-2.0/Parameters Object/invalid-not-matching-param-name.yaml +++ /dev/null @@ -1,16 +0,0 @@ -asyncapi: 2.0.0 - -info: - title: Signup service example (internal) - version: 0.1.0 - -channels: - user/{userId}/signup: - parameters: - userEmail: - schema: - type: string - publish: - message: - payload: - type: string