From 86f6ff8aa490dbb8c410de077994eb8664efd42c Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Sat, 13 Apr 2024 01:04:53 +0400 Subject: [PATCH] tests(schemaFormat): new AsyncAPI Schema tests https://github.com/asyncapi/jasyncapi/issues/185 --- .../com/asyncapi/v3/schema/SchemaProvider.kt | 37 -- .../multiformat/MultiFormatSchemaTest.kt | 530 +----------------- .../asyncapi/AsyncAPIFormatSchemaTest.kt | 36 ++ .../AsyncAPIFormatSchemaV2_0_0Test.kt | 164 ++++++ .../AsyncAPIFormatSchemaV2_1_0Test.kt | 164 ++++++ .../AsyncAPIFormatSchemaV2_2_0Test.kt | 164 ++++++ .../AsyncAPIFormatSchemaV2_3_0Test.kt | 164 ++++++ .../AsyncAPIFormatSchemaV2_4_0Test.kt | 164 ++++++ .../AsyncAPIFormatSchemaV2_5_0Test.kt | 164 ++++++ .../AsyncAPIFormatSchemaV2_6_0Test.kt | 164 ++++++ .../AsyncAPIFormatSchemaV3_0_0Test.kt | 164 ++++++ .../asyncapi/EmptySchemaFormatTest.kt | 104 ++++ .../asyncapi/NullSchemaFormatTest.kt | 106 ++++ .../asyncapi/WithoutSchemaFormatTest.kt | 106 ++++ .../arrays.schema.json | 0 .../complex-object.schema.json | 0 ...conditional-validation-if-else.schema.json | 0 .../draft-07-core-schema-meta-schema.json | 0 .../enumerated-values.schema.json | 0 .../person.schema.json | 0 .../regex-pattern.schema.json | 0 .../arrays.schema.yaml | 0 .../complex-object.schema.yaml | 0 ...conditional-validation-if-else.schema.yaml | 0 .../draft-07-core-schema-meta-schema.yaml | 0 .../enumerated-values.schema.yaml | 0 .../person.schema.yaml | 0 .../regex-pattern.schema.yaml | 0 .../2.0.0/vnd.aai.asyncapi/arrays.schema.json | 37 ++ .../2.0.0/vnd.aai.asyncapi/arrays.schema.yaml | 28 + .../complex-object.schema.json | 44 ++ .../complex-object.schema.yaml | 36 ++ ...conditional-validation-if-else.schema.json | 42 ++ ...conditional-validation-if-else.schema.yaml | 28 + .../draft-07-core-schema-meta-schema.json | 175 ++++++ .../draft-07-core-schema-meta-schema.yaml | 164 ++++++ .../enumerated-values.schema.json | 14 + .../enumerated-values.schema.yaml | 16 + .../2.0.0/vnd.aai.asyncapi/person.schema.json | 24 + .../2.0.0/vnd.aai.asyncapi/person.schema.yaml | 17 + .../regex-pattern.schema.json | 15 + .../regex-pattern.schema.yaml | 10 + .../arrays.schema.json | 0 .../complex-object.schema.json | 0 ...conditional-validation-if-else.schema.json | 0 .../draft-07-core-schema-meta-schema.json | 0 .../enumerated-values.schema.json | 0 .../person.schema.json | 0 .../regex-pattern.schema.json | 0 .../arrays.schema.yaml | 0 .../complex-object.schema.yaml | 0 ...conditional-validation-if-else.schema.yaml | 0 .../draft-07-core-schema-meta-schema.yaml | 0 .../enumerated-values.schema.yaml | 0 .../person.schema.yaml | 0 .../regex-pattern.schema.yaml | 0 .../2.1.0/vnd.aai.asyncapi/arrays.schema.json | 37 ++ .../2.1.0/vnd.aai.asyncapi/arrays.schema.yaml | 28 + .../complex-object.schema.json | 44 ++ .../complex-object.schema.yaml | 36 ++ ...conditional-validation-if-else.schema.json | 42 ++ ...conditional-validation-if-else.schema.yaml | 28 + .../draft-07-core-schema-meta-schema.json | 175 ++++++ .../draft-07-core-schema-meta-schema.yaml | 164 ++++++ .../enumerated-values.schema.json | 14 + .../enumerated-values.schema.yaml | 16 + .../2.1.0/vnd.aai.asyncapi/person.schema.json | 24 + .../2.1.0/vnd.aai.asyncapi/person.schema.yaml | 17 + .../regex-pattern.schema.json | 15 + .../regex-pattern.schema.yaml | 10 + .../arrays.schema.json | 0 .../complex-object.schema.json | 0 ...conditional-validation-if-else.schema.json | 0 .../draft-07-core-schema-meta-schema.json | 0 .../enumerated-values.schema.json | 0 .../person.schema.json | 0 .../regex-pattern.schema.json | 0 .../arrays.schema.yaml | 0 .../complex-object.schema.yaml | 0 ...conditional-validation-if-else.schema.yaml | 0 .../draft-07-core-schema-meta-schema.yaml | 0 .../enumerated-values.schema.yaml | 0 .../person.schema.yaml | 0 .../regex-pattern.schema.yaml | 0 .../2.2.0/vnd.aai.asyncapi/arrays.schema.json | 37 ++ .../2.2.0/vnd.aai.asyncapi/arrays.schema.yaml | 28 + .../complex-object.schema.json | 44 ++ .../complex-object.schema.yaml | 36 ++ ...conditional-validation-if-else.schema.json | 42 ++ ...conditional-validation-if-else.schema.yaml | 28 + .../draft-07-core-schema-meta-schema.json | 175 ++++++ .../draft-07-core-schema-meta-schema.yaml | 164 ++++++ .../enumerated-values.schema.json | 14 + .../enumerated-values.schema.yaml | 16 + .../2.2.0/vnd.aai.asyncapi/person.schema.json | 24 + .../2.2.0/vnd.aai.asyncapi/person.schema.yaml | 17 + .../regex-pattern.schema.json | 15 + .../regex-pattern.schema.yaml | 10 + .../arrays.schema.json | 0 .../complex-object.schema.json | 0 ...conditional-validation-if-else.schema.json | 0 .../draft-07-core-schema-meta-schema.json | 0 .../enumerated-values.schema.json | 0 .../person.schema.json | 0 .../regex-pattern.schema.json | 0 .../arrays.schema.yaml | 0 .../complex-object.schema.yaml | 0 ...conditional-validation-if-else.schema.yaml | 0 .../draft-07-core-schema-meta-schema.yaml | 0 .../enumerated-values.schema.yaml | 0 .../person.schema.yaml | 0 .../regex-pattern.schema.yaml | 0 .../2.3.0/vnd.aai.asyncapi/arrays.schema.json | 37 ++ .../2.3.0/vnd.aai.asyncapi/arrays.schema.yaml | 28 + .../complex-object.schema.json | 44 ++ .../complex-object.schema.yaml | 36 ++ ...conditional-validation-if-else.schema.json | 42 ++ ...conditional-validation-if-else.schema.yaml | 28 + .../draft-07-core-schema-meta-schema.json | 175 ++++++ .../draft-07-core-schema-meta-schema.yaml | 164 ++++++ .../enumerated-values.schema.json | 14 + .../enumerated-values.schema.yaml | 16 + .../2.3.0/vnd.aai.asyncapi/person.schema.json | 24 + .../2.3.0/vnd.aai.asyncapi/person.schema.yaml | 17 + .../regex-pattern.schema.json | 15 + .../regex-pattern.schema.yaml | 10 + .../arrays.schema.json | 0 .../complex-object.schema.json | 0 ...conditional-validation-if-else.schema.json | 0 .../draft-07-core-schema-meta-schema.json | 0 .../enumerated-values.schema.json | 0 .../person.schema.json | 0 .../regex-pattern.schema.json | 0 .../arrays.schema.yaml | 0 .../complex-object.schema.yaml | 0 ...conditional-validation-if-else.schema.yaml | 0 .../draft-07-core-schema-meta-schema.yaml | 0 .../enumerated-values.schema.yaml | 0 .../person.schema.yaml | 0 .../regex-pattern.schema.yaml | 0 .../2.4.0/vnd.aai.asyncapi/arrays.schema.json | 37 ++ .../2.4.0/vnd.aai.asyncapi/arrays.schema.yaml | 28 + .../complex-object.schema.json | 44 ++ .../complex-object.schema.yaml | 36 ++ ...conditional-validation-if-else.schema.json | 42 ++ ...conditional-validation-if-else.schema.yaml | 28 + .../draft-07-core-schema-meta-schema.json | 175 ++++++ .../draft-07-core-schema-meta-schema.yaml | 164 ++++++ .../enumerated-values.schema.json | 14 + .../enumerated-values.schema.yaml | 16 + .../2.4.0/vnd.aai.asyncapi/person.schema.json | 24 + .../2.4.0/vnd.aai.asyncapi/person.schema.yaml | 17 + .../regex-pattern.schema.json | 15 + .../regex-pattern.schema.yaml | 10 + .../arrays.schema.json | 0 .../complex-object.schema.json | 0 ...conditional-validation-if-else.schema.json | 0 .../draft-07-core-schema-meta-schema.json | 0 .../enumerated-values.schema.json | 0 .../person.schema.json | 0 .../regex-pattern.schema.json | 0 .../arrays.schema.yaml | 0 .../complex-object.schema.yaml | 0 ...conditional-validation-if-else.schema.yaml | 0 .../draft-07-core-schema-meta-schema.yaml | 0 .../enumerated-values.schema.yaml | 0 .../person.schema.yaml | 0 .../regex-pattern.schema.yaml | 0 .../2.5.0/vnd.aai.asyncapi/arrays.schema.json | 37 ++ .../2.5.0/vnd.aai.asyncapi/arrays.schema.yaml | 28 + .../complex-object.schema.json | 44 ++ .../complex-object.schema.yaml | 36 ++ ...conditional-validation-if-else.schema.json | 42 ++ ...conditional-validation-if-else.schema.yaml | 28 + .../draft-07-core-schema-meta-schema.json | 175 ++++++ .../draft-07-core-schema-meta-schema.yaml | 164 ++++++ .../enumerated-values.schema.json | 14 + .../enumerated-values.schema.yaml | 16 + .../2.5.0/vnd.aai.asyncapi/person.schema.json | 24 + .../2.5.0/vnd.aai.asyncapi/person.schema.yaml | 17 + .../regex-pattern.schema.json | 15 + .../regex-pattern.schema.yaml | 10 + .../arrays.schema.json | 0 .../complex-object.schema.json | 0 ...conditional-validation-if-else.schema.json | 0 .../draft-07-core-schema-meta-schema.json | 0 .../enumerated-values.schema.json | 0 .../person.schema.json | 0 .../regex-pattern.schema.json | 0 .../arrays.schema.yaml | 0 .../complex-object.schema.yaml | 0 ...conditional-validation-if-else.schema.yaml | 0 .../draft-07-core-schema-meta-schema.yaml | 0 .../enumerated-values.schema.yaml | 0 .../person.schema.yaml | 0 .../regex-pattern.schema.yaml | 0 .../2.6.0/vnd.aai.asyncapi/arrays.schema.json | 37 ++ .../2.6.0/vnd.aai.asyncapi/arrays.schema.yaml | 28 + .../complex-object.schema.json | 44 ++ .../complex-object.schema.yaml | 36 ++ ...conditional-validation-if-else.schema.json | 42 ++ ...conditional-validation-if-else.schema.yaml | 28 + .../draft-07-core-schema-meta-schema.json | 175 ++++++ .../draft-07-core-schema-meta-schema.yaml | 164 ++++++ .../enumerated-values.schema.json | 14 + .../enumerated-values.schema.yaml | 16 + .../2.6.0/vnd.aai.asyncapi/person.schema.json | 24 + .../2.6.0/vnd.aai.asyncapi/person.schema.yaml | 17 + .../regex-pattern.schema.json | 15 + .../regex-pattern.schema.yaml | 10 + .../arrays.schema.json | 0 .../complex-object.schema.json | 0 ...conditional-validation-if-else.schema.json | 0 .../draft-07-core-schema-meta-schema.json | 0 .../enumerated-values.schema.json | 0 .../person.schema.json | 0 .../regex-pattern.schema.json | 0 .../arrays.schema.yaml | 0 .../complex-object.schema.yaml | 0 ...conditional-validation-if-else.schema.yaml | 0 .../draft-07-core-schema-meta-schema.yaml | 0 .../enumerated-values.schema.yaml | 0 .../person.schema.yaml | 0 .../regex-pattern.schema.yaml | 0 .../3.0.0/vnd.aai.asyncapi/arrays.schema.json | 37 ++ .../3.0.0/vnd.aai.asyncapi/arrays.schema.yaml | 28 + .../complex-object.schema.json | 44 ++ .../complex-object.schema.yaml | 36 ++ ...conditional-validation-if-else.schema.json | 42 ++ ...conditional-validation-if-else.schema.yaml | 28 + .../draft-07-core-schema-meta-schema.json | 175 ++++++ .../draft-07-core-schema-meta-schema.yaml | 164 ++++++ .../enumerated-values.schema.json | 14 + .../enumerated-values.schema.yaml | 16 + .../3.0.0/vnd.aai.asyncapi/person.schema.json | 24 + .../3.0.0/vnd.aai.asyncapi/person.schema.yaml | 17 + .../regex-pattern.schema.json | 15 + .../regex-pattern.schema.yaml | 10 + 238 files changed, 6876 insertions(+), 555 deletions(-) create mode 100644 asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/asyncapi/AsyncAPIFormatSchemaTest.kt create mode 100644 asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/asyncapi/AsyncAPIFormatSchemaV2_0_0Test.kt create mode 100644 asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/asyncapi/AsyncAPIFormatSchemaV2_1_0Test.kt create mode 100644 asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/asyncapi/AsyncAPIFormatSchemaV2_2_0Test.kt create mode 100644 asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/asyncapi/AsyncAPIFormatSchemaV2_3_0Test.kt create mode 100644 asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/asyncapi/AsyncAPIFormatSchemaV2_4_0Test.kt create mode 100644 asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/asyncapi/AsyncAPIFormatSchemaV2_5_0Test.kt create mode 100644 asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/asyncapi/AsyncAPIFormatSchemaV2_6_0Test.kt create mode 100644 asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/asyncapi/AsyncAPIFormatSchemaV3_0_0Test.kt create mode 100644 asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/asyncapi/EmptySchemaFormatTest.kt create mode 100644 asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/asyncapi/NullSchemaFormatTest.kt create mode 100644 asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/asyncapi/WithoutSchemaFormatTest.kt rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/{ => vnd.aai.asyncapi+json}/arrays.schema.json (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/{ => vnd.aai.asyncapi+json}/complex-object.schema.json (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/{ => vnd.aai.asyncapi+json}/conditional-validation-if-else.schema.json (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/{ => vnd.aai.asyncapi+json}/draft-07-core-schema-meta-schema.json (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/{ => vnd.aai.asyncapi+json}/enumerated-values.schema.json (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/{ => vnd.aai.asyncapi+json}/person.schema.json (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/{ => vnd.aai.asyncapi+json}/regex-pattern.schema.json (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/{ => vnd.aai.asyncapi+yaml}/arrays.schema.yaml (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/{ => vnd.aai.asyncapi+yaml}/complex-object.schema.yaml (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/{ => vnd.aai.asyncapi+yaml}/conditional-validation-if-else.schema.yaml (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/{ => vnd.aai.asyncapi+yaml}/draft-07-core-schema-meta-schema.yaml (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/{ => vnd.aai.asyncapi+yaml}/enumerated-values.schema.yaml (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/{ => vnd.aai.asyncapi+yaml}/person.schema.yaml (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/{ => vnd.aai.asyncapi+yaml}/regex-pattern.schema.yaml (100%) create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/arrays.schema.json create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/arrays.schema.yaml create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/complex-object.schema.json create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/complex-object.schema.yaml create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.json create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.yaml create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.json create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.yaml create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/enumerated-values.schema.json create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/enumerated-values.schema.yaml create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/person.schema.json create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/person.schema.yaml create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/regex-pattern.schema.json create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/regex-pattern.schema.yaml rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/{ => vnd.aai.asyncapi+json}/arrays.schema.json (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/{ => vnd.aai.asyncapi+json}/complex-object.schema.json (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/{ => vnd.aai.asyncapi+json}/conditional-validation-if-else.schema.json (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/{ => vnd.aai.asyncapi+json}/draft-07-core-schema-meta-schema.json (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/{ => vnd.aai.asyncapi+json}/enumerated-values.schema.json (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/{ => vnd.aai.asyncapi+json}/person.schema.json (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/{ => vnd.aai.asyncapi+json}/regex-pattern.schema.json (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/{ => vnd.aai.asyncapi+yaml}/arrays.schema.yaml (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/{ => vnd.aai.asyncapi+yaml}/complex-object.schema.yaml (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/{ => vnd.aai.asyncapi+yaml}/conditional-validation-if-else.schema.yaml (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/{ => vnd.aai.asyncapi+yaml}/draft-07-core-schema-meta-schema.yaml (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/{ => vnd.aai.asyncapi+yaml}/enumerated-values.schema.yaml (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/{ => vnd.aai.asyncapi+yaml}/person.schema.yaml (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/{ => vnd.aai.asyncapi+yaml}/regex-pattern.schema.yaml (100%) create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/arrays.schema.json create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/arrays.schema.yaml create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/complex-object.schema.json create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/complex-object.schema.yaml create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.json create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.yaml create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.json create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.yaml create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/enumerated-values.schema.json create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/enumerated-values.schema.yaml create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/person.schema.json create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/person.schema.yaml create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/regex-pattern.schema.json create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/regex-pattern.schema.yaml rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/{ => vnd.aai.asyncapi+json}/arrays.schema.json (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/{ => vnd.aai.asyncapi+json}/complex-object.schema.json (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/{ => vnd.aai.asyncapi+json}/conditional-validation-if-else.schema.json (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/{ => vnd.aai.asyncapi+json}/draft-07-core-schema-meta-schema.json (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/{ => vnd.aai.asyncapi+json}/enumerated-values.schema.json (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/{ => vnd.aai.asyncapi+json}/person.schema.json (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/{ => vnd.aai.asyncapi+json}/regex-pattern.schema.json (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/{ => vnd.aai.asyncapi+yaml}/arrays.schema.yaml (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/{ => vnd.aai.asyncapi+yaml}/complex-object.schema.yaml (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/{ => vnd.aai.asyncapi+yaml}/conditional-validation-if-else.schema.yaml (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/{ => vnd.aai.asyncapi+yaml}/draft-07-core-schema-meta-schema.yaml (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/{ => vnd.aai.asyncapi+yaml}/enumerated-values.schema.yaml (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/{ => vnd.aai.asyncapi+yaml}/person.schema.yaml (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/{ => vnd.aai.asyncapi+yaml}/regex-pattern.schema.yaml (100%) create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/arrays.schema.json create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/arrays.schema.yaml create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/complex-object.schema.json create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/complex-object.schema.yaml create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.json create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.yaml create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.json create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.yaml create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/enumerated-values.schema.json create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/enumerated-values.schema.yaml create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/person.schema.json create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/person.schema.yaml create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/regex-pattern.schema.json create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/regex-pattern.schema.yaml rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/{ => vnd.aai.asyncapi+json}/arrays.schema.json (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/{ => vnd.aai.asyncapi+json}/complex-object.schema.json (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/{ => vnd.aai.asyncapi+json}/conditional-validation-if-else.schema.json (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/{ => vnd.aai.asyncapi+json}/draft-07-core-schema-meta-schema.json (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/{ => vnd.aai.asyncapi+json}/enumerated-values.schema.json (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/{ => vnd.aai.asyncapi+json}/person.schema.json (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/{ => vnd.aai.asyncapi+json}/regex-pattern.schema.json (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/{ => vnd.aai.asyncapi+yaml}/arrays.schema.yaml (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/{ => vnd.aai.asyncapi+yaml}/complex-object.schema.yaml (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/{ => vnd.aai.asyncapi+yaml}/conditional-validation-if-else.schema.yaml (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/{ => vnd.aai.asyncapi+yaml}/draft-07-core-schema-meta-schema.yaml (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/{ => vnd.aai.asyncapi+yaml}/enumerated-values.schema.yaml (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/{ => vnd.aai.asyncapi+yaml}/person.schema.yaml (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/{ => vnd.aai.asyncapi+yaml}/regex-pattern.schema.yaml (100%) create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/arrays.schema.json create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/arrays.schema.yaml create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/complex-object.schema.json create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/complex-object.schema.yaml create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.json create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.yaml create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.json create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.yaml create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/enumerated-values.schema.json create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/enumerated-values.schema.yaml create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/person.schema.json create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/person.schema.yaml create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/regex-pattern.schema.json create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/regex-pattern.schema.yaml rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/{ => vnd.aai.asyncapi+json}/arrays.schema.json (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/{ => vnd.aai.asyncapi+json}/complex-object.schema.json (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/{ => vnd.aai.asyncapi+json}/conditional-validation-if-else.schema.json (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/{ => vnd.aai.asyncapi+json}/draft-07-core-schema-meta-schema.json (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/{ => vnd.aai.asyncapi+json}/enumerated-values.schema.json (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/{ => vnd.aai.asyncapi+json}/person.schema.json (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/{ => vnd.aai.asyncapi+json}/regex-pattern.schema.json (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/{ => vnd.aai.asyncapi+yaml}/arrays.schema.yaml (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/{ => vnd.aai.asyncapi+yaml}/complex-object.schema.yaml (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/{ => vnd.aai.asyncapi+yaml}/conditional-validation-if-else.schema.yaml (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/{ => vnd.aai.asyncapi+yaml}/draft-07-core-schema-meta-schema.yaml (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/{ => vnd.aai.asyncapi+yaml}/enumerated-values.schema.yaml (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/{ => vnd.aai.asyncapi+yaml}/person.schema.yaml (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/{ => vnd.aai.asyncapi+yaml}/regex-pattern.schema.yaml (100%) create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/arrays.schema.json create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/arrays.schema.yaml create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/complex-object.schema.json create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/complex-object.schema.yaml create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.json create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.yaml create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.json create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.yaml create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/enumerated-values.schema.json create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/enumerated-values.schema.yaml create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/person.schema.json create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/person.schema.yaml create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/regex-pattern.schema.json create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/regex-pattern.schema.yaml rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/{ => vnd.aai.asyncapi+json}/arrays.schema.json (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/{ => vnd.aai.asyncapi+json}/complex-object.schema.json (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/{ => vnd.aai.asyncapi+json}/conditional-validation-if-else.schema.json (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/{ => vnd.aai.asyncapi+json}/draft-07-core-schema-meta-schema.json (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/{ => vnd.aai.asyncapi+json}/enumerated-values.schema.json (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/{ => vnd.aai.asyncapi+json}/person.schema.json (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/{ => vnd.aai.asyncapi+json}/regex-pattern.schema.json (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/{ => vnd.aai.asyncapi+yaml}/arrays.schema.yaml (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/{ => vnd.aai.asyncapi+yaml}/complex-object.schema.yaml (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/{ => vnd.aai.asyncapi+yaml}/conditional-validation-if-else.schema.yaml (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/{ => vnd.aai.asyncapi+yaml}/draft-07-core-schema-meta-schema.yaml (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/{ => vnd.aai.asyncapi+yaml}/enumerated-values.schema.yaml (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/{ => vnd.aai.asyncapi+yaml}/person.schema.yaml (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/{ => vnd.aai.asyncapi+yaml}/regex-pattern.schema.yaml (100%) create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/arrays.schema.json create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/arrays.schema.yaml create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/complex-object.schema.json create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/complex-object.schema.yaml create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.json create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.yaml create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.json create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.yaml create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/enumerated-values.schema.json create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/enumerated-values.schema.yaml create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/person.schema.json create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/person.schema.yaml create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/regex-pattern.schema.json create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/regex-pattern.schema.yaml rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/{ => vnd.aai.asyncapi+json}/arrays.schema.json (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/{ => vnd.aai.asyncapi+json}/complex-object.schema.json (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/{ => vnd.aai.asyncapi+json}/conditional-validation-if-else.schema.json (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/{ => vnd.aai.asyncapi+json}/draft-07-core-schema-meta-schema.json (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/{ => vnd.aai.asyncapi+json}/enumerated-values.schema.json (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/{ => vnd.aai.asyncapi+json}/person.schema.json (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/{ => vnd.aai.asyncapi+json}/regex-pattern.schema.json (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/{ => vnd.aai.asyncapi+yaml}/arrays.schema.yaml (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/{ => vnd.aai.asyncapi+yaml}/complex-object.schema.yaml (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/{ => vnd.aai.asyncapi+yaml}/conditional-validation-if-else.schema.yaml (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/{ => vnd.aai.asyncapi+yaml}/draft-07-core-schema-meta-schema.yaml (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/{ => vnd.aai.asyncapi+yaml}/enumerated-values.schema.yaml (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/{ => vnd.aai.asyncapi+yaml}/person.schema.yaml (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/{ => vnd.aai.asyncapi+yaml}/regex-pattern.schema.yaml (100%) create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/arrays.schema.json create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/arrays.schema.yaml create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/complex-object.schema.json create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/complex-object.schema.yaml create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.json create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.yaml create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.json create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.yaml create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/enumerated-values.schema.json create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/enumerated-values.schema.yaml create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/person.schema.json create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/person.schema.yaml create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/regex-pattern.schema.json create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/regex-pattern.schema.yaml rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/{ => vnd.aai.asyncapi+json}/arrays.schema.json (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/{ => vnd.aai.asyncapi+json}/complex-object.schema.json (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/{ => vnd.aai.asyncapi+json}/conditional-validation-if-else.schema.json (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/{ => vnd.aai.asyncapi+json}/draft-07-core-schema-meta-schema.json (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/{ => vnd.aai.asyncapi+json}/enumerated-values.schema.json (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/{ => vnd.aai.asyncapi+json}/person.schema.json (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/{ => vnd.aai.asyncapi+json}/regex-pattern.schema.json (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/{ => vnd.aai.asyncapi+yaml}/arrays.schema.yaml (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/{ => vnd.aai.asyncapi+yaml}/complex-object.schema.yaml (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/{ => vnd.aai.asyncapi+yaml}/conditional-validation-if-else.schema.yaml (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/{ => vnd.aai.asyncapi+yaml}/draft-07-core-schema-meta-schema.yaml (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/{ => vnd.aai.asyncapi+yaml}/enumerated-values.schema.yaml (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/{ => vnd.aai.asyncapi+yaml}/person.schema.yaml (100%) rename asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/{ => vnd.aai.asyncapi+yaml}/regex-pattern.schema.yaml (100%) create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/arrays.schema.json create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/arrays.schema.yaml create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/complex-object.schema.json create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/complex-object.schema.yaml create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.json create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.yaml create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.json create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.yaml create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/enumerated-values.schema.json create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/enumerated-values.schema.yaml create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/person.schema.json create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/person.schema.yaml create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/regex-pattern.schema.json create mode 100644 asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/regex-pattern.schema.yaml diff --git a/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/SchemaProvider.kt b/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/SchemaProvider.kt index e24b7cf8..6e5037c1 100644 --- a/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/SchemaProvider.kt +++ b/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/SchemaProvider.kt @@ -2,7 +2,6 @@ package com.asyncapi.v3.schema import com.asyncapi.v3.schema.multiformat.AsyncAPIFormatSchema import com.asyncapi.v3.schema.multiformat.JsonFormatSchema -import com.asyncapi.v3.schema.multiformat.OpenAPIFormatSchema import com.asyncapi.v3.schema.openapi.OpenAPISchema interface SchemaProvider { @@ -15,44 +14,8 @@ interface SchemaProvider { fun asyncAPISchema(): AsyncAPISchema = AsyncAPISchema() - fun asyncAPIFormatSchemaJsonV2_0_0(): AsyncAPIFormatSchema = AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=2.0.0", asyncAPISchema()) - - fun asyncAPIFormatSchemaYamlV2_0_0(): AsyncAPIFormatSchema = AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=2.0.0", asyncAPISchema()) - - fun asyncAPIFormatSchemaJsonV2_1_0(): AsyncAPIFormatSchema = AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=2.1.0", asyncAPISchema()) - - fun asyncAPIFormatSchemaYamlV2_1_0(): AsyncAPIFormatSchema = AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=2.1.0", asyncAPISchema()) - - fun asyncAPIFormatSchemaJsonV2_2_0(): AsyncAPIFormatSchema = AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=2.2.0", asyncAPISchema()) - - fun asyncAPIFormatSchemaYamlV2_2_0(): AsyncAPIFormatSchema = AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=2.2.0", asyncAPISchema()) - - fun asyncAPIFormatSchemaJsonV2_3_0(): AsyncAPIFormatSchema = AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=2.3.0", asyncAPISchema()) - - fun asyncAPIFormatSchemaYamlV2_3_0(): AsyncAPIFormatSchema = AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=2.3.0", asyncAPISchema()) - - fun asyncAPIFormatSchemaJsonV2_4_0(): AsyncAPIFormatSchema = AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=2.4.0", asyncAPISchema()) - - fun asyncAPIFormatSchemaYamlV2_4_0(): AsyncAPIFormatSchema = AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=2.4.0", asyncAPISchema()) - - fun asyncAPIFormatSchemaJsonV2_5_0(): AsyncAPIFormatSchema = AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=2.5.0", asyncAPISchema()) - - fun asyncAPIFormatSchemaYamlV2_5_0(): AsyncAPIFormatSchema = AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=2.5.0", asyncAPISchema()) - - fun asyncAPIFormatSchemaJsonV2_6_0(): AsyncAPIFormatSchema = AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=2.6.0", asyncAPISchema()) - - fun asyncAPIFormatSchemaYamlV2_6_0(): AsyncAPIFormatSchema = AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=2.6.0", asyncAPISchema()) - - fun asyncAPIFormatSchemaJsonV3_0_0(): AsyncAPIFormatSchema = AsyncAPIFormatSchema(asyncAPISchema()) - - fun asyncAPIFormatSchemaYamlV3_0_0(): AsyncAPIFormatSchema = AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=3.0.0", asyncAPISchema()) - fun asyncAPIFormatSchemaEmptySchemaFormat(): AsyncAPIFormatSchema = AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=3.0.0", asyncAPISchema()) fun openAPISchema(): OpenAPISchema = OpenAPISchema() - fun openAPIFormatSchemaJson(): OpenAPIFormatSchema = OpenAPIFormatSchema(openAPISchema()) - - fun openAPIFormatSchemaYaml(): OpenAPIFormatSchema = OpenAPIFormatSchema("application/vnd.oai.openapi+yaml;version=3.0.0", openAPISchema()) - } \ No newline at end of file diff --git a/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/MultiFormatSchemaTest.kt b/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/MultiFormatSchemaTest.kt index 141d30a5..988ff06e 100644 --- a/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/MultiFormatSchemaTest.kt +++ b/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/MultiFormatSchemaTest.kt @@ -3,7 +3,7 @@ package com.asyncapi.v3.schema.multiformat import com.asyncapi.v3.ClasspathUtils import com.asyncapi.v3.schema.SchemaProvider import com.asyncapi.v3.schema.json.* -import com.asyncapi.v3.schema.openapi.SchemaTest +import com.asyncapi.v3.schema.multiformat.asyncapi.* import com.asyncapi.v3.schema.multiformat.openapi.OpenAPIFormatSchemaV3_0_0Test import com.asyncapi.v3.schema.multiformat.openapi.OpenAPIFormatSchemaV3_0_1Test import com.asyncapi.v3.schema.multiformat.openapi.OpenAPIFormatSchemaV3_0_2Test @@ -43,201 +43,47 @@ class MultiFormatSchemaTest { @Nested @DisplayName("2.0.0") - inner class V2_0_0 { - - @ArgumentsSource(AsyncAPISchemasJsonFormatV2_0_0::class) - @ParameterizedTest(name = "Read: {0}") - fun json(schemaToCompareWith: String, schemaProvider: SchemaProvider) { - compareSchemas(schemaToCompareWith, AsyncAPIFormatSchema::class.java, schemaProvider.asyncAPIFormatSchemaJsonV2_0_0()) - } - - @ArgumentsSource(AsyncAPISchemasYamlFormatV2_0_0::class) - @ParameterizedTest(name = "Read: {0}") - fun yaml(schemaToCompareWith: String, schemaProvider: SchemaProvider) { - compareSchemas(schemaToCompareWith, AsyncAPIFormatSchema::class.java, schemaProvider.asyncAPIFormatSchemaYamlV2_0_0()) - } - - } + inner class V2_0_0: AsyncAPIFormatSchemaV2_0_0Test() @Nested @DisplayName("2.1.0") - inner class V2_1_0 { - - @ArgumentsSource(AsyncAPISchemasJsonFormatV2_1_0::class) - @ParameterizedTest(name = "Read: {0}") - fun json(schemaToCompareWith: String, schemaProvider: SchemaProvider) { - compareSchemas(schemaToCompareWith, AsyncAPIFormatSchema::class.java, schemaProvider.asyncAPIFormatSchemaJsonV2_1_0()) - } - - @ArgumentsSource(AsyncAPISchemasYamlFormatV2_1_0::class) - @ParameterizedTest(name = "Read: {0}") - fun yaml(schemaToCompareWith: String, schemaProvider: SchemaProvider) { - compareSchemas(schemaToCompareWith, AsyncAPIFormatSchema::class.java, schemaProvider.asyncAPIFormatSchemaYamlV2_1_0()) - } - - } + inner class V2_1_0: AsyncAPIFormatSchemaV2_1_0Test() @Nested @DisplayName("2.2.0") - inner class V2_2_0 { - - @ArgumentsSource(AsyncAPISchemasJsonFormatV2_2_0::class) - @ParameterizedTest(name = "Read: {0}") - fun json(schemaToCompareWith: String, schemaProvider: SchemaProvider) { - compareSchemas(schemaToCompareWith, AsyncAPIFormatSchema::class.java, schemaProvider.asyncAPIFormatSchemaJsonV2_2_0()) - } - - @ArgumentsSource(AsyncAPISchemasYamlFormatV2_2_0::class) - @ParameterizedTest(name = "Read: {0}") - fun yaml(schemaToCompareWith: String, schemaProvider: SchemaProvider) { - compareSchemas(schemaToCompareWith, AsyncAPIFormatSchema::class.java, schemaProvider.asyncAPIFormatSchemaYamlV2_2_0()) - } - - } + inner class V2_2_0: AsyncAPIFormatSchemaV2_2_0Test() @Nested @DisplayName("2.3.0") - inner class V2_3_0 { - - @ArgumentsSource(AsyncAPISchemasJsonFormatV2_3_0::class) - @ParameterizedTest(name = "Read: {0}") - fun json(schemaToCompareWith: String, schemaProvider: SchemaProvider) { - compareSchemas(schemaToCompareWith, AsyncAPIFormatSchema::class.java, schemaProvider.asyncAPIFormatSchemaJsonV2_3_0()) - } - - @ArgumentsSource(AsyncAPISchemasYamlFormatV2_3_0::class) - @ParameterizedTest(name = "Read: {0}") - fun yaml(schemaToCompareWith: String, schemaProvider: SchemaProvider) { - compareSchemas(schemaToCompareWith, AsyncAPIFormatSchema::class.java, schemaProvider.asyncAPIFormatSchemaYamlV2_3_0()) - } - - } + inner class V2_3_0: AsyncAPIFormatSchemaV2_3_0Test() @Nested @DisplayName("2.4.0") - inner class V2_4_0 { - - @ArgumentsSource(AsyncAPISchemasJsonFormatV2_4_0::class) - @ParameterizedTest(name = "Read: {0}") - fun json(schemaToCompareWith: String, schemaProvider: SchemaProvider) { - compareSchemas(schemaToCompareWith, AsyncAPIFormatSchema::class.java, schemaProvider.asyncAPIFormatSchemaJsonV2_4_0()) - } - - @ArgumentsSource(AsyncAPISchemasYamlFormatV2_4_0::class) - @ParameterizedTest(name = "Read: {0}") - fun yaml(schemaToCompareWith: String, schemaProvider: SchemaProvider) { - compareSchemas(schemaToCompareWith, AsyncAPIFormatSchema::class.java, schemaProvider.asyncAPIFormatSchemaYamlV2_4_0()) - } - - } + inner class V2_4_0: AsyncAPIFormatSchemaV2_4_0Test() @Nested @DisplayName("2.5.0") - inner class V2_5_0 { - - @ArgumentsSource(AsyncAPISchemasJsonFormatV2_5_0::class) - @ParameterizedTest(name = "Read: {0}") - fun json(schemaToCompareWith: String, schemaProvider: SchemaProvider) { - compareSchemas(schemaToCompareWith, AsyncAPIFormatSchema::class.java, schemaProvider.asyncAPIFormatSchemaJsonV2_5_0()) - } - - @ArgumentsSource(AsyncAPISchemasYamlFormatV2_5_0::class) - @ParameterizedTest(name = "Read: {0}") - fun yaml(schemaToCompareWith: String, schemaProvider: SchemaProvider) { - compareSchemas(schemaToCompareWith, AsyncAPIFormatSchema::class.java, schemaProvider.asyncAPIFormatSchemaYamlV2_5_0()) - } - - } + inner class V2_5_0: AsyncAPIFormatSchemaV2_5_0Test() @Nested @DisplayName("2.6.0") - inner class V2_6_0 { - - @ArgumentsSource(AsyncAPISchemasJsonFormatV2_6_0::class) - @ParameterizedTest(name = "Read: {0}") - fun json(schemaToCompareWith: String, schemaProvider: SchemaProvider) { - compareSchemas(schemaToCompareWith, AsyncAPIFormatSchema::class.java, schemaProvider.asyncAPIFormatSchemaJsonV2_6_0()) - } - - @ArgumentsSource(AsyncAPISchemasYamlFormatV2_6_0::class) - @ParameterizedTest(name = "Read: {0}") - fun yaml(schemaToCompareWith: String, schemaProvider: SchemaProvider) { - compareSchemas(schemaToCompareWith, AsyncAPIFormatSchema::class.java, schemaProvider.asyncAPIFormatSchemaYamlV2_6_0()) - } - - } + inner class V2_6_0: AsyncAPIFormatSchemaV2_6_0Test() @Nested @DisplayName("3.0.0") - inner class V3_0_0 { - - @ArgumentsSource(AsyncAPISchemasJsonFormatV3_0_0::class) - @ParameterizedTest(name = "Read: {0}") - fun json(schemaToCompareWith: String, schemaProvider: SchemaProvider) { - compareSchemas(schemaToCompareWith, AsyncAPIFormatSchema::class.java, schemaProvider.asyncAPIFormatSchemaJsonV3_0_0()) - } - - @ArgumentsSource(AsyncAPISchemasYamlFormatV3_0_0::class) - @ParameterizedTest(name = "Read: {0}") - fun yaml(schemaToCompareWith: String, schemaProvider: SchemaProvider) { - compareSchemas(schemaToCompareWith, AsyncAPIFormatSchema::class.java, schemaProvider.asyncAPIFormatSchemaYamlV3_0_0()) - } - - } + inner class V3_0_0: AsyncAPIFormatSchemaV3_0_0Test() @Nested @DisplayName("MultiFormatSchema with empty schemaFormat is AsyncAPI Schema") - inner class EmptySchemaFormat { - - @ArgumentsSource(JsonSchemasWithEmptySchemaFormat::class) - @ParameterizedTest(name = "Read: {0}") - fun json(schemaToCompareWith: String, schemaProvider: SchemaProvider) { - compareSchemas(schemaToCompareWith, AsyncAPIFormatSchema::class.java, schemaProvider.asyncAPIFormatSchemaEmptySchemaFormat()) - } - - @ArgumentsSource(YamlSchemasWithEmptySchemaFormat::class) - @ParameterizedTest(name = "Read: {0}") - fun yaml(schemaToCompareWith: String, schemaProvider: SchemaProvider) { - compareSchemas(schemaToCompareWith, AsyncAPIFormatSchema::class.java, schemaProvider.asyncAPIFormatSchemaEmptySchemaFormat()) - } - - } + inner class EmptySchemaFormat: EmptySchemaFormatTest() @Nested @DisplayName("MultiFormatSchema with null schemaFormat is AsyncAPI Schema") - inner class NullSchemaFormat { - - @ArgumentsSource(JsonSchemasWithNullSchemaFormat::class) - @ParameterizedTest(name = "Read: {0}") - fun json(schemaToCompareWith: String, schemaProvider: SchemaProvider) { - compareSchemas(schemaToCompareWith, AsyncAPIFormatSchema::class.java, schemaProvider.asyncAPIFormatSchemaEmptySchemaFormat()) - } - - @ArgumentsSource(YamlSchemasWithNullSchemaFormat::class) - @ParameterizedTest(name = "Read: {0}") - fun yaml(schemaToCompareWith: String, schemaProvider: SchemaProvider) { - compareSchemas(schemaToCompareWith, AsyncAPIFormatSchema::class.java, schemaProvider.asyncAPIFormatSchemaEmptySchemaFormat()) - } - - } + inner class NullSchemaFormat: NullSchemaFormatTest() @Nested @DisplayName("MultiFormatSchema without schemaFormat is AsyncAPI Schema") - inner class WithoutSchemaFormat { - - @ArgumentsSource(JsonSchemasWithoutSchemaFormat::class) - @ParameterizedTest(name = "Read: {0}") - fun json(schemaToCompareWith: String, schemaProvider: SchemaProvider) { - compareSchemas(schemaToCompareWith, AsyncAPIFormatSchema::class.java, schemaProvider.asyncAPIFormatSchemaEmptySchemaFormat()) - } - - @ArgumentsSource(YamlSchemasWithoutSchemaFormat::class) - @ParameterizedTest(name = "Read: {0}") - fun yaml(schemaToCompareWith: String, schemaProvider: SchemaProvider) { - compareSchemas(schemaToCompareWith, AsyncAPIFormatSchema::class.java, schemaProvider.asyncAPIFormatSchemaEmptySchemaFormat()) - } - - } + inner class WithoutSchemaFormat: WithoutSchemaFormatTest() } @@ -311,356 +157,4 @@ class MultiFormatSchemaTest { } - class AsyncAPISchemasJsonFormatV2_0_0: ArgumentsProvider { - - override fun provideArguments(context: ExtensionContext?): Stream { - return Stream.of( - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.0.0/arrays.schema.json", ArraysSchemaTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.0.0/complex-object.schema.json", ComplexObjectTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.0.0/conditional-validation-if-else.schema.json", ConditionalValidationIfElse()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.0.0/draft-07-core-schema-meta-schema.json", Draft07CoreSchemaMetaSchemaTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.0.0/enumerated-values.schema.json", EnumeratedValuesTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.0.0/person.schema.json", PersonTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.0.0/regex-pattern.schema.json", RegexPatternTest()) - ) - } - - } - - class AsyncAPISchemasYamlFormatV2_0_0: ArgumentsProvider { - - override fun provideArguments(context: ExtensionContext?): Stream { - return Stream.of( - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.0.0/arrays.schema.yaml", ArraysSchemaTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.0.0/complex-object.schema.yaml", ComplexObjectTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.0.0/conditional-validation-if-else.schema.yaml", ConditionalValidationIfElse()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.0.0/draft-07-core-schema-meta-schema.yaml", Draft07CoreSchemaMetaSchemaTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.0.0/enumerated-values.schema.yaml", EnumeratedValuesTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.0.0/person.schema.yaml", PersonTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.0.0/regex-pattern.schema.yaml", RegexPatternTest()) - ) - } - - } - - class AsyncAPISchemasJsonFormatV2_1_0: ArgumentsProvider { - - override fun provideArguments(context: ExtensionContext?): Stream { - return Stream.of( - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.1.0/arrays.schema.json", ArraysSchemaTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.1.0/complex-object.schema.json", ComplexObjectTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.1.0/conditional-validation-if-else.schema.json", ConditionalValidationIfElse()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.1.0/draft-07-core-schema-meta-schema.json", Draft07CoreSchemaMetaSchemaTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.1.0/enumerated-values.schema.json", EnumeratedValuesTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.1.0/person.schema.json", PersonTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.1.0/regex-pattern.schema.json", RegexPatternTest()) - ) - } - - } - - class AsyncAPISchemasYamlFormatV2_1_0: ArgumentsProvider { - - override fun provideArguments(context: ExtensionContext?): Stream { - return Stream.of( - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.1.0/arrays.schema.yaml", ArraysSchemaTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.1.0/complex-object.schema.yaml", ComplexObjectTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.1.0/conditional-validation-if-else.schema.yaml", ConditionalValidationIfElse()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.1.0/draft-07-core-schema-meta-schema.yaml", Draft07CoreSchemaMetaSchemaTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.1.0/enumerated-values.schema.yaml", EnumeratedValuesTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.1.0/person.schema.yaml", PersonTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.1.0/regex-pattern.schema.yaml", RegexPatternTest()) - ) - } - - } - - class AsyncAPISchemasJsonFormatV2_2_0: ArgumentsProvider { - - override fun provideArguments(context: ExtensionContext?): Stream { - return Stream.of( - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.2.0/arrays.schema.json", ArraysSchemaTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.2.0/complex-object.schema.json", ComplexObjectTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.2.0/conditional-validation-if-else.schema.json", ConditionalValidationIfElse()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.2.0/draft-07-core-schema-meta-schema.json", Draft07CoreSchemaMetaSchemaTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.2.0/enumerated-values.schema.json", EnumeratedValuesTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.2.0/person.schema.json", PersonTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.2.0/regex-pattern.schema.json", RegexPatternTest()) - ) - } - - } - - class AsyncAPISchemasYamlFormatV2_2_0: ArgumentsProvider { - - override fun provideArguments(context: ExtensionContext?): Stream { - return Stream.of( - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.2.0/arrays.schema.yaml", ArraysSchemaTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.2.0/complex-object.schema.yaml", ComplexObjectTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.2.0/conditional-validation-if-else.schema.yaml", ConditionalValidationIfElse()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.2.0/draft-07-core-schema-meta-schema.yaml", Draft07CoreSchemaMetaSchemaTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.2.0/enumerated-values.schema.yaml", EnumeratedValuesTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.2.0/person.schema.yaml", PersonTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.2.0/regex-pattern.schema.yaml", RegexPatternTest()) - ) - } - - } - - class AsyncAPISchemasJsonFormatV2_3_0: ArgumentsProvider { - - override fun provideArguments(context: ExtensionContext?): Stream { - return Stream.of( - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.3.0/arrays.schema.json", ArraysSchemaTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.3.0/complex-object.schema.json", ComplexObjectTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.3.0/conditional-validation-if-else.schema.json", ConditionalValidationIfElse()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.3.0/draft-07-core-schema-meta-schema.json", Draft07CoreSchemaMetaSchemaTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.3.0/enumerated-values.schema.json", EnumeratedValuesTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.3.0/person.schema.json", PersonTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.3.0/regex-pattern.schema.json", RegexPatternTest()) - ) - } - - } - - class AsyncAPISchemasYamlFormatV2_3_0: ArgumentsProvider { - - override fun provideArguments(context: ExtensionContext?): Stream { - return Stream.of( - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.3.0/arrays.schema.yaml", ArraysSchemaTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.3.0/complex-object.schema.yaml", ComplexObjectTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.3.0/conditional-validation-if-else.schema.yaml", ConditionalValidationIfElse()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.3.0/draft-07-core-schema-meta-schema.yaml", Draft07CoreSchemaMetaSchemaTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.3.0/enumerated-values.schema.yaml", EnumeratedValuesTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.3.0/person.schema.yaml", PersonTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.3.0/regex-pattern.schema.yaml", RegexPatternTest()) - ) - } - - } - - class AsyncAPISchemasJsonFormatV2_4_0: ArgumentsProvider { - - override fun provideArguments(context: ExtensionContext?): Stream { - return Stream.of( - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.4.0/arrays.schema.json", ArraysSchemaTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.4.0/complex-object.schema.json", ComplexObjectTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.4.0/conditional-validation-if-else.schema.json", ConditionalValidationIfElse()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.4.0/draft-07-core-schema-meta-schema.json", Draft07CoreSchemaMetaSchemaTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.4.0/enumerated-values.schema.json", EnumeratedValuesTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.4.0/person.schema.json", PersonTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.4.0/regex-pattern.schema.json", RegexPatternTest()) - ) - } - - } - - class AsyncAPISchemasYamlFormatV2_4_0: ArgumentsProvider { - - override fun provideArguments(context: ExtensionContext?): Stream { - return Stream.of( - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.4.0/arrays.schema.yaml", ArraysSchemaTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.4.0/complex-object.schema.yaml", ComplexObjectTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.4.0/conditional-validation-if-else.schema.yaml", ConditionalValidationIfElse()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.4.0/draft-07-core-schema-meta-schema.yaml", Draft07CoreSchemaMetaSchemaTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.4.0/enumerated-values.schema.yaml", EnumeratedValuesTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.4.0/person.schema.yaml", PersonTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.4.0/regex-pattern.schema.yaml", RegexPatternTest()) - ) - } - - } - - class AsyncAPISchemasJsonFormatV2_5_0: ArgumentsProvider { - - override fun provideArguments(context: ExtensionContext?): Stream { - return Stream.of( - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.5.0/arrays.schema.json", ArraysSchemaTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.5.0/complex-object.schema.json", ComplexObjectTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.5.0/conditional-validation-if-else.schema.json", ConditionalValidationIfElse()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.5.0/draft-07-core-schema-meta-schema.json", Draft07CoreSchemaMetaSchemaTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.5.0/enumerated-values.schema.json", EnumeratedValuesTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.5.0/person.schema.json", PersonTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.5.0/regex-pattern.schema.json", RegexPatternTest()) - ) - } - - } - - class AsyncAPISchemasYamlFormatV2_5_0: ArgumentsProvider { - - override fun provideArguments(context: ExtensionContext?): Stream { - return Stream.of( - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.5.0/arrays.schema.yaml", ArraysSchemaTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.5.0/complex-object.schema.yaml", ComplexObjectTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.5.0/conditional-validation-if-else.schema.yaml", ConditionalValidationIfElse()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.5.0/draft-07-core-schema-meta-schema.yaml", Draft07CoreSchemaMetaSchemaTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.5.0/enumerated-values.schema.yaml", EnumeratedValuesTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.5.0/person.schema.yaml", PersonTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.5.0/regex-pattern.schema.yaml", RegexPatternTest()) - ) - } - - } - - class AsyncAPISchemasJsonFormatV2_6_0: ArgumentsProvider { - - override fun provideArguments(context: ExtensionContext?): Stream { - return Stream.of( - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.6.0/arrays.schema.json", ArraysSchemaTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.6.0/complex-object.schema.json", ComplexObjectTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.6.0/conditional-validation-if-else.schema.json", ConditionalValidationIfElse()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.6.0/draft-07-core-schema-meta-schema.json", Draft07CoreSchemaMetaSchemaTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.6.0/enumerated-values.schema.json", EnumeratedValuesTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.6.0/person.schema.json", PersonTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.6.0/regex-pattern.schema.json", RegexPatternTest()) - ) - } - - } - - class AsyncAPISchemasYamlFormatV2_6_0: ArgumentsProvider { - - override fun provideArguments(context: ExtensionContext?): Stream { - return Stream.of( - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.6.0/arrays.schema.yaml", ArraysSchemaTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.6.0/complex-object.schema.yaml", ComplexObjectTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.6.0/conditional-validation-if-else.schema.yaml", ConditionalValidationIfElse()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.6.0/draft-07-core-schema-meta-schema.yaml", Draft07CoreSchemaMetaSchemaTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.6.0/enumerated-values.schema.yaml", EnumeratedValuesTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.6.0/person.schema.yaml", PersonTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/2.6.0/regex-pattern.schema.yaml", RegexPatternTest()) - ) - } - - } - - class AsyncAPISchemasJsonFormatV3_0_0: ArgumentsProvider { - - override fun provideArguments(context: ExtensionContext?): Stream { - return Stream.of( - Arguments.of("/json/v3/schema/multiformat/asyncapi/3.0.0/arrays.schema.json", ArraysSchemaTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/3.0.0/complex-object.schema.json", ComplexObjectTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/3.0.0/conditional-validation-if-else.schema.json", ConditionalValidationIfElse()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/3.0.0/draft-07-core-schema-meta-schema.json", Draft07CoreSchemaMetaSchemaTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/3.0.0/enumerated-values.schema.json", EnumeratedValuesTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/3.0.0/person.schema.json", PersonTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/3.0.0/regex-pattern.schema.json", RegexPatternTest()) - ) - } - - } - - class AsyncAPISchemasYamlFormatV3_0_0: ArgumentsProvider { - - override fun provideArguments(context: ExtensionContext?): Stream { - return Stream.of( - Arguments.of("/json/v3/schema/multiformat/asyncapi/3.0.0/arrays.schema.yaml", ArraysSchemaTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/3.0.0/complex-object.schema.yaml", ComplexObjectTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/3.0.0/conditional-validation-if-else.schema.yaml", ConditionalValidationIfElse()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/3.0.0/draft-07-core-schema-meta-schema.yaml", Draft07CoreSchemaMetaSchemaTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/3.0.0/enumerated-values.schema.yaml", EnumeratedValuesTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/3.0.0/person.schema.yaml", PersonTest()), - Arguments.of("/json/v3/schema/multiformat/asyncapi/3.0.0/regex-pattern.schema.yaml", RegexPatternTest()) - ) - } - - } - - class JsonSchemasWithEmptySchemaFormat: ArgumentsProvider { - - override fun provideArguments(context: ExtensionContext?): Stream { - return Stream.of( - Arguments.of("/json/v3/schema/multiformat/schemaFormat is empty/arrays.schema.json", ArraysSchemaTest()), - Arguments.of("/json/v3/schema/multiformat/schemaFormat is empty/complex-object.schema.json", ComplexObjectTest()), - Arguments.of("/json/v3/schema/multiformat/schemaFormat is empty/conditional-validation-if-else.schema.json", ConditionalValidationIfElse()), - Arguments.of("/json/v3/schema/multiformat/schemaFormat is empty/draft-07-core-schema-meta-schema.json", Draft07CoreSchemaMetaSchemaTest()), - Arguments.of("/json/v3/schema/multiformat/schemaFormat is empty/enumerated-values.schema.json", EnumeratedValuesTest()), - Arguments.of("/json/v3/schema/multiformat/schemaFormat is empty/person.schema.json", PersonTest()), - Arguments.of("/json/v3/schema/multiformat/schemaFormat is empty/regex-pattern.schema.json", RegexPatternTest()) - ) - } - - } - - class YamlSchemasWithEmptySchemaFormat: ArgumentsProvider { - - override fun provideArguments(context: ExtensionContext?): Stream { - return Stream.of( - Arguments.of("/json/v3/schema/multiformat/schemaFormat is empty/arrays.schema.yaml", ArraysSchemaTest()), - Arguments.of("/json/v3/schema/multiformat/schemaFormat is empty/complex-object.schema.yaml", ComplexObjectTest()), - Arguments.of("/json/v3/schema/multiformat/schemaFormat is empty/conditional-validation-if-else.schema.yaml", ConditionalValidationIfElse()), - Arguments.of("/json/v3/schema/multiformat/schemaFormat is empty/draft-07-core-schema-meta-schema.yaml", Draft07CoreSchemaMetaSchemaTest()), - Arguments.of("/json/v3/schema/multiformat/schemaFormat is empty/enumerated-values.schema.yaml", EnumeratedValuesTest()), - Arguments.of("/json/v3/schema/multiformat/schemaFormat is empty/person.schema.yaml", PersonTest()), - Arguments.of("/json/v3/schema/multiformat/schemaFormat is empty/regex-pattern.schema.yaml", RegexPatternTest()) - ) - } - - } - - class JsonSchemasWithNullSchemaFormat: ArgumentsProvider { - - override fun provideArguments(context: ExtensionContext?): Stream { - return Stream.of( - Arguments.of("/json/v3/schema/multiformat/schemaFormat is null/arrays.schema.json", ArraysSchemaTest()), - Arguments.of("/json/v3/schema/multiformat/schemaFormat is null/complex-object.schema.json", ComplexObjectTest()), - Arguments.of("/json/v3/schema/multiformat/schemaFormat is null/conditional-validation-if-else.schema.json", ConditionalValidationIfElse()), - Arguments.of("/json/v3/schema/multiformat/schemaFormat is null/draft-07-core-schema-meta-schema.json", Draft07CoreSchemaMetaSchemaTest()), - Arguments.of("/json/v3/schema/multiformat/schemaFormat is null/enumerated-values.schema.json", EnumeratedValuesTest()), - Arguments.of("/json/v3/schema/multiformat/schemaFormat is null/person.schema.json", PersonTest()), - Arguments.of("/json/v3/schema/multiformat/schemaFormat is null/regex-pattern.schema.json", RegexPatternTest()) - ) - } - - } - - class YamlSchemasWithNullSchemaFormat: ArgumentsProvider { - - override fun provideArguments(context: ExtensionContext?): Stream { - return Stream.of( - Arguments.of("/json/v3/schema/multiformat/schemaFormat is null/arrays.schema.yaml", ArraysSchemaTest()), - Arguments.of("/json/v3/schema/multiformat/schemaFormat is null/complex-object.schema.yaml", ComplexObjectTest()), - Arguments.of("/json/v3/schema/multiformat/schemaFormat is null/conditional-validation-if-else.schema.yaml", ConditionalValidationIfElse()), - Arguments.of("/json/v3/schema/multiformat/schemaFormat is null/draft-07-core-schema-meta-schema.yaml", Draft07CoreSchemaMetaSchemaTest()), - Arguments.of("/json/v3/schema/multiformat/schemaFormat is null/enumerated-values.schema.yaml", EnumeratedValuesTest()), - Arguments.of("/json/v3/schema/multiformat/schemaFormat is null/person.schema.yaml", PersonTest()), - Arguments.of("/json/v3/schema/multiformat/schemaFormat is null/regex-pattern.schema.yaml", RegexPatternTest()) - ) - } - - } - - class JsonSchemasWithoutSchemaFormat: ArgumentsProvider { - - override fun provideArguments(context: ExtensionContext?): Stream { - return Stream.of( - Arguments.of("/json/v3/schema/multiformat/without schemaFormat/arrays.schema.json", ArraysSchemaTest()), - Arguments.of("/json/v3/schema/multiformat/without schemaFormat/complex-object.schema.json", ComplexObjectTest()), - Arguments.of("/json/v3/schema/multiformat/without schemaFormat/conditional-validation-if-else.schema.json", ConditionalValidationIfElse()), - Arguments.of("/json/v3/schema/multiformat/without schemaFormat/draft-07-core-schema-meta-schema.json", Draft07CoreSchemaMetaSchemaTest()), - Arguments.of("/json/v3/schema/multiformat/without schemaFormat/enumerated-values.schema.json", EnumeratedValuesTest()), - Arguments.of("/json/v3/schema/multiformat/without schemaFormat/person.schema.json", PersonTest()), - Arguments.of("/json/v3/schema/multiformat/without schemaFormat/regex-pattern.schema.json", RegexPatternTest()) - ) - } - - } - - class YamlSchemasWithoutSchemaFormat: ArgumentsProvider { - - override fun provideArguments(context: ExtensionContext?): Stream { - return Stream.of( - Arguments.of("/json/v3/schema/multiformat/without schemaFormat/arrays.schema.yaml", ArraysSchemaTest()), - Arguments.of("/json/v3/schema/multiformat/without schemaFormat/complex-object.schema.yaml", ComplexObjectTest()), - Arguments.of("/json/v3/schema/multiformat/without schemaFormat/conditional-validation-if-else.schema.yaml", ConditionalValidationIfElse()), - Arguments.of("/json/v3/schema/multiformat/without schemaFormat/draft-07-core-schema-meta-schema.yaml", Draft07CoreSchemaMetaSchemaTest()), - Arguments.of("/json/v3/schema/multiformat/without schemaFormat/enumerated-values.schema.yaml", EnumeratedValuesTest()), - Arguments.of("/json/v3/schema/multiformat/without schemaFormat/person.schema.yaml", PersonTest()), - Arguments.of("/json/v3/schema/multiformat/without schemaFormat/regex-pattern.schema.yaml", RegexPatternTest()) - ) - } - - } - } \ No newline at end of file diff --git a/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/asyncapi/AsyncAPIFormatSchemaTest.kt b/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/asyncapi/AsyncAPIFormatSchemaTest.kt new file mode 100644 index 00000000..e076b795 --- /dev/null +++ b/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/asyncapi/AsyncAPIFormatSchemaTest.kt @@ -0,0 +1,36 @@ +package com.asyncapi.v3.schema.multiformat.asyncapi + +import com.asyncapi.v3.ClasspathUtils +import com.asyncapi.v3.schema.multiformat.AsyncAPIFormatSchema +import com.fasterxml.jackson.annotation.JsonInclude +import com.fasterxml.jackson.databind.ObjectMapper +import com.fasterxml.jackson.dataformat.yaml.YAMLFactory +import org.junit.jupiter.api.Assertions + +abstract class AsyncAPIFormatSchemaTest { + + private val objectMapper: ObjectMapper = ObjectMapper(YAMLFactory()) + .setSerializationInclusion(JsonInclude.Include.NON_NULL) + .findAndRegisterModules() + + fun compareSchemas( + openAPIFormatSchemaToCompareWithFilePath: String, + schemaToCheck: AsyncAPIFormatSchema + ) { + val schemaAsJson = ClasspathUtils.readAsString(openAPIFormatSchemaToCompareWithFilePath) + val schema = objectMapper.readValue(schemaAsJson, AsyncAPIFormatSchema::class.java) + + Assertions.assertEquals(schema, schemaToCheck) + } + + abstract fun parseJson( + asyncAPIFormatSchemaToCompareWithFilePath: String, + asyncAPIFormatSchema: AsyncAPIFormatSchema + ) + + abstract fun parseYaml( + asyncAPIFormatSchemaToCompareWithFilePath: String, + asyncAPIFormatSchema: AsyncAPIFormatSchema + ) + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/asyncapi/AsyncAPIFormatSchemaV2_0_0Test.kt b/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/asyncapi/AsyncAPIFormatSchemaV2_0_0Test.kt new file mode 100644 index 00000000..6c70dda0 --- /dev/null +++ b/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/asyncapi/AsyncAPIFormatSchemaV2_0_0Test.kt @@ -0,0 +1,164 @@ +package com.asyncapi.v3.schema.multiformat.asyncapi + +import com.asyncapi.v3.schema.json.* +import com.asyncapi.v3.schema.multiformat.AsyncAPIFormatSchema +import org.junit.jupiter.api.extension.ExtensionContext +import org.junit.jupiter.params.ParameterizedTest +import org.junit.jupiter.params.provider.Arguments +import org.junit.jupiter.params.provider.ArgumentsProvider +import org.junit.jupiter.params.provider.ArgumentsSource +import java.util.stream.Stream + +abstract class AsyncAPIFormatSchemaV2_0_0Test: AsyncAPIFormatSchemaTest() { + + @ArgumentsSource(JsonFormat::class) + @ParameterizedTest(name = "Read: {0}") + override fun parseJson( + asyncAPIFormatSchemaToCompareWithFilePath: String, + asyncAPIFormatSchema: AsyncAPIFormatSchema + ) { + compareSchemas(asyncAPIFormatSchemaToCompareWithFilePath, asyncAPIFormatSchema) + } + + @ArgumentsSource(YamlFormat::class) + @ParameterizedTest(name = "Read: {0}") + override fun parseYaml( + asyncAPIFormatSchemaToCompareWithFilePath: String, + asyncAPIFormatSchema: AsyncAPIFormatSchema + ) { + compareSchemas(asyncAPIFormatSchemaToCompareWithFilePath, asyncAPIFormatSchema) + } + + class JsonFormat: ArgumentsProvider { + + override fun provideArguments(context: ExtensionContext?): Stream { + return Stream.of( + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi+json/arrays.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=2.0.0", ArraysSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi+json/complex-object.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=2.0.0", ComplexObjectTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi+json/conditional-validation-if-else.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=2.0.0", ConditionalValidationIfElse().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi+json/draft-07-core-schema-meta-schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=2.0.0", Draft07CoreSchemaMetaSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi+json/enumerated-values.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=2.0.0", EnumeratedValuesTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi+json/person.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=2.0.0", PersonTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi+json/regex-pattern.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=2.0.0", RegexPatternTest().asyncAPISchema()) + ), + // + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/arrays.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.0.0", ArraysSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/complex-object.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.0.0", ComplexObjectTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.0.0", ConditionalValidationIfElse().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.0.0", Draft07CoreSchemaMetaSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/enumerated-values.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.0.0", EnumeratedValuesTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/person.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.0.0", PersonTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/regex-pattern.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.0.0", RegexPatternTest().asyncAPISchema()) + ) + ) + } + + } + + class YamlFormat: ArgumentsProvider { + + override fun provideArguments(context: ExtensionContext?): Stream { + return Stream.of( + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi+yaml/arrays.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=2.0.0", ArraysSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi+yaml/complex-object.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=2.0.0", ComplexObjectTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi+yaml/conditional-validation-if-else.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=2.0.0", ConditionalValidationIfElse().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi+yaml/draft-07-core-schema-meta-schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=2.0.0", Draft07CoreSchemaMetaSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi+yaml/enumerated-values.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=2.0.0", EnumeratedValuesTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi+yaml/person.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=2.0.0", PersonTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi+yaml/regex-pattern.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=2.0.0", RegexPatternTest().asyncAPISchema()) + ), + // + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/arrays.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.0.0", ArraysSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/complex-object.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.0.0", ComplexObjectTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.0.0", ConditionalValidationIfElse().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.0.0", Draft07CoreSchemaMetaSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/enumerated-values.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.0.0", EnumeratedValuesTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/person.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.0.0", PersonTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/regex-pattern.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.0.0", RegexPatternTest().asyncAPISchema()) + ) + ) + } + + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/asyncapi/AsyncAPIFormatSchemaV2_1_0Test.kt b/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/asyncapi/AsyncAPIFormatSchemaV2_1_0Test.kt new file mode 100644 index 00000000..fde6fb5c --- /dev/null +++ b/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/asyncapi/AsyncAPIFormatSchemaV2_1_0Test.kt @@ -0,0 +1,164 @@ +package com.asyncapi.v3.schema.multiformat.asyncapi + +import com.asyncapi.v3.schema.json.* +import com.asyncapi.v3.schema.multiformat.AsyncAPIFormatSchema +import org.junit.jupiter.api.extension.ExtensionContext +import org.junit.jupiter.params.ParameterizedTest +import org.junit.jupiter.params.provider.Arguments +import org.junit.jupiter.params.provider.ArgumentsProvider +import org.junit.jupiter.params.provider.ArgumentsSource +import java.util.stream.Stream + +abstract class AsyncAPIFormatSchemaV2_1_0Test: AsyncAPIFormatSchemaTest() { + + @ArgumentsSource(JsonFormat::class) + @ParameterizedTest(name = "Read: {0}") + override fun parseJson( + asyncAPIFormatSchemaToCompareWithFilePath: String, + asyncAPIFormatSchema: AsyncAPIFormatSchema + ) { + compareSchemas(asyncAPIFormatSchemaToCompareWithFilePath, asyncAPIFormatSchema) + } + + @ArgumentsSource(YamlFormat::class) + @ParameterizedTest(name = "Read: {0}") + override fun parseYaml( + asyncAPIFormatSchemaToCompareWithFilePath: String, + asyncAPIFormatSchema: AsyncAPIFormatSchema + ) { + compareSchemas(asyncAPIFormatSchemaToCompareWithFilePath, asyncAPIFormatSchema) + } + + class JsonFormat: ArgumentsProvider { + + override fun provideArguments(context: ExtensionContext?): Stream { + return Stream.of( + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi+json/arrays.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=2.1.0", ArraysSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi+json/complex-object.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=2.1.0", ComplexObjectTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi+json/conditional-validation-if-else.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=2.1.0", ConditionalValidationIfElse().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi+json/draft-07-core-schema-meta-schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=2.1.0", Draft07CoreSchemaMetaSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi+json/enumerated-values.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=2.1.0", EnumeratedValuesTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi+json/person.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=2.1.0", PersonTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi+json/regex-pattern.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=2.1.0", RegexPatternTest().asyncAPISchema()) + ), + // + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/arrays.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.1.0", ArraysSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/complex-object.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.1.0", ComplexObjectTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.1.0", ConditionalValidationIfElse().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.1.0", Draft07CoreSchemaMetaSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/enumerated-values.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.1.0", EnumeratedValuesTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/person.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.1.0", PersonTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/regex-pattern.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.1.0", RegexPatternTest().asyncAPISchema()) + ) + ) + } + + } + + class YamlFormat: ArgumentsProvider { + + override fun provideArguments(context: ExtensionContext?): Stream { + return Stream.of( + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi+yaml/arrays.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=2.1.0", ArraysSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi+yaml/complex-object.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=2.1.0", ComplexObjectTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi+yaml/conditional-validation-if-else.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=2.1.0", ConditionalValidationIfElse().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi+yaml/draft-07-core-schema-meta-schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=2.1.0", Draft07CoreSchemaMetaSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi+yaml/enumerated-values.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=2.1.0", EnumeratedValuesTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi+yaml/person.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=2.1.0", PersonTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi+yaml/regex-pattern.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=2.1.0", RegexPatternTest().asyncAPISchema()) + ), + // + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/arrays.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.1.0", ArraysSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/complex-object.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.1.0", ComplexObjectTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.1.0", ConditionalValidationIfElse().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.1.0", Draft07CoreSchemaMetaSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/enumerated-values.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.1.0", EnumeratedValuesTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/person.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.1.0", PersonTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/regex-pattern.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.1.0", RegexPatternTest().asyncAPISchema()) + ) + ) + } + + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/asyncapi/AsyncAPIFormatSchemaV2_2_0Test.kt b/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/asyncapi/AsyncAPIFormatSchemaV2_2_0Test.kt new file mode 100644 index 00000000..205bdd81 --- /dev/null +++ b/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/asyncapi/AsyncAPIFormatSchemaV2_2_0Test.kt @@ -0,0 +1,164 @@ +package com.asyncapi.v3.schema.multiformat.asyncapi + +import com.asyncapi.v3.schema.json.* +import com.asyncapi.v3.schema.multiformat.AsyncAPIFormatSchema +import org.junit.jupiter.api.extension.ExtensionContext +import org.junit.jupiter.params.ParameterizedTest +import org.junit.jupiter.params.provider.Arguments +import org.junit.jupiter.params.provider.ArgumentsProvider +import org.junit.jupiter.params.provider.ArgumentsSource +import java.util.stream.Stream + +abstract class AsyncAPIFormatSchemaV2_2_0Test: AsyncAPIFormatSchemaTest() { + + @ArgumentsSource(JsonFormat::class) + @ParameterizedTest(name = "Read: {0}") + override fun parseJson( + asyncAPIFormatSchemaToCompareWithFilePath: String, + asyncAPIFormatSchema: AsyncAPIFormatSchema + ) { + compareSchemas(asyncAPIFormatSchemaToCompareWithFilePath, asyncAPIFormatSchema) + } + + @ArgumentsSource(YamlFormat::class) + @ParameterizedTest(name = "Read: {0}") + override fun parseYaml( + asyncAPIFormatSchemaToCompareWithFilePath: String, + asyncAPIFormatSchema: AsyncAPIFormatSchema + ) { + compareSchemas(asyncAPIFormatSchemaToCompareWithFilePath, asyncAPIFormatSchema) + } + + class JsonFormat: ArgumentsProvider { + + override fun provideArguments(context: ExtensionContext?): Stream { + return Stream.of( + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi+json/arrays.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=2.2.0", ArraysSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi+json/complex-object.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=2.2.0", ComplexObjectTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi+json/conditional-validation-if-else.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=2.2.0", ConditionalValidationIfElse().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi+json/draft-07-core-schema-meta-schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=2.2.0", Draft07CoreSchemaMetaSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi+json/enumerated-values.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=2.2.0", EnumeratedValuesTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi+json/person.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=2.2.0", PersonTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi+json/regex-pattern.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=2.2.0", RegexPatternTest().asyncAPISchema()) + ), + // + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/arrays.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.2.0", ArraysSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/complex-object.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.2.0", ComplexObjectTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.2.0", ConditionalValidationIfElse().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.2.0", Draft07CoreSchemaMetaSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/enumerated-values.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.2.0", EnumeratedValuesTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/person.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.2.0", PersonTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/regex-pattern.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.2.0", RegexPatternTest().asyncAPISchema()) + ) + ) + } + + } + + class YamlFormat: ArgumentsProvider { + + override fun provideArguments(context: ExtensionContext?): Stream { + return Stream.of( + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi+yaml/arrays.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=2.2.0", ArraysSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi+yaml/complex-object.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=2.2.0", ComplexObjectTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi+yaml/conditional-validation-if-else.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=2.2.0", ConditionalValidationIfElse().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi+yaml/draft-07-core-schema-meta-schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=2.2.0", Draft07CoreSchemaMetaSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi+yaml/enumerated-values.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=2.2.0", EnumeratedValuesTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi+yaml/person.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=2.2.0", PersonTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi+yaml/regex-pattern.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=2.2.0", RegexPatternTest().asyncAPISchema()) + ), + // + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/arrays.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.2.0", ArraysSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/complex-object.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.2.0", ComplexObjectTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.2.0", ConditionalValidationIfElse().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.2.0", Draft07CoreSchemaMetaSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/enumerated-values.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.2.0", EnumeratedValuesTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/person.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.2.0", PersonTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/regex-pattern.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.2.0", RegexPatternTest().asyncAPISchema()) + ) + ) + } + + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/asyncapi/AsyncAPIFormatSchemaV2_3_0Test.kt b/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/asyncapi/AsyncAPIFormatSchemaV2_3_0Test.kt new file mode 100644 index 00000000..da5fe7ad --- /dev/null +++ b/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/asyncapi/AsyncAPIFormatSchemaV2_3_0Test.kt @@ -0,0 +1,164 @@ +package com.asyncapi.v3.schema.multiformat.asyncapi + +import com.asyncapi.v3.schema.json.* +import com.asyncapi.v3.schema.multiformat.AsyncAPIFormatSchema +import org.junit.jupiter.api.extension.ExtensionContext +import org.junit.jupiter.params.ParameterizedTest +import org.junit.jupiter.params.provider.Arguments +import org.junit.jupiter.params.provider.ArgumentsProvider +import org.junit.jupiter.params.provider.ArgumentsSource +import java.util.stream.Stream + +abstract class AsyncAPIFormatSchemaV2_3_0Test: AsyncAPIFormatSchemaTest() { + + @ArgumentsSource(JsonFormat::class) + @ParameterizedTest(name = "Read: {0}") + override fun parseJson( + asyncAPIFormatSchemaToCompareWithFilePath: String, + asyncAPIFormatSchema: AsyncAPIFormatSchema + ) { + compareSchemas(asyncAPIFormatSchemaToCompareWithFilePath, asyncAPIFormatSchema) + } + + @ArgumentsSource(YamlFormat::class) + @ParameterizedTest(name = "Read: {0}") + override fun parseYaml( + asyncAPIFormatSchemaToCompareWithFilePath: String, + asyncAPIFormatSchema: AsyncAPIFormatSchema + ) { + compareSchemas(asyncAPIFormatSchemaToCompareWithFilePath, asyncAPIFormatSchema) + } + + class JsonFormat: ArgumentsProvider { + + override fun provideArguments(context: ExtensionContext?): Stream { + return Stream.of( + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi+json/arrays.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=2.3.0", ArraysSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi+json/complex-object.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=2.3.0", ComplexObjectTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi+json/conditional-validation-if-else.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=2.3.0", ConditionalValidationIfElse().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi+json/draft-07-core-schema-meta-schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=2.3.0", Draft07CoreSchemaMetaSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi+json/enumerated-values.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=2.3.0", EnumeratedValuesTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi+json/person.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=2.3.0", PersonTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi+json/regex-pattern.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=2.3.0", RegexPatternTest().asyncAPISchema()) + ), + // + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/arrays.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.3.0", ArraysSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/complex-object.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.3.0", ComplexObjectTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.3.0", ConditionalValidationIfElse().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.3.0", Draft07CoreSchemaMetaSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/enumerated-values.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.3.0", EnumeratedValuesTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/person.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.3.0", PersonTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/regex-pattern.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.3.0", RegexPatternTest().asyncAPISchema()) + ) + ) + } + + } + + class YamlFormat: ArgumentsProvider { + + override fun provideArguments(context: ExtensionContext?): Stream { + return Stream.of( + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi+yaml/arrays.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=2.3.0", ArraysSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi+yaml/complex-object.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=2.3.0", ComplexObjectTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi+yaml/conditional-validation-if-else.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=2.3.0", ConditionalValidationIfElse().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi+yaml/draft-07-core-schema-meta-schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=2.3.0", Draft07CoreSchemaMetaSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi+yaml/enumerated-values.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=2.3.0", EnumeratedValuesTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi+yaml/person.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=2.3.0", PersonTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi+yaml/regex-pattern.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=2.3.0", RegexPatternTest().asyncAPISchema()) + ), + // + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/arrays.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.3.0", ArraysSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/complex-object.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.3.0", ComplexObjectTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.3.0", ConditionalValidationIfElse().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.3.0", Draft07CoreSchemaMetaSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/enumerated-values.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.3.0", EnumeratedValuesTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/person.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.3.0", PersonTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/regex-pattern.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.3.0", RegexPatternTest().asyncAPISchema()) + ) + ) + } + + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/asyncapi/AsyncAPIFormatSchemaV2_4_0Test.kt b/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/asyncapi/AsyncAPIFormatSchemaV2_4_0Test.kt new file mode 100644 index 00000000..c7063fbc --- /dev/null +++ b/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/asyncapi/AsyncAPIFormatSchemaV2_4_0Test.kt @@ -0,0 +1,164 @@ +package com.asyncapi.v3.schema.multiformat.asyncapi + +import com.asyncapi.v3.schema.json.* +import com.asyncapi.v3.schema.multiformat.AsyncAPIFormatSchema +import org.junit.jupiter.api.extension.ExtensionContext +import org.junit.jupiter.params.ParameterizedTest +import org.junit.jupiter.params.provider.Arguments +import org.junit.jupiter.params.provider.ArgumentsProvider +import org.junit.jupiter.params.provider.ArgumentsSource +import java.util.stream.Stream + +abstract class AsyncAPIFormatSchemaV2_4_0Test: AsyncAPIFormatSchemaTest() { + + @ArgumentsSource(JsonFormat::class) + @ParameterizedTest(name = "Read: {0}") + override fun parseJson( + asyncAPIFormatSchemaToCompareWithFilePath: String, + asyncAPIFormatSchema: AsyncAPIFormatSchema + ) { + compareSchemas(asyncAPIFormatSchemaToCompareWithFilePath, asyncAPIFormatSchema) + } + + @ArgumentsSource(YamlFormat::class) + @ParameterizedTest(name = "Read: {0}") + override fun parseYaml( + asyncAPIFormatSchemaToCompareWithFilePath: String, + asyncAPIFormatSchema: AsyncAPIFormatSchema + ) { + compareSchemas(asyncAPIFormatSchemaToCompareWithFilePath, asyncAPIFormatSchema) + } + + class JsonFormat: ArgumentsProvider { + + override fun provideArguments(context: ExtensionContext?): Stream { + return Stream.of( + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi+json/arrays.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=2.4.0", ArraysSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi+json/complex-object.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=2.4.0", ComplexObjectTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi+json/conditional-validation-if-else.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=2.4.0", ConditionalValidationIfElse().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi+json/draft-07-core-schema-meta-schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=2.4.0", Draft07CoreSchemaMetaSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi+json/enumerated-values.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=2.4.0", EnumeratedValuesTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi+json/person.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=2.4.0", PersonTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi+json/regex-pattern.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=2.4.0", RegexPatternTest().asyncAPISchema()) + ), + // + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/arrays.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.4.0", ArraysSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/complex-object.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.4.0", ComplexObjectTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.4.0", ConditionalValidationIfElse().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.4.0", Draft07CoreSchemaMetaSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/enumerated-values.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.4.0", EnumeratedValuesTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/person.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.4.0", PersonTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/regex-pattern.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.4.0", RegexPatternTest().asyncAPISchema()) + ) + ) + } + + } + + class YamlFormat: ArgumentsProvider { + + override fun provideArguments(context: ExtensionContext?): Stream { + return Stream.of( + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi+yaml/arrays.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=2.4.0", ArraysSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi+yaml/complex-object.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=2.4.0", ComplexObjectTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi+yaml/conditional-validation-if-else.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=2.4.0", ConditionalValidationIfElse().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi+yaml/draft-07-core-schema-meta-schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=2.4.0", Draft07CoreSchemaMetaSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi+yaml/enumerated-values.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=2.4.0", EnumeratedValuesTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi+yaml/person.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=2.4.0", PersonTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi+yaml/regex-pattern.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=2.4.0", RegexPatternTest().asyncAPISchema()) + ), + // + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/arrays.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.4.0", ArraysSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/complex-object.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.4.0", ComplexObjectTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.4.0", ConditionalValidationIfElse().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.4.0", Draft07CoreSchemaMetaSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/enumerated-values.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.4.0", EnumeratedValuesTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/person.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.4.0", PersonTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/regex-pattern.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.4.0", RegexPatternTest().asyncAPISchema()) + ) + ) + } + + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/asyncapi/AsyncAPIFormatSchemaV2_5_0Test.kt b/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/asyncapi/AsyncAPIFormatSchemaV2_5_0Test.kt new file mode 100644 index 00000000..61424c32 --- /dev/null +++ b/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/asyncapi/AsyncAPIFormatSchemaV2_5_0Test.kt @@ -0,0 +1,164 @@ +package com.asyncapi.v3.schema.multiformat.asyncapi + +import com.asyncapi.v3.schema.json.* +import com.asyncapi.v3.schema.multiformat.AsyncAPIFormatSchema +import org.junit.jupiter.api.extension.ExtensionContext +import org.junit.jupiter.params.ParameterizedTest +import org.junit.jupiter.params.provider.Arguments +import org.junit.jupiter.params.provider.ArgumentsProvider +import org.junit.jupiter.params.provider.ArgumentsSource +import java.util.stream.Stream + +abstract class AsyncAPIFormatSchemaV2_5_0Test: AsyncAPIFormatSchemaTest() { + + @ArgumentsSource(JsonFormat::class) + @ParameterizedTest(name = "Read: {0}") + override fun parseJson( + asyncAPIFormatSchemaToCompareWithFilePath: String, + asyncAPIFormatSchema: AsyncAPIFormatSchema + ) { + compareSchemas(asyncAPIFormatSchemaToCompareWithFilePath, asyncAPIFormatSchema) + } + + @ArgumentsSource(YamlFormat::class) + @ParameterizedTest(name = "Read: {0}") + override fun parseYaml( + asyncAPIFormatSchemaToCompareWithFilePath: String, + asyncAPIFormatSchema: AsyncAPIFormatSchema + ) { + compareSchemas(asyncAPIFormatSchemaToCompareWithFilePath, asyncAPIFormatSchema) + } + + class JsonFormat: ArgumentsProvider { + + override fun provideArguments(context: ExtensionContext?): Stream { + return Stream.of( + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi+json/arrays.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=2.5.0", ArraysSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi+json/complex-object.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=2.5.0", ComplexObjectTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi+json/conditional-validation-if-else.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=2.5.0", ConditionalValidationIfElse().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi+json/draft-07-core-schema-meta-schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=2.5.0", Draft07CoreSchemaMetaSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi+json/enumerated-values.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=2.5.0", EnumeratedValuesTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi+json/person.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=2.5.0", PersonTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi+json/regex-pattern.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=2.5.0", RegexPatternTest().asyncAPISchema()) + ), + // + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/arrays.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.5.0", ArraysSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/complex-object.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.5.0", ComplexObjectTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.5.0", ConditionalValidationIfElse().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.5.0", Draft07CoreSchemaMetaSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/enumerated-values.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.5.0", EnumeratedValuesTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/person.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.5.0", PersonTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/regex-pattern.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.5.0", RegexPatternTest().asyncAPISchema()) + ) + ) + } + + } + + class YamlFormat: ArgumentsProvider { + + override fun provideArguments(context: ExtensionContext?): Stream { + return Stream.of( + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi+yaml/arrays.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=2.5.0", ArraysSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi+yaml/complex-object.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=2.5.0", ComplexObjectTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi+yaml/conditional-validation-if-else.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=2.5.0", ConditionalValidationIfElse().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi+yaml/draft-07-core-schema-meta-schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=2.5.0", Draft07CoreSchemaMetaSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi+yaml/enumerated-values.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=2.5.0", EnumeratedValuesTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi+yaml/person.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=2.5.0", PersonTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi+yaml/regex-pattern.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=2.5.0", RegexPatternTest().asyncAPISchema()) + ), + // + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/arrays.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.5.0", ArraysSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/complex-object.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.5.0", ComplexObjectTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.5.0", ConditionalValidationIfElse().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.5.0", Draft07CoreSchemaMetaSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/enumerated-values.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.5.0", EnumeratedValuesTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/person.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.5.0", PersonTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/regex-pattern.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.5.0", RegexPatternTest().asyncAPISchema()) + ) + ) + } + + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/asyncapi/AsyncAPIFormatSchemaV2_6_0Test.kt b/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/asyncapi/AsyncAPIFormatSchemaV2_6_0Test.kt new file mode 100644 index 00000000..97d059e6 --- /dev/null +++ b/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/asyncapi/AsyncAPIFormatSchemaV2_6_0Test.kt @@ -0,0 +1,164 @@ +package com.asyncapi.v3.schema.multiformat.asyncapi + +import com.asyncapi.v3.schema.json.* +import com.asyncapi.v3.schema.multiformat.AsyncAPIFormatSchema +import org.junit.jupiter.api.extension.ExtensionContext +import org.junit.jupiter.params.ParameterizedTest +import org.junit.jupiter.params.provider.Arguments +import org.junit.jupiter.params.provider.ArgumentsProvider +import org.junit.jupiter.params.provider.ArgumentsSource +import java.util.stream.Stream + +abstract class AsyncAPIFormatSchemaV2_6_0Test: AsyncAPIFormatSchemaTest() { + + @ArgumentsSource(JsonFormat::class) + @ParameterizedTest(name = "Read: {0}") + override fun parseJson( + asyncAPIFormatSchemaToCompareWithFilePath: String, + asyncAPIFormatSchema: AsyncAPIFormatSchema + ) { + compareSchemas(asyncAPIFormatSchemaToCompareWithFilePath, asyncAPIFormatSchema) + } + + @ArgumentsSource(YamlFormat::class) + @ParameterizedTest(name = "Read: {0}") + override fun parseYaml( + asyncAPIFormatSchemaToCompareWithFilePath: String, + asyncAPIFormatSchema: AsyncAPIFormatSchema + ) { + compareSchemas(asyncAPIFormatSchemaToCompareWithFilePath, asyncAPIFormatSchema) + } + + class JsonFormat: ArgumentsProvider { + + override fun provideArguments(context: ExtensionContext?): Stream { + return Stream.of( + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi+json/arrays.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=2.6.0", ArraysSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi+json/complex-object.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=2.6.0", ComplexObjectTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi+json/conditional-validation-if-else.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=2.6.0", ConditionalValidationIfElse().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi+json/draft-07-core-schema-meta-schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=2.6.0", Draft07CoreSchemaMetaSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi+json/enumerated-values.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=2.6.0", EnumeratedValuesTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi+json/person.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=2.6.0", PersonTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi+json/regex-pattern.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=2.6.0", RegexPatternTest().asyncAPISchema()) + ), + // + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/arrays.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.6.0", ArraysSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/complex-object.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.6.0", ComplexObjectTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.6.0", ConditionalValidationIfElse().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.6.0", Draft07CoreSchemaMetaSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/enumerated-values.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.6.0", EnumeratedValuesTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/person.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.6.0", PersonTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/regex-pattern.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.6.0", RegexPatternTest().asyncAPISchema()) + ) + ) + } + + } + + class YamlFormat: ArgumentsProvider { + + override fun provideArguments(context: ExtensionContext?): Stream { + return Stream.of( + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi+yaml/arrays.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=2.6.0", ArraysSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi+yaml/complex-object.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=2.6.0", ComplexObjectTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi+yaml/conditional-validation-if-else.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=2.6.0", ConditionalValidationIfElse().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi+yaml/draft-07-core-schema-meta-schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=2.6.0", Draft07CoreSchemaMetaSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi+yaml/enumerated-values.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=2.6.0", EnumeratedValuesTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi+yaml/person.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=2.6.0", PersonTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi+yaml/regex-pattern.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=2.6.0", RegexPatternTest().asyncAPISchema()) + ), + // + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/arrays.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.6.0", ArraysSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/complex-object.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.6.0", ComplexObjectTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.6.0", ConditionalValidationIfElse().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.6.0", Draft07CoreSchemaMetaSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/enumerated-values.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.6.0", EnumeratedValuesTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/person.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.6.0", PersonTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/regex-pattern.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=2.6.0", RegexPatternTest().asyncAPISchema()) + ) + ) + } + + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/asyncapi/AsyncAPIFormatSchemaV3_0_0Test.kt b/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/asyncapi/AsyncAPIFormatSchemaV3_0_0Test.kt new file mode 100644 index 00000000..1f432975 --- /dev/null +++ b/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/asyncapi/AsyncAPIFormatSchemaV3_0_0Test.kt @@ -0,0 +1,164 @@ +package com.asyncapi.v3.schema.multiformat.asyncapi + +import com.asyncapi.v3.schema.json.* +import com.asyncapi.v3.schema.multiformat.AsyncAPIFormatSchema +import org.junit.jupiter.api.extension.ExtensionContext +import org.junit.jupiter.params.ParameterizedTest +import org.junit.jupiter.params.provider.Arguments +import org.junit.jupiter.params.provider.ArgumentsProvider +import org.junit.jupiter.params.provider.ArgumentsSource +import java.util.stream.Stream + +abstract class AsyncAPIFormatSchemaV3_0_0Test: AsyncAPIFormatSchemaTest() { + + @ArgumentsSource(JsonFormat::class) + @ParameterizedTest(name = "Read: {0}") + override fun parseJson( + asyncAPIFormatSchemaToCompareWithFilePath: String, + asyncAPIFormatSchema: AsyncAPIFormatSchema + ) { + compareSchemas(asyncAPIFormatSchemaToCompareWithFilePath, asyncAPIFormatSchema) + } + + @ArgumentsSource(YamlFormat::class) + @ParameterizedTest(name = "Read: {0}") + override fun parseYaml( + asyncAPIFormatSchemaToCompareWithFilePath: String, + asyncAPIFormatSchema: AsyncAPIFormatSchema + ) { + compareSchemas(asyncAPIFormatSchemaToCompareWithFilePath, asyncAPIFormatSchema) + } + + class JsonFormat: ArgumentsProvider { + + override fun provideArguments(context: ExtensionContext?): Stream { + return Stream.of( + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi+json/arrays.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=3.0.0", ArraysSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi+json/complex-object.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=3.0.0", ComplexObjectTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi+json/conditional-validation-if-else.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=3.0.0", ConditionalValidationIfElse().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi+json/draft-07-core-schema-meta-schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=3.0.0", Draft07CoreSchemaMetaSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi+json/enumerated-values.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=3.0.0", EnumeratedValuesTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi+json/person.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=3.0.0", PersonTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi+json/regex-pattern.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=3.0.0", RegexPatternTest().asyncAPISchema()) + ), + // + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/arrays.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=3.0.0", ArraysSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/complex-object.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=3.0.0", ComplexObjectTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=3.0.0", ConditionalValidationIfElse().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=3.0.0", Draft07CoreSchemaMetaSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/enumerated-values.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=3.0.0", EnumeratedValuesTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/person.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=3.0.0", PersonTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/regex-pattern.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=3.0.0", RegexPatternTest().asyncAPISchema()) + ) + ) + } + + } + + class YamlFormat: ArgumentsProvider { + + override fun provideArguments(context: ExtensionContext?): Stream { + return Stream.of( + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi+yaml/arrays.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=3.0.0", ArraysSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi+yaml/complex-object.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=3.0.0", ComplexObjectTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi+yaml/conditional-validation-if-else.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=3.0.0", ConditionalValidationIfElse().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi+yaml/draft-07-core-schema-meta-schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=3.0.0", Draft07CoreSchemaMetaSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi+yaml/enumerated-values.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=3.0.0", EnumeratedValuesTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi+yaml/person.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=3.0.0", PersonTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi+yaml/regex-pattern.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+yaml;version=3.0.0", RegexPatternTest().asyncAPISchema()) + ), + // + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/arrays.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=3.0.0", ArraysSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/complex-object.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=3.0.0", ComplexObjectTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=3.0.0", ConditionalValidationIfElse().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=3.0.0", Draft07CoreSchemaMetaSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/enumerated-values.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=3.0.0", EnumeratedValuesTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/person.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=3.0.0", PersonTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/regex-pattern.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi;version=3.0.0", RegexPatternTest().asyncAPISchema()) + ) + ) + } + + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/asyncapi/EmptySchemaFormatTest.kt b/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/asyncapi/EmptySchemaFormatTest.kt new file mode 100644 index 00000000..009363db --- /dev/null +++ b/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/asyncapi/EmptySchemaFormatTest.kt @@ -0,0 +1,104 @@ +package com.asyncapi.v3.schema.multiformat.asyncapi + +import com.asyncapi.v3.schema.json.* +import com.asyncapi.v3.schema.multiformat.AsyncAPIFormatSchema +import org.junit.jupiter.api.extension.ExtensionContext +import org.junit.jupiter.params.ParameterizedTest +import org.junit.jupiter.params.provider.Arguments +import org.junit.jupiter.params.provider.ArgumentsProvider +import org.junit.jupiter.params.provider.ArgumentsSource +import java.util.stream.Stream + +abstract class EmptySchemaFormatTest: AsyncAPIFormatSchemaTest() { + + @ArgumentsSource(Json::class) + @ParameterizedTest(name = "Read: {0}") + override fun parseJson( + asyncAPIFormatSchemaToCompareWithFilePath: String, + asyncAPIFormatSchema: AsyncAPIFormatSchema + ) { + compareSchemas(asyncAPIFormatSchemaToCompareWithFilePath, asyncAPIFormatSchema) + } + + @ArgumentsSource(Yaml::class) + @ParameterizedTest(name = "Read: {0}") + override fun parseYaml( + asyncAPIFormatSchemaToCompareWithFilePath: String, + asyncAPIFormatSchema: AsyncAPIFormatSchema + ) { + compareSchemas(asyncAPIFormatSchemaToCompareWithFilePath, asyncAPIFormatSchema) + } + + class Json: ArgumentsProvider { + + override fun provideArguments(context: ExtensionContext?): Stream { + return Stream.of( + Arguments.of( + "/json/v3/schema/multiformat/schemaFormat is empty/arrays.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=3.0.0", ArraysSchemaTest().asyncAPISchema()) + ), + Arguments.of("/json/v3/schema/multiformat/schemaFormat is empty/complex-object.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=3.0.0", ComplexObjectTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/schemaFormat is empty/conditional-validation-if-else.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=3.0.0", ConditionalValidationIfElse().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/schemaFormat is empty/draft-07-core-schema-meta-schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=3.0.0", Draft07CoreSchemaMetaSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/schemaFormat is empty/enumerated-values.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=3.0.0", EnumeratedValuesTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/schemaFormat is empty/person.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=3.0.0", PersonTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/schemaFormat is empty/regex-pattern.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=3.0.0", RegexPatternTest().asyncAPISchema()) + ) + ) + } + + } + + class Yaml: ArgumentsProvider { + + override fun provideArguments(context: ExtensionContext?): Stream { + return Stream.of( + Arguments.of( + "/json/v3/schema/multiformat/schemaFormat is empty/arrays.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=3.0.0", ArraysSchemaTest().asyncAPISchema()) + ), + Arguments.of("/json/v3/schema/multiformat/schemaFormat is empty/complex-object.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=3.0.0", ComplexObjectTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/schemaFormat is empty/conditional-validation-if-else.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=3.0.0", ConditionalValidationIfElse().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/schemaFormat is empty/draft-07-core-schema-meta-schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=3.0.0", Draft07CoreSchemaMetaSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/schemaFormat is empty/enumerated-values.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=3.0.0", EnumeratedValuesTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/schemaFormat is empty/person.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=3.0.0", PersonTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/schemaFormat is empty/regex-pattern.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=3.0.0", RegexPatternTest().asyncAPISchema()) + ) + ) + } + + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/asyncapi/NullSchemaFormatTest.kt b/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/asyncapi/NullSchemaFormatTest.kt new file mode 100644 index 00000000..043ae506 --- /dev/null +++ b/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/asyncapi/NullSchemaFormatTest.kt @@ -0,0 +1,106 @@ +package com.asyncapi.v3.schema.multiformat.asyncapi + +import com.asyncapi.v3.schema.json.* +import com.asyncapi.v3.schema.multiformat.AsyncAPIFormatSchema +import org.junit.jupiter.api.extension.ExtensionContext +import org.junit.jupiter.params.ParameterizedTest +import org.junit.jupiter.params.provider.Arguments +import org.junit.jupiter.params.provider.ArgumentsProvider +import org.junit.jupiter.params.provider.ArgumentsSource +import java.util.stream.Stream + +abstract class NullSchemaFormatTest: AsyncAPIFormatSchemaTest() { + + @ArgumentsSource(Json::class) + @ParameterizedTest(name = "Read: {0}") + override fun parseJson( + asyncAPIFormatSchemaToCompareWithFilePath: String, + asyncAPIFormatSchema: AsyncAPIFormatSchema + ) { + compareSchemas(asyncAPIFormatSchemaToCompareWithFilePath, asyncAPIFormatSchema) + } + + @ArgumentsSource(Yaml::class) + @ParameterizedTest(name = "Read: {0}") + override fun parseYaml( + asyncAPIFormatSchemaToCompareWithFilePath: String, + asyncAPIFormatSchema: AsyncAPIFormatSchema + ) { + compareSchemas(asyncAPIFormatSchemaToCompareWithFilePath, asyncAPIFormatSchema) + } + + class Json: ArgumentsProvider { + + override fun provideArguments(context: ExtensionContext?): Stream { + return Stream.of( + Arguments.of( + "/json/v3/schema/multiformat/schemaFormat is null/arrays.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=3.0.0", ArraysSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/schemaFormat is null/complex-object.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=3.0.0", ComplexObjectTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/schemaFormat is null/conditional-validation-if-else.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=3.0.0", ConditionalValidationIfElse().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/schemaFormat is null/draft-07-core-schema-meta-schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=3.0.0", Draft07CoreSchemaMetaSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/schemaFormat is null/enumerated-values.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=3.0.0", EnumeratedValuesTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/schemaFormat is null/person.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=3.0.0", PersonTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/schemaFormat is null/regex-pattern.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=3.0.0", RegexPatternTest().asyncAPISchema()) + ) + ) + } + + } + + class Yaml: ArgumentsProvider { + + override fun provideArguments(context: ExtensionContext?): Stream { + return Stream.of( + Arguments.of( + "/json/v3/schema/multiformat/schemaFormat is null/arrays.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=3.0.0", ArraysSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/schemaFormat is null/complex-object.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=3.0.0", ComplexObjectTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/schemaFormat is null/conditional-validation-if-else.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=3.0.0", ConditionalValidationIfElse().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/schemaFormat is null/draft-07-core-schema-meta-schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=3.0.0", Draft07CoreSchemaMetaSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/schemaFormat is null/enumerated-values.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=3.0.0", EnumeratedValuesTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/schemaFormat is null/person.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=3.0.0", PersonTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/schemaFormat is null/regex-pattern.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=3.0.0", RegexPatternTest().asyncAPISchema()) + ) + ) + } + + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/asyncapi/WithoutSchemaFormatTest.kt b/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/asyncapi/WithoutSchemaFormatTest.kt new file mode 100644 index 00000000..86333980 --- /dev/null +++ b/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/asyncapi/WithoutSchemaFormatTest.kt @@ -0,0 +1,106 @@ +package com.asyncapi.v3.schema.multiformat.asyncapi + +import com.asyncapi.v3.schema.json.* +import com.asyncapi.v3.schema.multiformat.AsyncAPIFormatSchema +import org.junit.jupiter.api.extension.ExtensionContext +import org.junit.jupiter.params.ParameterizedTest +import org.junit.jupiter.params.provider.Arguments +import org.junit.jupiter.params.provider.ArgumentsProvider +import org.junit.jupiter.params.provider.ArgumentsSource +import java.util.stream.Stream + +abstract class WithoutSchemaFormatTest: AsyncAPIFormatSchemaTest() { + + @ArgumentsSource(Json::class) + @ParameterizedTest(name = "Read: {0}") + override fun parseJson( + asyncAPIFormatSchemaToCompareWithFilePath: String, + asyncAPIFormatSchema: AsyncAPIFormatSchema + ) { + compareSchemas(asyncAPIFormatSchemaToCompareWithFilePath, asyncAPIFormatSchema) + } + + @ArgumentsSource(Yaml::class) + @ParameterizedTest(name = "Read: {0}") + override fun parseYaml( + asyncAPIFormatSchemaToCompareWithFilePath: String, + asyncAPIFormatSchema: AsyncAPIFormatSchema + ) { + compareSchemas(asyncAPIFormatSchemaToCompareWithFilePath, asyncAPIFormatSchema) + } + + class Json: ArgumentsProvider { + + override fun provideArguments(context: ExtensionContext?): Stream { + return Stream.of( + Arguments.of( + "/json/v3/schema/multiformat/without schemaFormat/arrays.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=3.0.0", ArraysSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/without schemaFormat/complex-object.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=3.0.0", ComplexObjectTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/without schemaFormat/conditional-validation-if-else.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=3.0.0", ConditionalValidationIfElse().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/without schemaFormat/draft-07-core-schema-meta-schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=3.0.0", Draft07CoreSchemaMetaSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/without schemaFormat/enumerated-values.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=3.0.0", EnumeratedValuesTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/without schemaFormat/person.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=3.0.0", PersonTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/without schemaFormat/regex-pattern.schema.json", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=3.0.0", RegexPatternTest().asyncAPISchema()) + ) + ) + } + + } + + class Yaml: ArgumentsProvider { + + override fun provideArguments(context: ExtensionContext?): Stream { + return Stream.of( + Arguments.of( + "/json/v3/schema/multiformat/without schemaFormat/arrays.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=3.0.0", ArraysSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/without schemaFormat/complex-object.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=3.0.0", ComplexObjectTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/without schemaFormat/conditional-validation-if-else.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=3.0.0", ConditionalValidationIfElse().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/without schemaFormat/draft-07-core-schema-meta-schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=3.0.0", Draft07CoreSchemaMetaSchemaTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/without schemaFormat/enumerated-values.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=3.0.0", EnumeratedValuesTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/without schemaFormat/person.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=3.0.0", PersonTest().asyncAPISchema()) + ), + Arguments.of( + "/json/v3/schema/multiformat/without schemaFormat/regex-pattern.schema.yaml", + AsyncAPIFormatSchema("application/vnd.aai.asyncapi+json;version=3.0.0", RegexPatternTest().asyncAPISchema()) + ) + ) + } + + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/arrays.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi+json/arrays.schema.json similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/arrays.schema.json rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi+json/arrays.schema.json diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/complex-object.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi+json/complex-object.schema.json similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/complex-object.schema.json rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi+json/complex-object.schema.json diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/conditional-validation-if-else.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi+json/conditional-validation-if-else.schema.json similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/conditional-validation-if-else.schema.json rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi+json/conditional-validation-if-else.schema.json diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/draft-07-core-schema-meta-schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi+json/draft-07-core-schema-meta-schema.json similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/draft-07-core-schema-meta-schema.json rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi+json/draft-07-core-schema-meta-schema.json diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/enumerated-values.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi+json/enumerated-values.schema.json similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/enumerated-values.schema.json rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi+json/enumerated-values.schema.json diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/person.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi+json/person.schema.json similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/person.schema.json rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi+json/person.schema.json diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/regex-pattern.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi+json/regex-pattern.schema.json similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/regex-pattern.schema.json rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi+json/regex-pattern.schema.json diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/arrays.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi+yaml/arrays.schema.yaml similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/arrays.schema.yaml rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi+yaml/arrays.schema.yaml diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/complex-object.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi+yaml/complex-object.schema.yaml similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/complex-object.schema.yaml rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi+yaml/complex-object.schema.yaml diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/conditional-validation-if-else.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi+yaml/conditional-validation-if-else.schema.yaml similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/conditional-validation-if-else.schema.yaml rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi+yaml/conditional-validation-if-else.schema.yaml diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/draft-07-core-schema-meta-schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi+yaml/draft-07-core-schema-meta-schema.yaml similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/draft-07-core-schema-meta-schema.yaml rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi+yaml/draft-07-core-schema-meta-schema.yaml diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/enumerated-values.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi+yaml/enumerated-values.schema.yaml similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/enumerated-values.schema.yaml rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi+yaml/enumerated-values.schema.yaml diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/person.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi+yaml/person.schema.yaml similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/person.schema.yaml rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi+yaml/person.schema.yaml diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/regex-pattern.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi+yaml/regex-pattern.schema.yaml similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/regex-pattern.schema.yaml rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi+yaml/regex-pattern.schema.yaml diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/arrays.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/arrays.schema.json new file mode 100644 index 00000000..97eedf64 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/arrays.schema.json @@ -0,0 +1,37 @@ +{ + "schemaFormat": "application/vnd.aai.asyncapi;version=2.0.0", + "schema": { + "$id": "https://example.com/arrays.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "description": "A representation of a person, company, organization, or place", + "type": "object", + "properties": { + "fruits": { + "type": "array", + "items": { + "type": "string" + } + }, + "vegetables": { + "type": "array", + "items": { "$ref": "#/definitions/veggie" } + } + }, + "definitions": { + "veggie": { + "type": "object", + "required": [ "veggieName", "veggieLike" ], + "properties": { + "veggieName": { + "type": "string", + "description": "The name of the vegetable." + }, + "veggieLike": { + "type": "boolean", + "description": "Do I like this vegetable?" + } + } + } + } + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/arrays.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/arrays.schema.yaml new file mode 100644 index 00000000..632b49d1 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/arrays.schema.yaml @@ -0,0 +1,28 @@ +schemaFormat: application/vnd.aai.asyncapi;version=2.0.0 +schema: + $id: 'https://example.com/arrays.schema.json' + $schema: 'http://json-schema.org/draft-07/schema#' + description: 'A representation of a person, company, organization, or place' + type: object + properties: + fruits: + type: array + items: + type: string + vegetables: + type: array + items: + $ref: '#/definitions/veggie' + definitions: + veggie: + type: object + required: + - veggieName + - veggieLike + properties: + veggieName: + type: string + description: The name of the vegetable. + veggieLike: + type: boolean + description: Do I like this vegetable? \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/complex-object.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/complex-object.schema.json new file mode 100644 index 00000000..7ae73e9a --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/complex-object.schema.json @@ -0,0 +1,44 @@ +{ + "schemaFormat": "application/vnd.aai.asyncapi;version=2.0.0", + "schema": { + "$id": "https://example.com/complex-object.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Complex Object", + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "age": { + "type": "integer", + "minimum": 0 + }, + "address": { + "type": "object", + "properties": { + "street": { + "type": "string" + }, + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "postalCode": { + "type": "string", + "pattern": "\\d{5}" + } + }, + "required": ["street", "city", "state", "postalCode"] + }, + "hobbies": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": ["name", "age"] + } +} diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/complex-object.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/complex-object.schema.yaml new file mode 100644 index 00000000..3ba907f5 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/complex-object.schema.yaml @@ -0,0 +1,36 @@ +schemaFormat: application/vnd.aai.asyncapi;version=2.0.0 +schema: + $id: 'https://example.com/complex-object.schema.json' + $schema: 'http://json-schema.org/draft-07/schema#' + title: Complex Object + type: object + properties: + name: + type: string + age: + type: integer + minimum: 0 + address: + type: object + properties: + street: + type: string + city: + type: string + state: + type: string + postalCode: + type: string + pattern: '\d{5}' + required: + - street + - city + - state + - postalCode + hobbies: + type: array + items: + type: string + required: + - name + - age \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.json new file mode 100644 index 00000000..00718098 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.json @@ -0,0 +1,42 @@ +{ + "schemaFormat": "application/vnd.aai.asyncapi;version=2.0.0", + "schema": { + "$id": "https://example.com/conditional-validation-if-else.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Conditional Validation with If-Else", + "type": "object", + "properties": { + "isMember": { + "type": "boolean" + }, + "membershipNumber": { + "type": "string" + } + }, + "required": ["isMember"], + "if": { + "properties": { + "isMember": { + "const": true + } + } + }, + "then": { + "properties": { + "membershipNumber": { + "type": "string", + "minLength": 10, + "maxLength": 10 + } + } + }, + "else": { + "properties": { + "membershipNumber": { + "type": "string", + "minLength": 15 + } + } + } + } +} diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.yaml new file mode 100644 index 00000000..0d0c000e --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.yaml @@ -0,0 +1,28 @@ +schemaFormat: application/vnd.aai.asyncapi;version=2.0.0 +schema: + $id: 'https://example.com/conditional-validation-if-else.schema.json' + $schema: 'http://json-schema.org/draft-07/schema#' + title: Conditional Validation with If-Else + type: object + properties: + isMember: + type: boolean + membershipNumber: + type: string + required: + - isMember + if: + properties: + isMember: + const: true + then: + properties: + membershipNumber: + type: string + minLength: 10 + maxLength: 10 + else: + properties: + membershipNumber: + type: string + minLength: 15 \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.json new file mode 100644 index 00000000..82a762a4 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.json @@ -0,0 +1,175 @@ +{ + "schemaFormat": "application/vnd.aai.asyncapi;version=2.0.0", + "schema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://json-schema.org/draft-07/schema#", + "title": "Core schema meta-schema", + "definitions": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": { "$ref": "#" } + }, + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "allOf": [ + { "$ref": "#/definitions/nonNegativeInteger" }, + { "default": 0 } + ] + }, + "simpleTypes": { + "enum": [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + "stringArray": { + "type": "array", + "items": { "type": "string" }, + "uniqueItems": true, + "default": [] + } + }, + "type": ["object", "boolean"], + "properties": { + "$id": { + "type": "string", + "format": "uri-reference" + }, + "$schema": { + "type": "string", + "format": "uri" + }, + "$ref": { + "type": "string", + "format": "uri-reference" + }, + "$comment": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": true, + "readOnly": { + "type": "boolean", + "default": false + }, + "writeOnly": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": true + }, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + }, + "maxLength": { "$ref": "#/definitions/nonNegativeInteger" }, + "minLength": { "$ref": "#/definitions/nonNegativeIntegerDefault0" }, + "pattern": { + "type": "string", + "format": "regex" + }, + "additionalItems": { "$ref": "#" }, + "items": { + "anyOf": [ + { "$ref": "#" }, + { "$ref": "#/definitions/schemaArray" } + ], + "default": true + }, + "maxItems": { "$ref": "#/definitions/nonNegativeInteger" }, + "minItems": { "$ref": "#/definitions/nonNegativeIntegerDefault0" }, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "contains": { "$ref": "#" }, + "maxProperties": { "$ref": "#/definitions/nonNegativeInteger" }, + "minProperties": { "$ref": "#/definitions/nonNegativeIntegerDefault0" }, + "required": { "$ref": "#/definitions/stringArray" }, + "additionalProperties": { "$ref": "#" }, + "definitions": { + "type": "object", + "additionalProperties": { "$ref": "#" }, + "default": {} + }, + "properties": { + "type": "object", + "additionalProperties": { "$ref": "#" }, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": { "$ref": "#" }, + "propertyNames": { "format": "regex" }, + "default": {} + }, + "dependencies": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { "$ref": "#" }, + { "$ref": "#/definitions/stringArray" } + ] + } + }, + "propertyNames": { "$ref": "#" }, + "const": true, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": true + }, + "type": { + "anyOf": [ + { "$ref": "#/definitions/simpleTypes" }, + { + "type": "array", + "items": { "$ref": "#/definitions/simpleTypes" }, + "minItems": 1, + "uniqueItems": true + } + ] + }, + "format": { "type": "string" }, + "contentMediaType": { "type": "string" }, + "contentEncoding": { "type": "string" }, + "if": { "$ref": "#" }, + "then": { "$ref": "#" }, + "else": { "$ref": "#" }, + "allOf": { "$ref": "#/definitions/schemaArray" }, + "anyOf": { "$ref": "#/definitions/schemaArray" }, + "oneOf": { "$ref": "#/definitions/schemaArray" }, + "not": { "$ref": "#" } + }, + "default": true + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.yaml new file mode 100644 index 00000000..6f461678 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.yaml @@ -0,0 +1,164 @@ +schemaFormat: application/vnd.aai.asyncapi;version=2.0.0 +schema: + $schema: 'http://json-schema.org/draft-07/schema#' + $id: 'http://json-schema.org/draft-07/schema#' + title: Core schema meta-schema + definitions: + schemaArray: + type: array + minItems: 1 + items: + $ref: '#' + nonNegativeInteger: + type: integer + minimum: 0 + nonNegativeIntegerDefault0: + allOf: + - $ref: '#/definitions/nonNegativeInteger' + - default: 0 + simpleTypes: + enum: + - 'array' + - 'boolean' + - 'integer' + - 'null' + - 'number' + - 'object' + - 'string' + stringArray: + type: array + items: + type: string + uniqueItems: true + default: [] + type: + - object + - boolean + properties: + $id: + type: string + format: uri-reference + $schema: + type: string + format: uri + $ref: + type: string + format: uri-reference + $comment: + type: string + title: + type: string + description: + type: string + default: true + readOnly: + type: boolean + default: false + writeOnly: + type: boolean + default: false + examples: + type: array + items: true + multipleOf: + type: number + exclusiveMinimum: 0 + maximum: + type: number + exclusiveMaximum: + type: number + minimum: + type: number + exclusiveMinimum: + type: number + maxLength: + $ref: '#/definitions/nonNegativeInteger' + minLength: + $ref: '#/definitions/nonNegativeIntegerDefault0' + pattern: + type: string + format: regex + additionalItems: + $ref: '#' + items: + anyOf: + - $ref: '#' + - $ref: '#/definitions/schemaArray' + default: true + maxItems: + $ref: '#/definitions/nonNegativeInteger' + minItems: + $ref: '#/definitions/nonNegativeIntegerDefault0' + uniqueItems: + type: boolean + default: false + contains: + $ref: '#' + maxProperties: + $ref: '#/definitions/nonNegativeInteger' + minProperties: + $ref: '#/definitions/nonNegativeIntegerDefault0' + required: + $ref: '#/definitions/stringArray' + additionalProperties: + $ref: '#' + definitions: + type: object + additionalProperties: + $ref: '#' + default: {} + properties: + type: object + additionalProperties: + $ref: '#' + default: {} + patternProperties: + type: object + additionalProperties: + $ref: '#' + propertyNames: + format: regex + default: {} + dependencies: + type: object + additionalProperties: + anyOf: + - $ref: '#' + - $ref: '#/definitions/stringArray' + propertyNames: + $ref: '#' + const: true + enum: + type: array + items: true + minItems: 1 + uniqueItems: true + type: + anyOf: + - $ref: '#/definitions/simpleTypes' + - type: array + items: + $ref: '#/definitions/simpleTypes' + minItems: 1 + uniqueItems: true + format: + type: string + contentMediaType: + type: string + contentEncoding: + type: string + if: + $ref: '#' + then: + $ref: '#' + else: + $ref: '#' + allOf: + $ref: '#/definitions/schemaArray' + anyOf: + $ref: '#/definitions/schemaArray' + oneOf: + $ref: '#/definitions/schemaArray' + not: + $ref: '#' + default: true \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/enumerated-values.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/enumerated-values.schema.json new file mode 100644 index 00000000..cc4258bb --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/enumerated-values.schema.json @@ -0,0 +1,14 @@ +{ + "schemaFormat": "application/vnd.aai.asyncapi;version=2.0.0", + "schema": { + "$id": "https://example.com/enumerated-values.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Enumerated Values", + "type": "object", + "properties": { + "data": { + "enum": [42, true, "hello", null, [1, 2, 3]] + } + } + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/enumerated-values.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/enumerated-values.schema.yaml new file mode 100644 index 00000000..393802f1 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/enumerated-values.schema.yaml @@ -0,0 +1,16 @@ +schemaFormat: application/vnd.aai.asyncapi;version=2.0.0 +schema: + $id: 'https://example.com/enumerated-values.schema.json' + $schema: 'http://json-schema.org/draft-07/schema#' + title: Enumerated Values + type: object + properties: + data: + enum: + - 42 + - true + - hello + - null + - - 1 + - 2 + - 3 \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/person.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/person.schema.json new file mode 100644 index 00000000..5f7cf384 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/person.schema.json @@ -0,0 +1,24 @@ +{ + "schemaFormat": "application/vnd.aai.asyncapi;version=2.0.0", + "schema": { + "$id": "https://example.com/person.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Person", + "type": "object", + "properties": { + "firstName": { + "type": "string", + "description": "The person's first name." + }, + "lastName": { + "type": "string", + "description": "The person's last name." + }, + "age": { + "description": "Age in years which must be equal to or greater than zero.", + "type": "integer", + "minimum": 0 + } + } + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/person.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/person.schema.yaml new file mode 100644 index 00000000..d09d8353 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/person.schema.yaml @@ -0,0 +1,17 @@ +schemaFormat: application/vnd.aai.asyncapi;version=2.0.0 +schema: + $id: 'https://example.com/person.schema.json' + $schema: 'http://json-schema.org/draft-07/schema#' + title: Person + type: object + properties: + firstName: + type: string + description: The person's first name. + lastName: + type: string + description: The person's last name. + age: + description: Age in years which must be equal to or greater than zero. + type: integer + minimum: 0 \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/regex-pattern.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/regex-pattern.schema.json new file mode 100644 index 00000000..585622fd --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/regex-pattern.schema.json @@ -0,0 +1,15 @@ +{ + "schemaFormat": "application/vnd.aai.asyncapi;version=2.0.0", + "schema": { + "$id": "https://example.com/regex-pattern.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Regular Expression Pattern", + "type": "object", + "properties": { + "code": { + "type": "string", + "pattern": "^[A-Z]{3}-\\d{3}$" + } + } + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/regex-pattern.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/regex-pattern.schema.yaml new file mode 100644 index 00000000..1955ae2a --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.0.0/vnd.aai.asyncapi/regex-pattern.schema.yaml @@ -0,0 +1,10 @@ +schemaFormat: application/vnd.aai.asyncapi;version=2.0.0 +schema: + $id: 'https://example.com/regex-pattern.schema.json' + $schema: 'http://json-schema.org/draft-07/schema#' + title: Regular Expression Pattern + type: object + properties: + code: + type: string + pattern: '^[A-Z]{3}-\d{3}$' \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/arrays.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi+json/arrays.schema.json similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/arrays.schema.json rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi+json/arrays.schema.json diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/complex-object.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi+json/complex-object.schema.json similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/complex-object.schema.json rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi+json/complex-object.schema.json diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/conditional-validation-if-else.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi+json/conditional-validation-if-else.schema.json similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/conditional-validation-if-else.schema.json rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi+json/conditional-validation-if-else.schema.json diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/draft-07-core-schema-meta-schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi+json/draft-07-core-schema-meta-schema.json similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/draft-07-core-schema-meta-schema.json rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi+json/draft-07-core-schema-meta-schema.json diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/enumerated-values.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi+json/enumerated-values.schema.json similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/enumerated-values.schema.json rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi+json/enumerated-values.schema.json diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/person.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi+json/person.schema.json similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/person.schema.json rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi+json/person.schema.json diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/regex-pattern.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi+json/regex-pattern.schema.json similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/regex-pattern.schema.json rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi+json/regex-pattern.schema.json diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/arrays.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi+yaml/arrays.schema.yaml similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/arrays.schema.yaml rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi+yaml/arrays.schema.yaml diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/complex-object.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi+yaml/complex-object.schema.yaml similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/complex-object.schema.yaml rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi+yaml/complex-object.schema.yaml diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/conditional-validation-if-else.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi+yaml/conditional-validation-if-else.schema.yaml similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/conditional-validation-if-else.schema.yaml rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi+yaml/conditional-validation-if-else.schema.yaml diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/draft-07-core-schema-meta-schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi+yaml/draft-07-core-schema-meta-schema.yaml similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/draft-07-core-schema-meta-schema.yaml rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi+yaml/draft-07-core-schema-meta-schema.yaml diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/enumerated-values.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi+yaml/enumerated-values.schema.yaml similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/enumerated-values.schema.yaml rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi+yaml/enumerated-values.schema.yaml diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/person.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi+yaml/person.schema.yaml similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/person.schema.yaml rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi+yaml/person.schema.yaml diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/regex-pattern.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi+yaml/regex-pattern.schema.yaml similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/regex-pattern.schema.yaml rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi+yaml/regex-pattern.schema.yaml diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/arrays.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/arrays.schema.json new file mode 100644 index 00000000..ad0c7262 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/arrays.schema.json @@ -0,0 +1,37 @@ +{ + "schemaFormat": "application/vnd.aai.asyncapi;version=2.1.0", + "schema": { + "$id": "https://example.com/arrays.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "description": "A representation of a person, company, organization, or place", + "type": "object", + "properties": { + "fruits": { + "type": "array", + "items": { + "type": "string" + } + }, + "vegetables": { + "type": "array", + "items": { "$ref": "#/definitions/veggie" } + } + }, + "definitions": { + "veggie": { + "type": "object", + "required": [ "veggieName", "veggieLike" ], + "properties": { + "veggieName": { + "type": "string", + "description": "The name of the vegetable." + }, + "veggieLike": { + "type": "boolean", + "description": "Do I like this vegetable?" + } + } + } + } + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/arrays.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/arrays.schema.yaml new file mode 100644 index 00000000..5ccb47ea --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/arrays.schema.yaml @@ -0,0 +1,28 @@ +schemaFormat: application/vnd.aai.asyncapi;version=2.1.0 +schema: + $id: 'https://example.com/arrays.schema.json' + $schema: 'http://json-schema.org/draft-07/schema#' + description: 'A representation of a person, company, organization, or place' + type: object + properties: + fruits: + type: array + items: + type: string + vegetables: + type: array + items: + $ref: '#/definitions/veggie' + definitions: + veggie: + type: object + required: + - veggieName + - veggieLike + properties: + veggieName: + type: string + description: The name of the vegetable. + veggieLike: + type: boolean + description: Do I like this vegetable? \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/complex-object.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/complex-object.schema.json new file mode 100644 index 00000000..c84e1acc --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/complex-object.schema.json @@ -0,0 +1,44 @@ +{ + "schemaFormat": "application/vnd.aai.asyncapi;version=2.1.0", + "schema": { + "$id": "https://example.com/complex-object.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Complex Object", + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "age": { + "type": "integer", + "minimum": 0 + }, + "address": { + "type": "object", + "properties": { + "street": { + "type": "string" + }, + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "postalCode": { + "type": "string", + "pattern": "\\d{5}" + } + }, + "required": ["street", "city", "state", "postalCode"] + }, + "hobbies": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": ["name", "age"] + } +} diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/complex-object.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/complex-object.schema.yaml new file mode 100644 index 00000000..376a3524 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/complex-object.schema.yaml @@ -0,0 +1,36 @@ +schemaFormat: application/vnd.aai.asyncapi;version=2.1.0 +schema: + $id: 'https://example.com/complex-object.schema.json' + $schema: 'http://json-schema.org/draft-07/schema#' + title: Complex Object + type: object + properties: + name: + type: string + age: + type: integer + minimum: 0 + address: + type: object + properties: + street: + type: string + city: + type: string + state: + type: string + postalCode: + type: string + pattern: '\d{5}' + required: + - street + - city + - state + - postalCode + hobbies: + type: array + items: + type: string + required: + - name + - age \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.json new file mode 100644 index 00000000..4147d48c --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.json @@ -0,0 +1,42 @@ +{ + "schemaFormat": "application/vnd.aai.asyncapi;version=2.1.0", + "schema": { + "$id": "https://example.com/conditional-validation-if-else.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Conditional Validation with If-Else", + "type": "object", + "properties": { + "isMember": { + "type": "boolean" + }, + "membershipNumber": { + "type": "string" + } + }, + "required": ["isMember"], + "if": { + "properties": { + "isMember": { + "const": true + } + } + }, + "then": { + "properties": { + "membershipNumber": { + "type": "string", + "minLength": 10, + "maxLength": 10 + } + } + }, + "else": { + "properties": { + "membershipNumber": { + "type": "string", + "minLength": 15 + } + } + } + } +} diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.yaml new file mode 100644 index 00000000..bb86ceea --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.yaml @@ -0,0 +1,28 @@ +schemaFormat: application/vnd.aai.asyncapi;version=2.1.0 +schema: + $id: 'https://example.com/conditional-validation-if-else.schema.json' + $schema: 'http://json-schema.org/draft-07/schema#' + title: Conditional Validation with If-Else + type: object + properties: + isMember: + type: boolean + membershipNumber: + type: string + required: + - isMember + if: + properties: + isMember: + const: true + then: + properties: + membershipNumber: + type: string + minLength: 10 + maxLength: 10 + else: + properties: + membershipNumber: + type: string + minLength: 15 \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.json new file mode 100644 index 00000000..0fe37492 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.json @@ -0,0 +1,175 @@ +{ + "schemaFormat": "application/vnd.aai.asyncapi;version=2.1.0", + "schema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://json-schema.org/draft-07/schema#", + "title": "Core schema meta-schema", + "definitions": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": { "$ref": "#" } + }, + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "allOf": [ + { "$ref": "#/definitions/nonNegativeInteger" }, + { "default": 0 } + ] + }, + "simpleTypes": { + "enum": [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + "stringArray": { + "type": "array", + "items": { "type": "string" }, + "uniqueItems": true, + "default": [] + } + }, + "type": ["object", "boolean"], + "properties": { + "$id": { + "type": "string", + "format": "uri-reference" + }, + "$schema": { + "type": "string", + "format": "uri" + }, + "$ref": { + "type": "string", + "format": "uri-reference" + }, + "$comment": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": true, + "readOnly": { + "type": "boolean", + "default": false + }, + "writeOnly": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": true + }, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + }, + "maxLength": { "$ref": "#/definitions/nonNegativeInteger" }, + "minLength": { "$ref": "#/definitions/nonNegativeIntegerDefault0" }, + "pattern": { + "type": "string", + "format": "regex" + }, + "additionalItems": { "$ref": "#" }, + "items": { + "anyOf": [ + { "$ref": "#" }, + { "$ref": "#/definitions/schemaArray" } + ], + "default": true + }, + "maxItems": { "$ref": "#/definitions/nonNegativeInteger" }, + "minItems": { "$ref": "#/definitions/nonNegativeIntegerDefault0" }, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "contains": { "$ref": "#" }, + "maxProperties": { "$ref": "#/definitions/nonNegativeInteger" }, + "minProperties": { "$ref": "#/definitions/nonNegativeIntegerDefault0" }, + "required": { "$ref": "#/definitions/stringArray" }, + "additionalProperties": { "$ref": "#" }, + "definitions": { + "type": "object", + "additionalProperties": { "$ref": "#" }, + "default": {} + }, + "properties": { + "type": "object", + "additionalProperties": { "$ref": "#" }, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": { "$ref": "#" }, + "propertyNames": { "format": "regex" }, + "default": {} + }, + "dependencies": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { "$ref": "#" }, + { "$ref": "#/definitions/stringArray" } + ] + } + }, + "propertyNames": { "$ref": "#" }, + "const": true, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": true + }, + "type": { + "anyOf": [ + { "$ref": "#/definitions/simpleTypes" }, + { + "type": "array", + "items": { "$ref": "#/definitions/simpleTypes" }, + "minItems": 1, + "uniqueItems": true + } + ] + }, + "format": { "type": "string" }, + "contentMediaType": { "type": "string" }, + "contentEncoding": { "type": "string" }, + "if": { "$ref": "#" }, + "then": { "$ref": "#" }, + "else": { "$ref": "#" }, + "allOf": { "$ref": "#/definitions/schemaArray" }, + "anyOf": { "$ref": "#/definitions/schemaArray" }, + "oneOf": { "$ref": "#/definitions/schemaArray" }, + "not": { "$ref": "#" } + }, + "default": true + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.yaml new file mode 100644 index 00000000..c2f8118a --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.yaml @@ -0,0 +1,164 @@ +schemaFormat: application/vnd.aai.asyncapi;version=2.1.0 +schema: + $schema: 'http://json-schema.org/draft-07/schema#' + $id: 'http://json-schema.org/draft-07/schema#' + title: Core schema meta-schema + definitions: + schemaArray: + type: array + minItems: 1 + items: + $ref: '#' + nonNegativeInteger: + type: integer + minimum: 0 + nonNegativeIntegerDefault0: + allOf: + - $ref: '#/definitions/nonNegativeInteger' + - default: 0 + simpleTypes: + enum: + - 'array' + - 'boolean' + - 'integer' + - 'null' + - 'number' + - 'object' + - 'string' + stringArray: + type: array + items: + type: string + uniqueItems: true + default: [] + type: + - object + - boolean + properties: + $id: + type: string + format: uri-reference + $schema: + type: string + format: uri + $ref: + type: string + format: uri-reference + $comment: + type: string + title: + type: string + description: + type: string + default: true + readOnly: + type: boolean + default: false + writeOnly: + type: boolean + default: false + examples: + type: array + items: true + multipleOf: + type: number + exclusiveMinimum: 0 + maximum: + type: number + exclusiveMaximum: + type: number + minimum: + type: number + exclusiveMinimum: + type: number + maxLength: + $ref: '#/definitions/nonNegativeInteger' + minLength: + $ref: '#/definitions/nonNegativeIntegerDefault0' + pattern: + type: string + format: regex + additionalItems: + $ref: '#' + items: + anyOf: + - $ref: '#' + - $ref: '#/definitions/schemaArray' + default: true + maxItems: + $ref: '#/definitions/nonNegativeInteger' + minItems: + $ref: '#/definitions/nonNegativeIntegerDefault0' + uniqueItems: + type: boolean + default: false + contains: + $ref: '#' + maxProperties: + $ref: '#/definitions/nonNegativeInteger' + minProperties: + $ref: '#/definitions/nonNegativeIntegerDefault0' + required: + $ref: '#/definitions/stringArray' + additionalProperties: + $ref: '#' + definitions: + type: object + additionalProperties: + $ref: '#' + default: {} + properties: + type: object + additionalProperties: + $ref: '#' + default: {} + patternProperties: + type: object + additionalProperties: + $ref: '#' + propertyNames: + format: regex + default: {} + dependencies: + type: object + additionalProperties: + anyOf: + - $ref: '#' + - $ref: '#/definitions/stringArray' + propertyNames: + $ref: '#' + const: true + enum: + type: array + items: true + minItems: 1 + uniqueItems: true + type: + anyOf: + - $ref: '#/definitions/simpleTypes' + - type: array + items: + $ref: '#/definitions/simpleTypes' + minItems: 1 + uniqueItems: true + format: + type: string + contentMediaType: + type: string + contentEncoding: + type: string + if: + $ref: '#' + then: + $ref: '#' + else: + $ref: '#' + allOf: + $ref: '#/definitions/schemaArray' + anyOf: + $ref: '#/definitions/schemaArray' + oneOf: + $ref: '#/definitions/schemaArray' + not: + $ref: '#' + default: true \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/enumerated-values.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/enumerated-values.schema.json new file mode 100644 index 00000000..08965325 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/enumerated-values.schema.json @@ -0,0 +1,14 @@ +{ + "schemaFormat": "application/vnd.aai.asyncapi;version=2.1.0", + "schema": { + "$id": "https://example.com/enumerated-values.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Enumerated Values", + "type": "object", + "properties": { + "data": { + "enum": [42, true, "hello", null, [1, 2, 3]] + } + } + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/enumerated-values.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/enumerated-values.schema.yaml new file mode 100644 index 00000000..9ddd01e6 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/enumerated-values.schema.yaml @@ -0,0 +1,16 @@ +schemaFormat: application/vnd.aai.asyncapi;version=2.1.0 +schema: + $id: 'https://example.com/enumerated-values.schema.json' + $schema: 'http://json-schema.org/draft-07/schema#' + title: Enumerated Values + type: object + properties: + data: + enum: + - 42 + - true + - hello + - null + - - 1 + - 2 + - 3 \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/person.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/person.schema.json new file mode 100644 index 00000000..5f021a5c --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/person.schema.json @@ -0,0 +1,24 @@ +{ + "schemaFormat": "application/vnd.aai.asyncapi;version=2.1.0", + "schema": { + "$id": "https://example.com/person.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Person", + "type": "object", + "properties": { + "firstName": { + "type": "string", + "description": "The person's first name." + }, + "lastName": { + "type": "string", + "description": "The person's last name." + }, + "age": { + "description": "Age in years which must be equal to or greater than zero.", + "type": "integer", + "minimum": 0 + } + } + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/person.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/person.schema.yaml new file mode 100644 index 00000000..e0b1e117 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/person.schema.yaml @@ -0,0 +1,17 @@ +schemaFormat: application/vnd.aai.asyncapi;version=2.1.0 +schema: + $id: 'https://example.com/person.schema.json' + $schema: 'http://json-schema.org/draft-07/schema#' + title: Person + type: object + properties: + firstName: + type: string + description: The person's first name. + lastName: + type: string + description: The person's last name. + age: + description: Age in years which must be equal to or greater than zero. + type: integer + minimum: 0 \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/regex-pattern.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/regex-pattern.schema.json new file mode 100644 index 00000000..74ac68c4 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/regex-pattern.schema.json @@ -0,0 +1,15 @@ +{ + "schemaFormat": "application/vnd.aai.asyncapi;version=2.1.0", + "schema": { + "$id": "https://example.com/regex-pattern.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Regular Expression Pattern", + "type": "object", + "properties": { + "code": { + "type": "string", + "pattern": "^[A-Z]{3}-\\d{3}$" + } + } + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/regex-pattern.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/regex-pattern.schema.yaml new file mode 100644 index 00000000..1779619b --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.1.0/vnd.aai.asyncapi/regex-pattern.schema.yaml @@ -0,0 +1,10 @@ +schemaFormat: application/vnd.aai.asyncapi;version=2.1.0 +schema: + $id: 'https://example.com/regex-pattern.schema.json' + $schema: 'http://json-schema.org/draft-07/schema#' + title: Regular Expression Pattern + type: object + properties: + code: + type: string + pattern: '^[A-Z]{3}-\d{3}$' \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/arrays.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi+json/arrays.schema.json similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/arrays.schema.json rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi+json/arrays.schema.json diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/complex-object.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi+json/complex-object.schema.json similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/complex-object.schema.json rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi+json/complex-object.schema.json diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/conditional-validation-if-else.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi+json/conditional-validation-if-else.schema.json similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/conditional-validation-if-else.schema.json rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi+json/conditional-validation-if-else.schema.json diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/draft-07-core-schema-meta-schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi+json/draft-07-core-schema-meta-schema.json similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/draft-07-core-schema-meta-schema.json rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi+json/draft-07-core-schema-meta-schema.json diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/enumerated-values.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi+json/enumerated-values.schema.json similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/enumerated-values.schema.json rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi+json/enumerated-values.schema.json diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/person.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi+json/person.schema.json similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/person.schema.json rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi+json/person.schema.json diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/regex-pattern.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi+json/regex-pattern.schema.json similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/regex-pattern.schema.json rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi+json/regex-pattern.schema.json diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/arrays.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi+yaml/arrays.schema.yaml similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/arrays.schema.yaml rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi+yaml/arrays.schema.yaml diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/complex-object.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi+yaml/complex-object.schema.yaml similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/complex-object.schema.yaml rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi+yaml/complex-object.schema.yaml diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/conditional-validation-if-else.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi+yaml/conditional-validation-if-else.schema.yaml similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/conditional-validation-if-else.schema.yaml rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi+yaml/conditional-validation-if-else.schema.yaml diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/draft-07-core-schema-meta-schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi+yaml/draft-07-core-schema-meta-schema.yaml similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/draft-07-core-schema-meta-schema.yaml rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi+yaml/draft-07-core-schema-meta-schema.yaml diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/enumerated-values.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi+yaml/enumerated-values.schema.yaml similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/enumerated-values.schema.yaml rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi+yaml/enumerated-values.schema.yaml diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/person.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi+yaml/person.schema.yaml similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/person.schema.yaml rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi+yaml/person.schema.yaml diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/regex-pattern.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi+yaml/regex-pattern.schema.yaml similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/regex-pattern.schema.yaml rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi+yaml/regex-pattern.schema.yaml diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/arrays.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/arrays.schema.json new file mode 100644 index 00000000..30e20850 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/arrays.schema.json @@ -0,0 +1,37 @@ +{ + "schemaFormat": "application/vnd.aai.asyncapi;version=2.2.0", + "schema": { + "$id": "https://example.com/arrays.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "description": "A representation of a person, company, organization, or place", + "type": "object", + "properties": { + "fruits": { + "type": "array", + "items": { + "type": "string" + } + }, + "vegetables": { + "type": "array", + "items": { "$ref": "#/definitions/veggie" } + } + }, + "definitions": { + "veggie": { + "type": "object", + "required": [ "veggieName", "veggieLike" ], + "properties": { + "veggieName": { + "type": "string", + "description": "The name of the vegetable." + }, + "veggieLike": { + "type": "boolean", + "description": "Do I like this vegetable?" + } + } + } + } + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/arrays.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/arrays.schema.yaml new file mode 100644 index 00000000..a4ee9e5e --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/arrays.schema.yaml @@ -0,0 +1,28 @@ +schemaFormat: application/vnd.aai.asyncapi;version=2.2.0 +schema: + $id: 'https://example.com/arrays.schema.json' + $schema: 'http://json-schema.org/draft-07/schema#' + description: 'A representation of a person, company, organization, or place' + type: object + properties: + fruits: + type: array + items: + type: string + vegetables: + type: array + items: + $ref: '#/definitions/veggie' + definitions: + veggie: + type: object + required: + - veggieName + - veggieLike + properties: + veggieName: + type: string + description: The name of the vegetable. + veggieLike: + type: boolean + description: Do I like this vegetable? \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/complex-object.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/complex-object.schema.json new file mode 100644 index 00000000..c2cd1d91 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/complex-object.schema.json @@ -0,0 +1,44 @@ +{ + "schemaFormat": "application/vnd.aai.asyncapi;version=2.2.0", + "schema": { + "$id": "https://example.com/complex-object.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Complex Object", + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "age": { + "type": "integer", + "minimum": 0 + }, + "address": { + "type": "object", + "properties": { + "street": { + "type": "string" + }, + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "postalCode": { + "type": "string", + "pattern": "\\d{5}" + } + }, + "required": ["street", "city", "state", "postalCode"] + }, + "hobbies": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": ["name", "age"] + } +} diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/complex-object.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/complex-object.schema.yaml new file mode 100644 index 00000000..7b0e8f60 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/complex-object.schema.yaml @@ -0,0 +1,36 @@ +schemaFormat: application/vnd.aai.asyncapi;version=2.2.0 +schema: + $id: 'https://example.com/complex-object.schema.json' + $schema: 'http://json-schema.org/draft-07/schema#' + title: Complex Object + type: object + properties: + name: + type: string + age: + type: integer + minimum: 0 + address: + type: object + properties: + street: + type: string + city: + type: string + state: + type: string + postalCode: + type: string + pattern: '\d{5}' + required: + - street + - city + - state + - postalCode + hobbies: + type: array + items: + type: string + required: + - name + - age \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.json new file mode 100644 index 00000000..44248817 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.json @@ -0,0 +1,42 @@ +{ + "schemaFormat": "application/vnd.aai.asyncapi;version=2.2.0", + "schema": { + "$id": "https://example.com/conditional-validation-if-else.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Conditional Validation with If-Else", + "type": "object", + "properties": { + "isMember": { + "type": "boolean" + }, + "membershipNumber": { + "type": "string" + } + }, + "required": ["isMember"], + "if": { + "properties": { + "isMember": { + "const": true + } + } + }, + "then": { + "properties": { + "membershipNumber": { + "type": "string", + "minLength": 10, + "maxLength": 10 + } + } + }, + "else": { + "properties": { + "membershipNumber": { + "type": "string", + "minLength": 15 + } + } + } + } +} diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.yaml new file mode 100644 index 00000000..0ebfca00 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.yaml @@ -0,0 +1,28 @@ +schemaFormat: application/vnd.aai.asyncapi;version=2.2.0 +schema: + $id: 'https://example.com/conditional-validation-if-else.schema.json' + $schema: 'http://json-schema.org/draft-07/schema#' + title: Conditional Validation with If-Else + type: object + properties: + isMember: + type: boolean + membershipNumber: + type: string + required: + - isMember + if: + properties: + isMember: + const: true + then: + properties: + membershipNumber: + type: string + minLength: 10 + maxLength: 10 + else: + properties: + membershipNumber: + type: string + minLength: 15 \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.json new file mode 100644 index 00000000..d36d60a5 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.json @@ -0,0 +1,175 @@ +{ + "schemaFormat": "application/vnd.aai.asyncapi;version=2.2.0", + "schema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://json-schema.org/draft-07/schema#", + "title": "Core schema meta-schema", + "definitions": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": { "$ref": "#" } + }, + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "allOf": [ + { "$ref": "#/definitions/nonNegativeInteger" }, + { "default": 0 } + ] + }, + "simpleTypes": { + "enum": [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + "stringArray": { + "type": "array", + "items": { "type": "string" }, + "uniqueItems": true, + "default": [] + } + }, + "type": ["object", "boolean"], + "properties": { + "$id": { + "type": "string", + "format": "uri-reference" + }, + "$schema": { + "type": "string", + "format": "uri" + }, + "$ref": { + "type": "string", + "format": "uri-reference" + }, + "$comment": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": true, + "readOnly": { + "type": "boolean", + "default": false + }, + "writeOnly": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": true + }, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + }, + "maxLength": { "$ref": "#/definitions/nonNegativeInteger" }, + "minLength": { "$ref": "#/definitions/nonNegativeIntegerDefault0" }, + "pattern": { + "type": "string", + "format": "regex" + }, + "additionalItems": { "$ref": "#" }, + "items": { + "anyOf": [ + { "$ref": "#" }, + { "$ref": "#/definitions/schemaArray" } + ], + "default": true + }, + "maxItems": { "$ref": "#/definitions/nonNegativeInteger" }, + "minItems": { "$ref": "#/definitions/nonNegativeIntegerDefault0" }, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "contains": { "$ref": "#" }, + "maxProperties": { "$ref": "#/definitions/nonNegativeInteger" }, + "minProperties": { "$ref": "#/definitions/nonNegativeIntegerDefault0" }, + "required": { "$ref": "#/definitions/stringArray" }, + "additionalProperties": { "$ref": "#" }, + "definitions": { + "type": "object", + "additionalProperties": { "$ref": "#" }, + "default": {} + }, + "properties": { + "type": "object", + "additionalProperties": { "$ref": "#" }, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": { "$ref": "#" }, + "propertyNames": { "format": "regex" }, + "default": {} + }, + "dependencies": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { "$ref": "#" }, + { "$ref": "#/definitions/stringArray" } + ] + } + }, + "propertyNames": { "$ref": "#" }, + "const": true, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": true + }, + "type": { + "anyOf": [ + { "$ref": "#/definitions/simpleTypes" }, + { + "type": "array", + "items": { "$ref": "#/definitions/simpleTypes" }, + "minItems": 1, + "uniqueItems": true + } + ] + }, + "format": { "type": "string" }, + "contentMediaType": { "type": "string" }, + "contentEncoding": { "type": "string" }, + "if": { "$ref": "#" }, + "then": { "$ref": "#" }, + "else": { "$ref": "#" }, + "allOf": { "$ref": "#/definitions/schemaArray" }, + "anyOf": { "$ref": "#/definitions/schemaArray" }, + "oneOf": { "$ref": "#/definitions/schemaArray" }, + "not": { "$ref": "#" } + }, + "default": true + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.yaml new file mode 100644 index 00000000..31afd8dc --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.yaml @@ -0,0 +1,164 @@ +schemaFormat: application/vnd.aai.asyncapi;version=2.2.0 +schema: + $schema: 'http://json-schema.org/draft-07/schema#' + $id: 'http://json-schema.org/draft-07/schema#' + title: Core schema meta-schema + definitions: + schemaArray: + type: array + minItems: 1 + items: + $ref: '#' + nonNegativeInteger: + type: integer + minimum: 0 + nonNegativeIntegerDefault0: + allOf: + - $ref: '#/definitions/nonNegativeInteger' + - default: 0 + simpleTypes: + enum: + - 'array' + - 'boolean' + - 'integer' + - 'null' + - 'number' + - 'object' + - 'string' + stringArray: + type: array + items: + type: string + uniqueItems: true + default: [] + type: + - object + - boolean + properties: + $id: + type: string + format: uri-reference + $schema: + type: string + format: uri + $ref: + type: string + format: uri-reference + $comment: + type: string + title: + type: string + description: + type: string + default: true + readOnly: + type: boolean + default: false + writeOnly: + type: boolean + default: false + examples: + type: array + items: true + multipleOf: + type: number + exclusiveMinimum: 0 + maximum: + type: number + exclusiveMaximum: + type: number + minimum: + type: number + exclusiveMinimum: + type: number + maxLength: + $ref: '#/definitions/nonNegativeInteger' + minLength: + $ref: '#/definitions/nonNegativeIntegerDefault0' + pattern: + type: string + format: regex + additionalItems: + $ref: '#' + items: + anyOf: + - $ref: '#' + - $ref: '#/definitions/schemaArray' + default: true + maxItems: + $ref: '#/definitions/nonNegativeInteger' + minItems: + $ref: '#/definitions/nonNegativeIntegerDefault0' + uniqueItems: + type: boolean + default: false + contains: + $ref: '#' + maxProperties: + $ref: '#/definitions/nonNegativeInteger' + minProperties: + $ref: '#/definitions/nonNegativeIntegerDefault0' + required: + $ref: '#/definitions/stringArray' + additionalProperties: + $ref: '#' + definitions: + type: object + additionalProperties: + $ref: '#' + default: {} + properties: + type: object + additionalProperties: + $ref: '#' + default: {} + patternProperties: + type: object + additionalProperties: + $ref: '#' + propertyNames: + format: regex + default: {} + dependencies: + type: object + additionalProperties: + anyOf: + - $ref: '#' + - $ref: '#/definitions/stringArray' + propertyNames: + $ref: '#' + const: true + enum: + type: array + items: true + minItems: 1 + uniqueItems: true + type: + anyOf: + - $ref: '#/definitions/simpleTypes' + - type: array + items: + $ref: '#/definitions/simpleTypes' + minItems: 1 + uniqueItems: true + format: + type: string + contentMediaType: + type: string + contentEncoding: + type: string + if: + $ref: '#' + then: + $ref: '#' + else: + $ref: '#' + allOf: + $ref: '#/definitions/schemaArray' + anyOf: + $ref: '#/definitions/schemaArray' + oneOf: + $ref: '#/definitions/schemaArray' + not: + $ref: '#' + default: true \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/enumerated-values.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/enumerated-values.schema.json new file mode 100644 index 00000000..66ff5e01 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/enumerated-values.schema.json @@ -0,0 +1,14 @@ +{ + "schemaFormat": "application/vnd.aai.asyncapi;version=2.2.0", + "schema": { + "$id": "https://example.com/enumerated-values.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Enumerated Values", + "type": "object", + "properties": { + "data": { + "enum": [42, true, "hello", null, [1, 2, 3]] + } + } + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/enumerated-values.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/enumerated-values.schema.yaml new file mode 100644 index 00000000..b2680bf3 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/enumerated-values.schema.yaml @@ -0,0 +1,16 @@ +schemaFormat: application/vnd.aai.asyncapi;version=2.2.0 +schema: + $id: 'https://example.com/enumerated-values.schema.json' + $schema: 'http://json-schema.org/draft-07/schema#' + title: Enumerated Values + type: object + properties: + data: + enum: + - 42 + - true + - hello + - null + - - 1 + - 2 + - 3 \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/person.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/person.schema.json new file mode 100644 index 00000000..eb1b4043 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/person.schema.json @@ -0,0 +1,24 @@ +{ + "schemaFormat": "application/vnd.aai.asyncapi;version=2.2.0", + "schema": { + "$id": "https://example.com/person.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Person", + "type": "object", + "properties": { + "firstName": { + "type": "string", + "description": "The person's first name." + }, + "lastName": { + "type": "string", + "description": "The person's last name." + }, + "age": { + "description": "Age in years which must be equal to or greater than zero.", + "type": "integer", + "minimum": 0 + } + } + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/person.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/person.schema.yaml new file mode 100644 index 00000000..c8cf594c --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/person.schema.yaml @@ -0,0 +1,17 @@ +schemaFormat: application/vnd.aai.asyncapi;version=2.2.0 +schema: + $id: 'https://example.com/person.schema.json' + $schema: 'http://json-schema.org/draft-07/schema#' + title: Person + type: object + properties: + firstName: + type: string + description: The person's first name. + lastName: + type: string + description: The person's last name. + age: + description: Age in years which must be equal to or greater than zero. + type: integer + minimum: 0 \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/regex-pattern.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/regex-pattern.schema.json new file mode 100644 index 00000000..e43a5c42 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/regex-pattern.schema.json @@ -0,0 +1,15 @@ +{ + "schemaFormat": "application/vnd.aai.asyncapi;version=2.2.0", + "schema": { + "$id": "https://example.com/regex-pattern.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Regular Expression Pattern", + "type": "object", + "properties": { + "code": { + "type": "string", + "pattern": "^[A-Z]{3}-\\d{3}$" + } + } + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/regex-pattern.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/regex-pattern.schema.yaml new file mode 100644 index 00000000..06515671 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.2.0/vnd.aai.asyncapi/regex-pattern.schema.yaml @@ -0,0 +1,10 @@ +schemaFormat: application/vnd.aai.asyncapi;version=2.2.0 +schema: + $id: 'https://example.com/regex-pattern.schema.json' + $schema: 'http://json-schema.org/draft-07/schema#' + title: Regular Expression Pattern + type: object + properties: + code: + type: string + pattern: '^[A-Z]{3}-\d{3}$' \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/arrays.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi+json/arrays.schema.json similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/arrays.schema.json rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi+json/arrays.schema.json diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/complex-object.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi+json/complex-object.schema.json similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/complex-object.schema.json rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi+json/complex-object.schema.json diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/conditional-validation-if-else.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi+json/conditional-validation-if-else.schema.json similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/conditional-validation-if-else.schema.json rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi+json/conditional-validation-if-else.schema.json diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/draft-07-core-schema-meta-schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi+json/draft-07-core-schema-meta-schema.json similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/draft-07-core-schema-meta-schema.json rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi+json/draft-07-core-schema-meta-schema.json diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/enumerated-values.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi+json/enumerated-values.schema.json similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/enumerated-values.schema.json rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi+json/enumerated-values.schema.json diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/person.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi+json/person.schema.json similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/person.schema.json rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi+json/person.schema.json diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/regex-pattern.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi+json/regex-pattern.schema.json similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/regex-pattern.schema.json rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi+json/regex-pattern.schema.json diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/arrays.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi+yaml/arrays.schema.yaml similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/arrays.schema.yaml rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi+yaml/arrays.schema.yaml diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/complex-object.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi+yaml/complex-object.schema.yaml similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/complex-object.schema.yaml rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi+yaml/complex-object.schema.yaml diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/conditional-validation-if-else.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi+yaml/conditional-validation-if-else.schema.yaml similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/conditional-validation-if-else.schema.yaml rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi+yaml/conditional-validation-if-else.schema.yaml diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/draft-07-core-schema-meta-schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi+yaml/draft-07-core-schema-meta-schema.yaml similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/draft-07-core-schema-meta-schema.yaml rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi+yaml/draft-07-core-schema-meta-schema.yaml diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/enumerated-values.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi+yaml/enumerated-values.schema.yaml similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/enumerated-values.schema.yaml rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi+yaml/enumerated-values.schema.yaml diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/person.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi+yaml/person.schema.yaml similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/person.schema.yaml rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi+yaml/person.schema.yaml diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/regex-pattern.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi+yaml/regex-pattern.schema.yaml similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/regex-pattern.schema.yaml rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi+yaml/regex-pattern.schema.yaml diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/arrays.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/arrays.schema.json new file mode 100644 index 00000000..a1ddba2e --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/arrays.schema.json @@ -0,0 +1,37 @@ +{ + "schemaFormat": "application/vnd.aai.asyncapi;version=2.3.0", + "schema": { + "$id": "https://example.com/arrays.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "description": "A representation of a person, company, organization, or place", + "type": "object", + "properties": { + "fruits": { + "type": "array", + "items": { + "type": "string" + } + }, + "vegetables": { + "type": "array", + "items": { "$ref": "#/definitions/veggie" } + } + }, + "definitions": { + "veggie": { + "type": "object", + "required": [ "veggieName", "veggieLike" ], + "properties": { + "veggieName": { + "type": "string", + "description": "The name of the vegetable." + }, + "veggieLike": { + "type": "boolean", + "description": "Do I like this vegetable?" + } + } + } + } + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/arrays.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/arrays.schema.yaml new file mode 100644 index 00000000..c8b469fa --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/arrays.schema.yaml @@ -0,0 +1,28 @@ +schemaFormat: application/vnd.aai.asyncapi;version=2.3.0 +schema: + $id: 'https://example.com/arrays.schema.json' + $schema: 'http://json-schema.org/draft-07/schema#' + description: 'A representation of a person, company, organization, or place' + type: object + properties: + fruits: + type: array + items: + type: string + vegetables: + type: array + items: + $ref: '#/definitions/veggie' + definitions: + veggie: + type: object + required: + - veggieName + - veggieLike + properties: + veggieName: + type: string + description: The name of the vegetable. + veggieLike: + type: boolean + description: Do I like this vegetable? \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/complex-object.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/complex-object.schema.json new file mode 100644 index 00000000..f3dc9004 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/complex-object.schema.json @@ -0,0 +1,44 @@ +{ + "schemaFormat": "application/vnd.aai.asyncapi;version=2.3.0", + "schema": { + "$id": "https://example.com/complex-object.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Complex Object", + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "age": { + "type": "integer", + "minimum": 0 + }, + "address": { + "type": "object", + "properties": { + "street": { + "type": "string" + }, + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "postalCode": { + "type": "string", + "pattern": "\\d{5}" + } + }, + "required": ["street", "city", "state", "postalCode"] + }, + "hobbies": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": ["name", "age"] + } +} diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/complex-object.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/complex-object.schema.yaml new file mode 100644 index 00000000..d89e869f --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/complex-object.schema.yaml @@ -0,0 +1,36 @@ +schemaFormat: application/vnd.aai.asyncapi;version=2.3.0 +schema: + $id: 'https://example.com/complex-object.schema.json' + $schema: 'http://json-schema.org/draft-07/schema#' + title: Complex Object + type: object + properties: + name: + type: string + age: + type: integer + minimum: 0 + address: + type: object + properties: + street: + type: string + city: + type: string + state: + type: string + postalCode: + type: string + pattern: '\d{5}' + required: + - street + - city + - state + - postalCode + hobbies: + type: array + items: + type: string + required: + - name + - age \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.json new file mode 100644 index 00000000..723296d8 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.json @@ -0,0 +1,42 @@ +{ + "schemaFormat": "application/vnd.aai.asyncapi;version=2.3.0", + "schema": { + "$id": "https://example.com/conditional-validation-if-else.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Conditional Validation with If-Else", + "type": "object", + "properties": { + "isMember": { + "type": "boolean" + }, + "membershipNumber": { + "type": "string" + } + }, + "required": ["isMember"], + "if": { + "properties": { + "isMember": { + "const": true + } + } + }, + "then": { + "properties": { + "membershipNumber": { + "type": "string", + "minLength": 10, + "maxLength": 10 + } + } + }, + "else": { + "properties": { + "membershipNumber": { + "type": "string", + "minLength": 15 + } + } + } + } +} diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.yaml new file mode 100644 index 00000000..cda0bd4b --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.yaml @@ -0,0 +1,28 @@ +schemaFormat: application/vnd.aai.asyncapi;version=2.3.0 +schema: + $id: 'https://example.com/conditional-validation-if-else.schema.json' + $schema: 'http://json-schema.org/draft-07/schema#' + title: Conditional Validation with If-Else + type: object + properties: + isMember: + type: boolean + membershipNumber: + type: string + required: + - isMember + if: + properties: + isMember: + const: true + then: + properties: + membershipNumber: + type: string + minLength: 10 + maxLength: 10 + else: + properties: + membershipNumber: + type: string + minLength: 15 \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.json new file mode 100644 index 00000000..fd942604 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.json @@ -0,0 +1,175 @@ +{ + "schemaFormat": "application/vnd.aai.asyncapi;version=2.3.0", + "schema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://json-schema.org/draft-07/schema#", + "title": "Core schema meta-schema", + "definitions": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": { "$ref": "#" } + }, + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "allOf": [ + { "$ref": "#/definitions/nonNegativeInteger" }, + { "default": 0 } + ] + }, + "simpleTypes": { + "enum": [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + "stringArray": { + "type": "array", + "items": { "type": "string" }, + "uniqueItems": true, + "default": [] + } + }, + "type": ["object", "boolean"], + "properties": { + "$id": { + "type": "string", + "format": "uri-reference" + }, + "$schema": { + "type": "string", + "format": "uri" + }, + "$ref": { + "type": "string", + "format": "uri-reference" + }, + "$comment": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": true, + "readOnly": { + "type": "boolean", + "default": false + }, + "writeOnly": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": true + }, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + }, + "maxLength": { "$ref": "#/definitions/nonNegativeInteger" }, + "minLength": { "$ref": "#/definitions/nonNegativeIntegerDefault0" }, + "pattern": { + "type": "string", + "format": "regex" + }, + "additionalItems": { "$ref": "#" }, + "items": { + "anyOf": [ + { "$ref": "#" }, + { "$ref": "#/definitions/schemaArray" } + ], + "default": true + }, + "maxItems": { "$ref": "#/definitions/nonNegativeInteger" }, + "minItems": { "$ref": "#/definitions/nonNegativeIntegerDefault0" }, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "contains": { "$ref": "#" }, + "maxProperties": { "$ref": "#/definitions/nonNegativeInteger" }, + "minProperties": { "$ref": "#/definitions/nonNegativeIntegerDefault0" }, + "required": { "$ref": "#/definitions/stringArray" }, + "additionalProperties": { "$ref": "#" }, + "definitions": { + "type": "object", + "additionalProperties": { "$ref": "#" }, + "default": {} + }, + "properties": { + "type": "object", + "additionalProperties": { "$ref": "#" }, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": { "$ref": "#" }, + "propertyNames": { "format": "regex" }, + "default": {} + }, + "dependencies": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { "$ref": "#" }, + { "$ref": "#/definitions/stringArray" } + ] + } + }, + "propertyNames": { "$ref": "#" }, + "const": true, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": true + }, + "type": { + "anyOf": [ + { "$ref": "#/definitions/simpleTypes" }, + { + "type": "array", + "items": { "$ref": "#/definitions/simpleTypes" }, + "minItems": 1, + "uniqueItems": true + } + ] + }, + "format": { "type": "string" }, + "contentMediaType": { "type": "string" }, + "contentEncoding": { "type": "string" }, + "if": { "$ref": "#" }, + "then": { "$ref": "#" }, + "else": { "$ref": "#" }, + "allOf": { "$ref": "#/definitions/schemaArray" }, + "anyOf": { "$ref": "#/definitions/schemaArray" }, + "oneOf": { "$ref": "#/definitions/schemaArray" }, + "not": { "$ref": "#" } + }, + "default": true + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.yaml new file mode 100644 index 00000000..eac81525 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.yaml @@ -0,0 +1,164 @@ +schemaFormat: application/vnd.aai.asyncapi;version=2.3.0 +schema: + $schema: 'http://json-schema.org/draft-07/schema#' + $id: 'http://json-schema.org/draft-07/schema#' + title: Core schema meta-schema + definitions: + schemaArray: + type: array + minItems: 1 + items: + $ref: '#' + nonNegativeInteger: + type: integer + minimum: 0 + nonNegativeIntegerDefault0: + allOf: + - $ref: '#/definitions/nonNegativeInteger' + - default: 0 + simpleTypes: + enum: + - 'array' + - 'boolean' + - 'integer' + - 'null' + - 'number' + - 'object' + - 'string' + stringArray: + type: array + items: + type: string + uniqueItems: true + default: [] + type: + - object + - boolean + properties: + $id: + type: string + format: uri-reference + $schema: + type: string + format: uri + $ref: + type: string + format: uri-reference + $comment: + type: string + title: + type: string + description: + type: string + default: true + readOnly: + type: boolean + default: false + writeOnly: + type: boolean + default: false + examples: + type: array + items: true + multipleOf: + type: number + exclusiveMinimum: 0 + maximum: + type: number + exclusiveMaximum: + type: number + minimum: + type: number + exclusiveMinimum: + type: number + maxLength: + $ref: '#/definitions/nonNegativeInteger' + minLength: + $ref: '#/definitions/nonNegativeIntegerDefault0' + pattern: + type: string + format: regex + additionalItems: + $ref: '#' + items: + anyOf: + - $ref: '#' + - $ref: '#/definitions/schemaArray' + default: true + maxItems: + $ref: '#/definitions/nonNegativeInteger' + minItems: + $ref: '#/definitions/nonNegativeIntegerDefault0' + uniqueItems: + type: boolean + default: false + contains: + $ref: '#' + maxProperties: + $ref: '#/definitions/nonNegativeInteger' + minProperties: + $ref: '#/definitions/nonNegativeIntegerDefault0' + required: + $ref: '#/definitions/stringArray' + additionalProperties: + $ref: '#' + definitions: + type: object + additionalProperties: + $ref: '#' + default: {} + properties: + type: object + additionalProperties: + $ref: '#' + default: {} + patternProperties: + type: object + additionalProperties: + $ref: '#' + propertyNames: + format: regex + default: {} + dependencies: + type: object + additionalProperties: + anyOf: + - $ref: '#' + - $ref: '#/definitions/stringArray' + propertyNames: + $ref: '#' + const: true + enum: + type: array + items: true + minItems: 1 + uniqueItems: true + type: + anyOf: + - $ref: '#/definitions/simpleTypes' + - type: array + items: + $ref: '#/definitions/simpleTypes' + minItems: 1 + uniqueItems: true + format: + type: string + contentMediaType: + type: string + contentEncoding: + type: string + if: + $ref: '#' + then: + $ref: '#' + else: + $ref: '#' + allOf: + $ref: '#/definitions/schemaArray' + anyOf: + $ref: '#/definitions/schemaArray' + oneOf: + $ref: '#/definitions/schemaArray' + not: + $ref: '#' + default: true \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/enumerated-values.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/enumerated-values.schema.json new file mode 100644 index 00000000..15bc2a59 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/enumerated-values.schema.json @@ -0,0 +1,14 @@ +{ + "schemaFormat": "application/vnd.aai.asyncapi;version=2.3.0", + "schema": { + "$id": "https://example.com/enumerated-values.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Enumerated Values", + "type": "object", + "properties": { + "data": { + "enum": [42, true, "hello", null, [1, 2, 3]] + } + } + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/enumerated-values.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/enumerated-values.schema.yaml new file mode 100644 index 00000000..2cd2611f --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/enumerated-values.schema.yaml @@ -0,0 +1,16 @@ +schemaFormat: application/vnd.aai.asyncapi;version=2.3.0 +schema: + $id: 'https://example.com/enumerated-values.schema.json' + $schema: 'http://json-schema.org/draft-07/schema#' + title: Enumerated Values + type: object + properties: + data: + enum: + - 42 + - true + - hello + - null + - - 1 + - 2 + - 3 \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/person.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/person.schema.json new file mode 100644 index 00000000..a638c9d8 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/person.schema.json @@ -0,0 +1,24 @@ +{ + "schemaFormat": "application/vnd.aai.asyncapi;version=2.3.0", + "schema": { + "$id": "https://example.com/person.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Person", + "type": "object", + "properties": { + "firstName": { + "type": "string", + "description": "The person's first name." + }, + "lastName": { + "type": "string", + "description": "The person's last name." + }, + "age": { + "description": "Age in years which must be equal to or greater than zero.", + "type": "integer", + "minimum": 0 + } + } + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/person.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/person.schema.yaml new file mode 100644 index 00000000..a68efc39 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/person.schema.yaml @@ -0,0 +1,17 @@ +schemaFormat: application/vnd.aai.asyncapi;version=2.3.0 +schema: + $id: 'https://example.com/person.schema.json' + $schema: 'http://json-schema.org/draft-07/schema#' + title: Person + type: object + properties: + firstName: + type: string + description: The person's first name. + lastName: + type: string + description: The person's last name. + age: + description: Age in years which must be equal to or greater than zero. + type: integer + minimum: 0 \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/regex-pattern.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/regex-pattern.schema.json new file mode 100644 index 00000000..0ee9afce --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/regex-pattern.schema.json @@ -0,0 +1,15 @@ +{ + "schemaFormat": "application/vnd.aai.asyncapi;version=2.3.0", + "schema": { + "$id": "https://example.com/regex-pattern.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Regular Expression Pattern", + "type": "object", + "properties": { + "code": { + "type": "string", + "pattern": "^[A-Z]{3}-\\d{3}$" + } + } + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/regex-pattern.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/regex-pattern.schema.yaml new file mode 100644 index 00000000..5eb999f3 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.3.0/vnd.aai.asyncapi/regex-pattern.schema.yaml @@ -0,0 +1,10 @@ +schemaFormat: application/vnd.aai.asyncapi;version=2.3.0 +schema: + $id: 'https://example.com/regex-pattern.schema.json' + $schema: 'http://json-schema.org/draft-07/schema#' + title: Regular Expression Pattern + type: object + properties: + code: + type: string + pattern: '^[A-Z]{3}-\d{3}$' \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/arrays.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi+json/arrays.schema.json similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/arrays.schema.json rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi+json/arrays.schema.json diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/complex-object.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi+json/complex-object.schema.json similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/complex-object.schema.json rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi+json/complex-object.schema.json diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/conditional-validation-if-else.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi+json/conditional-validation-if-else.schema.json similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/conditional-validation-if-else.schema.json rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi+json/conditional-validation-if-else.schema.json diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/draft-07-core-schema-meta-schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi+json/draft-07-core-schema-meta-schema.json similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/draft-07-core-schema-meta-schema.json rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi+json/draft-07-core-schema-meta-schema.json diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/enumerated-values.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi+json/enumerated-values.schema.json similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/enumerated-values.schema.json rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi+json/enumerated-values.schema.json diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/person.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi+json/person.schema.json similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/person.schema.json rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi+json/person.schema.json diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/regex-pattern.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi+json/regex-pattern.schema.json similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/regex-pattern.schema.json rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi+json/regex-pattern.schema.json diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/arrays.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi+yaml/arrays.schema.yaml similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/arrays.schema.yaml rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi+yaml/arrays.schema.yaml diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/complex-object.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi+yaml/complex-object.schema.yaml similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/complex-object.schema.yaml rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi+yaml/complex-object.schema.yaml diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/conditional-validation-if-else.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi+yaml/conditional-validation-if-else.schema.yaml similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/conditional-validation-if-else.schema.yaml rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi+yaml/conditional-validation-if-else.schema.yaml diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/draft-07-core-schema-meta-schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi+yaml/draft-07-core-schema-meta-schema.yaml similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/draft-07-core-schema-meta-schema.yaml rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi+yaml/draft-07-core-schema-meta-schema.yaml diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/enumerated-values.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi+yaml/enumerated-values.schema.yaml similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/enumerated-values.schema.yaml rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi+yaml/enumerated-values.schema.yaml diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/person.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi+yaml/person.schema.yaml similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/person.schema.yaml rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi+yaml/person.schema.yaml diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/regex-pattern.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi+yaml/regex-pattern.schema.yaml similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/regex-pattern.schema.yaml rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi+yaml/regex-pattern.schema.yaml diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/arrays.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/arrays.schema.json new file mode 100644 index 00000000..ee453ee2 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/arrays.schema.json @@ -0,0 +1,37 @@ +{ + "schemaFormat": "application/vnd.aai.asyncapi;version=2.4.0", + "schema": { + "$id": "https://example.com/arrays.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "description": "A representation of a person, company, organization, or place", + "type": "object", + "properties": { + "fruits": { + "type": "array", + "items": { + "type": "string" + } + }, + "vegetables": { + "type": "array", + "items": { "$ref": "#/definitions/veggie" } + } + }, + "definitions": { + "veggie": { + "type": "object", + "required": [ "veggieName", "veggieLike" ], + "properties": { + "veggieName": { + "type": "string", + "description": "The name of the vegetable." + }, + "veggieLike": { + "type": "boolean", + "description": "Do I like this vegetable?" + } + } + } + } + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/arrays.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/arrays.schema.yaml new file mode 100644 index 00000000..ae29c1b4 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/arrays.schema.yaml @@ -0,0 +1,28 @@ +schemaFormat: application/vnd.aai.asyncapi;version=2.4.0 +schema: + $id: 'https://example.com/arrays.schema.json' + $schema: 'http://json-schema.org/draft-07/schema#' + description: 'A representation of a person, company, organization, or place' + type: object + properties: + fruits: + type: array + items: + type: string + vegetables: + type: array + items: + $ref: '#/definitions/veggie' + definitions: + veggie: + type: object + required: + - veggieName + - veggieLike + properties: + veggieName: + type: string + description: The name of the vegetable. + veggieLike: + type: boolean + description: Do I like this vegetable? \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/complex-object.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/complex-object.schema.json new file mode 100644 index 00000000..d66dab7b --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/complex-object.schema.json @@ -0,0 +1,44 @@ +{ + "schemaFormat": "application/vnd.aai.asyncapi;version=2.4.0", + "schema": { + "$id": "https://example.com/complex-object.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Complex Object", + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "age": { + "type": "integer", + "minimum": 0 + }, + "address": { + "type": "object", + "properties": { + "street": { + "type": "string" + }, + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "postalCode": { + "type": "string", + "pattern": "\\d{5}" + } + }, + "required": ["street", "city", "state", "postalCode"] + }, + "hobbies": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": ["name", "age"] + } +} diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/complex-object.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/complex-object.schema.yaml new file mode 100644 index 00000000..31fbf610 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/complex-object.schema.yaml @@ -0,0 +1,36 @@ +schemaFormat: application/vnd.aai.asyncapi;version=2.4.0 +schema: + $id: 'https://example.com/complex-object.schema.json' + $schema: 'http://json-schema.org/draft-07/schema#' + title: Complex Object + type: object + properties: + name: + type: string + age: + type: integer + minimum: 0 + address: + type: object + properties: + street: + type: string + city: + type: string + state: + type: string + postalCode: + type: string + pattern: '\d{5}' + required: + - street + - city + - state + - postalCode + hobbies: + type: array + items: + type: string + required: + - name + - age \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.json new file mode 100644 index 00000000..18cad7f6 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.json @@ -0,0 +1,42 @@ +{ + "schemaFormat": "application/vnd.aai.asyncapi;version=2.4.0", + "schema": { + "$id": "https://example.com/conditional-validation-if-else.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Conditional Validation with If-Else", + "type": "object", + "properties": { + "isMember": { + "type": "boolean" + }, + "membershipNumber": { + "type": "string" + } + }, + "required": ["isMember"], + "if": { + "properties": { + "isMember": { + "const": true + } + } + }, + "then": { + "properties": { + "membershipNumber": { + "type": "string", + "minLength": 10, + "maxLength": 10 + } + } + }, + "else": { + "properties": { + "membershipNumber": { + "type": "string", + "minLength": 15 + } + } + } + } +} diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.yaml new file mode 100644 index 00000000..48de1d4b --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.yaml @@ -0,0 +1,28 @@ +schemaFormat: application/vnd.aai.asyncapi;version=2.4.0 +schema: + $id: 'https://example.com/conditional-validation-if-else.schema.json' + $schema: 'http://json-schema.org/draft-07/schema#' + title: Conditional Validation with If-Else + type: object + properties: + isMember: + type: boolean + membershipNumber: + type: string + required: + - isMember + if: + properties: + isMember: + const: true + then: + properties: + membershipNumber: + type: string + minLength: 10 + maxLength: 10 + else: + properties: + membershipNumber: + type: string + minLength: 15 \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.json new file mode 100644 index 00000000..a185fc43 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.json @@ -0,0 +1,175 @@ +{ + "schemaFormat": "application/vnd.aai.asyncapi;version=2.4.0", + "schema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://json-schema.org/draft-07/schema#", + "title": "Core schema meta-schema", + "definitions": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": { "$ref": "#" } + }, + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "allOf": [ + { "$ref": "#/definitions/nonNegativeInteger" }, + { "default": 0 } + ] + }, + "simpleTypes": { + "enum": [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + "stringArray": { + "type": "array", + "items": { "type": "string" }, + "uniqueItems": true, + "default": [] + } + }, + "type": ["object", "boolean"], + "properties": { + "$id": { + "type": "string", + "format": "uri-reference" + }, + "$schema": { + "type": "string", + "format": "uri" + }, + "$ref": { + "type": "string", + "format": "uri-reference" + }, + "$comment": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": true, + "readOnly": { + "type": "boolean", + "default": false + }, + "writeOnly": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": true + }, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + }, + "maxLength": { "$ref": "#/definitions/nonNegativeInteger" }, + "minLength": { "$ref": "#/definitions/nonNegativeIntegerDefault0" }, + "pattern": { + "type": "string", + "format": "regex" + }, + "additionalItems": { "$ref": "#" }, + "items": { + "anyOf": [ + { "$ref": "#" }, + { "$ref": "#/definitions/schemaArray" } + ], + "default": true + }, + "maxItems": { "$ref": "#/definitions/nonNegativeInteger" }, + "minItems": { "$ref": "#/definitions/nonNegativeIntegerDefault0" }, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "contains": { "$ref": "#" }, + "maxProperties": { "$ref": "#/definitions/nonNegativeInteger" }, + "minProperties": { "$ref": "#/definitions/nonNegativeIntegerDefault0" }, + "required": { "$ref": "#/definitions/stringArray" }, + "additionalProperties": { "$ref": "#" }, + "definitions": { + "type": "object", + "additionalProperties": { "$ref": "#" }, + "default": {} + }, + "properties": { + "type": "object", + "additionalProperties": { "$ref": "#" }, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": { "$ref": "#" }, + "propertyNames": { "format": "regex" }, + "default": {} + }, + "dependencies": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { "$ref": "#" }, + { "$ref": "#/definitions/stringArray" } + ] + } + }, + "propertyNames": { "$ref": "#" }, + "const": true, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": true + }, + "type": { + "anyOf": [ + { "$ref": "#/definitions/simpleTypes" }, + { + "type": "array", + "items": { "$ref": "#/definitions/simpleTypes" }, + "minItems": 1, + "uniqueItems": true + } + ] + }, + "format": { "type": "string" }, + "contentMediaType": { "type": "string" }, + "contentEncoding": { "type": "string" }, + "if": { "$ref": "#" }, + "then": { "$ref": "#" }, + "else": { "$ref": "#" }, + "allOf": { "$ref": "#/definitions/schemaArray" }, + "anyOf": { "$ref": "#/definitions/schemaArray" }, + "oneOf": { "$ref": "#/definitions/schemaArray" }, + "not": { "$ref": "#" } + }, + "default": true + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.yaml new file mode 100644 index 00000000..b8d13d12 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.yaml @@ -0,0 +1,164 @@ +schemaFormat: application/vnd.aai.asyncapi;version=2.4.0 +schema: + $schema: 'http://json-schema.org/draft-07/schema#' + $id: 'http://json-schema.org/draft-07/schema#' + title: Core schema meta-schema + definitions: + schemaArray: + type: array + minItems: 1 + items: + $ref: '#' + nonNegativeInteger: + type: integer + minimum: 0 + nonNegativeIntegerDefault0: + allOf: + - $ref: '#/definitions/nonNegativeInteger' + - default: 0 + simpleTypes: + enum: + - 'array' + - 'boolean' + - 'integer' + - 'null' + - 'number' + - 'object' + - 'string' + stringArray: + type: array + items: + type: string + uniqueItems: true + default: [] + type: + - object + - boolean + properties: + $id: + type: string + format: uri-reference + $schema: + type: string + format: uri + $ref: + type: string + format: uri-reference + $comment: + type: string + title: + type: string + description: + type: string + default: true + readOnly: + type: boolean + default: false + writeOnly: + type: boolean + default: false + examples: + type: array + items: true + multipleOf: + type: number + exclusiveMinimum: 0 + maximum: + type: number + exclusiveMaximum: + type: number + minimum: + type: number + exclusiveMinimum: + type: number + maxLength: + $ref: '#/definitions/nonNegativeInteger' + minLength: + $ref: '#/definitions/nonNegativeIntegerDefault0' + pattern: + type: string + format: regex + additionalItems: + $ref: '#' + items: + anyOf: + - $ref: '#' + - $ref: '#/definitions/schemaArray' + default: true + maxItems: + $ref: '#/definitions/nonNegativeInteger' + minItems: + $ref: '#/definitions/nonNegativeIntegerDefault0' + uniqueItems: + type: boolean + default: false + contains: + $ref: '#' + maxProperties: + $ref: '#/definitions/nonNegativeInteger' + minProperties: + $ref: '#/definitions/nonNegativeIntegerDefault0' + required: + $ref: '#/definitions/stringArray' + additionalProperties: + $ref: '#' + definitions: + type: object + additionalProperties: + $ref: '#' + default: {} + properties: + type: object + additionalProperties: + $ref: '#' + default: {} + patternProperties: + type: object + additionalProperties: + $ref: '#' + propertyNames: + format: regex + default: {} + dependencies: + type: object + additionalProperties: + anyOf: + - $ref: '#' + - $ref: '#/definitions/stringArray' + propertyNames: + $ref: '#' + const: true + enum: + type: array + items: true + minItems: 1 + uniqueItems: true + type: + anyOf: + - $ref: '#/definitions/simpleTypes' + - type: array + items: + $ref: '#/definitions/simpleTypes' + minItems: 1 + uniqueItems: true + format: + type: string + contentMediaType: + type: string + contentEncoding: + type: string + if: + $ref: '#' + then: + $ref: '#' + else: + $ref: '#' + allOf: + $ref: '#/definitions/schemaArray' + anyOf: + $ref: '#/definitions/schemaArray' + oneOf: + $ref: '#/definitions/schemaArray' + not: + $ref: '#' + default: true \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/enumerated-values.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/enumerated-values.schema.json new file mode 100644 index 00000000..f5a24ba2 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/enumerated-values.schema.json @@ -0,0 +1,14 @@ +{ + "schemaFormat": "application/vnd.aai.asyncapi;version=2.4.0", + "schema": { + "$id": "https://example.com/enumerated-values.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Enumerated Values", + "type": "object", + "properties": { + "data": { + "enum": [42, true, "hello", null, [1, 2, 3]] + } + } + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/enumerated-values.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/enumerated-values.schema.yaml new file mode 100644 index 00000000..85acde63 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/enumerated-values.schema.yaml @@ -0,0 +1,16 @@ +schemaFormat: application/vnd.aai.asyncapi;version=2.4.0 +schema: + $id: 'https://example.com/enumerated-values.schema.json' + $schema: 'http://json-schema.org/draft-07/schema#' + title: Enumerated Values + type: object + properties: + data: + enum: + - 42 + - true + - hello + - null + - - 1 + - 2 + - 3 \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/person.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/person.schema.json new file mode 100644 index 00000000..c02e8c0f --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/person.schema.json @@ -0,0 +1,24 @@ +{ + "schemaFormat": "application/vnd.aai.asyncapi;version=2.4.0", + "schema": { + "$id": "https://example.com/person.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Person", + "type": "object", + "properties": { + "firstName": { + "type": "string", + "description": "The person's first name." + }, + "lastName": { + "type": "string", + "description": "The person's last name." + }, + "age": { + "description": "Age in years which must be equal to or greater than zero.", + "type": "integer", + "minimum": 0 + } + } + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/person.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/person.schema.yaml new file mode 100644 index 00000000..16502a8a --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/person.schema.yaml @@ -0,0 +1,17 @@ +schemaFormat: application/vnd.aai.asyncapi;version=2.4.0 +schema: + $id: 'https://example.com/person.schema.json' + $schema: 'http://json-schema.org/draft-07/schema#' + title: Person + type: object + properties: + firstName: + type: string + description: The person's first name. + lastName: + type: string + description: The person's last name. + age: + description: Age in years which must be equal to or greater than zero. + type: integer + minimum: 0 \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/regex-pattern.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/regex-pattern.schema.json new file mode 100644 index 00000000..f14b0bf8 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/regex-pattern.schema.json @@ -0,0 +1,15 @@ +{ + "schemaFormat": "application/vnd.aai.asyncapi;version=2.4.0", + "schema": { + "$id": "https://example.com/regex-pattern.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Regular Expression Pattern", + "type": "object", + "properties": { + "code": { + "type": "string", + "pattern": "^[A-Z]{3}-\\d{3}$" + } + } + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/regex-pattern.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/regex-pattern.schema.yaml new file mode 100644 index 00000000..3a9b47f0 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.4.0/vnd.aai.asyncapi/regex-pattern.schema.yaml @@ -0,0 +1,10 @@ +schemaFormat: application/vnd.aai.asyncapi;version=2.4.0 +schema: + $id: 'https://example.com/regex-pattern.schema.json' + $schema: 'http://json-schema.org/draft-07/schema#' + title: Regular Expression Pattern + type: object + properties: + code: + type: string + pattern: '^[A-Z]{3}-\d{3}$' \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/arrays.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi+json/arrays.schema.json similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/arrays.schema.json rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi+json/arrays.schema.json diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/complex-object.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi+json/complex-object.schema.json similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/complex-object.schema.json rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi+json/complex-object.schema.json diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/conditional-validation-if-else.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi+json/conditional-validation-if-else.schema.json similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/conditional-validation-if-else.schema.json rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi+json/conditional-validation-if-else.schema.json diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/draft-07-core-schema-meta-schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi+json/draft-07-core-schema-meta-schema.json similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/draft-07-core-schema-meta-schema.json rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi+json/draft-07-core-schema-meta-schema.json diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/enumerated-values.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi+json/enumerated-values.schema.json similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/enumerated-values.schema.json rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi+json/enumerated-values.schema.json diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/person.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi+json/person.schema.json similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/person.schema.json rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi+json/person.schema.json diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/regex-pattern.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi+json/regex-pattern.schema.json similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/regex-pattern.schema.json rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi+json/regex-pattern.schema.json diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/arrays.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi+yaml/arrays.schema.yaml similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/arrays.schema.yaml rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi+yaml/arrays.schema.yaml diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/complex-object.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi+yaml/complex-object.schema.yaml similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/complex-object.schema.yaml rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi+yaml/complex-object.schema.yaml diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/conditional-validation-if-else.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi+yaml/conditional-validation-if-else.schema.yaml similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/conditional-validation-if-else.schema.yaml rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi+yaml/conditional-validation-if-else.schema.yaml diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/draft-07-core-schema-meta-schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi+yaml/draft-07-core-schema-meta-schema.yaml similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/draft-07-core-schema-meta-schema.yaml rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi+yaml/draft-07-core-schema-meta-schema.yaml diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/enumerated-values.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi+yaml/enumerated-values.schema.yaml similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/enumerated-values.schema.yaml rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi+yaml/enumerated-values.schema.yaml diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/person.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi+yaml/person.schema.yaml similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/person.schema.yaml rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi+yaml/person.schema.yaml diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/regex-pattern.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi+yaml/regex-pattern.schema.yaml similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/regex-pattern.schema.yaml rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi+yaml/regex-pattern.schema.yaml diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/arrays.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/arrays.schema.json new file mode 100644 index 00000000..038be9e2 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/arrays.schema.json @@ -0,0 +1,37 @@ +{ + "schemaFormat": "application/vnd.aai.asyncapi;version=2.5.0", + "schema": { + "$id": "https://example.com/arrays.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "description": "A representation of a person, company, organization, or place", + "type": "object", + "properties": { + "fruits": { + "type": "array", + "items": { + "type": "string" + } + }, + "vegetables": { + "type": "array", + "items": { "$ref": "#/definitions/veggie" } + } + }, + "definitions": { + "veggie": { + "type": "object", + "required": [ "veggieName", "veggieLike" ], + "properties": { + "veggieName": { + "type": "string", + "description": "The name of the vegetable." + }, + "veggieLike": { + "type": "boolean", + "description": "Do I like this vegetable?" + } + } + } + } + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/arrays.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/arrays.schema.yaml new file mode 100644 index 00000000..545c2f6c --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/arrays.schema.yaml @@ -0,0 +1,28 @@ +schemaFormat: application/vnd.aai.asyncapi;version=2.5.0 +schema: + $id: 'https://example.com/arrays.schema.json' + $schema: 'http://json-schema.org/draft-07/schema#' + description: 'A representation of a person, company, organization, or place' + type: object + properties: + fruits: + type: array + items: + type: string + vegetables: + type: array + items: + $ref: '#/definitions/veggie' + definitions: + veggie: + type: object + required: + - veggieName + - veggieLike + properties: + veggieName: + type: string + description: The name of the vegetable. + veggieLike: + type: boolean + description: Do I like this vegetable? \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/complex-object.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/complex-object.schema.json new file mode 100644 index 00000000..4eddf572 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/complex-object.schema.json @@ -0,0 +1,44 @@ +{ + "schemaFormat": "application/vnd.aai.asyncapi;version=2.5.0", + "schema": { + "$id": "https://example.com/complex-object.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Complex Object", + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "age": { + "type": "integer", + "minimum": 0 + }, + "address": { + "type": "object", + "properties": { + "street": { + "type": "string" + }, + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "postalCode": { + "type": "string", + "pattern": "\\d{5}" + } + }, + "required": ["street", "city", "state", "postalCode"] + }, + "hobbies": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": ["name", "age"] + } +} diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/complex-object.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/complex-object.schema.yaml new file mode 100644 index 00000000..a79f3410 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/complex-object.schema.yaml @@ -0,0 +1,36 @@ +schemaFormat: application/vnd.aai.asyncapi;version=2.5.0 +schema: + $id: 'https://example.com/complex-object.schema.json' + $schema: 'http://json-schema.org/draft-07/schema#' + title: Complex Object + type: object + properties: + name: + type: string + age: + type: integer + minimum: 0 + address: + type: object + properties: + street: + type: string + city: + type: string + state: + type: string + postalCode: + type: string + pattern: '\d{5}' + required: + - street + - city + - state + - postalCode + hobbies: + type: array + items: + type: string + required: + - name + - age \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.json new file mode 100644 index 00000000..33c685e1 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.json @@ -0,0 +1,42 @@ +{ + "schemaFormat": "application/vnd.aai.asyncapi;version=2.5.0", + "schema": { + "$id": "https://example.com/conditional-validation-if-else.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Conditional Validation with If-Else", + "type": "object", + "properties": { + "isMember": { + "type": "boolean" + }, + "membershipNumber": { + "type": "string" + } + }, + "required": ["isMember"], + "if": { + "properties": { + "isMember": { + "const": true + } + } + }, + "then": { + "properties": { + "membershipNumber": { + "type": "string", + "minLength": 10, + "maxLength": 10 + } + } + }, + "else": { + "properties": { + "membershipNumber": { + "type": "string", + "minLength": 15 + } + } + } + } +} diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.yaml new file mode 100644 index 00000000..69b89f02 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.yaml @@ -0,0 +1,28 @@ +schemaFormat: application/vnd.aai.asyncapi;version=2.5.0 +schema: + $id: 'https://example.com/conditional-validation-if-else.schema.json' + $schema: 'http://json-schema.org/draft-07/schema#' + title: Conditional Validation with If-Else + type: object + properties: + isMember: + type: boolean + membershipNumber: + type: string + required: + - isMember + if: + properties: + isMember: + const: true + then: + properties: + membershipNumber: + type: string + minLength: 10 + maxLength: 10 + else: + properties: + membershipNumber: + type: string + minLength: 15 \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.json new file mode 100644 index 00000000..b7b68540 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.json @@ -0,0 +1,175 @@ +{ + "schemaFormat": "application/vnd.aai.asyncapi;version=2.5.0", + "schema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://json-schema.org/draft-07/schema#", + "title": "Core schema meta-schema", + "definitions": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": { "$ref": "#" } + }, + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "allOf": [ + { "$ref": "#/definitions/nonNegativeInteger" }, + { "default": 0 } + ] + }, + "simpleTypes": { + "enum": [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + "stringArray": { + "type": "array", + "items": { "type": "string" }, + "uniqueItems": true, + "default": [] + } + }, + "type": ["object", "boolean"], + "properties": { + "$id": { + "type": "string", + "format": "uri-reference" + }, + "$schema": { + "type": "string", + "format": "uri" + }, + "$ref": { + "type": "string", + "format": "uri-reference" + }, + "$comment": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": true, + "readOnly": { + "type": "boolean", + "default": false + }, + "writeOnly": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": true + }, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + }, + "maxLength": { "$ref": "#/definitions/nonNegativeInteger" }, + "minLength": { "$ref": "#/definitions/nonNegativeIntegerDefault0" }, + "pattern": { + "type": "string", + "format": "regex" + }, + "additionalItems": { "$ref": "#" }, + "items": { + "anyOf": [ + { "$ref": "#" }, + { "$ref": "#/definitions/schemaArray" } + ], + "default": true + }, + "maxItems": { "$ref": "#/definitions/nonNegativeInteger" }, + "minItems": { "$ref": "#/definitions/nonNegativeIntegerDefault0" }, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "contains": { "$ref": "#" }, + "maxProperties": { "$ref": "#/definitions/nonNegativeInteger" }, + "minProperties": { "$ref": "#/definitions/nonNegativeIntegerDefault0" }, + "required": { "$ref": "#/definitions/stringArray" }, + "additionalProperties": { "$ref": "#" }, + "definitions": { + "type": "object", + "additionalProperties": { "$ref": "#" }, + "default": {} + }, + "properties": { + "type": "object", + "additionalProperties": { "$ref": "#" }, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": { "$ref": "#" }, + "propertyNames": { "format": "regex" }, + "default": {} + }, + "dependencies": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { "$ref": "#" }, + { "$ref": "#/definitions/stringArray" } + ] + } + }, + "propertyNames": { "$ref": "#" }, + "const": true, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": true + }, + "type": { + "anyOf": [ + { "$ref": "#/definitions/simpleTypes" }, + { + "type": "array", + "items": { "$ref": "#/definitions/simpleTypes" }, + "minItems": 1, + "uniqueItems": true + } + ] + }, + "format": { "type": "string" }, + "contentMediaType": { "type": "string" }, + "contentEncoding": { "type": "string" }, + "if": { "$ref": "#" }, + "then": { "$ref": "#" }, + "else": { "$ref": "#" }, + "allOf": { "$ref": "#/definitions/schemaArray" }, + "anyOf": { "$ref": "#/definitions/schemaArray" }, + "oneOf": { "$ref": "#/definitions/schemaArray" }, + "not": { "$ref": "#" } + }, + "default": true + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.yaml new file mode 100644 index 00000000..ef123b0a --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.yaml @@ -0,0 +1,164 @@ +schemaFormat: application/vnd.aai.asyncapi;version=2.5.0 +schema: + $schema: 'http://json-schema.org/draft-07/schema#' + $id: 'http://json-schema.org/draft-07/schema#' + title: Core schema meta-schema + definitions: + schemaArray: + type: array + minItems: 1 + items: + $ref: '#' + nonNegativeInteger: + type: integer + minimum: 0 + nonNegativeIntegerDefault0: + allOf: + - $ref: '#/definitions/nonNegativeInteger' + - default: 0 + simpleTypes: + enum: + - 'array' + - 'boolean' + - 'integer' + - 'null' + - 'number' + - 'object' + - 'string' + stringArray: + type: array + items: + type: string + uniqueItems: true + default: [] + type: + - object + - boolean + properties: + $id: + type: string + format: uri-reference + $schema: + type: string + format: uri + $ref: + type: string + format: uri-reference + $comment: + type: string + title: + type: string + description: + type: string + default: true + readOnly: + type: boolean + default: false + writeOnly: + type: boolean + default: false + examples: + type: array + items: true + multipleOf: + type: number + exclusiveMinimum: 0 + maximum: + type: number + exclusiveMaximum: + type: number + minimum: + type: number + exclusiveMinimum: + type: number + maxLength: + $ref: '#/definitions/nonNegativeInteger' + minLength: + $ref: '#/definitions/nonNegativeIntegerDefault0' + pattern: + type: string + format: regex + additionalItems: + $ref: '#' + items: + anyOf: + - $ref: '#' + - $ref: '#/definitions/schemaArray' + default: true + maxItems: + $ref: '#/definitions/nonNegativeInteger' + minItems: + $ref: '#/definitions/nonNegativeIntegerDefault0' + uniqueItems: + type: boolean + default: false + contains: + $ref: '#' + maxProperties: + $ref: '#/definitions/nonNegativeInteger' + minProperties: + $ref: '#/definitions/nonNegativeIntegerDefault0' + required: + $ref: '#/definitions/stringArray' + additionalProperties: + $ref: '#' + definitions: + type: object + additionalProperties: + $ref: '#' + default: {} + properties: + type: object + additionalProperties: + $ref: '#' + default: {} + patternProperties: + type: object + additionalProperties: + $ref: '#' + propertyNames: + format: regex + default: {} + dependencies: + type: object + additionalProperties: + anyOf: + - $ref: '#' + - $ref: '#/definitions/stringArray' + propertyNames: + $ref: '#' + const: true + enum: + type: array + items: true + minItems: 1 + uniqueItems: true + type: + anyOf: + - $ref: '#/definitions/simpleTypes' + - type: array + items: + $ref: '#/definitions/simpleTypes' + minItems: 1 + uniqueItems: true + format: + type: string + contentMediaType: + type: string + contentEncoding: + type: string + if: + $ref: '#' + then: + $ref: '#' + else: + $ref: '#' + allOf: + $ref: '#/definitions/schemaArray' + anyOf: + $ref: '#/definitions/schemaArray' + oneOf: + $ref: '#/definitions/schemaArray' + not: + $ref: '#' + default: true \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/enumerated-values.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/enumerated-values.schema.json new file mode 100644 index 00000000..55d9ee66 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/enumerated-values.schema.json @@ -0,0 +1,14 @@ +{ + "schemaFormat": "application/vnd.aai.asyncapi;version=2.5.0", + "schema": { + "$id": "https://example.com/enumerated-values.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Enumerated Values", + "type": "object", + "properties": { + "data": { + "enum": [42, true, "hello", null, [1, 2, 3]] + } + } + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/enumerated-values.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/enumerated-values.schema.yaml new file mode 100644 index 00000000..efe6b7df --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/enumerated-values.schema.yaml @@ -0,0 +1,16 @@ +schemaFormat: application/vnd.aai.asyncapi;version=2.5.0 +schema: + $id: 'https://example.com/enumerated-values.schema.json' + $schema: 'http://json-schema.org/draft-07/schema#' + title: Enumerated Values + type: object + properties: + data: + enum: + - 42 + - true + - hello + - null + - - 1 + - 2 + - 3 \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/person.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/person.schema.json new file mode 100644 index 00000000..e4bebeee --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/person.schema.json @@ -0,0 +1,24 @@ +{ + "schemaFormat": "application/vnd.aai.asyncapi;version=2.5.0", + "schema": { + "$id": "https://example.com/person.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Person", + "type": "object", + "properties": { + "firstName": { + "type": "string", + "description": "The person's first name." + }, + "lastName": { + "type": "string", + "description": "The person's last name." + }, + "age": { + "description": "Age in years which must be equal to or greater than zero.", + "type": "integer", + "minimum": 0 + } + } + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/person.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/person.schema.yaml new file mode 100644 index 00000000..2360adc3 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/person.schema.yaml @@ -0,0 +1,17 @@ +schemaFormat: application/vnd.aai.asyncapi;version=2.5.0 +schema: + $id: 'https://example.com/person.schema.json' + $schema: 'http://json-schema.org/draft-07/schema#' + title: Person + type: object + properties: + firstName: + type: string + description: The person's first name. + lastName: + type: string + description: The person's last name. + age: + description: Age in years which must be equal to or greater than zero. + type: integer + minimum: 0 \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/regex-pattern.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/regex-pattern.schema.json new file mode 100644 index 00000000..a3bc197e --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/regex-pattern.schema.json @@ -0,0 +1,15 @@ +{ + "schemaFormat": "application/vnd.aai.asyncapi;version=2.5.0", + "schema": { + "$id": "https://example.com/regex-pattern.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Regular Expression Pattern", + "type": "object", + "properties": { + "code": { + "type": "string", + "pattern": "^[A-Z]{3}-\\d{3}$" + } + } + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/regex-pattern.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/regex-pattern.schema.yaml new file mode 100644 index 00000000..3a2a7509 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.5.0/vnd.aai.asyncapi/regex-pattern.schema.yaml @@ -0,0 +1,10 @@ +schemaFormat: application/vnd.aai.asyncapi;version=2.5.0 +schema: + $id: 'https://example.com/regex-pattern.schema.json' + $schema: 'http://json-schema.org/draft-07/schema#' + title: Regular Expression Pattern + type: object + properties: + code: + type: string + pattern: '^[A-Z]{3}-\d{3}$' \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/arrays.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi+json/arrays.schema.json similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/arrays.schema.json rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi+json/arrays.schema.json diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/complex-object.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi+json/complex-object.schema.json similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/complex-object.schema.json rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi+json/complex-object.schema.json diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/conditional-validation-if-else.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi+json/conditional-validation-if-else.schema.json similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/conditional-validation-if-else.schema.json rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi+json/conditional-validation-if-else.schema.json diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/draft-07-core-schema-meta-schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi+json/draft-07-core-schema-meta-schema.json similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/draft-07-core-schema-meta-schema.json rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi+json/draft-07-core-schema-meta-schema.json diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/enumerated-values.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi+json/enumerated-values.schema.json similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/enumerated-values.schema.json rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi+json/enumerated-values.schema.json diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/person.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi+json/person.schema.json similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/person.schema.json rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi+json/person.schema.json diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/regex-pattern.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi+json/regex-pattern.schema.json similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/regex-pattern.schema.json rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi+json/regex-pattern.schema.json diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/arrays.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi+yaml/arrays.schema.yaml similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/arrays.schema.yaml rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi+yaml/arrays.schema.yaml diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/complex-object.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi+yaml/complex-object.schema.yaml similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/complex-object.schema.yaml rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi+yaml/complex-object.schema.yaml diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/conditional-validation-if-else.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi+yaml/conditional-validation-if-else.schema.yaml similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/conditional-validation-if-else.schema.yaml rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi+yaml/conditional-validation-if-else.schema.yaml diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/draft-07-core-schema-meta-schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi+yaml/draft-07-core-schema-meta-schema.yaml similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/draft-07-core-schema-meta-schema.yaml rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi+yaml/draft-07-core-schema-meta-schema.yaml diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/enumerated-values.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi+yaml/enumerated-values.schema.yaml similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/enumerated-values.schema.yaml rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi+yaml/enumerated-values.schema.yaml diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/person.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi+yaml/person.schema.yaml similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/person.schema.yaml rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi+yaml/person.schema.yaml diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/regex-pattern.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi+yaml/regex-pattern.schema.yaml similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/regex-pattern.schema.yaml rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi+yaml/regex-pattern.schema.yaml diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/arrays.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/arrays.schema.json new file mode 100644 index 00000000..1e9aa24b --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/arrays.schema.json @@ -0,0 +1,37 @@ +{ + "schemaFormat": "application/vnd.aai.asyncapi;version=2.6.0", + "schema": { + "$id": "https://example.com/arrays.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "description": "A representation of a person, company, organization, or place", + "type": "object", + "properties": { + "fruits": { + "type": "array", + "items": { + "type": "string" + } + }, + "vegetables": { + "type": "array", + "items": { "$ref": "#/definitions/veggie" } + } + }, + "definitions": { + "veggie": { + "type": "object", + "required": [ "veggieName", "veggieLike" ], + "properties": { + "veggieName": { + "type": "string", + "description": "The name of the vegetable." + }, + "veggieLike": { + "type": "boolean", + "description": "Do I like this vegetable?" + } + } + } + } + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/arrays.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/arrays.schema.yaml new file mode 100644 index 00000000..972cbe24 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/arrays.schema.yaml @@ -0,0 +1,28 @@ +schemaFormat: application/vnd.aai.asyncapi;version=2.6.0 +schema: + $id: 'https://example.com/arrays.schema.json' + $schema: 'http://json-schema.org/draft-07/schema#' + description: 'A representation of a person, company, organization, or place' + type: object + properties: + fruits: + type: array + items: + type: string + vegetables: + type: array + items: + $ref: '#/definitions/veggie' + definitions: + veggie: + type: object + required: + - veggieName + - veggieLike + properties: + veggieName: + type: string + description: The name of the vegetable. + veggieLike: + type: boolean + description: Do I like this vegetable? \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/complex-object.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/complex-object.schema.json new file mode 100644 index 00000000..6062b663 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/complex-object.schema.json @@ -0,0 +1,44 @@ +{ + "schemaFormat": "application/vnd.aai.asyncapi;version=2.6.0", + "schema": { + "$id": "https://example.com/complex-object.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Complex Object", + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "age": { + "type": "integer", + "minimum": 0 + }, + "address": { + "type": "object", + "properties": { + "street": { + "type": "string" + }, + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "postalCode": { + "type": "string", + "pattern": "\\d{5}" + } + }, + "required": ["street", "city", "state", "postalCode"] + }, + "hobbies": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": ["name", "age"] + } +} diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/complex-object.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/complex-object.schema.yaml new file mode 100644 index 00000000..433bc7ca --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/complex-object.schema.yaml @@ -0,0 +1,36 @@ +schemaFormat: application/vnd.aai.asyncapi;version=2.6.0 +schema: + $id: 'https://example.com/complex-object.schema.json' + $schema: 'http://json-schema.org/draft-07/schema#' + title: Complex Object + type: object + properties: + name: + type: string + age: + type: integer + minimum: 0 + address: + type: object + properties: + street: + type: string + city: + type: string + state: + type: string + postalCode: + type: string + pattern: '\d{5}' + required: + - street + - city + - state + - postalCode + hobbies: + type: array + items: + type: string + required: + - name + - age \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.json new file mode 100644 index 00000000..69de6026 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.json @@ -0,0 +1,42 @@ +{ + "schemaFormat": "application/vnd.aai.asyncapi;version=2.6.0", + "schema": { + "$id": "https://example.com/conditional-validation-if-else.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Conditional Validation with If-Else", + "type": "object", + "properties": { + "isMember": { + "type": "boolean" + }, + "membershipNumber": { + "type": "string" + } + }, + "required": ["isMember"], + "if": { + "properties": { + "isMember": { + "const": true + } + } + }, + "then": { + "properties": { + "membershipNumber": { + "type": "string", + "minLength": 10, + "maxLength": 10 + } + } + }, + "else": { + "properties": { + "membershipNumber": { + "type": "string", + "minLength": 15 + } + } + } + } +} diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.yaml new file mode 100644 index 00000000..a65a8a4a --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.yaml @@ -0,0 +1,28 @@ +schemaFormat: application/vnd.aai.asyncapi;version=2.6.0 +schema: + $id: 'https://example.com/conditional-validation-if-else.schema.json' + $schema: 'http://json-schema.org/draft-07/schema#' + title: Conditional Validation with If-Else + type: object + properties: + isMember: + type: boolean + membershipNumber: + type: string + required: + - isMember + if: + properties: + isMember: + const: true + then: + properties: + membershipNumber: + type: string + minLength: 10 + maxLength: 10 + else: + properties: + membershipNumber: + type: string + minLength: 15 \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.json new file mode 100644 index 00000000..1cf64c5e --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.json @@ -0,0 +1,175 @@ +{ + "schemaFormat": "application/vnd.aai.asyncapi;version=2.6.0", + "schema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://json-schema.org/draft-07/schema#", + "title": "Core schema meta-schema", + "definitions": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": { "$ref": "#" } + }, + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "allOf": [ + { "$ref": "#/definitions/nonNegativeInteger" }, + { "default": 0 } + ] + }, + "simpleTypes": { + "enum": [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + "stringArray": { + "type": "array", + "items": { "type": "string" }, + "uniqueItems": true, + "default": [] + } + }, + "type": ["object", "boolean"], + "properties": { + "$id": { + "type": "string", + "format": "uri-reference" + }, + "$schema": { + "type": "string", + "format": "uri" + }, + "$ref": { + "type": "string", + "format": "uri-reference" + }, + "$comment": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": true, + "readOnly": { + "type": "boolean", + "default": false + }, + "writeOnly": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": true + }, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + }, + "maxLength": { "$ref": "#/definitions/nonNegativeInteger" }, + "minLength": { "$ref": "#/definitions/nonNegativeIntegerDefault0" }, + "pattern": { + "type": "string", + "format": "regex" + }, + "additionalItems": { "$ref": "#" }, + "items": { + "anyOf": [ + { "$ref": "#" }, + { "$ref": "#/definitions/schemaArray" } + ], + "default": true + }, + "maxItems": { "$ref": "#/definitions/nonNegativeInteger" }, + "minItems": { "$ref": "#/definitions/nonNegativeIntegerDefault0" }, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "contains": { "$ref": "#" }, + "maxProperties": { "$ref": "#/definitions/nonNegativeInteger" }, + "minProperties": { "$ref": "#/definitions/nonNegativeIntegerDefault0" }, + "required": { "$ref": "#/definitions/stringArray" }, + "additionalProperties": { "$ref": "#" }, + "definitions": { + "type": "object", + "additionalProperties": { "$ref": "#" }, + "default": {} + }, + "properties": { + "type": "object", + "additionalProperties": { "$ref": "#" }, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": { "$ref": "#" }, + "propertyNames": { "format": "regex" }, + "default": {} + }, + "dependencies": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { "$ref": "#" }, + { "$ref": "#/definitions/stringArray" } + ] + } + }, + "propertyNames": { "$ref": "#" }, + "const": true, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": true + }, + "type": { + "anyOf": [ + { "$ref": "#/definitions/simpleTypes" }, + { + "type": "array", + "items": { "$ref": "#/definitions/simpleTypes" }, + "minItems": 1, + "uniqueItems": true + } + ] + }, + "format": { "type": "string" }, + "contentMediaType": { "type": "string" }, + "contentEncoding": { "type": "string" }, + "if": { "$ref": "#" }, + "then": { "$ref": "#" }, + "else": { "$ref": "#" }, + "allOf": { "$ref": "#/definitions/schemaArray" }, + "anyOf": { "$ref": "#/definitions/schemaArray" }, + "oneOf": { "$ref": "#/definitions/schemaArray" }, + "not": { "$ref": "#" } + }, + "default": true + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.yaml new file mode 100644 index 00000000..46b10757 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.yaml @@ -0,0 +1,164 @@ +schemaFormat: application/vnd.aai.asyncapi;version=2.6.0 +schema: + $schema: 'http://json-schema.org/draft-07/schema#' + $id: 'http://json-schema.org/draft-07/schema#' + title: Core schema meta-schema + definitions: + schemaArray: + type: array + minItems: 1 + items: + $ref: '#' + nonNegativeInteger: + type: integer + minimum: 0 + nonNegativeIntegerDefault0: + allOf: + - $ref: '#/definitions/nonNegativeInteger' + - default: 0 + simpleTypes: + enum: + - 'array' + - 'boolean' + - 'integer' + - 'null' + - 'number' + - 'object' + - 'string' + stringArray: + type: array + items: + type: string + uniqueItems: true + default: [] + type: + - object + - boolean + properties: + $id: + type: string + format: uri-reference + $schema: + type: string + format: uri + $ref: + type: string + format: uri-reference + $comment: + type: string + title: + type: string + description: + type: string + default: true + readOnly: + type: boolean + default: false + writeOnly: + type: boolean + default: false + examples: + type: array + items: true + multipleOf: + type: number + exclusiveMinimum: 0 + maximum: + type: number + exclusiveMaximum: + type: number + minimum: + type: number + exclusiveMinimum: + type: number + maxLength: + $ref: '#/definitions/nonNegativeInteger' + minLength: + $ref: '#/definitions/nonNegativeIntegerDefault0' + pattern: + type: string + format: regex + additionalItems: + $ref: '#' + items: + anyOf: + - $ref: '#' + - $ref: '#/definitions/schemaArray' + default: true + maxItems: + $ref: '#/definitions/nonNegativeInteger' + minItems: + $ref: '#/definitions/nonNegativeIntegerDefault0' + uniqueItems: + type: boolean + default: false + contains: + $ref: '#' + maxProperties: + $ref: '#/definitions/nonNegativeInteger' + minProperties: + $ref: '#/definitions/nonNegativeIntegerDefault0' + required: + $ref: '#/definitions/stringArray' + additionalProperties: + $ref: '#' + definitions: + type: object + additionalProperties: + $ref: '#' + default: {} + properties: + type: object + additionalProperties: + $ref: '#' + default: {} + patternProperties: + type: object + additionalProperties: + $ref: '#' + propertyNames: + format: regex + default: {} + dependencies: + type: object + additionalProperties: + anyOf: + - $ref: '#' + - $ref: '#/definitions/stringArray' + propertyNames: + $ref: '#' + const: true + enum: + type: array + items: true + minItems: 1 + uniqueItems: true + type: + anyOf: + - $ref: '#/definitions/simpleTypes' + - type: array + items: + $ref: '#/definitions/simpleTypes' + minItems: 1 + uniqueItems: true + format: + type: string + contentMediaType: + type: string + contentEncoding: + type: string + if: + $ref: '#' + then: + $ref: '#' + else: + $ref: '#' + allOf: + $ref: '#/definitions/schemaArray' + anyOf: + $ref: '#/definitions/schemaArray' + oneOf: + $ref: '#/definitions/schemaArray' + not: + $ref: '#' + default: true \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/enumerated-values.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/enumerated-values.schema.json new file mode 100644 index 00000000..2504bee4 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/enumerated-values.schema.json @@ -0,0 +1,14 @@ +{ + "schemaFormat": "application/vnd.aai.asyncapi;version=2.6.0", + "schema": { + "$id": "https://example.com/enumerated-values.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Enumerated Values", + "type": "object", + "properties": { + "data": { + "enum": [42, true, "hello", null, [1, 2, 3]] + } + } + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/enumerated-values.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/enumerated-values.schema.yaml new file mode 100644 index 00000000..79a3224a --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/enumerated-values.schema.yaml @@ -0,0 +1,16 @@ +schemaFormat: application/vnd.aai.asyncapi;version=2.6.0 +schema: + $id: 'https://example.com/enumerated-values.schema.json' + $schema: 'http://json-schema.org/draft-07/schema#' + title: Enumerated Values + type: object + properties: + data: + enum: + - 42 + - true + - hello + - null + - - 1 + - 2 + - 3 \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/person.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/person.schema.json new file mode 100644 index 00000000..23625df1 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/person.schema.json @@ -0,0 +1,24 @@ +{ + "schemaFormat": "application/vnd.aai.asyncapi;version=2.6.0", + "schema": { + "$id": "https://example.com/person.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Person", + "type": "object", + "properties": { + "firstName": { + "type": "string", + "description": "The person's first name." + }, + "lastName": { + "type": "string", + "description": "The person's last name." + }, + "age": { + "description": "Age in years which must be equal to or greater than zero.", + "type": "integer", + "minimum": 0 + } + } + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/person.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/person.schema.yaml new file mode 100644 index 00000000..4f7102c2 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/person.schema.yaml @@ -0,0 +1,17 @@ +schemaFormat: application/vnd.aai.asyncapi;version=2.6.0 +schema: + $id: 'https://example.com/person.schema.json' + $schema: 'http://json-schema.org/draft-07/schema#' + title: Person + type: object + properties: + firstName: + type: string + description: The person's first name. + lastName: + type: string + description: The person's last name. + age: + description: Age in years which must be equal to or greater than zero. + type: integer + minimum: 0 \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/regex-pattern.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/regex-pattern.schema.json new file mode 100644 index 00000000..b6936391 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/regex-pattern.schema.json @@ -0,0 +1,15 @@ +{ + "schemaFormat": "application/vnd.aai.asyncapi;version=2.6.0", + "schema": { + "$id": "https://example.com/regex-pattern.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Regular Expression Pattern", + "type": "object", + "properties": { + "code": { + "type": "string", + "pattern": "^[A-Z]{3}-\\d{3}$" + } + } + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/regex-pattern.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/regex-pattern.schema.yaml new file mode 100644 index 00000000..b3afbf26 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/2.6.0/vnd.aai.asyncapi/regex-pattern.schema.yaml @@ -0,0 +1,10 @@ +schemaFormat: application/vnd.aai.asyncapi;version=2.6.0 +schema: + $id: 'https://example.com/regex-pattern.schema.json' + $schema: 'http://json-schema.org/draft-07/schema#' + title: Regular Expression Pattern + type: object + properties: + code: + type: string + pattern: '^[A-Z]{3}-\d{3}$' \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/arrays.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi+json/arrays.schema.json similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/arrays.schema.json rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi+json/arrays.schema.json diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/complex-object.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi+json/complex-object.schema.json similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/complex-object.schema.json rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi+json/complex-object.schema.json diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/conditional-validation-if-else.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi+json/conditional-validation-if-else.schema.json similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/conditional-validation-if-else.schema.json rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi+json/conditional-validation-if-else.schema.json diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/draft-07-core-schema-meta-schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi+json/draft-07-core-schema-meta-schema.json similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/draft-07-core-schema-meta-schema.json rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi+json/draft-07-core-schema-meta-schema.json diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/enumerated-values.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi+json/enumerated-values.schema.json similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/enumerated-values.schema.json rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi+json/enumerated-values.schema.json diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/person.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi+json/person.schema.json similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/person.schema.json rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi+json/person.schema.json diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/regex-pattern.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi+json/regex-pattern.schema.json similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/regex-pattern.schema.json rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi+json/regex-pattern.schema.json diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/arrays.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi+yaml/arrays.schema.yaml similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/arrays.schema.yaml rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi+yaml/arrays.schema.yaml diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/complex-object.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi+yaml/complex-object.schema.yaml similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/complex-object.schema.yaml rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi+yaml/complex-object.schema.yaml diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/conditional-validation-if-else.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi+yaml/conditional-validation-if-else.schema.yaml similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/conditional-validation-if-else.schema.yaml rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi+yaml/conditional-validation-if-else.schema.yaml diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/draft-07-core-schema-meta-schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi+yaml/draft-07-core-schema-meta-schema.yaml similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/draft-07-core-schema-meta-schema.yaml rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi+yaml/draft-07-core-schema-meta-schema.yaml diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/enumerated-values.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi+yaml/enumerated-values.schema.yaml similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/enumerated-values.schema.yaml rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi+yaml/enumerated-values.schema.yaml diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/person.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi+yaml/person.schema.yaml similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/person.schema.yaml rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi+yaml/person.schema.yaml diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/regex-pattern.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi+yaml/regex-pattern.schema.yaml similarity index 100% rename from asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/regex-pattern.schema.yaml rename to asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi+yaml/regex-pattern.schema.yaml diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/arrays.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/arrays.schema.json new file mode 100644 index 00000000..fde8915d --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/arrays.schema.json @@ -0,0 +1,37 @@ +{ + "schemaFormat": "application/vnd.aai.asyncapi;version=3.0.0", + "schema": { + "$id": "https://example.com/arrays.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "description": "A representation of a person, company, organization, or place", + "type": "object", + "properties": { + "fruits": { + "type": "array", + "items": { + "type": "string" + } + }, + "vegetables": { + "type": "array", + "items": { "$ref": "#/definitions/veggie" } + } + }, + "definitions": { + "veggie": { + "type": "object", + "required": [ "veggieName", "veggieLike" ], + "properties": { + "veggieName": { + "type": "string", + "description": "The name of the vegetable." + }, + "veggieLike": { + "type": "boolean", + "description": "Do I like this vegetable?" + } + } + } + } + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/arrays.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/arrays.schema.yaml new file mode 100644 index 00000000..d6d6df25 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/arrays.schema.yaml @@ -0,0 +1,28 @@ +schemaFormat: application/vnd.aai.asyncapi;version=3.0.0 +schema: + $id: 'https://example.com/arrays.schema.json' + $schema: 'http://json-schema.org/draft-07/schema#' + description: 'A representation of a person, company, organization, or place' + type: object + properties: + fruits: + type: array + items: + type: string + vegetables: + type: array + items: + $ref: '#/definitions/veggie' + definitions: + veggie: + type: object + required: + - veggieName + - veggieLike + properties: + veggieName: + type: string + description: The name of the vegetable. + veggieLike: + type: boolean + description: Do I like this vegetable? \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/complex-object.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/complex-object.schema.json new file mode 100644 index 00000000..380d050e --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/complex-object.schema.json @@ -0,0 +1,44 @@ +{ + "schemaFormat": "application/vnd.aai.asyncapi;version=3.0.0", + "schema": { + "$id": "https://example.com/complex-object.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Complex Object", + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "age": { + "type": "integer", + "minimum": 0 + }, + "address": { + "type": "object", + "properties": { + "street": { + "type": "string" + }, + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "postalCode": { + "type": "string", + "pattern": "\\d{5}" + } + }, + "required": ["street", "city", "state", "postalCode"] + }, + "hobbies": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": ["name", "age"] + } +} diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/complex-object.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/complex-object.schema.yaml new file mode 100644 index 00000000..3dc936a0 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/complex-object.schema.yaml @@ -0,0 +1,36 @@ +schemaFormat: application/vnd.aai.asyncapi;version=3.0.0 +schema: + $id: 'https://example.com/complex-object.schema.json' + $schema: 'http://json-schema.org/draft-07/schema#' + title: Complex Object + type: object + properties: + name: + type: string + age: + type: integer + minimum: 0 + address: + type: object + properties: + street: + type: string + city: + type: string + state: + type: string + postalCode: + type: string + pattern: '\d{5}' + required: + - street + - city + - state + - postalCode + hobbies: + type: array + items: + type: string + required: + - name + - age \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.json new file mode 100644 index 00000000..92e2a1b6 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.json @@ -0,0 +1,42 @@ +{ + "schemaFormat": "application/vnd.aai.asyncapi;version=3.0.0", + "schema": { + "$id": "https://example.com/conditional-validation-if-else.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Conditional Validation with If-Else", + "type": "object", + "properties": { + "isMember": { + "type": "boolean" + }, + "membershipNumber": { + "type": "string" + } + }, + "required": ["isMember"], + "if": { + "properties": { + "isMember": { + "const": true + } + } + }, + "then": { + "properties": { + "membershipNumber": { + "type": "string", + "minLength": 10, + "maxLength": 10 + } + } + }, + "else": { + "properties": { + "membershipNumber": { + "type": "string", + "minLength": 15 + } + } + } + } +} diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.yaml new file mode 100644 index 00000000..6a60760e --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/conditional-validation-if-else.schema.yaml @@ -0,0 +1,28 @@ +schemaFormat: application/vnd.aai.asyncapi;version=3.0.0 +schema: + $id: 'https://example.com/conditional-validation-if-else.schema.json' + $schema: 'http://json-schema.org/draft-07/schema#' + title: Conditional Validation with If-Else + type: object + properties: + isMember: + type: boolean + membershipNumber: + type: string + required: + - isMember + if: + properties: + isMember: + const: true + then: + properties: + membershipNumber: + type: string + minLength: 10 + maxLength: 10 + else: + properties: + membershipNumber: + type: string + minLength: 15 \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.json new file mode 100644 index 00000000..c61325c4 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.json @@ -0,0 +1,175 @@ +{ + "schemaFormat": "application/vnd.aai.asyncapi;version=3.0.0", + "schema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://json-schema.org/draft-07/schema#", + "title": "Core schema meta-schema", + "definitions": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": { "$ref": "#" } + }, + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "allOf": [ + { "$ref": "#/definitions/nonNegativeInteger" }, + { "default": 0 } + ] + }, + "simpleTypes": { + "enum": [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + "stringArray": { + "type": "array", + "items": { "type": "string" }, + "uniqueItems": true, + "default": [] + } + }, + "type": ["object", "boolean"], + "properties": { + "$id": { + "type": "string", + "format": "uri-reference" + }, + "$schema": { + "type": "string", + "format": "uri" + }, + "$ref": { + "type": "string", + "format": "uri-reference" + }, + "$comment": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": true, + "readOnly": { + "type": "boolean", + "default": false + }, + "writeOnly": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": true + }, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + }, + "maxLength": { "$ref": "#/definitions/nonNegativeInteger" }, + "minLength": { "$ref": "#/definitions/nonNegativeIntegerDefault0" }, + "pattern": { + "type": "string", + "format": "regex" + }, + "additionalItems": { "$ref": "#" }, + "items": { + "anyOf": [ + { "$ref": "#" }, + { "$ref": "#/definitions/schemaArray" } + ], + "default": true + }, + "maxItems": { "$ref": "#/definitions/nonNegativeInteger" }, + "minItems": { "$ref": "#/definitions/nonNegativeIntegerDefault0" }, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "contains": { "$ref": "#" }, + "maxProperties": { "$ref": "#/definitions/nonNegativeInteger" }, + "minProperties": { "$ref": "#/definitions/nonNegativeIntegerDefault0" }, + "required": { "$ref": "#/definitions/stringArray" }, + "additionalProperties": { "$ref": "#" }, + "definitions": { + "type": "object", + "additionalProperties": { "$ref": "#" }, + "default": {} + }, + "properties": { + "type": "object", + "additionalProperties": { "$ref": "#" }, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": { "$ref": "#" }, + "propertyNames": { "format": "regex" }, + "default": {} + }, + "dependencies": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { "$ref": "#" }, + { "$ref": "#/definitions/stringArray" } + ] + } + }, + "propertyNames": { "$ref": "#" }, + "const": true, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": true + }, + "type": { + "anyOf": [ + { "$ref": "#/definitions/simpleTypes" }, + { + "type": "array", + "items": { "$ref": "#/definitions/simpleTypes" }, + "minItems": 1, + "uniqueItems": true + } + ] + }, + "format": { "type": "string" }, + "contentMediaType": { "type": "string" }, + "contentEncoding": { "type": "string" }, + "if": { "$ref": "#" }, + "then": { "$ref": "#" }, + "else": { "$ref": "#" }, + "allOf": { "$ref": "#/definitions/schemaArray" }, + "anyOf": { "$ref": "#/definitions/schemaArray" }, + "oneOf": { "$ref": "#/definitions/schemaArray" }, + "not": { "$ref": "#" } + }, + "default": true + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.yaml new file mode 100644 index 00000000..b38a28f8 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/draft-07-core-schema-meta-schema.yaml @@ -0,0 +1,164 @@ +schemaFormat: application/vnd.aai.asyncapi;version=3.0.0 +schema: + $schema: 'http://json-schema.org/draft-07/schema#' + $id: 'http://json-schema.org/draft-07/schema#' + title: Core schema meta-schema + definitions: + schemaArray: + type: array + minItems: 1 + items: + $ref: '#' + nonNegativeInteger: + type: integer + minimum: 0 + nonNegativeIntegerDefault0: + allOf: + - $ref: '#/definitions/nonNegativeInteger' + - default: 0 + simpleTypes: + enum: + - 'array' + - 'boolean' + - 'integer' + - 'null' + - 'number' + - 'object' + - 'string' + stringArray: + type: array + items: + type: string + uniqueItems: true + default: [] + type: + - object + - boolean + properties: + $id: + type: string + format: uri-reference + $schema: + type: string + format: uri + $ref: + type: string + format: uri-reference + $comment: + type: string + title: + type: string + description: + type: string + default: true + readOnly: + type: boolean + default: false + writeOnly: + type: boolean + default: false + examples: + type: array + items: true + multipleOf: + type: number + exclusiveMinimum: 0 + maximum: + type: number + exclusiveMaximum: + type: number + minimum: + type: number + exclusiveMinimum: + type: number + maxLength: + $ref: '#/definitions/nonNegativeInteger' + minLength: + $ref: '#/definitions/nonNegativeIntegerDefault0' + pattern: + type: string + format: regex + additionalItems: + $ref: '#' + items: + anyOf: + - $ref: '#' + - $ref: '#/definitions/schemaArray' + default: true + maxItems: + $ref: '#/definitions/nonNegativeInteger' + minItems: + $ref: '#/definitions/nonNegativeIntegerDefault0' + uniqueItems: + type: boolean + default: false + contains: + $ref: '#' + maxProperties: + $ref: '#/definitions/nonNegativeInteger' + minProperties: + $ref: '#/definitions/nonNegativeIntegerDefault0' + required: + $ref: '#/definitions/stringArray' + additionalProperties: + $ref: '#' + definitions: + type: object + additionalProperties: + $ref: '#' + default: {} + properties: + type: object + additionalProperties: + $ref: '#' + default: {} + patternProperties: + type: object + additionalProperties: + $ref: '#' + propertyNames: + format: regex + default: {} + dependencies: + type: object + additionalProperties: + anyOf: + - $ref: '#' + - $ref: '#/definitions/stringArray' + propertyNames: + $ref: '#' + const: true + enum: + type: array + items: true + minItems: 1 + uniqueItems: true + type: + anyOf: + - $ref: '#/definitions/simpleTypes' + - type: array + items: + $ref: '#/definitions/simpleTypes' + minItems: 1 + uniqueItems: true + format: + type: string + contentMediaType: + type: string + contentEncoding: + type: string + if: + $ref: '#' + then: + $ref: '#' + else: + $ref: '#' + allOf: + $ref: '#/definitions/schemaArray' + anyOf: + $ref: '#/definitions/schemaArray' + oneOf: + $ref: '#/definitions/schemaArray' + not: + $ref: '#' + default: true \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/enumerated-values.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/enumerated-values.schema.json new file mode 100644 index 00000000..c5f2fbf7 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/enumerated-values.schema.json @@ -0,0 +1,14 @@ +{ + "schemaFormat": "application/vnd.aai.asyncapi;version=3.0.0", + "schema": { + "$id": "https://example.com/enumerated-values.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Enumerated Values", + "type": "object", + "properties": { + "data": { + "enum": [42, true, "hello", null, [1, 2, 3]] + } + } + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/enumerated-values.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/enumerated-values.schema.yaml new file mode 100644 index 00000000..d1bb7ecf --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/enumerated-values.schema.yaml @@ -0,0 +1,16 @@ +schemaFormat: application/vnd.aai.asyncapi;version=3.0.0 +schema: + $id: 'https://example.com/enumerated-values.schema.json' + $schema: 'http://json-schema.org/draft-07/schema#' + title: Enumerated Values + type: object + properties: + data: + enum: + - 42 + - true + - hello + - null + - - 1 + - 2 + - 3 \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/person.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/person.schema.json new file mode 100644 index 00000000..02913a8e --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/person.schema.json @@ -0,0 +1,24 @@ +{ + "schemaFormat": "application/vnd.aai.asyncapi;version=3.0.0", + "schema": { + "$id": "https://example.com/person.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Person", + "type": "object", + "properties": { + "firstName": { + "type": "string", + "description": "The person's first name." + }, + "lastName": { + "type": "string", + "description": "The person's last name." + }, + "age": { + "description": "Age in years which must be equal to or greater than zero.", + "type": "integer", + "minimum": 0 + } + } + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/person.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/person.schema.yaml new file mode 100644 index 00000000..147e627d --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/person.schema.yaml @@ -0,0 +1,17 @@ +schemaFormat: application/vnd.aai.asyncapi;version=3.0.0 +schema: + $id: 'https://example.com/person.schema.json' + $schema: 'http://json-schema.org/draft-07/schema#' + title: Person + type: object + properties: + firstName: + type: string + description: The person's first name. + lastName: + type: string + description: The person's last name. + age: + description: Age in years which must be equal to or greater than zero. + type: integer + minimum: 0 \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/regex-pattern.schema.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/regex-pattern.schema.json new file mode 100644 index 00000000..a891512b --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/regex-pattern.schema.json @@ -0,0 +1,15 @@ +{ + "schemaFormat": "application/vnd.aai.asyncapi;version=3.0.0", + "schema": { + "$id": "https://example.com/regex-pattern.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Regular Expression Pattern", + "type": "object", + "properties": { + "code": { + "type": "string", + "pattern": "^[A-Z]{3}-\\d{3}$" + } + } + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/regex-pattern.schema.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/regex-pattern.schema.yaml new file mode 100644 index 00000000..bb1def4a --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/asyncapi/3.0.0/vnd.aai.asyncapi/regex-pattern.schema.yaml @@ -0,0 +1,10 @@ +schemaFormat: application/vnd.aai.asyncapi;version=3.0.0 +schema: + $id: 'https://example.com/regex-pattern.schema.json' + $schema: 'http://json-schema.org/draft-07/schema#' + title: Regular Expression Pattern + type: object + properties: + code: + type: string + pattern: '^[A-Z]{3}-\d{3}$' \ No newline at end of file