diff --git a/test/definitions/3.0.0/models/channel/channel parameter.test.mjs b/test/definitions/3.0.0/models/channel/channel parameter.test.mjs new file mode 100644 index 00000000..09491146 --- /dev/null +++ b/test/definitions/3.0.0/models/channel/channel parameter.test.mjs @@ -0,0 +1,59 @@ +import { + JsonSchemaTestSuite, + JsonSchemaTestSuiteConfig, + JsonSchemaTestSuiteData +} from '@test/definitions/base-schema-test.mjs'; +import {describe} from 'vitest'; + +const jsonSchema = require('@definitions/3.0.0/parameter.json'); + +const config = new JsonSchemaTestSuiteConfig( + false, + [], + true, + [] +); + +const data = new JsonSchemaTestSuiteData( + jsonSchema, + [ + { + "description": "Id of the user.", + "default": "0e822ca6-5311-4d4c-b409-993a1820e689", + "enum": [ + "0e822ca6-5311-4d4c-b409-993a1820e689", + "381f5ddc-75c6-4c21-9ec1-3919ed345be9", + "70559d88-31a5-4ef2-8c34-7fbd04057ed5", + "c6dc0047-a90d-4efa-95e3-a272282934e0" + ], + "examples": [ + "0e822ca6-5311-4d4c-b409-993a1820e689", + "381f5ddc-75c6-4c21-9ec1-3919ed345be9", + "70559d88-31a5-4ef2-8c34-7fbd04057ed5", + "c6dc0047-a90d-4efa-95e3-a272282934e0" + ], + "location": "$message.payload#/user/id" + } + ], + {}, + {}, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } +); + +describe('Channel Parameter', () => { + new JsonSchemaTestSuite(data, config).testSuite() +}); diff --git a/test/definitions/3.0.0/models/channel/channel.test.mjs b/test/definitions/3.0.0/models/channel/channel.test.mjs new file mode 100644 index 00000000..d121772d --- /dev/null +++ b/test/definitions/3.0.0/models/channel/channel.test.mjs @@ -0,0 +1,82 @@ +import { + JsonSchemaTestSuite, + JsonSchemaTestSuiteConfig, + JsonSchemaTestSuiteData +} from '@test/definitions/base-schema-test.mjs'; +import {describe} from 'vitest'; + +const jsonSchema = require('@definitions/3.0.0/channel.json'); + +const config = new JsonSchemaTestSuiteConfig( + false, + [], + true, + [] +); + +const data = new JsonSchemaTestSuiteData( + jsonSchema, + [ + { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + }, + "userCompletedOrder": { + "$ref": "#/components/messages/userCompletedOrder" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { "$ref": "#/servers/rabbitmqInProd" }, + { "$ref": "#/servers/rabbitmqInStaging" } + ], + "bindings": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + }, + "tags": [ + { + "name": "user", + "description": "User-related messages" + } + ], + "externalDocs": { + "description": "Find more info here", + "url": "https://example.com" + } + } + ], + {}, + {}, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } +); + +describe('Channel', () => { + new JsonSchemaTestSuite(data, config).testSuite() +}); diff --git a/test/definitions/3.0.0/models/channel/channel/empty.json b/test/definitions/3.0.0/models/channel/channel/empty.json deleted file mode 100644 index 0967ef42..00000000 --- a/test/definitions/3.0.0/models/channel/channel/empty.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/test/definitions/3.0.0/models/channel/channel/example.json b/test/definitions/3.0.0/models/channel/channel/example.json deleted file mode 100644 index 99e41d24..00000000 --- a/test/definitions/3.0.0/models/channel/channel/example.json +++ /dev/null @@ -1,1994 +0,0 @@ -{ - "address": "users.{userId}", - "title": "Users channel", - "summary": "messages about user events.", - "description": "This channel is used to exchange messages about users signing up", - "servers": [ - { "$ref": "#/components/servers/1"}, - { "$ref": "#/components/servers/2"}, - { "$ref": "#/components/servers/3"} - ], - "parameters": { - "userId": { - "description": "Id of the user.", - "default": "0e822ca6-5311-4d4c-b409-993a1820e689", - "enum": [ - "0e822ca6-5311-4d4c-b409-993a1820e689", - "381f5ddc-75c6-4c21-9ec1-3919ed345be9", - "70559d88-31a5-4ef2-8c34-7fbd04057ed5", - "c6dc0047-a90d-4efa-95e3-a272282934e0" - ], - "examples": [ - "0e822ca6-5311-4d4c-b409-993a1820e689", - "381f5ddc-75c6-4c21-9ec1-3919ed345be9", - "70559d88-31a5-4ef2-8c34-7fbd04057ed5", - "c6dc0047-a90d-4efa-95e3-a272282934e0" - ], - "location": "$message.payload#/user/id" - }, - "userStatus": { "$ref": "#/components/parameters/user-status"} - }, - "messages": { - "changeStatus": { "$ref": "#/components/parameters/user-status"}, - "message": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - }, - "applicationInstanceId": { - "description": "Unique identifier for a given instance of the publishing application", - "type": "string" - } - } - }, - "payload": { - "type": "object", - "properties": { - "metric": { - "description": "Metric set by application", - "type": "string" - } - } - }, - "correlationId": { - "description": "Default Correlation ID", - "location": "$message.header#/correlationId" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" } - ], - "externalDocs": { - "description": "User sign up rules", - "url": "messages/sign-up-rules" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "bindingVersion": "0.1.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ], - "traits": [ - { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - }, - "applicationInstanceId": { - "description": "Unique identifier for a given instance of the publishing application", - "type": "string" - } - } - }, - "correlationId": { - "description": "Default Correlation ID", - "location": "$message.header#/correlationId" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" } - ], - "externalDocs": { - "description": "User sign up rules", - "url": "messages/sign-up-rules" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "bindingVersion": "0.1.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ] - }, - { - "headers": { - "$ref": "#/components/messages/message-header" - }, - "correlationId": { - "$ref": "#/components/messages/message-correlation-id" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" }, - { "$ref": "#/components/tags/tag" } - ], - "externalDocs": { - "$ref": "#/components/externalDocs/external-doc" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "bindingVersion": "0.1.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ] - }, - { - "headers": { - "schemaFormat": "application/vnd.aai.asyncapi+json;version=3.0.0", - "schema": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - }, - "applicationInstanceId": { - "description": "Unique identifier for a given instance of the publishing application", - "type": "string" - } - } - } - }, - "correlationId": { - "$ref": "#/components/messages/message-correlation-id" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" }, - { "$ref": "#/components/tags/tag" } - ], - "externalDocs": { - "$ref": "#/components/externalDocs/external-doc" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "bindingVersion": "0.1.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ] - } - ] - }, - "message 2": { - "headers": { - "schemaFormat": "application/vnd.aai.asyncapi+json;version=3.0.0", - "schema": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - }, - "applicationInstanceId": { - "description": "Unique identifier for a given instance of the publishing application", - "type": "string" - } - } - } - }, - "payload": { - "schemaFormat": "application/vnd.aai.asyncapi+json;version=3.0.0", - "schema": { - "type": "object", - "properties": { - "metric": { - "description": "Metric set by application", - "type": "string" - } - } - } - }, - "correlationId": { - "$ref" : "#/components/messages/message-correlation-id" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" }, - { "$ref": "#/components/tags/tag" } - ], - "externalDocs": { - "$ref": "#/components/externalDocs/external-doc" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "bindingVersion": "0.1.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ], - "traits": [ - { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - }, - "applicationInstanceId": { - "description": "Unique identifier for a given instance of the publishing application", - "type": "string" - } - } - }, - "correlationId": { - "description": "Default Correlation ID", - "location": "$message.header#/correlationId" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" } - ], - "externalDocs": { - "description": "User sign up rules", - "url": "messages/sign-up-rules" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "bindingVersion": "0.1.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ] - }, - { - "headers": { - "$ref": "#/components/messages/message-header" - }, - "correlationId": { - "$ref": "#/components/messages/message-correlation-id" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" }, - { "$ref": "#/components/tags/tag" } - ], - "externalDocs": { - "$ref": "#/components/externalDocs/external-doc" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "bindingVersion": "0.1.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ] - }, - { - "headers": { - "schemaFormat": "application/vnd.aai.asyncapi+json;version=3.0.0", - "schema": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - }, - "applicationInstanceId": { - "description": "Unique identifier for a given instance of the publishing application", - "type": "string" - } - } - } - }, - "correlationId": { - "$ref": "#/components/messages/message-correlation-id" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" }, - { "$ref": "#/components/tags/tag" } - ], - "externalDocs": { - "$ref": "#/components/externalDocs/external-doc" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "bindingVersion": "0.1.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ] - } - ] - }, - "message with reference": { - "headers": { - "$ref": "#/components/messages/message-header" - }, - "payload": { - "$ref": "#/components/messages/message-payload" - }, - "correlationId": { - "$ref": "#/components/messages/message-correlation-id" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" }, - { "$ref": "#/components/tags/tag" } - ], - "externalDocs": { - "$ref": "#/components/externalDocs/external-doc" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "bindingVersion": "0.1.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ], - "traits": [ - { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - }, - "applicationInstanceId": { - "description": "Unique identifier for a given instance of the publishing application", - "type": "string" - } - } - }, - "correlationId": { - "description": "Default Correlation ID", - "location": "$message.header#/correlationId" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" } - ], - "externalDocs": { - "description": "User sign up rules", - "url": "messages/sign-up-rules" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "bindingVersion": "0.1.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ] - }, - { - "headers": { - "$ref": "#/components/messages/message-header" - }, - "correlationId": { - "$ref": "#/components/messages/message-correlation-id" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" }, - { "$ref": "#/components/tags/tag" } - ], - "externalDocs": { - "$ref": "#/components/externalDocs/external-doc" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "bindingVersion": "0.1.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ] - }, - { - "headers": { - "schemaFormat": "application/vnd.aai.asyncapi+json;version=3.0.0", - "schema": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - }, - "applicationInstanceId": { - "description": "Unique identifier for a given instance of the publishing application", - "type": "string" - } - } - } - }, - "correlationId": { - "$ref": "#/components/messages/message-correlation-id" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" }, - { "$ref": "#/components/tags/tag" } - ], - "externalDocs": { - "$ref": "#/components/externalDocs/external-doc" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "bindingVersion": "0.1.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ] - } - ] - } - }, - "bindings": { - "amqp": { - "is": "routingKey", - "queue": { - "name": "my-queue-name", - "durable": true, - "exclusive": true, - "autoDelete": false, - "vhost": "/" - }, - "exchange": { - "name": "myExchange", - "type": "topic", - "durable": true, - "autoDelete": false, - "vhost": "/" - }, - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/channelBindings/amqp1" - }, - "anypointmq": { - "destination": "user-signup-exchg", - "destinationType": "exchange", - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "topic": "projects/your-project/topics/topic-proto-schema", - "messageRetentionDuration": "86400s", - "messageStoragePolicy": { - "allowedPersistenceRegions": [ - "us-central1", - "us-central2", - "us-east1", - "us-east4", - "us-east5", - "us-east7", - "us-south1", - "us-west1", - "us-west2", - "us-west3", - "us-west4" - ] - }, - "schemaSettings": { - "encoding": "binary", - "name": "projects/your-project/schemas/message-proto" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "$ref": "#/components/channelBindings/http" - }, - "ibmmq": { - "destinationType": "topic", - "queue": { - "objectName": "message", - "isPartitioned": false, - "exclusive": true - }, - "topic": { - "string": "messages", - "objectName": "message", - "durablePermitted": true, - "lastMsgRetained": true - }, - "maxMsgLength": 1024, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/channelBindings/jms" - }, - "kafka": { - "topic": "my-specific-topic-name", - "partitions": 20, - "replicas": 3, - "topicConfiguration": { - "cleanup.policy": [ - "delete", - "compact" - ], - "retention.ms": 604800000, - "retention.bytes": 1000000000, - "delete.retention.ms": 86400000, - "max.message.bytes": 1048588 - }, - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/channelBindings/mercure" - }, - "mqtt": { - "$ref": "#/components/channelBindings/mqtt" - }, - "mqtt5": { - "$ref": "#/components/channelBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/channelBindings/nats" - }, - "pulsar": { - "namespace": "staging", - "persistence": "persistent", - "compaction": 1000, - "geo-replication": [ - "us-east1", - "us-west1" - ], - "retention": { - "time": 7, - "size": 1000 - }, - "ttl": 360, - "deduplication": false, - "bindingVersion": "0.1.0" - }, - "redis": { - "$ref": "#/components/channelBindings/redis" - }, - "sns": { - "$ref": "#/components/channelBindings/sns" - }, - "solace": { - "$ref": "#/components/channelBindings/solace" - }, - "sqs": { - "$ref": "#/components/channelBindings/sqs" - }, - "stomp": { - "$ref": "#/components/channelBindings/stomp" - }, - "ws": { - "method": "GET", - "query": { - "type": "object", - "properties": { - "ref": { - "type": "string", - "description": "Referral." - } - } - }, - "headers": { - "type": "object", - "properties": { - "Authentication": { - "type": "string", - "description": "Authentication token" - } - } - } - } - }, - "tags": [ - { - "name": "user", - "description": "User-related messages", - "externalDocs": { - "description" : "Find more info here", - "url" : "https://example.com" - } - }, - { - "name": "user", - "description": "User-related messages", - "externalDocs": { - "$ref": "#/components/external-doc" - } - }, - { - "$ref": "#/components/tag" - } - ], - "externalDocs": { - "description" : "Find more info here", - "url" : "https://example.com" - } -} diff --git a/test/definitions/3.0.0/models/channel/channel/extended.json b/test/definitions/3.0.0/models/channel/channel/extended.json deleted file mode 100644 index 1403f905..00000000 --- a/test/definitions/3.0.0/models/channel/channel/extended.json +++ /dev/null @@ -1,1999 +0,0 @@ -{ - "address": "users.{userId}", - "title": "Users channel", - "summary": "messages about user events.", - "description": "This channel is used to exchange messages about users signing up", - "servers": [ - { "$ref": "#/components/servers/1"}, - { "$ref": "#/components/servers/2"}, - { "$ref": "#/components/servers/3"} - ], - "parameters": { - "userId": { - "description": "Id of the user.", - "default": "0e822ca6-5311-4d4c-b409-993a1820e689", - "enum": [ - "0e822ca6-5311-4d4c-b409-993a1820e689", - "381f5ddc-75c6-4c21-9ec1-3919ed345be9", - "70559d88-31a5-4ef2-8c34-7fbd04057ed5", - "c6dc0047-a90d-4efa-95e3-a272282934e0" - ], - "examples": [ - "0e822ca6-5311-4d4c-b409-993a1820e689", - "381f5ddc-75c6-4c21-9ec1-3919ed345be9", - "70559d88-31a5-4ef2-8c34-7fbd04057ed5", - "c6dc0047-a90d-4efa-95e3-a272282934e0" - ], - "location": "$message.payload#/user/id" - }, - "userStatus": { "$ref": "#/components/parameters/user-status"} - }, - "messages": { - "changeStatus": { "$ref": "#/components/parameters/user-status"}, - "message": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - }, - "applicationInstanceId": { - "description": "Unique identifier for a given instance of the publishing application", - "type": "string" - } - } - }, - "payload": { - "type": "object", - "properties": { - "metric": { - "description": "Metric set by application", - "type": "string" - } - } - }, - "correlationId": { - "description": "Default Correlation ID", - "location": "$message.header#/correlationId" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" } - ], - "externalDocs": { - "description": "User sign up rules", - "url": "messages/sign-up-rules" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "bindingVersion": "0.1.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ], - "traits": [ - { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - }, - "applicationInstanceId": { - "description": "Unique identifier for a given instance of the publishing application", - "type": "string" - } - } - }, - "correlationId": { - "description": "Default Correlation ID", - "location": "$message.header#/correlationId" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" } - ], - "externalDocs": { - "description": "User sign up rules", - "url": "messages/sign-up-rules" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "bindingVersion": "0.1.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ] - }, - { - "headers": { - "$ref": "#/components/messages/message-header" - }, - "correlationId": { - "$ref": "#/components/messages/message-correlation-id" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" }, - { "$ref": "#/components/tags/tag" } - ], - "externalDocs": { - "$ref": "#/components/externalDocs/external-doc" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "bindingVersion": "0.1.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ] - }, - { - "headers": { - "schemaFormat": "application/vnd.aai.asyncapi+json;version=3.0.0", - "schema": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - }, - "applicationInstanceId": { - "description": "Unique identifier for a given instance of the publishing application", - "type": "string" - } - } - } - }, - "correlationId": { - "$ref": "#/components/messages/message-correlation-id" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" }, - { "$ref": "#/components/tags/tag" } - ], - "externalDocs": { - "$ref": "#/components/externalDocs/external-doc" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "bindingVersion": "0.1.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ] - } - ] - }, - "message 2": { - "headers": { - "schemaFormat": "application/vnd.aai.asyncapi+json;version=3.0.0", - "schema": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - }, - "applicationInstanceId": { - "description": "Unique identifier for a given instance of the publishing application", - "type": "string" - } - } - } - }, - "payload": { - "schemaFormat": "application/vnd.aai.asyncapi+json;version=3.0.0", - "schema": { - "type": "object", - "properties": { - "metric": { - "description": "Metric set by application", - "type": "string" - } - } - } - }, - "correlationId": { - "$ref" : "#/components/messages/message-correlation-id" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" }, - { "$ref": "#/components/tags/tag" } - ], - "externalDocs": { - "$ref": "#/components/externalDocs/external-doc" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "bindingVersion": "0.1.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ], - "traits": [ - { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - }, - "applicationInstanceId": { - "description": "Unique identifier for a given instance of the publishing application", - "type": "string" - } - } - }, - "correlationId": { - "description": "Default Correlation ID", - "location": "$message.header#/correlationId" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" } - ], - "externalDocs": { - "description": "User sign up rules", - "url": "messages/sign-up-rules" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "bindingVersion": "0.1.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ] - }, - { - "headers": { - "$ref": "#/components/messages/message-header" - }, - "correlationId": { - "$ref": "#/components/messages/message-correlation-id" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" }, - { "$ref": "#/components/tags/tag" } - ], - "externalDocs": { - "$ref": "#/components/externalDocs/external-doc" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "bindingVersion": "0.1.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ] - }, - { - "headers": { - "schemaFormat": "application/vnd.aai.asyncapi+json;version=3.0.0", - "schema": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - }, - "applicationInstanceId": { - "description": "Unique identifier for a given instance of the publishing application", - "type": "string" - } - } - } - }, - "correlationId": { - "$ref": "#/components/messages/message-correlation-id" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" }, - { "$ref": "#/components/tags/tag" } - ], - "externalDocs": { - "$ref": "#/components/externalDocs/external-doc" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "bindingVersion": "0.1.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ] - } - ] - }, - "message with reference": { - "headers": { - "$ref": "#/components/messages/message-header" - }, - "payload": { - "$ref": "#/components/messages/message-payload" - }, - "correlationId": { - "$ref": "#/components/messages/message-correlation-id" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" }, - { "$ref": "#/components/tags/tag" } - ], - "externalDocs": { - "$ref": "#/components/externalDocs/external-doc" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "bindingVersion": "0.1.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ], - "traits": [ - { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - }, - "applicationInstanceId": { - "description": "Unique identifier for a given instance of the publishing application", - "type": "string" - } - } - }, - "correlationId": { - "description": "Default Correlation ID", - "location": "$message.header#/correlationId" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" } - ], - "externalDocs": { - "description": "User sign up rules", - "url": "messages/sign-up-rules" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "bindingVersion": "0.1.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ] - }, - { - "headers": { - "$ref": "#/components/messages/message-header" - }, - "correlationId": { - "$ref": "#/components/messages/message-correlation-id" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" }, - { "$ref": "#/components/tags/tag" } - ], - "externalDocs": { - "$ref": "#/components/externalDocs/external-doc" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "bindingVersion": "0.1.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ] - }, - { - "headers": { - "schemaFormat": "application/vnd.aai.asyncapi+json;version=3.0.0", - "schema": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - }, - "applicationInstanceId": { - "description": "Unique identifier for a given instance of the publishing application", - "type": "string" - } - } - } - }, - "correlationId": { - "$ref": "#/components/messages/message-correlation-id" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" }, - { "$ref": "#/components/tags/tag" } - ], - "externalDocs": { - "$ref": "#/components/externalDocs/external-doc" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "bindingVersion": "0.1.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ] - } - ] - } - }, - "bindings": { - "amqp": { - "is": "routingKey", - "queue": { - "name": "my-queue-name", - "durable": true, - "exclusive": true, - "autoDelete": false, - "vhost": "/" - }, - "exchange": { - "name": "myExchange", - "type": "topic", - "durable": true, - "autoDelete": false, - "vhost": "/" - }, - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/channelBindings/amqp1" - }, - "anypointmq": { - "destination": "user-signup-exchg", - "destinationType": "exchange", - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "topic": "projects/your-project/topics/topic-proto-schema", - "messageRetentionDuration": "86400s", - "messageStoragePolicy": { - "allowedPersistenceRegions": [ - "us-central1", - "us-central2", - "us-east1", - "us-east4", - "us-east5", - "us-east7", - "us-south1", - "us-west1", - "us-west2", - "us-west3", - "us-west4" - ] - }, - "schemaSettings": { - "encoding": "binary", - "name": "projects/your-project/schemas/message-proto" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "$ref": "#/components/channelBindings/http" - }, - "ibmmq": { - "destinationType": "topic", - "queue": { - "objectName": "message", - "isPartitioned": false, - "exclusive": true - }, - "topic": { - "string": "messages", - "objectName": "message", - "durablePermitted": true, - "lastMsgRetained": true - }, - "maxMsgLength": 1024, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/channelBindings/jms" - }, - "kafka": { - "topic": "my-specific-topic-name", - "partitions": 20, - "replicas": 3, - "topicConfiguration": { - "cleanup.policy": [ - "delete", - "compact" - ], - "retention.ms": 604800000, - "retention.bytes": 1000000000, - "delete.retention.ms": 86400000, - "max.message.bytes": 1048588 - }, - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/channelBindings/mercure" - }, - "mqtt": { - "$ref": "#/components/channelBindings/mqtt" - }, - "mqtt5": { - "$ref": "#/components/channelBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/channelBindings/nats" - }, - "pulsar": { - "namespace": "staging", - "persistence": "persistent", - "compaction": 1000, - "geo-replication": [ - "us-east1", - "us-west1" - ], - "retention": { - "time": 7, - "size": 1000 - }, - "ttl": 360, - "deduplication": false, - "bindingVersion": "0.1.0" - }, - "redis": { - "$ref": "#/components/channelBindings/redis" - }, - "sns": { - "$ref": "#/components/channelBindings/sns" - }, - "solace": { - "$ref": "#/components/channelBindings/solace" - }, - "sqs": { - "$ref": "#/components/channelBindings/sqs" - }, - "stomp": { - "$ref": "#/components/channelBindings/stomp" - }, - "ws": { - "method": "GET", - "query": { - "type": "object", - "properties": { - "ref": { - "type": "string", - "description": "Referral." - } - } - }, - "headers": { - "type": "object", - "properties": { - "Authentication": { - "type": "string", - "description": "Authentication token" - } - } - } - } - }, - "tags": [ - { - "name": "user", - "description": "User-related messages", - "externalDocs": { - "description" : "Find more info here", - "url" : "https://example.com" - } - }, - { - "name": "user", - "description": "User-related messages", - "externalDocs": { - "$ref": "#/components/external-doc" - } - }, - { - "$ref": "#/components/tag" - } - ], - "externalDocs": { - "description" : "Find more info here", - "url" : "https://example.com" - }, - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} diff --git a/test/definitions/3.0.0/models/channel/channel/index.mjs b/test/definitions/3.0.0/models/channel/channel/index.mjs deleted file mode 100644 index ae17245c..00000000 --- a/test/definitions/3.0.0/models/channel/channel/index.mjs +++ /dev/null @@ -1,37 +0,0 @@ -import {describe, it} from 'vitest'; -import TestHelper from '@test/test-helper'; -import path from 'path'; - -const jsonSchema = require('@definitions/3.0.0/channel.json'); - -describe.skip('Channel. Reason: multiple errors with bindings, externalDoc, ...', () => { - it('example', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './example.json'), - )); - - it('empty', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './empty.json'), - )); - - it('without required properties', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './without required properties.json'), - )); - - it('only required properties', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './only required properties.json'), - )); - - it('extended', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './extended.json'), - )); - - it('wrongly extended', () => TestHelper.wronglyExtended( - jsonSchema, - path.resolve(__dirname, './wrongly extended.json'), - )); -}); diff --git a/test/definitions/3.0.0/models/channel/channel/only required properties.json b/test/definitions/3.0.0/models/channel/channel/only required properties.json deleted file mode 100644 index 0967ef42..00000000 --- a/test/definitions/3.0.0/models/channel/channel/only required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/test/definitions/3.0.0/models/channel/channel/without required properties.json b/test/definitions/3.0.0/models/channel/channel/without required properties.json deleted file mode 100644 index 99e41d24..00000000 --- a/test/definitions/3.0.0/models/channel/channel/without required properties.json +++ /dev/null @@ -1,1994 +0,0 @@ -{ - "address": "users.{userId}", - "title": "Users channel", - "summary": "messages about user events.", - "description": "This channel is used to exchange messages about users signing up", - "servers": [ - { "$ref": "#/components/servers/1"}, - { "$ref": "#/components/servers/2"}, - { "$ref": "#/components/servers/3"} - ], - "parameters": { - "userId": { - "description": "Id of the user.", - "default": "0e822ca6-5311-4d4c-b409-993a1820e689", - "enum": [ - "0e822ca6-5311-4d4c-b409-993a1820e689", - "381f5ddc-75c6-4c21-9ec1-3919ed345be9", - "70559d88-31a5-4ef2-8c34-7fbd04057ed5", - "c6dc0047-a90d-4efa-95e3-a272282934e0" - ], - "examples": [ - "0e822ca6-5311-4d4c-b409-993a1820e689", - "381f5ddc-75c6-4c21-9ec1-3919ed345be9", - "70559d88-31a5-4ef2-8c34-7fbd04057ed5", - "c6dc0047-a90d-4efa-95e3-a272282934e0" - ], - "location": "$message.payload#/user/id" - }, - "userStatus": { "$ref": "#/components/parameters/user-status"} - }, - "messages": { - "changeStatus": { "$ref": "#/components/parameters/user-status"}, - "message": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - }, - "applicationInstanceId": { - "description": "Unique identifier for a given instance of the publishing application", - "type": "string" - } - } - }, - "payload": { - "type": "object", - "properties": { - "metric": { - "description": "Metric set by application", - "type": "string" - } - } - }, - "correlationId": { - "description": "Default Correlation ID", - "location": "$message.header#/correlationId" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" } - ], - "externalDocs": { - "description": "User sign up rules", - "url": "messages/sign-up-rules" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "bindingVersion": "0.1.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ], - "traits": [ - { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - }, - "applicationInstanceId": { - "description": "Unique identifier for a given instance of the publishing application", - "type": "string" - } - } - }, - "correlationId": { - "description": "Default Correlation ID", - "location": "$message.header#/correlationId" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" } - ], - "externalDocs": { - "description": "User sign up rules", - "url": "messages/sign-up-rules" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "bindingVersion": "0.1.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ] - }, - { - "headers": { - "$ref": "#/components/messages/message-header" - }, - "correlationId": { - "$ref": "#/components/messages/message-correlation-id" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" }, - { "$ref": "#/components/tags/tag" } - ], - "externalDocs": { - "$ref": "#/components/externalDocs/external-doc" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "bindingVersion": "0.1.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ] - }, - { - "headers": { - "schemaFormat": "application/vnd.aai.asyncapi+json;version=3.0.0", - "schema": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - }, - "applicationInstanceId": { - "description": "Unique identifier for a given instance of the publishing application", - "type": "string" - } - } - } - }, - "correlationId": { - "$ref": "#/components/messages/message-correlation-id" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" }, - { "$ref": "#/components/tags/tag" } - ], - "externalDocs": { - "$ref": "#/components/externalDocs/external-doc" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "bindingVersion": "0.1.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ] - } - ] - }, - "message 2": { - "headers": { - "schemaFormat": "application/vnd.aai.asyncapi+json;version=3.0.0", - "schema": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - }, - "applicationInstanceId": { - "description": "Unique identifier for a given instance of the publishing application", - "type": "string" - } - } - } - }, - "payload": { - "schemaFormat": "application/vnd.aai.asyncapi+json;version=3.0.0", - "schema": { - "type": "object", - "properties": { - "metric": { - "description": "Metric set by application", - "type": "string" - } - } - } - }, - "correlationId": { - "$ref" : "#/components/messages/message-correlation-id" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" }, - { "$ref": "#/components/tags/tag" } - ], - "externalDocs": { - "$ref": "#/components/externalDocs/external-doc" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "bindingVersion": "0.1.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ], - "traits": [ - { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - }, - "applicationInstanceId": { - "description": "Unique identifier for a given instance of the publishing application", - "type": "string" - } - } - }, - "correlationId": { - "description": "Default Correlation ID", - "location": "$message.header#/correlationId" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" } - ], - "externalDocs": { - "description": "User sign up rules", - "url": "messages/sign-up-rules" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "bindingVersion": "0.1.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ] - }, - { - "headers": { - "$ref": "#/components/messages/message-header" - }, - "correlationId": { - "$ref": "#/components/messages/message-correlation-id" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" }, - { "$ref": "#/components/tags/tag" } - ], - "externalDocs": { - "$ref": "#/components/externalDocs/external-doc" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "bindingVersion": "0.1.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ] - }, - { - "headers": { - "schemaFormat": "application/vnd.aai.asyncapi+json;version=3.0.0", - "schema": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - }, - "applicationInstanceId": { - "description": "Unique identifier for a given instance of the publishing application", - "type": "string" - } - } - } - }, - "correlationId": { - "$ref": "#/components/messages/message-correlation-id" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" }, - { "$ref": "#/components/tags/tag" } - ], - "externalDocs": { - "$ref": "#/components/externalDocs/external-doc" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "bindingVersion": "0.1.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ] - } - ] - }, - "message with reference": { - "headers": { - "$ref": "#/components/messages/message-header" - }, - "payload": { - "$ref": "#/components/messages/message-payload" - }, - "correlationId": { - "$ref": "#/components/messages/message-correlation-id" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" }, - { "$ref": "#/components/tags/tag" } - ], - "externalDocs": { - "$ref": "#/components/externalDocs/external-doc" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "bindingVersion": "0.1.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ], - "traits": [ - { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - }, - "applicationInstanceId": { - "description": "Unique identifier for a given instance of the publishing application", - "type": "string" - } - } - }, - "correlationId": { - "description": "Default Correlation ID", - "location": "$message.header#/correlationId" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" } - ], - "externalDocs": { - "description": "User sign up rules", - "url": "messages/sign-up-rules" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "bindingVersion": "0.1.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ] - }, - { - "headers": { - "$ref": "#/components/messages/message-header" - }, - "correlationId": { - "$ref": "#/components/messages/message-correlation-id" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" }, - { "$ref": "#/components/tags/tag" } - ], - "externalDocs": { - "$ref": "#/components/externalDocs/external-doc" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "bindingVersion": "0.1.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ] - }, - { - "headers": { - "schemaFormat": "application/vnd.aai.asyncapi+json;version=3.0.0", - "schema": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - }, - "applicationInstanceId": { - "description": "Unique identifier for a given instance of the publishing application", - "type": "string" - } - } - } - }, - "correlationId": { - "$ref": "#/components/messages/message-correlation-id" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" }, - { "$ref": "#/components/tags/tag" } - ], - "externalDocs": { - "$ref": "#/components/externalDocs/external-doc" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "bindingVersion": "0.1.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ] - } - ] - } - }, - "bindings": { - "amqp": { - "is": "routingKey", - "queue": { - "name": "my-queue-name", - "durable": true, - "exclusive": true, - "autoDelete": false, - "vhost": "/" - }, - "exchange": { - "name": "myExchange", - "type": "topic", - "durable": true, - "autoDelete": false, - "vhost": "/" - }, - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/channelBindings/amqp1" - }, - "anypointmq": { - "destination": "user-signup-exchg", - "destinationType": "exchange", - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "topic": "projects/your-project/topics/topic-proto-schema", - "messageRetentionDuration": "86400s", - "messageStoragePolicy": { - "allowedPersistenceRegions": [ - "us-central1", - "us-central2", - "us-east1", - "us-east4", - "us-east5", - "us-east7", - "us-south1", - "us-west1", - "us-west2", - "us-west3", - "us-west4" - ] - }, - "schemaSettings": { - "encoding": "binary", - "name": "projects/your-project/schemas/message-proto" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "$ref": "#/components/channelBindings/http" - }, - "ibmmq": { - "destinationType": "topic", - "queue": { - "objectName": "message", - "isPartitioned": false, - "exclusive": true - }, - "topic": { - "string": "messages", - "objectName": "message", - "durablePermitted": true, - "lastMsgRetained": true - }, - "maxMsgLength": 1024, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/channelBindings/jms" - }, - "kafka": { - "topic": "my-specific-topic-name", - "partitions": 20, - "replicas": 3, - "topicConfiguration": { - "cleanup.policy": [ - "delete", - "compact" - ], - "retention.ms": 604800000, - "retention.bytes": 1000000000, - "delete.retention.ms": 86400000, - "max.message.bytes": 1048588 - }, - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/channelBindings/mercure" - }, - "mqtt": { - "$ref": "#/components/channelBindings/mqtt" - }, - "mqtt5": { - "$ref": "#/components/channelBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/channelBindings/nats" - }, - "pulsar": { - "namespace": "staging", - "persistence": "persistent", - "compaction": 1000, - "geo-replication": [ - "us-east1", - "us-west1" - ], - "retention": { - "time": 7, - "size": 1000 - }, - "ttl": 360, - "deduplication": false, - "bindingVersion": "0.1.0" - }, - "redis": { - "$ref": "#/components/channelBindings/redis" - }, - "sns": { - "$ref": "#/components/channelBindings/sns" - }, - "solace": { - "$ref": "#/components/channelBindings/solace" - }, - "sqs": { - "$ref": "#/components/channelBindings/sqs" - }, - "stomp": { - "$ref": "#/components/channelBindings/stomp" - }, - "ws": { - "method": "GET", - "query": { - "type": "object", - "properties": { - "ref": { - "type": "string", - "description": "Referral." - } - } - }, - "headers": { - "type": "object", - "properties": { - "Authentication": { - "type": "string", - "description": "Authentication token" - } - } - } - } - }, - "tags": [ - { - "name": "user", - "description": "User-related messages", - "externalDocs": { - "description" : "Find more info here", - "url" : "https://example.com" - } - }, - { - "name": "user", - "description": "User-related messages", - "externalDocs": { - "$ref": "#/components/external-doc" - } - }, - { - "$ref": "#/components/tag" - } - ], - "externalDocs": { - "description" : "Find more info here", - "url" : "https://example.com" - } -} diff --git a/test/definitions/3.0.0/models/channel/channel/wrongly extended.json b/test/definitions/3.0.0/models/channel/channel/wrongly extended.json deleted file mode 100644 index b9b9fc35..00000000 --- a/test/definitions/3.0.0/models/channel/channel/wrongly extended.json +++ /dev/null @@ -1,2000 +0,0 @@ -{ - "address": "users.{userId}", - "title": "Users channel", - "summary": "messages about user events.", - "description": "This channel is used to exchange messages about users signing up", - "servers": [ - { "$ref": "#/components/servers/1"}, - { "$ref": "#/components/servers/2"}, - { "$ref": "#/components/servers/3"} - ], - "parameters": { - "userId": { - "description": "Id of the user.", - "default": "0e822ca6-5311-4d4c-b409-993a1820e689", - "enum": [ - "0e822ca6-5311-4d4c-b409-993a1820e689", - "381f5ddc-75c6-4c21-9ec1-3919ed345be9", - "70559d88-31a5-4ef2-8c34-7fbd04057ed5", - "c6dc0047-a90d-4efa-95e3-a272282934e0" - ], - "examples": [ - "0e822ca6-5311-4d4c-b409-993a1820e689", - "381f5ddc-75c6-4c21-9ec1-3919ed345be9", - "70559d88-31a5-4ef2-8c34-7fbd04057ed5", - "c6dc0047-a90d-4efa-95e3-a272282934e0" - ], - "location": "$message.payload#/user/id" - }, - "userStatus": { "$ref": "#/components/parameters/user-status"} - }, - "messages": { - "changeStatus": { "$ref": "#/components/parameters/user-status"}, - "message": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - }, - "applicationInstanceId": { - "description": "Unique identifier for a given instance of the publishing application", - "type": "string" - } - } - }, - "payload": { - "type": "object", - "properties": { - "metric": { - "description": "Metric set by application", - "type": "string" - } - } - }, - "correlationId": { - "description": "Default Correlation ID", - "location": "$message.header#/correlationId" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" } - ], - "externalDocs": { - "description": "User sign up rules", - "url": "messages/sign-up-rules" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "bindingVersion": "0.1.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ], - "traits": [ - { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - }, - "applicationInstanceId": { - "description": "Unique identifier for a given instance of the publishing application", - "type": "string" - } - } - }, - "correlationId": { - "description": "Default Correlation ID", - "location": "$message.header#/correlationId" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" } - ], - "externalDocs": { - "description": "User sign up rules", - "url": "messages/sign-up-rules" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "bindingVersion": "0.1.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ] - }, - { - "headers": { - "$ref": "#/components/messages/message-header" - }, - "correlationId": { - "$ref": "#/components/messages/message-correlation-id" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" }, - { "$ref": "#/components/tags/tag" } - ], - "externalDocs": { - "$ref": "#/components/externalDocs/external-doc" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "bindingVersion": "0.1.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ] - }, - { - "headers": { - "schemaFormat": "application/vnd.aai.asyncapi+json;version=3.0.0", - "schema": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - }, - "applicationInstanceId": { - "description": "Unique identifier for a given instance of the publishing application", - "type": "string" - } - } - } - }, - "correlationId": { - "$ref": "#/components/messages/message-correlation-id" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" }, - { "$ref": "#/components/tags/tag" } - ], - "externalDocs": { - "$ref": "#/components/externalDocs/external-doc" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "bindingVersion": "0.1.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ] - } - ] - }, - "message 2": { - "headers": { - "schemaFormat": "application/vnd.aai.asyncapi+json;version=3.0.0", - "schema": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - }, - "applicationInstanceId": { - "description": "Unique identifier for a given instance of the publishing application", - "type": "string" - } - } - } - }, - "payload": { - "schemaFormat": "application/vnd.aai.asyncapi+json;version=3.0.0", - "schema": { - "type": "object", - "properties": { - "metric": { - "description": "Metric set by application", - "type": "string" - } - } - } - }, - "correlationId": { - "$ref" : "#/components/messages/message-correlation-id" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" }, - { "$ref": "#/components/tags/tag" } - ], - "externalDocs": { - "$ref": "#/components/externalDocs/external-doc" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "bindingVersion": "0.1.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ], - "traits": [ - { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - }, - "applicationInstanceId": { - "description": "Unique identifier for a given instance of the publishing application", - "type": "string" - } - } - }, - "correlationId": { - "description": "Default Correlation ID", - "location": "$message.header#/correlationId" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" } - ], - "externalDocs": { - "description": "User sign up rules", - "url": "messages/sign-up-rules" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "bindingVersion": "0.1.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ] - }, - { - "headers": { - "$ref": "#/components/messages/message-header" - }, - "correlationId": { - "$ref": "#/components/messages/message-correlation-id" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" }, - { "$ref": "#/components/tags/tag" } - ], - "externalDocs": { - "$ref": "#/components/externalDocs/external-doc" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "bindingVersion": "0.1.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ] - }, - { - "headers": { - "schemaFormat": "application/vnd.aai.asyncapi+json;version=3.0.0", - "schema": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - }, - "applicationInstanceId": { - "description": "Unique identifier for a given instance of the publishing application", - "type": "string" - } - } - } - }, - "correlationId": { - "$ref": "#/components/messages/message-correlation-id" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" }, - { "$ref": "#/components/tags/tag" } - ], - "externalDocs": { - "$ref": "#/components/externalDocs/external-doc" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "bindingVersion": "0.1.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ] - } - ] - }, - "message with reference": { - "headers": { - "$ref": "#/components/messages/message-header" - }, - "payload": { - "$ref": "#/components/messages/message-payload" - }, - "correlationId": { - "$ref": "#/components/messages/message-correlation-id" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" }, - { "$ref": "#/components/tags/tag" } - ], - "externalDocs": { - "$ref": "#/components/externalDocs/external-doc" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "bindingVersion": "0.1.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ], - "traits": [ - { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - }, - "applicationInstanceId": { - "description": "Unique identifier for a given instance of the publishing application", - "type": "string" - } - } - }, - "correlationId": { - "description": "Default Correlation ID", - "location": "$message.header#/correlationId" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" } - ], - "externalDocs": { - "description": "User sign up rules", - "url": "messages/sign-up-rules" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "bindingVersion": "0.1.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ] - }, - { - "headers": { - "$ref": "#/components/messages/message-header" - }, - "correlationId": { - "$ref": "#/components/messages/message-correlation-id" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" }, - { "$ref": "#/components/tags/tag" } - ], - "externalDocs": { - "$ref": "#/components/externalDocs/external-doc" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "bindingVersion": "0.1.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ] - }, - { - "headers": { - "schemaFormat": "application/vnd.aai.asyncapi+json;version=3.0.0", - "schema": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - }, - "applicationInstanceId": { - "description": "Unique identifier for a given instance of the publishing application", - "type": "string" - } - } - } - }, - "correlationId": { - "$ref": "#/components/messages/message-correlation-id" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" }, - { "$ref": "#/components/tags/tag" } - ], - "externalDocs": { - "$ref": "#/components/externalDocs/external-doc" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "bindingVersion": "0.1.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ] - } - ] - } - }, - "bindings": { - "amqp": { - "is": "routingKey", - "queue": { - "name": "my-queue-name", - "durable": true, - "exclusive": true, - "autoDelete": false, - "vhost": "/" - }, - "exchange": { - "name": "myExchange", - "type": "topic", - "durable": true, - "autoDelete": false, - "vhost": "/" - }, - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/channelBindings/amqp1" - }, - "anypointmq": { - "destination": "user-signup-exchg", - "destinationType": "exchange", - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "topic": "projects/your-project/topics/topic-proto-schema", - "messageRetentionDuration": "86400s", - "messageStoragePolicy": { - "allowedPersistenceRegions": [ - "us-central1", - "us-central2", - "us-east1", - "us-east4", - "us-east5", - "us-east7", - "us-south1", - "us-west1", - "us-west2", - "us-west3", - "us-west4" - ] - }, - "schemaSettings": { - "encoding": "binary", - "name": "projects/your-project/schemas/message-proto" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "$ref": "#/components/channelBindings/http" - }, - "ibmmq": { - "destinationType": "topic", - "queue": { - "objectName": "message", - "isPartitioned": false, - "exclusive": true - }, - "topic": { - "string": "messages", - "objectName": "message", - "durablePermitted": true, - "lastMsgRetained": true - }, - "maxMsgLength": 1024, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/channelBindings/jms" - }, - "kafka": { - "topic": "my-specific-topic-name", - "partitions": 20, - "replicas": 3, - "topicConfiguration": { - "cleanup.policy": [ - "delete", - "compact" - ], - "retention.ms": 604800000, - "retention.bytes": 1000000000, - "delete.retention.ms": 86400000, - "max.message.bytes": 1048588 - }, - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/channelBindings/mercure" - }, - "mqtt": { - "$ref": "#/components/channelBindings/mqtt" - }, - "mqtt5": { - "$ref": "#/components/channelBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/channelBindings/nats" - }, - "pulsar": { - "namespace": "staging", - "persistence": "persistent", - "compaction": 1000, - "geo-replication": [ - "us-east1", - "us-west1" - ], - "retention": { - "time": 7, - "size": 1000 - }, - "ttl": 360, - "deduplication": false, - "bindingVersion": "0.1.0" - }, - "redis": { - "$ref": "#/components/channelBindings/redis" - }, - "sns": { - "$ref": "#/components/channelBindings/sns" - }, - "solace": { - "$ref": "#/components/channelBindings/solace" - }, - "sqs": { - "$ref": "#/components/channelBindings/sqs" - }, - "stomp": { - "$ref": "#/components/channelBindings/stomp" - }, - "ws": { - "method": "GET", - "query": { - "type": "object", - "properties": { - "ref": { - "type": "string", - "description": "Referral." - } - } - }, - "headers": { - "type": "object", - "properties": { - "Authentication": { - "type": "string", - "description": "Authentication token" - } - } - } - } - }, - "tags": [ - { - "name": "user", - "description": "User-related messages", - "externalDocs": { - "description" : "Find more info here", - "url" : "https://example.com" - } - }, - { - "name": "user", - "description": "User-related messages", - "externalDocs": { - "$ref": "#/components/external-doc" - } - }, - { - "$ref": "#/components/tag" - } - ], - "externalDocs": { - "description" : "Find more info here", - "url" : "https://example.com" - }, - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} diff --git a/test/definitions/3.0.0/models/channel/index.mjs b/test/definitions/3.0.0/models/channel/index.mjs deleted file mode 100644 index b2ce3177..00000000 --- a/test/definitions/3.0.0/models/channel/index.mjs +++ /dev/null @@ -1,7 +0,0 @@ -import {describe} from 'vitest'; - -describe('Channel Test Suite', async () => { - await import('./channel'); - await import('./message'); - await import('./parameter'); -}); diff --git a/test/definitions/3.0.0/models/channel/message correlation id.test.mjs b/test/definitions/3.0.0/models/channel/message correlation id.test.mjs new file mode 100644 index 00000000..e983f034 --- /dev/null +++ b/test/definitions/3.0.0/models/channel/message correlation id.test.mjs @@ -0,0 +1,52 @@ +import { + JsonSchemaTestSuite, + JsonSchemaTestSuiteConfig, + JsonSchemaTestSuiteData +} from '@test/definitions/base-schema-test.mjs'; +import {describe} from 'vitest'; + +const jsonSchema = require('@definitions/3.0.0/correlationId.json'); + +const config = new JsonSchemaTestSuiteConfig( + true, + ['must have required property \'location\''], + true, + [] +); + +const data = new JsonSchemaTestSuiteData( + jsonSchema, + [ + { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + ], + { + "location": "$message.header#/correlationId" + }, + { + "description": "Default Correlation ID", + }, + { + "location": "$message.header#/correlationId", + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "location": "$message.header#/correlationId", + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } +); + +describe('Channel Correlation ID', () => { + new JsonSchemaTestSuite(data, config).testSuite() +}); diff --git a/test/definitions/3.0.0/models/channel/message example.test.mjs b/test/definitions/3.0.0/models/channel/message example.test.mjs new file mode 100644 index 00000000..5f7db494 --- /dev/null +++ b/test/definitions/3.0.0/models/channel/message example.test.mjs @@ -0,0 +1,83 @@ +import { + JsonSchemaTestSuite, + JsonSchemaTestSuiteConfig, + JsonSchemaTestSuiteData +} from '@test/definitions/base-schema-test.mjs'; +import {describe} from 'vitest'; + +const jsonSchema = require('@definitions/3.0.0/messageExampleObject.json'); + +const config = new JsonSchemaTestSuiteConfig( + true, + [ + 'must have required property \'payload\'', + 'must have required property \'headers\'', + 'must match a schema in anyOf' + ], + true, + [] +); + +const data = new JsonSchemaTestSuiteData( + jsonSchema, + [ + { + "name": "SimpleSignup", + "summary": "A simple UserSignup example message", + "headers": { + "correlationId": "my-correlation-id", + "applicationInstanceId": "myInstanceId" + }, + "payload": { + "user": { + "someUserKey": "someUserValue" + }, + "signup": { + "someSignupKey": "someSignupValue" + } + } + } + ], + { + "headers": { + "correlationId": "my-correlation-id", + "applicationInstanceId": "myInstanceId" + } + }, + {}, + { + "payload": { + "user": { + "someUserKey": "someUserValue" + }, + "signup": { + "someSignupKey": "someSignupValue" + } + }, + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "payload": { + "user": { + "someUserKey": "someUserValue" + }, + "signup": { + "someSignupKey": "someSignupValue" + } + }, + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } +); + +describe('Channel Message Example', () => { + new JsonSchemaTestSuite(data, config).testSuite() +}); diff --git a/test/definitions/3.0.0/models/channel/message trait.test.mjs b/test/definitions/3.0.0/models/channel/message trait.test.mjs new file mode 100644 index 00000000..52078507 --- /dev/null +++ b/test/definitions/3.0.0/models/channel/message trait.test.mjs @@ -0,0 +1,45 @@ +import { + JsonSchemaTestSuite, + JsonSchemaTestSuiteConfig, + JsonSchemaTestSuiteData +} from '@test/definitions/base-schema-test.mjs'; +import {describe} from 'vitest'; + +const jsonSchema = require('@definitions/3.0.0/messageTrait.json'); + +const config = new JsonSchemaTestSuiteConfig( + false, + [], + true, + [] +); + +const data = new JsonSchemaTestSuiteData( + jsonSchema, + [ + { + "contentType": "application/json" + } + ], + {}, + {}, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } +); + +describe('Channel Message Trait', () => { + new JsonSchemaTestSuite(data, config).testSuite() +}); diff --git a/test/definitions/3.0.0/models/channel/message.test.mjs b/test/definitions/3.0.0/models/channel/message.test.mjs new file mode 100644 index 00000000..99426546 --- /dev/null +++ b/test/definitions/3.0.0/models/channel/message.test.mjs @@ -0,0 +1,97 @@ +import { + JsonSchemaTestSuite, + JsonSchemaTestSuiteConfig, + JsonSchemaTestSuiteData +} from '@test/definitions/base-schema-test.mjs'; +import {describe} from 'vitest'; + +const jsonSchema = require('@definitions/3.0.0/messageObject.json'); + +const config = new JsonSchemaTestSuiteConfig( + false, + [], + true, + [] +); + +const data = new JsonSchemaTestSuiteData( + jsonSchema, + [ + { + "name": "UserSignup", + "title": "User signup", + "summary": "Action to sign a user up.", + "description": "A longer description", + "contentType": "application/json", + "tags": [{ "name": "user" }, { "name": "signup" }, { "name": "register" }], + "headers": { + "type": "object", + "properties": { + "correlationId": { + "description": "Correlation ID set by application", + "type": "string" + }, + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + }, + "correlationId": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + }, + "traits": [{ "$ref": "#/components/messageTraits/commonHeaders" }], + "examples": [ + { + "name": "SimpleSignup", + "summary": "A simple UserSignup example message", + "headers": { + "correlationId": "my-correlation-id", + "applicationInstanceId": "myInstanceId" + }, + "payload": { + "user": { + "someUserKey": "someUserValue" + }, + "signup": { + "someSignupKey": "someSignupValue" + } + } + } + ] + } + ], + {}, + {}, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } +); + +describe('Channel Message', () => { + new JsonSchemaTestSuite(data, config).testSuite() +}); diff --git a/test/definitions/3.0.0/models/channel/message/correlationId/empty.json b/test/definitions/3.0.0/models/channel/message/correlationId/empty.json deleted file mode 100644 index 0967ef42..00000000 --- a/test/definitions/3.0.0/models/channel/message/correlationId/empty.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/test/definitions/3.0.0/models/channel/message/correlationId/example.json b/test/definitions/3.0.0/models/channel/message/correlationId/example.json deleted file mode 100644 index 9cc818d9..00000000 --- a/test/definitions/3.0.0/models/channel/message/correlationId/example.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "description": "Default Correlation ID", - "location": "$message.header#/correlationId" -} diff --git a/test/definitions/3.0.0/models/channel/message/correlationId/extended.json b/test/definitions/3.0.0/models/channel/message/correlationId/extended.json deleted file mode 100644 index 2b46e32b..00000000 --- a/test/definitions/3.0.0/models/channel/message/correlationId/extended.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "description": "Default Correlation ID", - "location": "$message.header#/correlationId", - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} diff --git a/test/definitions/3.0.0/models/channel/message/correlationId/index.mjs b/test/definitions/3.0.0/models/channel/message/correlationId/index.mjs deleted file mode 100644 index ba0f11fc..00000000 --- a/test/definitions/3.0.0/models/channel/message/correlationId/index.mjs +++ /dev/null @@ -1,39 +0,0 @@ -import {describe, it} from 'vitest'; -import TestHelper from '@test/test-helper'; -import path from 'path'; - -const jsonSchema = require('@definitions/3.0.0/correlationId.json'); - -describe('Correlation ID', () => { - it('example', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './example.json'), - )); - - it('empty', () => TestHelper.objectIsNotValid( - jsonSchema, - path.resolve(__dirname, './empty.json'), - ['must have required property \'location\''] - )); - - it('without required properties', () => TestHelper.objectIsNotValid( - jsonSchema, - path.resolve(__dirname, './without required properties.json'), - ['must have required property \'location\''] - )); - - it('only required properties', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './only required properties.json'), - )); - - it('extended', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './extended.json'), - )); - - it('wrongly extended', () => TestHelper.wronglyExtended( - jsonSchema, - path.resolve(__dirname, './wrongly extended.json'), - )); -}); diff --git a/test/definitions/3.0.0/models/channel/message/correlationId/only required properties.json b/test/definitions/3.0.0/models/channel/message/correlationId/only required properties.json deleted file mode 100644 index bb75dcb8..00000000 --- a/test/definitions/3.0.0/models/channel/message/correlationId/only required properties.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "location": "$message.header#/correlationId" -} diff --git a/test/definitions/3.0.0/models/channel/message/correlationId/without required properties.json b/test/definitions/3.0.0/models/channel/message/correlationId/without required properties.json deleted file mode 100644 index dae25353..00000000 --- a/test/definitions/3.0.0/models/channel/message/correlationId/without required properties.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "Default Correlation ID" -} diff --git a/test/definitions/3.0.0/models/channel/message/correlationId/wrongly extended.json b/test/definitions/3.0.0/models/channel/message/correlationId/wrongly extended.json deleted file mode 100644 index f409af21..00000000 --- a/test/definitions/3.0.0/models/channel/message/correlationId/wrongly extended.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "description": "Default Correlation ID", - "location": "$message.header#/correlationId", - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} diff --git a/test/definitions/3.0.0/models/channel/message/index.mjs b/test/definitions/3.0.0/models/channel/message/index.mjs deleted file mode 100644 index 28bee9d9..00000000 --- a/test/definitions/3.0.0/models/channel/message/index.mjs +++ /dev/null @@ -1,8 +0,0 @@ -import {describe} from 'vitest'; - -describe('Message Test Suite', async () => { - await import('./correlationId'); - await import('./message'); - await import('./messageExample'); - await import('./messageTrait'); -}); diff --git a/test/definitions/3.0.0/models/channel/message/message/empty.json b/test/definitions/3.0.0/models/channel/message/message/empty.json deleted file mode 100644 index 0967ef42..00000000 --- a/test/definitions/3.0.0/models/channel/message/message/empty.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/test/definitions/3.0.0/models/channel/message/message/example.json b/test/definitions/3.0.0/models/channel/message/message/example.json deleted file mode 100644 index f8cd8169..00000000 --- a/test/definitions/3.0.0/models/channel/message/message/example.json +++ /dev/null @@ -1,607 +0,0 @@ -{ - "headers": { - "schemaFormat": "application/vnd.aai.asyncapi+json;version=3.0.0", - "schema": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - }, - "applicationInstanceId": { - "description": "Unique identifier for a given instance of the publishing application", - "type": "string" - } - } - } - }, - "payload": { - "schemaFormat": "application/vnd.aai.asyncapi+json;version=3.0.0", - "schema": { - "type": "object", - "properties": { - "metric": { - "description": "Metric set by application", - "type": "string" - } - } - } - }, - "correlationId": { - "$ref" : "#/components/messages/message-correlation-id" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" }, - { "$ref": "#/components/tags/tag" } - ], - "externalDocs": { - "$ref": "#/components/externalDocs/external-doc" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "statusCode" : 200, - "bindingVersion": "0.3.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ], - "traits": [ - { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - }, - "applicationInstanceId": { - "description": "Unique identifier for a given instance of the publishing application", - "type": "string" - } - } - }, - "correlationId": { - "description": "Default Correlation ID", - "location": "$message.header#/correlationId" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" } - ], - "externalDocs": { - "description": "User sign up rules", - "url": "messages/sign-up-rules" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "statusCode" : 200, - "bindingVersion": "0.3.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ] - }, - { - "headers": { - "$ref": "#/components/messages/message-header" - }, - "correlationId": { - "$ref": "#/components/messages/message-correlation-id" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" }, - { "$ref": "#/components/tags/tag" } - ], - "externalDocs": { - "$ref": "#/components/externalDocs/external-doc" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "statusCode" : 200, - "bindingVersion": "0.3.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ] - }, - { - "headers": { - "schemaFormat": "application/vnd.aai.asyncapi+json;version=3.0.0", - "schema": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - }, - "applicationInstanceId": { - "description": "Unique identifier for a given instance of the publishing application", - "type": "string" - } - } - } - }, - "correlationId": { - "$ref": "#/components/messages/message-correlation-id" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" }, - { "$ref": "#/components/tags/tag" } - ], - "externalDocs": { - "$ref": "#/components/externalDocs/external-doc" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "statusCode" : 200, - "bindingVersion": "0.3.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ] - } - ] -} diff --git a/test/definitions/3.0.0/models/channel/message/message/extended.json b/test/definitions/3.0.0/models/channel/message/message/extended.json deleted file mode 100644 index 55a2953e..00000000 --- a/test/definitions/3.0.0/models/channel/message/message/extended.json +++ /dev/null @@ -1,612 +0,0 @@ -{ - "headers": { - "schemaFormat": "application/vnd.aai.asyncapi+json;version=3.0.0", - "schema": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - }, - "applicationInstanceId": { - "description": "Unique identifier for a given instance of the publishing application", - "type": "string" - } - } - } - }, - "payload": { - "schemaFormat": "application/vnd.aai.asyncapi+json;version=3.0.0", - "schema": { - "type": "object", - "properties": { - "metric": { - "description": "Metric set by application", - "type": "string" - } - } - } - }, - "correlationId": { - "$ref" : "#/components/messages/message-correlation-id" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" }, - { "$ref": "#/components/tags/tag" } - ], - "externalDocs": { - "$ref": "#/components/externalDocs/external-doc" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "statusCode" : 200, - "bindingVersion": "0.3.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ], - "traits": [ - { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - }, - "applicationInstanceId": { - "description": "Unique identifier for a given instance of the publishing application", - "type": "string" - } - } - }, - "correlationId": { - "description": "Default Correlation ID", - "location": "$message.header#/correlationId" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" } - ], - "externalDocs": { - "description": "User sign up rules", - "url": "messages/sign-up-rules" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "statusCode" : 200, - "bindingVersion": "0.3.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ] - }, - { - "headers": { - "$ref": "#/components/messages/message-header" - }, - "correlationId": { - "$ref": "#/components/messages/message-correlation-id" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" }, - { "$ref": "#/components/tags/tag" } - ], - "externalDocs": { - "$ref": "#/components/externalDocs/external-doc" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "statusCode" : 200, - "bindingVersion": "0.3.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ] - }, - { - "headers": { - "schemaFormat": "application/vnd.aai.asyncapi+json;version=3.0.0", - "schema": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - }, - "applicationInstanceId": { - "description": "Unique identifier for a given instance of the publishing application", - "type": "string" - } - } - } - }, - "correlationId": { - "$ref": "#/components/messages/message-correlation-id" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" }, - { "$ref": "#/components/tags/tag" } - ], - "externalDocs": { - "$ref": "#/components/externalDocs/external-doc" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "statusCode" : 200, - "bindingVersion": "0.3.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ] - } - ], - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} diff --git a/test/definitions/3.0.0/models/channel/message/message/index.mjs b/test/definitions/3.0.0/models/channel/message/message/index.mjs deleted file mode 100644 index 2cbb3c45..00000000 --- a/test/definitions/3.0.0/models/channel/message/message/index.mjs +++ /dev/null @@ -1,37 +0,0 @@ -import {describe, it} from 'vitest'; -import TestHelper from '@test/test-helper'; -import path from 'path'; - -const jsonSchema = require('@definitions/3.0.0/messageObject.json'); - -describe.skip('Message. Issues with bindings', () => { - it('example', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './example.json'), - )); - - it('empty', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './empty.json'), - )); - - it('without required properties', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './without required properties.json'), - )); - - it('only required properties', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './only required properties.json'), - )); - - it.skip('extended. Reason: schema prohibites extendsion. Check', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './extended.json'), - )); - - it.skip('wrongly extended. Reason: schema prohibites extendsion. Check', () => TestHelper.wronglyExtended( - jsonSchema, - path.resolve(__dirname, './wrongly extended.json'), - )); -}); diff --git a/test/definitions/3.0.0/models/channel/message/message/only required properties.json b/test/definitions/3.0.0/models/channel/message/message/only required properties.json deleted file mode 100644 index 0967ef42..00000000 --- a/test/definitions/3.0.0/models/channel/message/message/only required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/test/definitions/3.0.0/models/channel/message/message/without required properties.json b/test/definitions/3.0.0/models/channel/message/message/without required properties.json deleted file mode 100644 index 5a6a41bf..00000000 --- a/test/definitions/3.0.0/models/channel/message/message/without required properties.json +++ /dev/null @@ -1,150 +0,0 @@ -{ - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - }, - "applicationInstanceId": { - "description": "Unique identifier for a given instance of the publishing application", - "type": "string" - } - } - }, - "correlationId": { - "description": "Default Correlation ID", - "location": "$message.header#/correlationId" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" } - ], - "externalDocs": { - "description": "User sign up rules", - "url": "messages/sign-up-rules" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "statusCode" : 200, - "bindingVersion": "0.3.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ] -} diff --git a/test/definitions/3.0.0/models/channel/message/message/wrongly extended.json b/test/definitions/3.0.0/models/channel/message/message/wrongly extended.json deleted file mode 100644 index a6cd0763..00000000 --- a/test/definitions/3.0.0/models/channel/message/message/wrongly extended.json +++ /dev/null @@ -1,613 +0,0 @@ -{ - "headers": { - "schemaFormat": "application/vnd.aai.asyncapi+json;version=3.0.0", - "schema": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - }, - "applicationInstanceId": { - "description": "Unique identifier for a given instance of the publishing application", - "type": "string" - } - } - } - }, - "payload": { - "schemaFormat": "application/vnd.aai.asyncapi+json;version=3.0.0", - "schema": { - "type": "object", - "properties": { - "metric": { - "description": "Metric set by application", - "type": "string" - } - } - } - }, - "correlationId": { - "$ref" : "#/components/messages/message-correlation-id" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" }, - { "$ref": "#/components/tags/tag" } - ], - "externalDocs": { - "$ref": "#/components/externalDocs/external-doc" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "statusCode" : 200, - "bindingVersion": "0.3.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ], - "traits": [ - { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - }, - "applicationInstanceId": { - "description": "Unique identifier for a given instance of the publishing application", - "type": "string" - } - } - }, - "correlationId": { - "description": "Default Correlation ID", - "location": "$message.header#/correlationId" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" } - ], - "externalDocs": { - "description": "User sign up rules", - "url": "messages/sign-up-rules" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "statusCode" : 200, - "bindingVersion": "0.3.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ] - }, - { - "headers": { - "$ref": "#/components/messages/message-header" - }, - "correlationId": { - "$ref": "#/components/messages/message-correlation-id" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" }, - { "$ref": "#/components/tags/tag" } - ], - "externalDocs": { - "$ref": "#/components/externalDocs/external-doc" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "statusCode" : 200, - "bindingVersion": "0.3.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ] - }, - { - "headers": { - "schemaFormat": "application/vnd.aai.asyncapi+json;version=3.0.0", - "schema": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - }, - "applicationInstanceId": { - "description": "Unique identifier for a given instance of the publishing application", - "type": "string" - } - } - } - }, - "correlationId": { - "$ref": "#/components/messages/message-correlation-id" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" }, - { "$ref": "#/components/tags/tag" } - ], - "externalDocs": { - "$ref": "#/components/externalDocs/external-doc" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "statusCode" : 200, - "bindingVersion": "0.3.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ] - } - ], - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} diff --git a/test/definitions/3.0.0/models/channel/message/messageExample/empty.json b/test/definitions/3.0.0/models/channel/message/messageExample/empty.json deleted file mode 100644 index 0967ef42..00000000 --- a/test/definitions/3.0.0/models/channel/message/messageExample/empty.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/test/definitions/3.0.0/models/channel/message/messageExample/example.json b/test/definitions/3.0.0/models/channel/message/messageExample/example.json deleted file mode 100644 index cec8a4ae..00000000 --- a/test/definitions/3.0.0/models/channel/message/messageExample/example.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } -} diff --git a/test/definitions/3.0.0/models/channel/message/messageExample/extended.json b/test/definitions/3.0.0/models/channel/message/messageExample/extended.json deleted file mode 100644 index 96d374da..00000000 --- a/test/definitions/3.0.0/models/channel/message/messageExample/extended.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - }, - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} diff --git a/test/definitions/3.0.0/models/channel/message/messageExample/index.mjs b/test/definitions/3.0.0/models/channel/message/messageExample/index.mjs deleted file mode 100644 index 3ccdb7cd..00000000 --- a/test/definitions/3.0.0/models/channel/message/messageExample/index.mjs +++ /dev/null @@ -1,47 +0,0 @@ -import {describe, it} from 'vitest'; -import TestHelper from '@test/test-helper'; -import path from 'path'; - -const jsonSchema = require('@definitions/3.0.0/messageExampleObject.json'); - -describe('Message example', () => { - it('example', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './example.json'), - )); - - it('empty', () => TestHelper.objectIsNotValid( - jsonSchema, - path.resolve(__dirname, './empty.json'), - [ - 'must have required property \'payload\'', - 'must have required property \'headers\'', - 'must match a schema in anyOf' - ] - )); - - it('without required properties', () => TestHelper.objectIsNotValid( - jsonSchema, - path.resolve(__dirname, './without required properties.json'), - [ - 'must have required property \'payload\'', - 'must have required property \'headers\'', - 'must match a schema in anyOf' - ] - )); - - it('only required properties', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './only required properties.json'), - )); - - it.skip('extended. Reason: schema prohibites extendsion. Check', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './extended.json'), - )); - - it.skip('wrongly extended. Reason: schema prohibites extendsion. Check', () => TestHelper.wronglyExtended( - jsonSchema, - path.resolve(__dirname, './wrongly extended.json'), - )); -}); diff --git a/test/definitions/3.0.0/models/channel/message/messageExample/only required properties.json b/test/definitions/3.0.0/models/channel/message/messageExample/only required properties.json deleted file mode 100644 index 2848ef96..00000000 --- a/test/definitions/3.0.0/models/channel/message/messageExample/only required properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } -} diff --git a/test/definitions/3.0.0/models/channel/message/messageExample/without required properties.json b/test/definitions/3.0.0/models/channel/message/messageExample/without required properties.json deleted file mode 100644 index 65be85b8..00000000 --- a/test/definitions/3.0.0/models/channel/message/messageExample/without required properties.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "SimpleSignup", - "summary": "A simple UserSignup example message" -} diff --git a/test/definitions/3.0.0/models/channel/message/messageExample/wrongly extended.json b/test/definitions/3.0.0/models/channel/message/messageExample/wrongly extended.json deleted file mode 100644 index 876390ff..00000000 --- a/test/definitions/3.0.0/models/channel/message/messageExample/wrongly extended.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - }, - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} diff --git a/test/definitions/3.0.0/models/channel/message/messageTrait/empty.json b/test/definitions/3.0.0/models/channel/message/messageTrait/empty.json deleted file mode 100644 index 0967ef42..00000000 --- a/test/definitions/3.0.0/models/channel/message/messageTrait/empty.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/test/definitions/3.0.0/models/channel/message/messageTrait/example.json b/test/definitions/3.0.0/models/channel/message/messageTrait/example.json deleted file mode 100644 index 5a6a41bf..00000000 --- a/test/definitions/3.0.0/models/channel/message/messageTrait/example.json +++ /dev/null @@ -1,150 +0,0 @@ -{ - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - }, - "applicationInstanceId": { - "description": "Unique identifier for a given instance of the publishing application", - "type": "string" - } - } - }, - "correlationId": { - "description": "Default Correlation ID", - "location": "$message.header#/correlationId" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" } - ], - "externalDocs": { - "description": "User sign up rules", - "url": "messages/sign-up-rules" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "statusCode" : 200, - "bindingVersion": "0.3.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ] -} diff --git a/test/definitions/3.0.0/models/channel/message/messageTrait/extended.json b/test/definitions/3.0.0/models/channel/message/messageTrait/extended.json deleted file mode 100644 index 84dbdd14..00000000 --- a/test/definitions/3.0.0/models/channel/message/messageTrait/extended.json +++ /dev/null @@ -1,155 +0,0 @@ -{ - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - }, - "applicationInstanceId": { - "description": "Unique identifier for a given instance of the publishing application", - "type": "string" - } - } - }, - "correlationId": { - "description": "Default Correlation ID", - "location": "$message.header#/correlationId" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" } - ], - "externalDocs": { - "description": "User sign up rules", - "url": "messages/sign-up-rules" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "statusCode" : 200, - "bindingVersion": "0.3.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ], - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} diff --git a/test/definitions/3.0.0/models/channel/message/messageTrait/index.mjs b/test/definitions/3.0.0/models/channel/message/messageTrait/index.mjs deleted file mode 100644 index 1c38c401..00000000 --- a/test/definitions/3.0.0/models/channel/message/messageTrait/index.mjs +++ /dev/null @@ -1,37 +0,0 @@ -import {describe, it} from 'vitest'; -import TestHelper from '@test/test-helper'; -import path from 'path'; - -const jsonSchema = require('@definitions/3.0.0/messageTrait.json'); - -describe.skip('Message trait. Issues with bindings', () => { - it('example', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './example.json'), - )); - - it('empty', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './empty.json'), - )); - - it('without required properties', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './without required properties.json'), - )); - - it('only required properties', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './only required properties.json'), - )); - - it.skip('extended. Reason: schema prohibites extendsion. Check', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './extended.json'), - )); - - it.skip('wrongly extended. Reason: schema prohibites extendsion. Check', () => TestHelper.wronglyExtended( - jsonSchema, - path.resolve(__dirname, './wrongly extended.json'), - )); -}); diff --git a/test/definitions/3.0.0/models/channel/message/messageTrait/only required properties.json b/test/definitions/3.0.0/models/channel/message/messageTrait/only required properties.json deleted file mode 100644 index 0967ef42..00000000 --- a/test/definitions/3.0.0/models/channel/message/messageTrait/only required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/test/definitions/3.0.0/models/channel/message/messageTrait/without required properties.json b/test/definitions/3.0.0/models/channel/message/messageTrait/without required properties.json deleted file mode 100644 index 5a6a41bf..00000000 --- a/test/definitions/3.0.0/models/channel/message/messageTrait/without required properties.json +++ /dev/null @@ -1,150 +0,0 @@ -{ - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - }, - "applicationInstanceId": { - "description": "Unique identifier for a given instance of the publishing application", - "type": "string" - } - } - }, - "correlationId": { - "description": "Default Correlation ID", - "location": "$message.header#/correlationId" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" } - ], - "externalDocs": { - "description": "User sign up rules", - "url": "messages/sign-up-rules" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "statusCode" : 200, - "bindingVersion": "0.3.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ] -} diff --git a/test/definitions/3.0.0/models/channel/message/messageTrait/wrongly extended.json b/test/definitions/3.0.0/models/channel/message/messageTrait/wrongly extended.json deleted file mode 100644 index 84bffb24..00000000 --- a/test/definitions/3.0.0/models/channel/message/messageTrait/wrongly extended.json +++ /dev/null @@ -1,156 +0,0 @@ -{ - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - }, - "applicationInstanceId": { - "description": "Unique identifier for a given instance of the publishing application", - "type": "string" - } - } - }, - "correlationId": { - "description": "Default Correlation ID", - "location": "$message.header#/correlationId" - }, - "contentType": "application/json", - "name": "UserSignup", - "title": "User signup", - "summary": "Action to sign a user up.", - "description": "A longer description", - "tags": [ - { "name": "user" }, - { "name": "signup" }, - { "name": "register" } - ], - "externalDocs": { - "description": "User sign up rules", - "url": "messages/sign-up-rules" - }, - "bindings": { - "amqp": { - "contentEncoding": "gzip", - "messageType": "user.signup", - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/messageBindings/amqp1" - }, - "anypointmq": { - "headers": { - "type": "object", - "properties": { - "correlationId": { - "description": "Correlation ID set by application", - "type": "string" - } - } - }, - "bindingVersion": "0.0.1" - }, - "googlepubsub": { - "schema": { - "name": "projects/your-project/schemas/message-avro", - "type": "avro" - }, - "bindingVersion": "0.1.0" - }, - "http": { - "headers": { - "type": "object", - "properties": { - "Content-Type": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - }, - "statusCode" : 200, - "bindingVersion": "0.3.0" - }, - "ibmmq": { - "type": "jms", - "description": "JMS stream message", - "headers": "Content-Type: application/json", - "expiry": 0, - "bindingVersion": "0.1.0" - }, - "jms": { - "$ref": "#/components/messageBindings/jms" - }, - "kafka": { - "key": { - "type": "string", - "enum": [ - "myKey" - ] - }, - "schemaIdLocation": "payload", - "schemaIdPayloadEncoding": "apicurio-new", - "schemaLookupStrategy": "TopicIdStrategy", - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/messageBindings/mercure" - }, - "mqtt": { - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/messageBindings/mqtt5" - }, - "nats": { - "$ref": "#/components/messageBindings/nats" - }, - "pulsar": { - "$ref": "#/components/messageBindings/pulsar" - }, - "redis": { - "$ref": "#/components/messageBindings/redis" - }, - "sns": { - "$ref": "#/components/messageBindings/sns" - }, - "solace": { - "$ref": "#/components/messageBindings/solace" - }, - "sqs": { - "$ref": "#/components/messageBindings/sqs" - }, - "stomp": { - "$ref": "#/components/messageBindings/stomp" - }, - "ws": { - "$ref": "#/components/messageBindings/ws" - } - }, - "examples": [ - { - "name": "SimpleSignup", - "summary": "A simple UserSignup example message", - "headers": { - "correlationId": "my-correlation-id", - "applicationInstanceId": "myInstanceId" - }, - "payload": { - "user": { - "someUserKey": "someUserValue" - }, - "signup": { - "someSignupKey": "someSignupValue" - } - } - } - ], - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} diff --git a/test/definitions/3.0.0/models/channel/parameter/empty.json b/test/definitions/3.0.0/models/channel/parameter/empty.json deleted file mode 100644 index 0967ef42..00000000 --- a/test/definitions/3.0.0/models/channel/parameter/empty.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/test/definitions/3.0.0/models/channel/parameter/example.json b/test/definitions/3.0.0/models/channel/parameter/example.json deleted file mode 100644 index b9e4dbc1..00000000 --- a/test/definitions/3.0.0/models/channel/parameter/example.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "description": "Id of the user.", - "default": "0e822ca6-5311-4d4c-b409-993a1820e689", - "enum": [ - "0e822ca6-5311-4d4c-b409-993a1820e689", - "381f5ddc-75c6-4c21-9ec1-3919ed345be9", - "70559d88-31a5-4ef2-8c34-7fbd04057ed5", - "c6dc0047-a90d-4efa-95e3-a272282934e0" - ], - "examples": [ - "0e822ca6-5311-4d4c-b409-993a1820e689", - "381f5ddc-75c6-4c21-9ec1-3919ed345be9", - "70559d88-31a5-4ef2-8c34-7fbd04057ed5", - "c6dc0047-a90d-4efa-95e3-a272282934e0" - ], - "location": "$message.payload#/user/id" -} diff --git a/test/definitions/3.0.0/models/channel/parameter/extended.json b/test/definitions/3.0.0/models/channel/parameter/extended.json deleted file mode 100644 index 756158c7..00000000 --- a/test/definitions/3.0.0/models/channel/parameter/extended.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "description": "Id of the user.", - "default": "0e822ca6-5311-4d4c-b409-993a1820e689", - "enum": [ - "0e822ca6-5311-4d4c-b409-993a1820e689", - "381f5ddc-75c6-4c21-9ec1-3919ed345be9", - "70559d88-31a5-4ef2-8c34-7fbd04057ed5", - "c6dc0047-a90d-4efa-95e3-a272282934e0" - ], - "examples": [ - "0e822ca6-5311-4d4c-b409-993a1820e689", - "381f5ddc-75c6-4c21-9ec1-3919ed345be9", - "70559d88-31a5-4ef2-8c34-7fbd04057ed5", - "c6dc0047-a90d-4efa-95e3-a272282934e0" - ], - "location": "$message.payload#/user/id", - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} diff --git a/test/definitions/3.0.0/models/channel/parameter/index.mjs b/test/definitions/3.0.0/models/channel/parameter/index.mjs deleted file mode 100644 index ff7b57f4..00000000 --- a/test/definitions/3.0.0/models/channel/parameter/index.mjs +++ /dev/null @@ -1,37 +0,0 @@ -import {describe, it} from 'vitest'; -import TestHelper from '@test/test-helper'; -import path from 'path'; - -const jsonSchema = require('@definitions/3.0.0/parameter.json'); - -describe('Parameter', () => { - it('example', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './example.json'), - )); - - it('empty', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './empty.json'), - )); - - it('without required properties', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './without required properties.json'), - )); - - it('only required properties', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './only required properties.json'), - )); - - it('extended', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './extended.json'), - )); - - it('wrongly extended', () => TestHelper.wronglyExtended( - jsonSchema, - path.resolve(__dirname, './wrongly extended.json'), - )); -}); diff --git a/test/definitions/3.0.0/models/channel/parameter/only required properties.json b/test/definitions/3.0.0/models/channel/parameter/only required properties.json deleted file mode 100644 index 0967ef42..00000000 --- a/test/definitions/3.0.0/models/channel/parameter/only required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/test/definitions/3.0.0/models/channel/parameter/without required properties.json b/test/definitions/3.0.0/models/channel/parameter/without required properties.json deleted file mode 100644 index b9e4dbc1..00000000 --- a/test/definitions/3.0.0/models/channel/parameter/without required properties.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "description": "Id of the user.", - "default": "0e822ca6-5311-4d4c-b409-993a1820e689", - "enum": [ - "0e822ca6-5311-4d4c-b409-993a1820e689", - "381f5ddc-75c6-4c21-9ec1-3919ed345be9", - "70559d88-31a5-4ef2-8c34-7fbd04057ed5", - "c6dc0047-a90d-4efa-95e3-a272282934e0" - ], - "examples": [ - "0e822ca6-5311-4d4c-b409-993a1820e689", - "381f5ddc-75c6-4c21-9ec1-3919ed345be9", - "70559d88-31a5-4ef2-8c34-7fbd04057ed5", - "c6dc0047-a90d-4efa-95e3-a272282934e0" - ], - "location": "$message.payload#/user/id" -} diff --git a/test/definitions/3.0.0/models/channel/parameter/wrongly extended.json b/test/definitions/3.0.0/models/channel/parameter/wrongly extended.json deleted file mode 100644 index 13e29d1c..00000000 --- a/test/definitions/3.0.0/models/channel/parameter/wrongly extended.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "description": "Id of the user.", - "default": "0e822ca6-5311-4d4c-b409-993a1820e689", - "enum": [ - "0e822ca6-5311-4d4c-b409-993a1820e689", - "381f5ddc-75c6-4c21-9ec1-3919ed345be9", - "70559d88-31a5-4ef2-8c34-7fbd04057ed5", - "c6dc0047-a90d-4efa-95e3-a272282934e0" - ], - "examples": [ - "0e822ca6-5311-4d4c-b409-993a1820e689", - "381f5ddc-75c6-4c21-9ec1-3919ed345be9", - "70559d88-31a5-4ef2-8c34-7fbd04057ed5", - "c6dc0047-a90d-4efa-95e3-a272282934e0" - ], - "location": "$message.payload#/user/id", - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} diff --git a/test/definitions/3.0.0/models/index.mjs b/test/definitions/3.0.0/models/index.mjs index 323d0932..1f3db2d9 100644 --- a/test/definitions/3.0.0/models/index.mjs +++ b/test/definitions/3.0.0/models/index.mjs @@ -2,9 +2,4 @@ import {describe} from 'vitest'; describe('Models Test Suite', async () => { await import('./channel'); - await import('./info'); - await import('./operation'); - await import('./reference'); - await import('./server'); - await import('./tag'); }); diff --git a/test/definitions/3.0.0/models/info/contact.test.mjs b/test/definitions/3.0.0/models/info/contact.test.mjs new file mode 100644 index 00000000..c57244a9 --- /dev/null +++ b/test/definitions/3.0.0/models/info/contact.test.mjs @@ -0,0 +1,61 @@ +import {describe} from 'vitest'; +import { + JsonSchemaTestSuite, + JsonSchemaTestSuiteConfig, + JsonSchemaTestSuiteData +} from '@test/definitions/base-schema-test.mjs'; + +const example = { + "name": "AsyncApi", + "url": "https://www.asyncapi.com", + "email": "java@asyncapi.com" +} + +const onlyRequiredProperties = {} + +const withoutRequiredProperties = {} + +const extended = { + "name": "AsyncAPI", + "url": "https://www.asyncapi.com", + "email": "java@asyncapi.com", + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } +} + +const wronglyExtended = { + "name": "AsyncAPI", + "url": "https://www.asyncapi.com", + "email": "java@asyncapi.com", + "x-number": 0, + "x-string": "", + "x-object": { + "property" : { } + }, + "ext-number": 1 +} + +const jsonSchema = require('@definitions/3.0.0/contact.json'); + +const config = new JsonSchemaTestSuiteConfig( + false, + [], + true, + [] +); + +const data = new JsonSchemaTestSuiteData( + jsonSchema, + [example], + onlyRequiredProperties, + withoutRequiredProperties, + extended, + wronglyExtended +); + +describe('Contact', () => { + new JsonSchemaTestSuite(data, config).testSuite() +}); \ No newline at end of file diff --git a/test/definitions/3.0.0/models/info/contact/empty.json b/test/definitions/3.0.0/models/info/contact/empty.json deleted file mode 100644 index 0967ef42..00000000 --- a/test/definitions/3.0.0/models/info/contact/empty.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/test/definitions/3.0.0/models/info/contact/example.json b/test/definitions/3.0.0/models/info/contact/example.json deleted file mode 100644 index 31cd246a..00000000 --- a/test/definitions/3.0.0/models/info/contact/example.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "AsyncApi", - "url": "https://www.asyncapi.com", - "email": "java@asyncapi.com" -} diff --git a/test/definitions/3.0.0/models/info/contact/extended.json b/test/definitions/3.0.0/models/info/contact/extended.json deleted file mode 100644 index fbc417ba..00000000 --- a/test/definitions/3.0.0/models/info/contact/extended.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name" : "AsyncAPI", - "url" : "https://www.asyncapi.com", - "email" : "java@asyncapi.com", - "x-number" : 0, - "x-string" : "", - "x-object" : { - "property" : { } - } -} diff --git a/test/definitions/3.0.0/models/info/contact/index.mjs b/test/definitions/3.0.0/models/info/contact/index.mjs deleted file mode 100644 index f181a7c3..00000000 --- a/test/definitions/3.0.0/models/info/contact/index.mjs +++ /dev/null @@ -1,37 +0,0 @@ -import {describe, it} from 'vitest'; -import TestHelper from '@test/test-helper'; -import path from 'path'; - -const jsonSchema = require('@definitions/3.0.0/contact.json'); - -describe('Contact', () => { - it(TestHelper.exampleIsValidTestName, () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './example.json'), - )); - - it(TestHelper.canBeEmptyTestName, () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './empty.json'), - )); - - it(TestHelper.isValidWithoutRequiredPropertiesTestName, () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './without required properties.json'), - )); - - it(TestHelper.isValidWithOnlyRequiredPropertiesTestName, () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './only required properties.json'), - )); - - it(TestHelper.isValidWhenIsExtendedTestName, () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './extended.json'), - )); - - it(TestHelper.isNotValidWhenIsWronglyExtendedTestName, () => TestHelper.wronglyExtended( - jsonSchema, - path.resolve(__dirname, './wrongly extended.json') - )); -}); diff --git a/test/definitions/3.0.0/models/info/contact/only required properties.json b/test/definitions/3.0.0/models/info/contact/only required properties.json deleted file mode 100644 index 0967ef42..00000000 --- a/test/definitions/3.0.0/models/info/contact/only required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/test/definitions/3.0.0/models/info/contact/without required properties.json b/test/definitions/3.0.0/models/info/contact/without required properties.json deleted file mode 100644 index 0967ef42..00000000 --- a/test/definitions/3.0.0/models/info/contact/without required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/test/definitions/3.0.0/models/info/contact/wrongly extended.json b/test/definitions/3.0.0/models/info/contact/wrongly extended.json deleted file mode 100644 index fe3dcbfc..00000000 --- a/test/definitions/3.0.0/models/info/contact/wrongly extended.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name" : "AsyncAPI", - "url" : "https://www.asyncapi.com", - "email" : "java@asyncapi.com", - "x-number" : 0, - "x-string" : "", - "x-object" : { - "property" : { } - }, - "ext-number": 1 -} diff --git a/test/definitions/3.0.0/models/info/index.mjs b/test/definitions/3.0.0/models/info/index.mjs deleted file mode 100644 index d7c0a2ab..00000000 --- a/test/definitions/3.0.0/models/info/index.mjs +++ /dev/null @@ -1,8 +0,0 @@ -import {describe} from 'vitest'; - -describe('Info Test Suite', async () => { - await import('./info'); - await import('./info extensions'); - await import('./contact'); - await import('./license'); -}); diff --git a/test/definitions/3.0.0/models/info/info extensions.test.mjs b/test/definitions/3.0.0/models/info/info extensions.test.mjs new file mode 100644 index 00000000..8e47cbb7 --- /dev/null +++ b/test/definitions/3.0.0/models/info/info extensions.test.mjs @@ -0,0 +1,58 @@ +import {describe} from 'vitest'; +import { + JsonSchemaTestSuite, + JsonSchemaTestSuiteConfig, + JsonSchemaTestSuiteData +} from '@test/definitions/base-schema-test.mjs'; + +const example = { + "x-x": "PBodiachevskii", + "x-linkedin": "https://www.linkedin.com/company/asyncapi/" +} + +const onlyRequiredProperties = {} + +const withoutRequiredProperties = {} + +const extended = { + "x-number" : 0, + "x-string" : "", + "x-object" : { + "property" : { } + }, + "x-x": "PBodiachevskii", + "x-linkedin": "https://www.linkedin.com/company/asyncapi/" +} + +const wronglyExtended = { + "ext-number": 1, + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "x-x": "PBodiachevskii", + "x-linkedin": "https://www.linkedin.com/company/asyncapi/" +} + +const jsonSchema = require('@definitions/3.0.0/infoExtensions.json'); + +const config = new JsonSchemaTestSuiteConfig( + false, + [], + false, + [] +); + +const data = new JsonSchemaTestSuiteData( + jsonSchema, + [example], + onlyRequiredProperties, + withoutRequiredProperties, + extended, + wronglyExtended +); + +describe('Info Extensions', () => { + new JsonSchemaTestSuite(data, config).testSuite() +}); diff --git a/test/definitions/3.0.0/models/info/info extensions/empty.json b/test/definitions/3.0.0/models/info/info extensions/empty.json deleted file mode 100644 index 0967ef42..00000000 --- a/test/definitions/3.0.0/models/info/info extensions/empty.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/test/definitions/3.0.0/models/info/info extensions/example.json b/test/definitions/3.0.0/models/info/info extensions/example.json deleted file mode 100644 index 331d9f15..00000000 --- a/test/definitions/3.0.0/models/info/info extensions/example.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "x-x": "PBodiachevskii", - "x-linkedin": "https://www.linkedin.com/company/asyncapi/" -} diff --git a/test/definitions/3.0.0/models/info/info extensions/extended.json b/test/definitions/3.0.0/models/info/info extensions/extended.json deleted file mode 100644 index edaedced..00000000 --- a/test/definitions/3.0.0/models/info/info extensions/extended.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "x-number" : 0, - "x-string" : "", - "x-object" : { - "property" : { } - }, - "x-x": "PBodiachevskii", - "x-linkedin": "https://www.linkedin.com/company/asyncapi/" -} diff --git a/test/definitions/3.0.0/models/info/info extensions/index.mjs b/test/definitions/3.0.0/models/info/info extensions/index.mjs deleted file mode 100644 index 199dc128..00000000 --- a/test/definitions/3.0.0/models/info/info extensions/index.mjs +++ /dev/null @@ -1,37 +0,0 @@ -import {describe, it} from 'vitest'; -import TestHelper from '@test/test-helper'; -import path from 'path'; - -const jsonSchema = require('@definitions/3.0.0/infoExtensions.json'); - -describe('Info Extensions', () => { - it('example', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './example.json'), - )); - - it('empty', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './empty.json'), - )); - - it('without required properties', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './without required properties.json'), - )); - - it('only required properties', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './only required properties.json'), - )); - - it.skip('extended. Reason: schema doesn\'t check for extensions', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './extended.json'), - )); - - it.skip('wrongly extended. Reason: schema doesn\'t check for extensions', () => TestHelper.wronglyExtended( - jsonSchema, - path.resolve(__dirname, './wrongly extended.json') - )); -}); diff --git a/test/definitions/3.0.0/models/info/info extensions/only required properties.json b/test/definitions/3.0.0/models/info/info extensions/only required properties.json deleted file mode 100644 index 0967ef42..00000000 --- a/test/definitions/3.0.0/models/info/info extensions/only required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/test/definitions/3.0.0/models/info/info extensions/without required properties.json b/test/definitions/3.0.0/models/info/info extensions/without required properties.json deleted file mode 100644 index 0967ef42..00000000 --- a/test/definitions/3.0.0/models/info/info extensions/without required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/test/definitions/3.0.0/models/info/info extensions/wrongly extended.json b/test/definitions/3.0.0/models/info/info extensions/wrongly extended.json deleted file mode 100644 index f9cd5905..00000000 --- a/test/definitions/3.0.0/models/info/info extensions/wrongly extended.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "ext-number": 1, - "x-number" : 0, - "x-string" : "", - "x-object" : { - "property" : { } - }, - "x-x": "PBodiachevskii", - "x-linkedin": "https://www.linkedin.com/company/asyncapi/" -} diff --git a/test/definitions/3.0.0/models/info/info/properties/contact.mjs b/test/definitions/3.0.0/models/info/info properties/contact.mjs similarity index 96% rename from test/definitions/3.0.0/models/info/info/properties/contact.mjs rename to test/definitions/3.0.0/models/info/info properties/contact.mjs index 8d1f6d5f..42d29468 100644 --- a/test/definitions/3.0.0/models/info/info/properties/contact.mjs +++ b/test/definitions/3.0.0/models/info/info properties/contact.mjs @@ -1,6 +1,5 @@ import {describe, it} from 'vitest'; -import TestHelper from '@test/test-helper'; -import path from 'path'; +import TestHelper from '@test/test-helper.mjs'; const jsonSchema = require('@definitions/3.0.0/info.json'); diff --git a/test/definitions/3.0.0/models/info/info/properties/description.mjs b/test/definitions/3.0.0/models/info/info properties/description.mjs similarity index 96% rename from test/definitions/3.0.0/models/info/info/properties/description.mjs rename to test/definitions/3.0.0/models/info/info properties/description.mjs index 315df5bc..7949530a 100644 --- a/test/definitions/3.0.0/models/info/info/properties/description.mjs +++ b/test/definitions/3.0.0/models/info/info properties/description.mjs @@ -1,6 +1,5 @@ import {describe, it} from 'vitest'; -import TestHelper from '@test/test-helper'; -import path from 'path'; +import TestHelper from '@test/test-helper.mjs'; const jsonSchema = require('@definitions/3.0.0/info.json'); diff --git a/test/definitions/3.0.0/models/info/info/properties/externalDocs.mjs b/test/definitions/3.0.0/models/info/info properties/externalDocs.mjs similarity index 97% rename from test/definitions/3.0.0/models/info/info/properties/externalDocs.mjs rename to test/definitions/3.0.0/models/info/info properties/externalDocs.mjs index ade365d7..14d0ede9 100644 --- a/test/definitions/3.0.0/models/info/info/properties/externalDocs.mjs +++ b/test/definitions/3.0.0/models/info/info properties/externalDocs.mjs @@ -1,6 +1,5 @@ import {describe, it} from 'vitest'; -import TestHelper from '@test/test-helper'; -import path from 'path'; +import TestHelper from '@test/test-helper.mjs'; const jsonSchema = require('@definitions/3.0.0/info.json'); diff --git a/test/definitions/3.0.0/models/info/info/properties/license.mjs b/test/definitions/3.0.0/models/info/info properties/license.mjs similarity index 96% rename from test/definitions/3.0.0/models/info/info/properties/license.mjs rename to test/definitions/3.0.0/models/info/info properties/license.mjs index 392db039..91442a7b 100644 --- a/test/definitions/3.0.0/models/info/info/properties/license.mjs +++ b/test/definitions/3.0.0/models/info/info properties/license.mjs @@ -1,6 +1,5 @@ import {describe, it} from 'vitest'; -import TestHelper from '@test/test-helper'; -import path from 'path'; +import TestHelper from '@test/test-helper.mjs'; const jsonSchema = require('@definitions/3.0.0/info.json'); diff --git a/test/definitions/3.0.0/models/info/info/properties/tags.mjs b/test/definitions/3.0.0/models/info/info properties/tags.mjs similarity index 98% rename from test/definitions/3.0.0/models/info/info/properties/tags.mjs rename to test/definitions/3.0.0/models/info/info properties/tags.mjs index 7dc1f770..6b4cc458 100644 --- a/test/definitions/3.0.0/models/info/info/properties/tags.mjs +++ b/test/definitions/3.0.0/models/info/info properties/tags.mjs @@ -1,6 +1,5 @@ import {describe, it} from 'vitest'; -import TestHelper from '@test/test-helper'; -import path from 'path'; +import TestHelper from '@test/test-helper.mjs'; const jsonSchema = require('@definitions/3.0.0/info.json'); diff --git a/test/definitions/3.0.0/models/info/info/properties/termsOfService.mjs b/test/definitions/3.0.0/models/info/info properties/termsOfService.mjs similarity index 96% rename from test/definitions/3.0.0/models/info/info/properties/termsOfService.mjs rename to test/definitions/3.0.0/models/info/info properties/termsOfService.mjs index b44a666b..54fcf8e6 100644 --- a/test/definitions/3.0.0/models/info/info/properties/termsOfService.mjs +++ b/test/definitions/3.0.0/models/info/info properties/termsOfService.mjs @@ -1,6 +1,5 @@ import {describe, it} from 'vitest'; -import TestHelper from '@test/test-helper'; -import path from 'path'; +import TestHelper from '@test/test-helper.mjs'; const jsonSchema = require('@definitions/3.0.0/info.json'); diff --git a/test/definitions/3.0.0/models/info/info.test.mjs b/test/definitions/3.0.0/models/info/info.test.mjs new file mode 100644 index 00000000..b9398ec5 --- /dev/null +++ b/test/definitions/3.0.0/models/info/info.test.mjs @@ -0,0 +1,178 @@ +import {describe} from 'vitest'; +import { + JsonSchemaTestSuite, + JsonSchemaTestSuiteConfig, + JsonSchemaTestSuiteData +} from '@test/definitions/base-schema-test.mjs'; + +const example = { + "title": "AsyncAPI sample", + "version": "2.0", + "description": "short description", + "termsOfService": "https://www.asyncapi.com/about/", + "contact": { + "name": "AsyncApi", + "url": "https://www.asyncapi.com", + "email": "java@asyncapi.com" + }, + "license": { + "name": "Apache License 2.0", + "url": "https://www.apache.org/licenses/" + }, + "tags": [ + { + "name": "user", + "description": "User-related messages", + "externalDocs": { + "description" : "Find more info here", + "url" : "https://example.com" + } + } + ], + "externalDocs": { + "description": "Find more info here", + "url": "https://example.com" + } +} + +const onlyRequiredProperties = { + "title": "AsyncApi sample", + "version": "1.2.34" +} + +const withoutRequiredProperties = { + "description": "Short description", + "termsOfService": "https://www.asyncapi.com/about/", + "contact": { + "name": "AsyncApi", + "url": "https://www.asyncapi.com", + "email": "java@asyncapi.com" + }, + "license": { + "name": "Apache License 2.0", + "url": "https://www.apache.org/licenses/" + }, + "tags": [ + { + "name": "user", + "description": "User-related messages", + "externalDocs": { + "description": "Find more info here", + "url": "https://example.com" + } + } + ], + "externalDocs": { + "description": "Find more info here", + "url": "https://example.com" + } +} + +const extended = { + "title": "AsyncApi sample", + "version": "1.2.34", + "description": "Short description", + "termsOfService": "https://www.asyncapi.com/about/", + "contact": { + "name": "AsyncApi", + "url": "https://www.asyncapi.com", + "email": "java@asyncapi.com" + }, + "license": { + "name": "Apache License 2.0", + "url": "https://www.apache.org/licenses/" + }, + "tags": [ + { + "name": "user", + "description": "User-related messages", + "externalDocs": { + "description": "Find more info here", + "url": "https://example.com" + } + } + ], + "externalDocs": { + "description": "Find more info here", + "url": "https://example.com" + }, + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "x-x": "PBodiachevskii", + "x-linkedin": "https://www.linkedin.com/company/asyncapi/" +} + +const wronglyExtended = { + "title": "AsyncApi sample", + "version": "1.2.34", + "description": "Short description", + "termsOfService": "https://www.asyncapi.com/about/", + "contact": { + "name": "AsyncApi", + "url": "https://www.asyncapi.com", + "email": "java@asyncapi.com" + }, + "license": { + "name": "Apache License 2.0", + "url": "https://www.apache.org/licenses/" + }, + "tags": [ + { + "name": "user", + "description": "User-related messages", + "externalDocs": { + "description": "Find more info here", + "url": "https://example.com" + } + } + ], + "externalDocs": { + "description": "Find more info here", + "url": "https://example.com" + }, + "ext-number": 1, + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "x-x": "PBodiachevskii", + "x-linkedin": "https://www.linkedin.com/company/asyncapi/" +} + +const jsonSchema = require('@definitions/3.0.0/info.json'); + +const config = new JsonSchemaTestSuiteConfig( + true, + [ + 'must have required property \'version\'', + 'must have required property \'title\'' + ], + true, + [] +); + +const data = new JsonSchemaTestSuiteData( + jsonSchema, + [example], + onlyRequiredProperties, + withoutRequiredProperties, + extended, + wronglyExtended +); + +describe('Info', () => { + new JsonSchemaTestSuite(data, config).testSuite() +}); + +describe('Info Properties', async () => { + await import('@test/definitions/3.0.0/models/info/info properties/description.mjs'); + await import('@test/definitions/3.0.0/models/info/info properties/termsOfService.mjs'); + await import('@test/definitions/3.0.0/models/info/info properties/contact.mjs'); + await import('@test/definitions/3.0.0/models/info/info properties/license.mjs'); + await import('@test/definitions/3.0.0/models/info/info properties/tags.mjs'); + await import('@test/definitions/3.0.0/models/info/info properties/externalDocs.mjs'); +}); diff --git a/test/definitions/3.0.0/models/info/info/empty.json b/test/definitions/3.0.0/models/info/info/empty.json deleted file mode 100644 index 0967ef42..00000000 --- a/test/definitions/3.0.0/models/info/info/empty.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/test/definitions/3.0.0/models/info/info/example.json b/test/definitions/3.0.0/models/info/info/example.json deleted file mode 100644 index 8231edb9..00000000 --- a/test/definitions/3.0.0/models/info/info/example.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "title": "AsyncApi sample", - "version": "2.0", - "description": "short description", - "termsOfService": "https://www.asyncapi.com/about/", - "contact": { - "name": "AsyncApi", - "url": "https://www.asyncapi.com", - "email": "java@asyncapi.com" - }, - "license": { - "name": "Apache License 2.0", - "url": "http://www.apache.org/licenses/" - }, - "tags": [ - { - "name": "user", - "description": "User-related messages", - "externalDocs": { - "description" : "Find more info here", - "url" : "https://example.com" - } - } - ], - "externalDocs": { - "description": "Find more info here", - "url": "https://example.com" - } -} diff --git a/test/definitions/3.0.0/models/info/info/extended.json b/test/definitions/3.0.0/models/info/info/extended.json deleted file mode 100644 index 11b4eec2..00000000 --- a/test/definitions/3.0.0/models/info/info/extended.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "title": "AsyncApi sample", - "version": "1.2.34", - "description": "Short description", - "termsOfService": "https://www.asyncapi.com/about/", - "contact": { - "name": "AsyncApi", - "url": "https://www.asyncapi.com", - "email": "java@asyncapi.com" - }, - "license": { - "name": "Apache License 2.0", - "url": "http://www.apache.org/licenses/" - }, - "tags": [ - { - "name": "user", - "description": "User-related messages", - "externalDocs": { - "description": "Find more info here", - "url": "https://example.com" - } - } - ], - "externalDocs": { - "description": "Find more info here", - "url": "https://example.com" - }, - "x-number" : 0, - "x-string" : "", - "x-object" : { - "property" : { } - }, - "x-x": "PBodiachevskii", - "x-linkedin": "https://www.linkedin.com/company/asyncapi/" -} diff --git a/test/definitions/3.0.0/models/info/info/index.mjs b/test/definitions/3.0.0/models/info/info/index.mjs deleted file mode 100644 index 3be3bc0e..00000000 --- a/test/definitions/3.0.0/models/info/info/index.mjs +++ /dev/null @@ -1,52 +0,0 @@ -import {describe, it} from 'vitest'; -import TestHelper from '@test/test-helper'; -import path from 'path'; - -const jsonSchema = require('@definitions/3.0.0/info.json'); - -describe('Info', async () => { - await import('./properties/description.mjs'); - await import('./properties/termsOfService.mjs'); - await import('./properties/contact.mjs'); - await import('./properties/license.mjs'); - await import('./properties/tags.mjs'); - await import('./properties/externalDocs.mjs'); - - it(TestHelper.exampleIsValidTestName, () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './example.json'), - )); - - it(TestHelper.cannotBeEmptyTestName, () => TestHelper.objectIsNotValid( - jsonSchema, - path.resolve(__dirname, './empty.json'), - [ - 'must have required property \'version\'', - 'must have required property \'title\'' - ] - )); - - it(TestHelper.isNotValidWithoutRequiredPropertiesTestName, () => TestHelper.objectIsNotValid( - jsonSchema, - path.resolve(__dirname, './without required properties.json'), - [ - 'must have required property \'version\'', - 'must have required property \'title\'' - ] - )); - - it(TestHelper.isValidWithOnlyRequiredPropertiesTestName, () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './only required properties.json'), - )); - - it(TestHelper.isValidWhenIsExtendedTestName, () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './extended.json'), - )); - - it(TestHelper.isNotValidWhenIsWronglyExtendedTestName, () => TestHelper.wronglyExtended( - jsonSchema, - path.resolve(__dirname, './wrongly extended.json') - )); -}); diff --git a/test/definitions/3.0.0/models/info/info/only required properties.json b/test/definitions/3.0.0/models/info/info/only required properties.json deleted file mode 100644 index e04a62ca..00000000 --- a/test/definitions/3.0.0/models/info/info/only required properties.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "title": "AsyncApi sample", - "version": "1.2.34" -} diff --git a/test/definitions/3.0.0/models/info/info/without required properties.json b/test/definitions/3.0.0/models/info/info/without required properties.json deleted file mode 100644 index 6c71665d..00000000 --- a/test/definitions/3.0.0/models/info/info/without required properties.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "description": "Short description", - "termsOfService": "https://www.asyncapi.com/about/", - "contact": { - "name": "AsyncApi", - "url": "https://www.asyncapi.com", - "email": "java@asyncapi.com" - }, - "license": { - "name": "Apache License 2.0", - "url": "http://www.apache.org/licenses/" - }, - "tags": [ - { - "name": "user", - "description": "User-related messages", - "externalDocs": { - "description": "Find more info here", - "url": "https://example.com" - } - } - ], - "externalDocs": { - "description": "Find more info here", - "url": "https://example.com" - } -} diff --git a/test/definitions/3.0.0/models/info/info/wrongly extended.json b/test/definitions/3.0.0/models/info/info/wrongly extended.json deleted file mode 100644 index 2024806e..00000000 --- a/test/definitions/3.0.0/models/info/info/wrongly extended.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "title": "AsyncApi sample", - "version": "1.2.34", - "description": "Short description", - "termsOfService": "https://www.asyncapi.com/about/", - "contact": { - "name": "AsyncApi", - "url": "https://www.asyncapi.com", - "email": "java@asyncapi.com" - }, - "license": { - "name": "Apache License 2.0", - "url": "http://www.apache.org/licenses/" - }, - "tags": [ - { - "name": "user", - "description": "User-related messages", - "externalDocs": { - "description": "Find more info here", - "url": "https://example.com" - } - } - ], - "externalDocs": { - "description": "Find more info here", - "url": "https://example.com" - }, - "ext-number": 1, - "x-number" : 0, - "x-string" : "", - "x-object" : { - "property" : { } - }, - "x-x": "PBodiachevskii", - "x-linkedin": "https://www.linkedin.com/company/asyncapi/" -} diff --git a/test/definitions/3.0.0/models/info/licence.test.mjs b/test/definitions/3.0.0/models/info/licence.test.mjs new file mode 100644 index 00000000..944e8b91 --- /dev/null +++ b/test/definitions/3.0.0/models/info/licence.test.mjs @@ -0,0 +1,67 @@ +import {describe} from 'vitest'; +import { + JsonSchemaTestSuite, + JsonSchemaTestSuiteConfig, + JsonSchemaTestSuiteData +} from '@test/definitions/base-schema-test.mjs'; + +const example = { + "name": "Apache License 2.0", + "url": "https://www.apache.org/licenses/" +} + +const onlyRequiredProperties = { + "name": "Apache License 2.0" +} + +const withoutRequiredProperties = { + "url": "https://www.apache.org/licenses/", + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } +} + +const extended = { + "name": "Apache License 2.0", + "url": "https://www.apache.org/licenses/", + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } +} + +const wronglyExtended = { + "name": "Apache License 2.0", + "url": "https://www.apache.org/licenses/", + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 +} + +const jsonSchema = require('@definitions/3.0.0/license.json'); + +const data = new JsonSchemaTestSuiteData( + jsonSchema, + [example], + onlyRequiredProperties, + withoutRequiredProperties, + extended, + wronglyExtended +); + +const config = new JsonSchemaTestSuiteConfig( + true, + ['must have required property \'name\''], + false, + [] +); + +describe('License', () => { + new JsonSchemaTestSuite(data, config).testSuite() +}); \ No newline at end of file diff --git a/test/definitions/3.0.0/models/info/license/empty.json b/test/definitions/3.0.0/models/info/license/empty.json deleted file mode 100644 index 0967ef42..00000000 --- a/test/definitions/3.0.0/models/info/license/empty.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/test/definitions/3.0.0/models/info/license/example.json b/test/definitions/3.0.0/models/info/license/example.json deleted file mode 100644 index 61436164..00000000 --- a/test/definitions/3.0.0/models/info/license/example.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "Apache License 2.0", - "url": "http://www.apache.org/licenses/" -} diff --git a/test/definitions/3.0.0/models/info/license/extended.json b/test/definitions/3.0.0/models/info/license/extended.json deleted file mode 100644 index e68cd0c9..00000000 --- a/test/definitions/3.0.0/models/info/license/extended.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "Apache License 2.0", - "url": "http://www.apache.org/licenses/", - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} diff --git a/test/definitions/3.0.0/models/info/license/index.mjs b/test/definitions/3.0.0/models/info/license/index.mjs deleted file mode 100644 index 3ce5bdd8..00000000 --- a/test/definitions/3.0.0/models/info/license/index.mjs +++ /dev/null @@ -1,39 +0,0 @@ -import {describe, it} from 'vitest'; -import TestHelper from '@test/test-helper'; -import path from 'path'; - -const jsonSchema = require('@definitions/3.0.0/license.json'); - -describe('License', () => { - it('example', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './example.json'), - )); - - it('empty', () => TestHelper.objectIsNotValid( - jsonSchema, - path.resolve(__dirname, './empty.json'), - ['must have required property \'name\''] - )); - - it('without required properties', () => TestHelper.objectIsNotValid( - jsonSchema, - path.resolve(__dirname, './without required properties.json'), - ['must have required property \'name\''] - )); - - it('only required properties', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './only required properties.json'), - )); - - it('extended', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './extended.json'), - )); - - it('wrongly extended', () => TestHelper.wronglyExtended( - jsonSchema, - path.resolve(__dirname, './wrongly extended.json') - )); -}); diff --git a/test/definitions/3.0.0/models/info/license/only required properties.json b/test/definitions/3.0.0/models/info/license/only required properties.json deleted file mode 100644 index 79e4eb51..00000000 --- a/test/definitions/3.0.0/models/info/license/only required properties.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name": "Apache License 2.0" -} diff --git a/test/definitions/3.0.0/models/info/license/without required properties.json b/test/definitions/3.0.0/models/info/license/without required properties.json deleted file mode 100644 index be63250b..00000000 --- a/test/definitions/3.0.0/models/info/license/without required properties.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "url": "http://www.apache.org/licenses/", - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} diff --git a/test/definitions/3.0.0/models/info/license/wrongly extended.json b/test/definitions/3.0.0/models/info/license/wrongly extended.json deleted file mode 100644 index a52ea20d..00000000 --- a/test/definitions/3.0.0/models/info/license/wrongly extended.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "Apache License 2.0", - "url": "http://www.apache.org/licenses/", - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} diff --git a/test/definitions/3.0.0/models/operation/index.mjs b/test/definitions/3.0.0/models/operation/index.mjs deleted file mode 100644 index c676db7d..00000000 --- a/test/definitions/3.0.0/models/operation/index.mjs +++ /dev/null @@ -1,8 +0,0 @@ -import {describe} from 'vitest'; - -describe('Operation Test Suite', async () => { - await import('./operation'); - await import('./operationReply'); - await import('./operationReplyAddress'); - await import('./operationTrait'); -}); diff --git a/test/definitions/3.0.0/models/operation/operation reply address.test.mjs b/test/definitions/3.0.0/models/operation/operation reply address.test.mjs new file mode 100644 index 00000000..49dca587 --- /dev/null +++ b/test/definitions/3.0.0/models/operation/operation reply address.test.mjs @@ -0,0 +1,52 @@ +import { + JsonSchemaTestSuite, + JsonSchemaTestSuiteConfig, + JsonSchemaTestSuiteData +} from '@test/definitions/base-schema-test.mjs'; +import {describe} from 'vitest'; + +const jsonSchema = require('@definitions/3.0.0/operationReplyAddress.json'); + +const config = new JsonSchemaTestSuiteConfig( + true, + ['must have required property \'location\''], + true, + [] +); + +const data = new JsonSchemaTestSuiteData( + jsonSchema, + [ + { + "description" : "Consumer inbox", + "location" : "$message.header#/replyTo" + } + ], + { + "location" : "$message.header#/replyTo" + }, + { + "description" : "Consumer inbox" + }, + { + "location" : "$message.header#/replyTo", + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "location" : "$message.header#/replyTo", + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } +); + +describe('Operation Reply Address', () => { + new JsonSchemaTestSuite(data, config).testSuite() +}); diff --git a/test/definitions/3.0.0/models/operation/operation reply.test.mjs b/test/definitions/3.0.0/models/operation/operation reply.test.mjs new file mode 100644 index 00000000..50d434cf --- /dev/null +++ b/test/definitions/3.0.0/models/operation/operation reply.test.mjs @@ -0,0 +1,62 @@ +import { + JsonSchemaTestSuite, + JsonSchemaTestSuiteConfig, + JsonSchemaTestSuiteData +} from '@test/definitions/base-schema-test.mjs'; +import {describe} from 'vitest'; + +const jsonSchema = require('@definitions/3.0.0/operationReply.json'); + +const config = new JsonSchemaTestSuiteConfig( + false, + [], + true, + [] +); + +const data = new JsonSchemaTestSuiteData( + jsonSchema, + [ + { + "address": { + "description": "Consumer inbox", + "location": "$message.header#/replyTo" + }, + "channel": { + "$ref": "#/components/channels/channel" + }, + "messages": [ + { + "$ref": "#/components/messages/message 1" + }, + { + "$ref": "#/components/messages/message 2" + }, + { + "$ref": "#/components/messages/message 3" + } + ] + } + ], + {}, + {}, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } +); + +describe('Operation Reply', () => { + new JsonSchemaTestSuite(data, config).testSuite() +}); diff --git a/test/definitions/3.0.0/models/operation/operation trait.test.mjs b/test/definitions/3.0.0/models/operation/operation trait.test.mjs new file mode 100644 index 00000000..a53c344e --- /dev/null +++ b/test/definitions/3.0.0/models/operation/operation trait.test.mjs @@ -0,0 +1,83 @@ +import { + JsonSchemaTestSuite, + JsonSchemaTestSuiteConfig, + JsonSchemaTestSuiteData +} from '@test/definitions/base-schema-test.mjs'; +import {describe} from 'vitest'; + +const jsonSchema = require('@definitions/3.0.0/operationTrait.json'); + +const config = new JsonSchemaTestSuiteConfig( + false, + [], + true, + [] +); + +const data = new JsonSchemaTestSuiteData( + jsonSchema, + [ + { + "title": "Send message operation", + "summary": "Send message", + "description": "Send message to remote server", + "security": [ + { + "type": "apiKey", + "description": "apiKey", + "in": "user" + }, + { + "$ref": "#/components/security/plain" + } + ], + "tags": [ + { + "$ref": "#/components/tags/tag" + } + ], + "externalDocs": { + "$ref": "#/components/externalDocs" + }, + "bindings": { + "amqp":{ + "expiration": 100000, + "userId": "guest", + "cc": [ + "user.logs" + ], + "priority": 10, + "deliveryMode": 2, + "mandatory": false, + "bcc": [ + "external.audit" + ], + "timestamp": true, + "ack": false, + "bindingVersion": "0.3.0" + } + } + } + ], + {}, + {}, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } +); + +describe('Operation Trait', () => { + new JsonSchemaTestSuite(data, config).testSuite() +}); diff --git a/test/definitions/3.0.0/models/operation/operation.test.mjs b/test/definitions/3.0.0/models/operation/operation.test.mjs new file mode 100644 index 00000000..f670c49a --- /dev/null +++ b/test/definitions/3.0.0/models/operation/operation.test.mjs @@ -0,0 +1,84 @@ +import { + JsonSchemaTestSuite, + JsonSchemaTestSuiteConfig, + JsonSchemaTestSuiteData +} from '@test/definitions/base-schema-test.mjs'; +import {describe} from 'vitest'; + +const jsonSchema = require('@definitions/3.0.0/operation.json'); + +const config = new JsonSchemaTestSuiteConfig( + true, + [ + 'must have required property \'action\'', + 'must have required property \'channel\'' + ], + true, + [] +); + +const data = new JsonSchemaTestSuiteData( + jsonSchema, + [ + { + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/userSignup" + }, + "action": "send", + "tags": [{ "name": "user" }, { "name": "signup" }, { "name": "register" }], + "bindings": { + "amqp": { + "ack": false + } + }, + "traits": [{ "$ref": "#/components/operationTraits/kafka" }] + } + ], + { + "channel": { + "$ref": "#/channels/userSignup" + }, + "action": "send" + }, + { + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "bindings": { + "amqp": { + "ack": false + } + }, + "traits": [{ "$ref": "#/components/operationTraits/kafka" }] + }, + { + "channel": { + "$ref": "#/channels/userSignup" + }, + "action": "send", + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "channel": { + "$ref": "#/channels/userSignup" + }, + "action": "send", + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } +); + +describe('Operation', () => { + new JsonSchemaTestSuite(data, config).testSuite() +}); diff --git a/test/definitions/3.0.0/models/operation/operation/empty.json b/test/definitions/3.0.0/models/operation/operation/empty.json deleted file mode 100644 index 0967ef42..00000000 --- a/test/definitions/3.0.0/models/operation/operation/empty.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/test/definitions/3.0.0/models/operation/operation/example.json b/test/definitions/3.0.0/models/operation/operation/example.json deleted file mode 100644 index 3d5a4bee..00000000 --- a/test/definitions/3.0.0/models/operation/operation/example.json +++ /dev/null @@ -1,484 +0,0 @@ -{ - "action": "send", - "channel": "#/components/channels/channel", - "title": "Send message operation", - "summary": "Send message", - "description": "Send message to remote server", - "security": [ - { - "type": "apiKey", - "description": "apiKey", - "in": "user" - }, - { - "$ref": "#/components/security/plain" - } - ], - "tags": [ - { - "name": "messages", - "description": "operations with messages", - "externalDocs": { - "description": "Messages validation rules", - "url": "messages/validation-rules" - } - }, - { - "$ref": "#/components/tags/tag" - } - ], - "externalDocs": { - "description": "Messages validation rules", - "url": "messages/validation-rules" - }, - "bindings": { - "amqp": { - "expiration": 100000, - "userId": "guest", - "cc": [ - "user.logs" - ], - "priority": 10, - "deliveryMode": 2, - "mandatory": false, - "bcc": [ - "external.audit" - ], - "replyTo": "user.signedup", - "timestamp": true, - "ack": false, - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/operationBindings/amqp1" - }, - "anypointmq": { - "$ref": "#/components/operationBindings/anypointmq" - }, - "googlepubsub": { - "$ref": "#/components/operationBindings/googlepubsub" - }, - "http": { - "method": "GET", - "query": { - "type": "object", - "required": [ - "companyId" - ], - "properties": { - "companyId": { - "type": "number", - "minimum": 1, - "description": "The Id of the company." - } - }, - "additionalProperties": false - }, - "bindingVersion": "0.3.0" - }, - "ibmmq": { - "$ref": "#/components/operationBindings/ibmmq" - }, - "jms": { - "$ref": "#/components/operationBindings/jms" - }, - "kafka": { - "groupId": { - "type": "string", - "enum": [ - "myGroupId" - ] - }, - "clientId": { - "type": "string", - "enum": [ - "myClientId" - ] - }, - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/operationBindings/mercure" - }, - "mqtt": { - "qos": 2, - "retain": true, - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/operationBindings/mqtt5" - }, - "nats": { - "queue": "messages", - "bindingVersion": "0.1.0" - }, - "pulsar": { - "$ref": "#/components/operationBindings/pulsar" - }, - "redis": { - "$ref": "#/components/operationBindings/redis" - }, - "sns": { - "$ref": "#/components/operationBindings/sns" - }, - "solace": { - "dmqEligible" : false, - "bindingVersion" : "0.4.0", - "destinations" : [ { - "destinationType" : "queue", - "deliveryMode" : "persistent", - "queue" : { - "name" : "sampleQueue", - "topicSubscriptions" : [ "samples/*" ], - "accessType" : "nonexclusive" - } - }, { - "destinationType" : "topic", - "deliveryMode" : "persistent", - "topicSubscriptions" : [ "samples/*" ] - } ] - }, - "sqs": { - "$ref": "#/components/operationBindings/sqs" - }, - "stomp": { - "$ref": "#/components/operationBindings/stomp" - }, - "ws": { - "$ref": "#/components/operationBindings/ws" - } - }, - "traits": [ - { - "title": "Send message operation", - "summary": "Send message", - "description": "Send message to remote server", - "security": [ - { - "type": "apiKey", - "description": "apiKey", - "in": "user" - }, - { - "$ref": "#/components/security/plain" - } - ], - "tags": [ - { - "name": "messages", - "description": "operations with messages", - "externalDocs": { - "description": "Messages validation rules", - "url": "messages/validation-rules" - } - }, - { - "$ref": "#/components/tags/tag" - } - ], - "externalDocs": { - "description": "Messages validation rules", - "url": "messages/validation-rules" - }, - "bindings": { - "amqp": { - "expiration": 100000, - "userId": "guest", - "cc": [ - "user.logs" - ], - "priority": 10, - "deliveryMode": 2, - "mandatory": false, - "bcc": [ - "external.audit" - ], - "replyTo": "user.signedup", - "timestamp": true, - "ack": false, - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/operationBindings/amqp1" - }, - "anypointmq": { - "$ref": "#/components/operationBindings/anypointmq" - }, - "googlepubsub": { - "$ref": "#/components/operationBindings/googlepubsub" - }, - "http": { - "method": "GET", - "query": { - "type": "object", - "required": [ - "companyId" - ], - "properties": { - "companyId": { - "type": "number", - "minimum": 1, - "description": "The Id of the company." - } - }, - "additionalProperties": false - }, - "bindingVersion": "0.3.0" - }, - "ibmmq": { - "$ref": "#/components/operationBindings/ibmmq" - }, - "jms": { - "$ref": "#/components/operationBindings/jms" - }, - "kafka": { - "groupId": { - "type": "string", - "enum": [ - "myGroupId" - ] - }, - "clientId": { - "type": "string", - "enum": [ - "myClientId" - ] - }, - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/operationBindings/mercure" - }, - "mqtt": { - "qos": 2, - "retain": true, - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/operationBindings/mqtt5" - }, - "nats": { - "queue": "messages", - "bindingVersion": "0.1.0" - }, - "pulsar": { - "$ref": "#/components/operationBindings/pulsar" - }, - "redis": { - "$ref": "#/components/operationBindings/redis" - }, - "sns": { - "$ref": "#/components/operationBindings/sns" - }, - "solace": { - "dmqEligible" : false, - "bindingVersion" : "0.4.0", - "destinations" : [ { - "destinationType" : "queue", - "deliveryMode" : "persistent", - "queue" : { - "name" : "sampleQueue", - "topicSubscriptions" : [ "samples/*" ], - "accessType" : "nonexclusive" - } - }, { - "destinationType" : "topic", - "deliveryMode" : "persistent", - "topicSubscriptions" : [ "samples/*" ] - } ] - }, - "sqs": { - "$ref": "#/components/operationBindings/sqs" - }, - "stomp": { - "$ref": "#/components/operationBindings/stomp" - }, - "ws": { - "$ref": "#/components/operationBindings/ws" - } - } - }, - { - "title": "Send message operation", - "summary": "Send message", - "description": "Send message to remote server", - "security": [ - { - "type": "apiKey", - "description": "apiKey", - "in": "user" - }, - { - "$ref": "#/components/security/plain" - } - ], - "tags": [ - { - "name": "messages", - "description": "operations with messages", - "externalDocs": { - "description": "Messages validation rules", - "url": "messages/validation-rules" - } - }, - { - "$ref": "#/components/tags/tag" - } - ], - "externalDocs": { - "$ref": "#/components/externalDocs/external-doc" - }, - "bindings": { - "amqp": { - "expiration": 100000, - "userId": "guest", - "cc": [ - "user.logs" - ], - "priority": 10, - "deliveryMode": 2, - "mandatory": false, - "bcc": [ - "external.audit" - ], - "replyTo": "user.signedup", - "timestamp": true, - "ack": false, - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/operationBindings/amqp1" - }, - "anypointmq": { - "$ref": "#/components/operationBindings/anypointmq" - }, - "googlepubsub": { - "$ref": "#/components/operationBindings/googlepubsub" - }, - "http": { - "method": "GET", - "query": { - "type": "object", - "required": [ - "companyId" - ], - "properties": { - "companyId": { - "type": "number", - "minimum": 1, - "description": "The Id of the company." - } - }, - "additionalProperties": false - }, - "bindingVersion": "0.3.0" - }, - "ibmmq": { - "$ref": "#/components/operationBindings/ibmmq" - }, - "jms": { - "$ref": "#/components/operationBindings/jms" - }, - "kafka": { - "groupId": { - "type": "string", - "enum": [ - "myGroupId" - ] - }, - "clientId": { - "type": "string", - "enum": [ - "myClientId" - ] - }, - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/operationBindings/mercure" - }, - "mqtt": { - "qos": 2, - "retain": true, - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/operationBindings/mqtt5" - }, - "nats": { - "queue": "messages", - "bindingVersion": "0.1.0" - }, - "pulsar": { - "$ref": "#/components/operationBindings/pulsar" - }, - "redis": { - "$ref": "#/components/operationBindings/redis" - }, - "sns": { - "$ref": "#/components/operationBindings/sns" - }, - "solace": { - "dmqEligible" : false, - "bindingVersion" : "0.4.0", - "destinations" : [ { - "destinationType" : "queue", - "deliveryMode" : "persistent", - "queue" : { - "name" : "sampleQueue", - "topicSubscriptions" : [ "samples/*" ], - "accessType" : "nonexclusive" - } - }, { - "destinationType" : "topic", - "deliveryMode" : "persistent", - "topicSubscriptions" : [ "samples/*" ] - } ] - }, - "sqs": { - "$ref": "#/components/operationBindings/sqs" - }, - "stomp": { - "$ref": "#/components/operationBindings/stomp" - }, - "ws": { - "$ref": "#/components/operationBindings/ws" - } - } - }, - { - "$ref": "#/components/operations/trait" - } - ], - "messages": [ - { - "$ref": "#/components/messages/message 1" - }, - { - "$ref": "#/components/messages/message 2" - }, - { - "$ref": "#/components/messages/message 3" - } - ], - "reply": { - "address": { - "description": "Consumer inbox", - "location": "$message.header#/replyTo" - }, - "channel": { - "$ref": "#/components/channels/channel" - }, - "messages": [ - { - "$ref": "#/components/messages/message 1" - }, - { - "$ref": "#/components/messages/message 2" - }, - { - "$ref": "#/components/messages/message 3" - } - ] - } -} diff --git a/test/definitions/3.0.0/models/operation/operation/extended.json b/test/definitions/3.0.0/models/operation/operation/extended.json deleted file mode 100644 index 0aa1e607..00000000 --- a/test/definitions/3.0.0/models/operation/operation/extended.json +++ /dev/null @@ -1,489 +0,0 @@ -{ - "action": "send", - "channel": "#/components/channels/channel", - "title": "Send message operation", - "summary": "Send message", - "description": "Send message to remote server", - "security": [ - { - "type": "apiKey", - "description": "apiKey", - "in": "user" - }, - { - "$ref": "#/components/security/plain" - } - ], - "tags": [ - { - "name": "messages", - "description": "operations with messages", - "externalDocs": { - "description": "Messages validation rules", - "url": "messages/validation-rules" - } - }, - { - "$ref": "#/components/tags/tag" - } - ], - "externalDocs": { - "description": "Messages validation rules", - "url": "messages/validation-rules" - }, - "bindings": { - "amqp": { - "expiration": 100000, - "userId": "guest", - "cc": [ - "user.logs" - ], - "priority": 10, - "deliveryMode": 2, - "mandatory": false, - "bcc": [ - "external.audit" - ], - "replyTo": "user.signedup", - "timestamp": true, - "ack": false, - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/operationBindings/amqp1" - }, - "anypointmq": { - "$ref": "#/components/operationBindings/anypointmq" - }, - "googlepubsub": { - "$ref": "#/components/operationBindings/googlepubsub" - }, - "http": { - "method": "GET", - "query": { - "type": "object", - "required": [ - "companyId" - ], - "properties": { - "companyId": { - "type": "number", - "minimum": 1, - "description": "The Id of the company." - } - }, - "additionalProperties": false - }, - "bindingVersion": "0.3.0" - }, - "ibmmq": { - "$ref": "#/components/operationBindings/ibmmq" - }, - "jms": { - "$ref": "#/components/operationBindings/jms" - }, - "kafka": { - "groupId": { - "type": "string", - "enum": [ - "myGroupId" - ] - }, - "clientId": { - "type": "string", - "enum": [ - "myClientId" - ] - }, - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/operationBindings/mercure" - }, - "mqtt": { - "qos": 2, - "retain": true, - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/operationBindings/mqtt5" - }, - "nats": { - "queue": "messages", - "bindingVersion": "0.1.0" - }, - "pulsar": { - "$ref": "#/components/operationBindings/pulsar" - }, - "redis": { - "$ref": "#/components/operationBindings/redis" - }, - "sns": { - "$ref": "#/components/operationBindings/sns" - }, - "solace": { - "dmqEligible" : false, - "bindingVersion" : "0.4.0", - "destinations" : [ { - "destinationType" : "queue", - "deliveryMode" : "persistent", - "queue" : { - "name" : "sampleQueue", - "topicSubscriptions" : [ "samples/*" ], - "accessType" : "nonexclusive" - } - }, { - "destinationType" : "topic", - "deliveryMode" : "persistent", - "topicSubscriptions" : [ "samples/*" ] - } ] - }, - "sqs": { - "$ref": "#/components/operationBindings/sqs" - }, - "stomp": { - "$ref": "#/components/operationBindings/stomp" - }, - "ws": { - "$ref": "#/components/operationBindings/ws" - } - }, - "traits": [ - { - "title": "Send message operation", - "summary": "Send message", - "description": "Send message to remote server", - "security": [ - { - "type": "apiKey", - "description": "apiKey", - "in": "user" - }, - { - "$ref": "#/components/security/plain" - } - ], - "tags": [ - { - "name": "messages", - "description": "operations with messages", - "externalDocs": { - "description": "Messages validation rules", - "url": "messages/validation-rules" - } - }, - { - "$ref": "#/components/tags/tag" - } - ], - "externalDocs": { - "description": "Messages validation rules", - "url": "messages/validation-rules" - }, - "bindings": { - "amqp": { - "expiration": 100000, - "userId": "guest", - "cc": [ - "user.logs" - ], - "priority": 10, - "deliveryMode": 2, - "mandatory": false, - "bcc": [ - "external.audit" - ], - "replyTo": "user.signedup", - "timestamp": true, - "ack": false, - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/operationBindings/amqp1" - }, - "anypointmq": { - "$ref": "#/components/operationBindings/anypointmq" - }, - "googlepubsub": { - "$ref": "#/components/operationBindings/googlepubsub" - }, - "http": { - "method": "GET", - "query": { - "type": "object", - "required": [ - "companyId" - ], - "properties": { - "companyId": { - "type": "number", - "minimum": 1, - "description": "The Id of the company." - } - }, - "additionalProperties": false - }, - "bindingVersion": "0.3.0" - }, - "ibmmq": { - "$ref": "#/components/operationBindings/ibmmq" - }, - "jms": { - "$ref": "#/components/operationBindings/jms" - }, - "kafka": { - "groupId": { - "type": "string", - "enum": [ - "myGroupId" - ] - }, - "clientId": { - "type": "string", - "enum": [ - "myClientId" - ] - }, - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/operationBindings/mercure" - }, - "mqtt": { - "qos": 2, - "retain": true, - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/operationBindings/mqtt5" - }, - "nats": { - "queue": "messages", - "bindingVersion": "0.1.0" - }, - "pulsar": { - "$ref": "#/components/operationBindings/pulsar" - }, - "redis": { - "$ref": "#/components/operationBindings/redis" - }, - "sns": { - "$ref": "#/components/operationBindings/sns" - }, - "solace": { - "dmqEligible" : false, - "bindingVersion" : "0.4.0", - "destinations" : [ { - "destinationType" : "queue", - "deliveryMode" : "persistent", - "queue" : { - "name" : "sampleQueue", - "topicSubscriptions" : [ "samples/*" ], - "accessType" : "nonexclusive" - } - }, { - "destinationType" : "topic", - "deliveryMode" : "persistent", - "topicSubscriptions" : [ "samples/*" ] - } ] - }, - "sqs": { - "$ref": "#/components/operationBindings/sqs" - }, - "stomp": { - "$ref": "#/components/operationBindings/stomp" - }, - "ws": { - "$ref": "#/components/operationBindings/ws" - } - } - }, - { - "title": "Send message operation", - "summary": "Send message", - "description": "Send message to remote server", - "security": [ - { - "type": "apiKey", - "description": "apiKey", - "in": "user" - }, - { - "$ref": "#/components/security/plain" - } - ], - "tags": [ - { - "name": "messages", - "description": "operations with messages", - "externalDocs": { - "description": "Messages validation rules", - "url": "messages/validation-rules" - } - }, - { - "$ref": "#/components/tags/tag" - } - ], - "externalDocs": { - "$ref": "#/components/externalDocs/external-doc" - }, - "bindings": { - "amqp": { - "expiration": 100000, - "userId": "guest", - "cc": [ - "user.logs" - ], - "priority": 10, - "deliveryMode": 2, - "mandatory": false, - "bcc": [ - "external.audit" - ], - "replyTo": "user.signedup", - "timestamp": true, - "ack": false, - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/operationBindings/amqp1" - }, - "anypointmq": { - "$ref": "#/components/operationBindings/anypointmq" - }, - "googlepubsub": { - "$ref": "#/components/operationBindings/googlepubsub" - }, - "http": { - "method": "GET", - "query": { - "type": "object", - "required": [ - "companyId" - ], - "properties": { - "companyId": { - "type": "number", - "minimum": 1, - "description": "The Id of the company." - } - }, - "additionalProperties": false - }, - "bindingVersion": "0.3.0" - }, - "ibmmq": { - "$ref": "#/components/operationBindings/ibmmq" - }, - "jms": { - "$ref": "#/components/operationBindings/jms" - }, - "kafka": { - "groupId": { - "type": "string", - "enum": [ - "myGroupId" - ] - }, - "clientId": { - "type": "string", - "enum": [ - "myClientId" - ] - }, - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/operationBindings/mercure" - }, - "mqtt": { - "qos": 2, - "retain": true, - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/operationBindings/mqtt5" - }, - "nats": { - "queue": "messages", - "bindingVersion": "0.1.0" - }, - "pulsar": { - "$ref": "#/components/operationBindings/pulsar" - }, - "redis": { - "$ref": "#/components/operationBindings/redis" - }, - "sns": { - "$ref": "#/components/operationBindings/sns" - }, - "solace": { - "dmqEligible" : false, - "bindingVersion" : "0.4.0", - "destinations" : [ { - "destinationType" : "queue", - "deliveryMode" : "persistent", - "queue" : { - "name" : "sampleQueue", - "topicSubscriptions" : [ "samples/*" ], - "accessType" : "nonexclusive" - } - }, { - "destinationType" : "topic", - "deliveryMode" : "persistent", - "topicSubscriptions" : [ "samples/*" ] - } ] - }, - "sqs": { - "$ref": "#/components/operationBindings/sqs" - }, - "stomp": { - "$ref": "#/components/operationBindings/stomp" - }, - "ws": { - "$ref": "#/components/operationBindings/ws" - } - } - }, - { - "$ref": "#/components/operations/trait" - } - ], - "messages": [ - { - "$ref": "#/components/messages/message 1" - }, - { - "$ref": "#/components/messages/message 2" - }, - { - "$ref": "#/components/messages/message 3" - } - ], - "reply": { - "address": { - "description": "Consumer inbox", - "location": "$message.header#/replyTo" - }, - "channel": { - "$ref": "#/components/channels/channel" - }, - "messages": [ - { - "$ref": "#/components/messages/message 1" - }, - { - "$ref": "#/components/messages/message 2" - }, - { - "$ref": "#/components/messages/message 3" - } - ] - }, - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} diff --git a/test/definitions/3.0.0/models/operation/operation/index.mjs b/test/definitions/3.0.0/models/operation/operation/index.mjs deleted file mode 100644 index 5aa6d04f..00000000 --- a/test/definitions/3.0.0/models/operation/operation/index.mjs +++ /dev/null @@ -1,37 +0,0 @@ -import {describe, it} from 'vitest'; -import TestHelper from '@test/test-helper'; -import path from 'path'; - -const jsonSchema = require('@definitions/3.0.0/operation.json'); - -describe.skip('Operation. Reason: errors with bindings, external docs, ...', () => { - it('example', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './example.json'), - )); - - it('empty', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './empty.json'), - )); - - it('without required properties', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './without required properties.json'), - )); - - it('only required properties', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './only required properties.json'), - )); - - it.skip('extended. Reason: schema doesn\'t check for extensions', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './extended.json'), - )); - - it.skip('wrongly extended. Reason: schema doesn\'t check for extensions', () => TestHelper.wronglyExtended( - jsonSchema, - path.resolve(__dirname, './wrongly extended.json') - )); -}); diff --git a/test/definitions/3.0.0/models/operation/operation/only required properties.json b/test/definitions/3.0.0/models/operation/operation/only required properties.json deleted file mode 100644 index 0a1a8de5..00000000 --- a/test/definitions/3.0.0/models/operation/operation/only required properties.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "action": "send", - "channel": "#/components/channels/channel" -} diff --git a/test/definitions/3.0.0/models/operation/operation/without required properties.json b/test/definitions/3.0.0/models/operation/operation/without required properties.json deleted file mode 100644 index 526b22d2..00000000 --- a/test/definitions/3.0.0/models/operation/operation/without required properties.json +++ /dev/null @@ -1,482 +0,0 @@ -{ - "title": "Send message operation", - "summary": "Send message", - "description": "Send message to remote server", - "security": [ - { - "type": "apiKey", - "description": "apiKey", - "in": "user" - }, - { - "$ref": "#/components/security/plain" - } - ], - "tags": [ - { - "name": "messages", - "description": "operations with messages", - "externalDocs": { - "description": "Messages validation rules", - "url": "messages/validation-rules" - } - }, - { - "$ref": "#/components/tags/tag" - } - ], - "externalDocs": { - "description": "Messages validation rules", - "url": "messages/validation-rules" - }, - "bindings": { - "amqp": { - "expiration": 100000, - "userId": "guest", - "cc": [ - "user.logs" - ], - "priority": 10, - "deliveryMode": 2, - "mandatory": false, - "bcc": [ - "external.audit" - ], - "replyTo": "user.signedup", - "timestamp": true, - "ack": false, - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/operationBindings/amqp1" - }, - "anypointmq": { - "$ref": "#/components/operationBindings/anypointmq" - }, - "googlepubsub": { - "$ref": "#/components/operationBindings/googlepubsub" - }, - "http": { - "method": "GET", - "query": { - "type": "object", - "required": [ - "companyId" - ], - "properties": { - "companyId": { - "type": "number", - "minimum": 1, - "description": "The Id of the company." - } - }, - "additionalProperties": false - }, - "bindingVersion": "0.3.0" - }, - "ibmmq": { - "$ref": "#/components/operationBindings/ibmmq" - }, - "jms": { - "$ref": "#/components/operationBindings/jms" - }, - "kafka": { - "groupId": { - "type": "string", - "enum": [ - "myGroupId" - ] - }, - "clientId": { - "type": "string", - "enum": [ - "myClientId" - ] - }, - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/operationBindings/mercure" - }, - "mqtt": { - "qos": 2, - "retain": true, - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/operationBindings/mqtt5" - }, - "nats": { - "queue": "messages", - "bindingVersion": "0.1.0" - }, - "pulsar": { - "$ref": "#/components/operationBindings/pulsar" - }, - "redis": { - "$ref": "#/components/operationBindings/redis" - }, - "sns": { - "$ref": "#/components/operationBindings/sns" - }, - "solace": { - "dmqEligible" : false, - "bindingVersion" : "0.4.0", - "destinations" : [ { - "destinationType" : "queue", - "deliveryMode" : "persistent", - "queue" : { - "name" : "sampleQueue", - "topicSubscriptions" : [ "samples/*" ], - "accessType" : "nonexclusive" - } - }, { - "destinationType" : "topic", - "deliveryMode" : "persistent", - "topicSubscriptions" : [ "samples/*" ] - } ] - }, - "sqs": { - "$ref": "#/components/operationBindings/sqs" - }, - "stomp": { - "$ref": "#/components/operationBindings/stomp" - }, - "ws": { - "$ref": "#/components/operationBindings/ws" - } - }, - "traits": [ - { - "title": "Send message operation", - "summary": "Send message", - "description": "Send message to remote server", - "security": [ - { - "type": "apiKey", - "description": "apiKey", - "in": "user" - }, - { - "$ref": "#/components/security/plain" - } - ], - "tags": [ - { - "name": "messages", - "description": "operations with messages", - "externalDocs": { - "description": "Messages validation rules", - "url": "messages/validation-rules" - } - }, - { - "$ref": "#/components/tags/tag" - } - ], - "externalDocs": { - "description": "Messages validation rules", - "url": "messages/validation-rules" - }, - "bindings": { - "amqp": { - "expiration": 100000, - "userId": "guest", - "cc": [ - "user.logs" - ], - "priority": 10, - "deliveryMode": 2, - "mandatory": false, - "bcc": [ - "external.audit" - ], - "replyTo": "user.signedup", - "timestamp": true, - "ack": false, - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/operationBindings/amqp1" - }, - "anypointmq": { - "$ref": "#/components/operationBindings/anypointmq" - }, - "googlepubsub": { - "$ref": "#/components/operationBindings/googlepubsub" - }, - "http": { - "method": "GET", - "query": { - "type": "object", - "required": [ - "companyId" - ], - "properties": { - "companyId": { - "type": "number", - "minimum": 1, - "description": "The Id of the company." - } - }, - "additionalProperties": false - }, - "bindingVersion": "0.3.0" - }, - "ibmmq": { - "$ref": "#/components/operationBindings/ibmmq" - }, - "jms": { - "$ref": "#/components/operationBindings/jms" - }, - "kafka": { - "groupId": { - "type": "string", - "enum": [ - "myGroupId" - ] - }, - "clientId": { - "type": "string", - "enum": [ - "myClientId" - ] - }, - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/operationBindings/mercure" - }, - "mqtt": { - "qos": 2, - "retain": true, - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/operationBindings/mqtt5" - }, - "nats": { - "queue": "messages", - "bindingVersion": "0.1.0" - }, - "pulsar": { - "$ref": "#/components/operationBindings/pulsar" - }, - "redis": { - "$ref": "#/components/operationBindings/redis" - }, - "sns": { - "$ref": "#/components/operationBindings/sns" - }, - "solace": { - "dmqEligible" : false, - "bindingVersion" : "0.4.0", - "destinations" : [ { - "destinationType" : "queue", - "deliveryMode" : "persistent", - "queue" : { - "name" : "sampleQueue", - "topicSubscriptions" : [ "samples/*" ], - "accessType" : "nonexclusive" - } - }, { - "destinationType" : "topic", - "deliveryMode" : "persistent", - "topicSubscriptions" : [ "samples/*" ] - } ] - }, - "sqs": { - "$ref": "#/components/operationBindings/sqs" - }, - "stomp": { - "$ref": "#/components/operationBindings/stomp" - }, - "ws": { - "$ref": "#/components/operationBindings/ws" - } - } - }, - { - "title": "Send message operation", - "summary": "Send message", - "description": "Send message to remote server", - "security": [ - { - "type": "apiKey", - "description": "apiKey", - "in": "user" - }, - { - "$ref": "#/components/security/plain" - } - ], - "tags": [ - { - "name": "messages", - "description": "operations with messages", - "externalDocs": { - "description": "Messages validation rules", - "url": "messages/validation-rules" - } - }, - { - "$ref": "#/components/tags/tag" - } - ], - "externalDocs": { - "$ref": "#/components/externalDocs/external-doc" - }, - "bindings": { - "amqp": { - "expiration": 100000, - "userId": "guest", - "cc": [ - "user.logs" - ], - "priority": 10, - "deliveryMode": 2, - "mandatory": false, - "bcc": [ - "external.audit" - ], - "replyTo": "user.signedup", - "timestamp": true, - "ack": false, - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/operationBindings/amqp1" - }, - "anypointmq": { - "$ref": "#/components/operationBindings/anypointmq" - }, - "googlepubsub": { - "$ref": "#/components/operationBindings/googlepubsub" - }, - "http": { - "method": "GET", - "query": { - "type": "object", - "required": [ - "companyId" - ], - "properties": { - "companyId": { - "type": "number", - "minimum": 1, - "description": "The Id of the company." - } - }, - "additionalProperties": false - }, - "bindingVersion": "0.3.0" - }, - "ibmmq": { - "$ref": "#/components/operationBindings/ibmmq" - }, - "jms": { - "$ref": "#/components/operationBindings/jms" - }, - "kafka": { - "groupId": { - "type": "string", - "enum": [ - "myGroupId" - ] - }, - "clientId": { - "type": "string", - "enum": [ - "myClientId" - ] - }, - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/operationBindings/mercure" - }, - "mqtt": { - "qos": 2, - "retain": true, - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/operationBindings/mqtt5" - }, - "nats": { - "queue": "messages", - "bindingVersion": "0.1.0" - }, - "pulsar": { - "$ref": "#/components/operationBindings/pulsar" - }, - "redis": { - "$ref": "#/components/operationBindings/redis" - }, - "sns": { - "$ref": "#/components/operationBindings/sns" - }, - "solace": { - "dmqEligible" : false, - "bindingVersion" : "0.4.0", - "destinations" : [ { - "destinationType" : "queue", - "deliveryMode" : "persistent", - "queue" : { - "name" : "sampleQueue", - "topicSubscriptions" : [ "samples/*" ], - "accessType" : "nonexclusive" - } - }, { - "destinationType" : "topic", - "deliveryMode" : "persistent", - "topicSubscriptions" : [ "samples/*" ] - } ] - }, - "sqs": { - "$ref": "#/components/operationBindings/sqs" - }, - "stomp": { - "$ref": "#/components/operationBindings/stomp" - }, - "ws": { - "$ref": "#/components/operationBindings/ws" - } - } - }, - { - "$ref": "#/components/operations/trait" - } - ], - "messages": [ - { - "$ref": "#/components/messages/message 1" - }, - { - "$ref": "#/components/messages/message 2" - }, - { - "$ref": "#/components/messages/message 3" - } - ], - "reply": { - "address": { - "description": "Consumer inbox", - "location": "$message.header#/replyTo" - }, - "channel": { - "$ref": "#/components/channels/channel" - }, - "messages": [ - { - "$ref": "#/components/messages/message 1" - }, - { - "$ref": "#/components/messages/message 2" - }, - { - "$ref": "#/components/messages/message 3" - } - ] - } -} diff --git a/test/definitions/3.0.0/models/operation/operation/wrongly extended.json b/test/definitions/3.0.0/models/operation/operation/wrongly extended.json deleted file mode 100644 index 78fe51e5..00000000 --- a/test/definitions/3.0.0/models/operation/operation/wrongly extended.json +++ /dev/null @@ -1,490 +0,0 @@ -{ - "action": "send", - "channel": "#/components/channels/channel", - "title": "Send message operation", - "summary": "Send message", - "description": "Send message to remote server", - "security": [ - { - "type": "apiKey", - "description": "apiKey", - "in": "user" - }, - { - "$ref": "#/components/security/plain" - } - ], - "tags": [ - { - "name": "messages", - "description": "operations with messages", - "externalDocs": { - "description": "Messages validation rules", - "url": "messages/validation-rules" - } - }, - { - "$ref": "#/components/tags/tag" - } - ], - "externalDocs": { - "description": "Messages validation rules", - "url": "messages/validation-rules" - }, - "bindings": { - "amqp": { - "expiration": 100000, - "userId": "guest", - "cc": [ - "user.logs" - ], - "priority": 10, - "deliveryMode": 2, - "mandatory": false, - "bcc": [ - "external.audit" - ], - "replyTo": "user.signedup", - "timestamp": true, - "ack": false, - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/operationBindings/amqp1" - }, - "anypointmq": { - "$ref": "#/components/operationBindings/anypointmq" - }, - "googlepubsub": { - "$ref": "#/components/operationBindings/googlepubsub" - }, - "http": { - "method": "GET", - "query": { - "type": "object", - "required": [ - "companyId" - ], - "properties": { - "companyId": { - "type": "number", - "minimum": 1, - "description": "The Id of the company." - } - }, - "additionalProperties": false - }, - "bindingVersion": "0.3.0" - }, - "ibmmq": { - "$ref": "#/components/operationBindings/ibmmq" - }, - "jms": { - "$ref": "#/components/operationBindings/jms" - }, - "kafka": { - "groupId": { - "type": "string", - "enum": [ - "myGroupId" - ] - }, - "clientId": { - "type": "string", - "enum": [ - "myClientId" - ] - }, - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/operationBindings/mercure" - }, - "mqtt": { - "qos": 2, - "retain": true, - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/operationBindings/mqtt5" - }, - "nats": { - "queue": "messages", - "bindingVersion": "0.1.0" - }, - "pulsar": { - "$ref": "#/components/operationBindings/pulsar" - }, - "redis": { - "$ref": "#/components/operationBindings/redis" - }, - "sns": { - "$ref": "#/components/operationBindings/sns" - }, - "solace": { - "dmqEligible" : false, - "bindingVersion" : "0.4.0", - "destinations" : [ { - "destinationType" : "queue", - "deliveryMode" : "persistent", - "queue" : { - "name" : "sampleQueue", - "topicSubscriptions" : [ "samples/*" ], - "accessType" : "nonexclusive" - } - }, { - "destinationType" : "topic", - "deliveryMode" : "persistent", - "topicSubscriptions" : [ "samples/*" ] - } ] - }, - "sqs": { - "$ref": "#/components/operationBindings/sqs" - }, - "stomp": { - "$ref": "#/components/operationBindings/stomp" - }, - "ws": { - "$ref": "#/components/operationBindings/ws" - } - }, - "traits": [ - { - "title": "Send message operation", - "summary": "Send message", - "description": "Send message to remote server", - "security": [ - { - "type": "apiKey", - "description": "apiKey", - "in": "user" - }, - { - "$ref": "#/components/security/plain" - } - ], - "tags": [ - { - "name": "messages", - "description": "operations with messages", - "externalDocs": { - "description": "Messages validation rules", - "url": "messages/validation-rules" - } - }, - { - "$ref": "#/components/tags/tag" - } - ], - "externalDocs": { - "description": "Messages validation rules", - "url": "messages/validation-rules" - }, - "bindings": { - "amqp": { - "expiration": 100000, - "userId": "guest", - "cc": [ - "user.logs" - ], - "priority": 10, - "deliveryMode": 2, - "mandatory": false, - "bcc": [ - "external.audit" - ], - "replyTo": "user.signedup", - "timestamp": true, - "ack": false, - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/operationBindings/amqp1" - }, - "anypointmq": { - "$ref": "#/components/operationBindings/anypointmq" - }, - "googlepubsub": { - "$ref": "#/components/operationBindings/googlepubsub" - }, - "http": { - "method": "GET", - "query": { - "type": "object", - "required": [ - "companyId" - ], - "properties": { - "companyId": { - "type": "number", - "minimum": 1, - "description": "The Id of the company." - } - }, - "additionalProperties": false - }, - "bindingVersion": "0.3.0" - }, - "ibmmq": { - "$ref": "#/components/operationBindings/ibmmq" - }, - "jms": { - "$ref": "#/components/operationBindings/jms" - }, - "kafka": { - "groupId": { - "type": "string", - "enum": [ - "myGroupId" - ] - }, - "clientId": { - "type": "string", - "enum": [ - "myClientId" - ] - }, - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/operationBindings/mercure" - }, - "mqtt": { - "qos": 2, - "retain": true, - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/operationBindings/mqtt5" - }, - "nats": { - "queue": "messages", - "bindingVersion": "0.1.0" - }, - "pulsar": { - "$ref": "#/components/operationBindings/pulsar" - }, - "redis": { - "$ref": "#/components/operationBindings/redis" - }, - "sns": { - "$ref": "#/components/operationBindings/sns" - }, - "solace": { - "dmqEligible" : false, - "bindingVersion" : "0.4.0", - "destinations" : [ { - "destinationType" : "queue", - "deliveryMode" : "persistent", - "queue" : { - "name" : "sampleQueue", - "topicSubscriptions" : [ "samples/*" ], - "accessType" : "nonexclusive" - } - }, { - "destinationType" : "topic", - "deliveryMode" : "persistent", - "topicSubscriptions" : [ "samples/*" ] - } ] - }, - "sqs": { - "$ref": "#/components/operationBindings/sqs" - }, - "stomp": { - "$ref": "#/components/operationBindings/stomp" - }, - "ws": { - "$ref": "#/components/operationBindings/ws" - } - } - }, - { - "title": "Send message operation", - "summary": "Send message", - "description": "Send message to remote server", - "security": [ - { - "type": "apiKey", - "description": "apiKey", - "in": "user" - }, - { - "$ref": "#/components/security/plain" - } - ], - "tags": [ - { - "name": "messages", - "description": "operations with messages", - "externalDocs": { - "description": "Messages validation rules", - "url": "messages/validation-rules" - } - }, - { - "$ref": "#/components/tags/tag" - } - ], - "externalDocs": { - "$ref": "#/components/externalDocs/external-doc" - }, - "bindings": { - "amqp": { - "expiration": 100000, - "userId": "guest", - "cc": [ - "user.logs" - ], - "priority": 10, - "deliveryMode": 2, - "mandatory": false, - "bcc": [ - "external.audit" - ], - "replyTo": "user.signedup", - "timestamp": true, - "ack": false, - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/operationBindings/amqp1" - }, - "anypointmq": { - "$ref": "#/components/operationBindings/anypointmq" - }, - "googlepubsub": { - "$ref": "#/components/operationBindings/googlepubsub" - }, - "http": { - "method": "GET", - "query": { - "type": "object", - "required": [ - "companyId" - ], - "properties": { - "companyId": { - "type": "number", - "minimum": 1, - "description": "The Id of the company." - } - }, - "additionalProperties": false - }, - "bindingVersion": "0.3.0" - }, - "ibmmq": { - "$ref": "#/components/operationBindings/ibmmq" - }, - "jms": { - "$ref": "#/components/operationBindings/jms" - }, - "kafka": { - "groupId": { - "type": "string", - "enum": [ - "myGroupId" - ] - }, - "clientId": { - "type": "string", - "enum": [ - "myClientId" - ] - }, - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/operationBindings/mercure" - }, - "mqtt": { - "qos": 2, - "retain": true, - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/operationBindings/mqtt5" - }, - "nats": { - "queue": "messages", - "bindingVersion": "0.1.0" - }, - "pulsar": { - "$ref": "#/components/operationBindings/pulsar" - }, - "redis": { - "$ref": "#/components/operationBindings/redis" - }, - "sns": { - "$ref": "#/components/operationBindings/sns" - }, - "solace": { - "dmqEligible" : false, - "bindingVersion" : "0.4.0", - "destinations" : [ { - "destinationType" : "queue", - "deliveryMode" : "persistent", - "queue" : { - "name" : "sampleQueue", - "topicSubscriptions" : [ "samples/*" ], - "accessType" : "nonexclusive" - } - }, { - "destinationType" : "topic", - "deliveryMode" : "persistent", - "topicSubscriptions" : [ "samples/*" ] - } ] - }, - "sqs": { - "$ref": "#/components/operationBindings/sqs" - }, - "stomp": { - "$ref": "#/components/operationBindings/stomp" - }, - "ws": { - "$ref": "#/components/operationBindings/ws" - } - } - }, - { - "$ref": "#/components/operations/trait" - } - ], - "messages": [ - { - "$ref": "#/components/messages/message 1" - }, - { - "$ref": "#/components/messages/message 2" - }, - { - "$ref": "#/components/messages/message 3" - } - ], - "reply": { - "address": { - "description": "Consumer inbox", - "location": "$message.header#/replyTo" - }, - "channel": { - "$ref": "#/components/channels/channel" - }, - "messages": [ - { - "$ref": "#/components/messages/message 1" - }, - { - "$ref": "#/components/messages/message 2" - }, - { - "$ref": "#/components/messages/message 3" - } - ] - }, - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} diff --git a/test/definitions/3.0.0/models/operation/operationReply/empty.json b/test/definitions/3.0.0/models/operation/operationReply/empty.json deleted file mode 100644 index 0967ef42..00000000 --- a/test/definitions/3.0.0/models/operation/operationReply/empty.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/test/definitions/3.0.0/models/operation/operationReply/example.json b/test/definitions/3.0.0/models/operation/operationReply/example.json deleted file mode 100644 index acff7a45..00000000 --- a/test/definitions/3.0.0/models/operation/operationReply/example.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "address": { - "description": "Consumer inbox", - "location": "$message.header#/replyTo" - }, - "channel": { - "$ref": "#/components/channels/channel" - }, - "messages": [ - { - "$ref": "#/components/messages/message 1" - }, - { - "$ref": "#/components/messages/message 2" - }, - { - "$ref": "#/components/messages/message 3" - } - ] -} diff --git a/test/definitions/3.0.0/models/operation/operationReply/extended.json b/test/definitions/3.0.0/models/operation/operationReply/extended.json deleted file mode 100644 index 6bd4022c..00000000 --- a/test/definitions/3.0.0/models/operation/operationReply/extended.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "address": { - "description": "Consumer inbox", - "location": "$message.header#/replyTo" - }, - "channel": { - "$ref": "#/components/channels/channel" - }, - "messages": [ - { - "$ref": "#/components/messages/message 1" - }, - { - "$ref": "#/components/messages/message 2" - }, - { - "$ref": "#/components/messages/message 3" - } - ], - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} diff --git a/test/definitions/3.0.0/models/operation/operationReply/index.mjs b/test/definitions/3.0.0/models/operation/operationReply/index.mjs deleted file mode 100644 index f0c03ca9..00000000 --- a/test/definitions/3.0.0/models/operation/operationReply/index.mjs +++ /dev/null @@ -1,37 +0,0 @@ -import {describe, it} from 'vitest'; -import TestHelper from '@test/test-helper'; -import path from 'path'; - -const jsonSchema = require('@definitions/3.0.0/operationReply.json'); - -describe.skip('Operation Reply. uri-reference not compatible with #/components/...', () => { - it('example', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './example.json'), - )); - - it('empty', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './empty.json'), - )); - - it('without required properties', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './without required properties.json'), - )); - - it('only required properties', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './only required properties.json'), - )); - - it('extended. Reason: schema doesn\'t check for extensions', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './extended.json'), - )); - - it('wrongly extended. Reason: schema doesn\'t check for extensions', () => TestHelper.wronglyExtended( - jsonSchema, - path.resolve(__dirname, './wrongly extended.json'), - )); -}); diff --git a/test/definitions/3.0.0/models/operation/operationReply/only required properties.json b/test/definitions/3.0.0/models/operation/operationReply/only required properties.json deleted file mode 100644 index 0967ef42..00000000 --- a/test/definitions/3.0.0/models/operation/operationReply/only required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/test/definitions/3.0.0/models/operation/operationReply/without required properties.json b/test/definitions/3.0.0/models/operation/operationReply/without required properties.json deleted file mode 100644 index 0967ef42..00000000 --- a/test/definitions/3.0.0/models/operation/operationReply/without required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/test/definitions/3.0.0/models/operation/operationReply/wrongly extended.json b/test/definitions/3.0.0/models/operation/operationReply/wrongly extended.json deleted file mode 100644 index d37537b5..00000000 --- a/test/definitions/3.0.0/models/operation/operationReply/wrongly extended.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "address": { - "description": "Consumer inbox", - "location": "$message.header#/replyTo" - }, - "channel": { - "$ref": "#/components/channels/channel" - }, - "messages": [ - { - "$ref": "#/components/messages/message 1" - }, - { - "$ref": "#/components/messages/message 2" - }, - { - "$ref": "#/components/messages/message 3" - } - ], - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} diff --git a/test/definitions/3.0.0/models/operation/operationReplyAddress/empty.json b/test/definitions/3.0.0/models/operation/operationReplyAddress/empty.json deleted file mode 100644 index 0967ef42..00000000 --- a/test/definitions/3.0.0/models/operation/operationReplyAddress/empty.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/test/definitions/3.0.0/models/operation/operationReplyAddress/example.json b/test/definitions/3.0.0/models/operation/operationReplyAddress/example.json deleted file mode 100644 index 46e6cec6..00000000 --- a/test/definitions/3.0.0/models/operation/operationReplyAddress/example.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "description" : "Consumer inbox", - "location" : "$message.header#/replyTo" -} diff --git a/test/definitions/3.0.0/models/operation/operationReplyAddress/extended.json b/test/definitions/3.0.0/models/operation/operationReplyAddress/extended.json deleted file mode 100644 index 415a08e5..00000000 --- a/test/definitions/3.0.0/models/operation/operationReplyAddress/extended.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "description" : "Consumer inbox", - "location" : "$message.header#/replyTo", - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} diff --git a/test/definitions/3.0.0/models/operation/operationReplyAddress/index.mjs b/test/definitions/3.0.0/models/operation/operationReplyAddress/index.mjs deleted file mode 100644 index dc0ecfc5..00000000 --- a/test/definitions/3.0.0/models/operation/operationReplyAddress/index.mjs +++ /dev/null @@ -1,39 +0,0 @@ -import {describe, it} from 'vitest'; -import TestHelper from '@test/test-helper'; -import path from 'path'; - -const jsonSchema = require('@definitions/3.0.0/operationReplyAddress.json'); - -describe('Operation Reply Address', () => { - it('example', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './example.json'), - )); - - it('empty', () => TestHelper.objectIsNotValid( - jsonSchema, - path.resolve(__dirname, './empty.json'), - ['must have required property \'location\''] - )); - - it('without required properties', () => TestHelper.objectIsNotValid( - jsonSchema, - path.resolve(__dirname, './without required properties.json'), - ['must have required property \'location\''] - )); - - it('only required properties', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './only required properties.json'), - )); - - it('extended', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './extended.json'), - )); - - it('wrongly extended', () => TestHelper.wronglyExtended( - jsonSchema, - path.resolve(__dirname, './wrongly extended.json'), - )); -}); diff --git a/test/definitions/3.0.0/models/operation/operationReplyAddress/only required properties.json b/test/definitions/3.0.0/models/operation/operationReplyAddress/only required properties.json deleted file mode 100644 index 0e6c7ba1..00000000 --- a/test/definitions/3.0.0/models/operation/operationReplyAddress/only required properties.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "location" : "$message.header#/replyTo" -} diff --git a/test/definitions/3.0.0/models/operation/operationReplyAddress/without required properties.json b/test/definitions/3.0.0/models/operation/operationReplyAddress/without required properties.json deleted file mode 100644 index b043cd0b..00000000 --- a/test/definitions/3.0.0/models/operation/operationReplyAddress/without required properties.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description" : "Consumer inbox" -} diff --git a/test/definitions/3.0.0/models/operation/operationReplyAddress/wrongly extended.json b/test/definitions/3.0.0/models/operation/operationReplyAddress/wrongly extended.json deleted file mode 100644 index d9379a06..00000000 --- a/test/definitions/3.0.0/models/operation/operationReplyAddress/wrongly extended.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "description" : "Consumer inbox", - "location" : "$message.header#/replyTo", - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} diff --git a/test/definitions/3.0.0/models/operation/operationTrait/empty.json b/test/definitions/3.0.0/models/operation/operationTrait/empty.json deleted file mode 100644 index 0967ef42..00000000 --- a/test/definitions/3.0.0/models/operation/operationTrait/empty.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/test/definitions/3.0.0/models/operation/operationTrait/example.json b/test/definitions/3.0.0/models/operation/operationTrait/example.json deleted file mode 100644 index e2ddf7fd..00000000 --- a/test/definitions/3.0.0/models/operation/operationTrait/example.json +++ /dev/null @@ -1,149 +0,0 @@ -{ - "title": "Send message operation", - "summary": "Send message", - "description": "Send message to remote server", - "security": [ - { - "type": "apiKey", - "description": "apiKey", - "in": "user" - }, - { - "$ref": "#/components/security/plain" - } - ], - "tags": [ - { - "name": "messages", - "description": "operations with messages", - "externalDocs": { - "description": "Messages validation rules", - "url": "messages/validation-rules" - } - }, - { - "$ref": "#/components/tags/tag" - } - ], - "externalDocs": { - "description": "Messages validation rules", - "url": "messages/validation-rules" - }, - "bindings": { - "amqp": { - "expiration": 100000, - "userId": "guest", - "cc": [ - "user.logs" - ], - "priority": 10, - "deliveryMode": 2, - "mandatory": false, - "bcc": [ - "external.audit" - ], - "replyTo": "user.signedup", - "timestamp": true, - "ack": false, - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/operationBindings/amqp1" - }, - "anypointmq": { - "$ref": "#/components/operationBindings/anypointmq" - }, - "googlepubsub": { - "$ref": "#/components/operationBindings/googlepubsub" - }, - "http": { - "method": "GET", - "query": { - "type": "object", - "required": [ - "companyId" - ], - "properties": { - "companyId": { - "type": "number", - "minimum": 1, - "description": "The Id of the company." - } - }, - "additionalProperties": false - }, - "bindingVersion": "0.3.0" - }, - "ibmmq": { - "$ref": "#/components/operationBindings/ibmmq" - }, - "jms": { - "$ref": "#/components/operationBindings/jms" - }, - "kafka": { - "groupId": { - "type": "string", - "enum": [ - "myGroupId" - ] - }, - "clientId": { - "type": "string", - "enum": [ - "myClientId" - ] - }, - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/operationBindings/mercure" - }, - "mqtt": { - "qos": 2, - "retain": true, - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/operationBindings/mqtt5" - }, - "nats": { - "queue": "messages", - "bindingVersion": "0.1.0" - }, - "pulsar": { - "$ref": "#/components/operationBindings/pulsar" - }, - "redis": { - "$ref": "#/components/operationBindings/redis" - }, - "sns": { - "$ref": "#/components/operationBindings/sns" - }, - "solace": { - "dmqEligible" : false, - "bindingVersion" : "0.4.0", - "destinations" : [ { - "destinationType" : "queue", - "deliveryMode" : "persistent", - "queue" : { - "name" : "sampleQueue", - "topicSubscriptions" : [ "samples/*" ], - "accessType" : "nonexclusive" - } - }, { - "destinationType" : "topic", - "deliveryMode" : "persistent", - "topicSubscriptions" : [ "samples/*" ] - } ] - }, - "sqs": { - "$ref": "#/components/operationBindings/sqs" - }, - "stomp": { - "$ref": "#/components/operationBindings/stomp" - }, - "ws": { - "$ref": "#/components/operationBindings/ws" - } - } -} diff --git a/test/definitions/3.0.0/models/operation/operationTrait/extended.json b/test/definitions/3.0.0/models/operation/operationTrait/extended.json deleted file mode 100644 index a985d991..00000000 --- a/test/definitions/3.0.0/models/operation/operationTrait/extended.json +++ /dev/null @@ -1,154 +0,0 @@ -{ - "title": "Send message operation", - "summary": "Send message", - "description": "Send message to remote server", - "security": [ - { - "type" : "apiKey", - "description" : "apiKey", - "in" : "user" - }, - { - "$ref": "#/components/security/plain" - } - ], - "tags": [ - { - "name": "messages", - "description": "operations with messages", - "externalDocs": { - "description": "Messages validation rules", - "url": "messages/validation-rules" - } - }, - { - "$ref": "#/components/tags/tag" - } - ], - "externalDocs": { - "description": "Messages validation rules", - "url": "messages/validation-rules" - }, - "bindings": { - "amqp": { - "expiration": 100000, - "userId": "guest", - "cc": [ - "user.logs" - ], - "priority": 10, - "deliveryMode": 2, - "mandatory": false, - "bcc": [ - "external.audit" - ], - "replyTo": "user.signedup", - "timestamp": true, - "ack": false, - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/operationBindings/amqp1" - }, - "anypointmq": { - "$ref": "#/components/operationBindings/anypointmq" - }, - "googlepubsub": { - "$ref": "#/components/operationBindings/googlepubsub" - }, - "http": { - "method": "GET", - "query": { - "type": "object", - "required": [ - "companyId" - ], - "properties": { - "companyId": { - "type": "number", - "minimum": 1, - "description": "The Id of the company." - } - }, - "additionalProperties": false - }, - "bindingVersion": "0.3.0" - }, - "ibmmq": { - "$ref": "#/components/operationBindings/ibmmq" - }, - "jms": { - "$ref": "#/components/operationBindings/jms" - }, - "kafka": { - "groupId": { - "type": "string", - "enum": [ - "myGroupId" - ] - }, - "clientId": { - "type": "string", - "enum": [ - "myClientId" - ] - }, - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/operationBindings/mercure" - }, - "mqtt": { - "qos": 2, - "retain": true, - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/operationBindings/mqtt5" - }, - "nats": { - "queue": "messages", - "bindingVersion": "0.1.0" - }, - "pulsar": { - "$ref": "#/components/operationBindings/pulsar" - }, - "redis": { - "$ref": "#/components/operationBindings/redis" - }, - "sns": { - "$ref": "#/components/operationBindings/sns" - }, - "solace": { - "dmqEligible" : false, - "bindingVersion" : "0.4.0", - "destinations" : [ { - "destinationType" : "queue", - "deliveryMode" : "persistent", - "queue" : { - "name" : "sampleQueue", - "topicSubscriptions" : [ "samples/*" ], - "accessType" : "nonexclusive" - } - }, { - "destinationType" : "topic", - "deliveryMode" : "persistent", - "topicSubscriptions" : [ "samples/*" ] - } ] - }, - "sqs": { - "$ref": "#/components/operationBindings/sqs" - }, - "stomp": { - "$ref": "#/components/operationBindings/stomp" - }, - "ws": { - "$ref": "#/components/operationBindings/ws" - } - }, - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} diff --git a/test/definitions/3.0.0/models/operation/operationTrait/index.mjs b/test/definitions/3.0.0/models/operation/operationTrait/index.mjs deleted file mode 100644 index 5779d2e7..00000000 --- a/test/definitions/3.0.0/models/operation/operationTrait/index.mjs +++ /dev/null @@ -1,37 +0,0 @@ -import {describe, it} from 'vitest'; -import TestHelper from '@test/test-helper'; -import path from 'path'; - -const jsonSchema = require('@definitions/3.0.0/operationTrait.json'); - -describe.skip('Operation Trait Reason: errors with bindings, external docs, ...', () => { - it('example', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './example.json'), - )); - - it('empty', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './empty.json'), - )); - - it('without required properties', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './without required properties.json'), - )); - - it('only required properties', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './only required properties.json'), - )); - - it.skip('extended. Reason: schema doesn\'t check for extensions', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './extended.json'), - )); - - it.skip('wrongly extended. Reason: schema doesn\'t check for extensions', () => TestHelper.wronglyExtended( - jsonSchema, - path.resolve(__dirname, './wrongly extended.json') - )); -}); diff --git a/test/definitions/3.0.0/models/operation/operationTrait/only required properties.json b/test/definitions/3.0.0/models/operation/operationTrait/only required properties.json deleted file mode 100644 index 0967ef42..00000000 --- a/test/definitions/3.0.0/models/operation/operationTrait/only required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/test/definitions/3.0.0/models/operation/operationTrait/without required properties.json b/test/definitions/3.0.0/models/operation/operationTrait/without required properties.json deleted file mode 100644 index e2ddf7fd..00000000 --- a/test/definitions/3.0.0/models/operation/operationTrait/without required properties.json +++ /dev/null @@ -1,149 +0,0 @@ -{ - "title": "Send message operation", - "summary": "Send message", - "description": "Send message to remote server", - "security": [ - { - "type": "apiKey", - "description": "apiKey", - "in": "user" - }, - { - "$ref": "#/components/security/plain" - } - ], - "tags": [ - { - "name": "messages", - "description": "operations with messages", - "externalDocs": { - "description": "Messages validation rules", - "url": "messages/validation-rules" - } - }, - { - "$ref": "#/components/tags/tag" - } - ], - "externalDocs": { - "description": "Messages validation rules", - "url": "messages/validation-rules" - }, - "bindings": { - "amqp": { - "expiration": 100000, - "userId": "guest", - "cc": [ - "user.logs" - ], - "priority": 10, - "deliveryMode": 2, - "mandatory": false, - "bcc": [ - "external.audit" - ], - "replyTo": "user.signedup", - "timestamp": true, - "ack": false, - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/operationBindings/amqp1" - }, - "anypointmq": { - "$ref": "#/components/operationBindings/anypointmq" - }, - "googlepubsub": { - "$ref": "#/components/operationBindings/googlepubsub" - }, - "http": { - "method": "GET", - "query": { - "type": "object", - "required": [ - "companyId" - ], - "properties": { - "companyId": { - "type": "number", - "minimum": 1, - "description": "The Id of the company." - } - }, - "additionalProperties": false - }, - "bindingVersion": "0.3.0" - }, - "ibmmq": { - "$ref": "#/components/operationBindings/ibmmq" - }, - "jms": { - "$ref": "#/components/operationBindings/jms" - }, - "kafka": { - "groupId": { - "type": "string", - "enum": [ - "myGroupId" - ] - }, - "clientId": { - "type": "string", - "enum": [ - "myClientId" - ] - }, - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/operationBindings/mercure" - }, - "mqtt": { - "qos": 2, - "retain": true, - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/operationBindings/mqtt5" - }, - "nats": { - "queue": "messages", - "bindingVersion": "0.1.0" - }, - "pulsar": { - "$ref": "#/components/operationBindings/pulsar" - }, - "redis": { - "$ref": "#/components/operationBindings/redis" - }, - "sns": { - "$ref": "#/components/operationBindings/sns" - }, - "solace": { - "dmqEligible" : false, - "bindingVersion" : "0.4.0", - "destinations" : [ { - "destinationType" : "queue", - "deliveryMode" : "persistent", - "queue" : { - "name" : "sampleQueue", - "topicSubscriptions" : [ "samples/*" ], - "accessType" : "nonexclusive" - } - }, { - "destinationType" : "topic", - "deliveryMode" : "persistent", - "topicSubscriptions" : [ "samples/*" ] - } ] - }, - "sqs": { - "$ref": "#/components/operationBindings/sqs" - }, - "stomp": { - "$ref": "#/components/operationBindings/stomp" - }, - "ws": { - "$ref": "#/components/operationBindings/ws" - } - } -} diff --git a/test/definitions/3.0.0/models/operation/operationTrait/wrongly extended.json b/test/definitions/3.0.0/models/operation/operationTrait/wrongly extended.json deleted file mode 100644 index 30b0ac06..00000000 --- a/test/definitions/3.0.0/models/operation/operationTrait/wrongly extended.json +++ /dev/null @@ -1,155 +0,0 @@ -{ - "title": "Send message operation", - "summary": "Send message", - "description": "Send message to remote server", - "security": [ - { - "type" : "apiKey", - "description" : "apiKey", - "in" : "user" - }, - { - "$ref": "#/components/security/plain" - } - ], - "tags": [ - { - "name": "messages", - "description": "operations with messages", - "externalDocs": { - "description": "Messages validation rules", - "url": "messages/validation-rules" - } - }, - { - "$ref": "#/components/tags/tag" - } - ], - "externalDocs": { - "description": "Messages validation rules", - "url": "messages/validation-rules" - }, - "bindings": { - "amqp": { - "expiration": 100000, - "userId": "guest", - "cc": [ - "user.logs" - ], - "priority": 10, - "deliveryMode": 2, - "mandatory": false, - "bcc": [ - "external.audit" - ], - "replyTo": "user.signedup", - "timestamp": true, - "ack": false, - "bindingVersion": "0.2.0" - }, - "amqp1": { - "$ref": "#/components/operationBindings/amqp1" - }, - "anypointmq": { - "$ref": "#/components/operationBindings/anypointmq" - }, - "googlepubsub": { - "$ref": "#/components/operationBindings/googlepubsub" - }, - "http": { - "method": "GET", - "query": { - "type": "object", - "required": [ - "companyId" - ], - "properties": { - "companyId": { - "type": "number", - "minimum": 1, - "description": "The Id of the company." - } - }, - "additionalProperties": false - }, - "bindingVersion": "0.3.0" - }, - "ibmmq": { - "$ref": "#/components/operationBindings/ibmmq" - }, - "jms": { - "$ref": "#/components/operationBindings/jms" - }, - "kafka": { - "groupId": { - "type": "string", - "enum": [ - "myGroupId" - ] - }, - "clientId": { - "type": "string", - "enum": [ - "myClientId" - ] - }, - "bindingVersion": "0.5.0" - }, - "mercure": { - "$ref": "#/components/operationBindings/mercure" - }, - "mqtt": { - "qos": 2, - "retain": true, - "bindingVersion": "0.1.0" - }, - "mqtt5": { - "$ref": "#/components/operationBindings/mqtt5" - }, - "nats": { - "queue": "messages", - "bindingVersion": "0.1.0" - }, - "pulsar": { - "$ref": "#/components/operationBindings/pulsar" - }, - "redis": { - "$ref": "#/components/operationBindings/redis" - }, - "sns": { - "$ref": "#/components/operationBindings/sns" - }, - "solace": { - "dmqEligible" : false, - "bindingVersion" : "0.4.0", - "destinations" : [ { - "destinationType" : "queue", - "deliveryMode" : "persistent", - "queue" : { - "name" : "sampleQueue", - "topicSubscriptions" : [ "samples/*" ], - "accessType" : "nonexclusive" - } - }, { - "destinationType" : "topic", - "deliveryMode" : "persistent", - "topicSubscriptions" : [ "samples/*" ] - } ] - }, - "sqs": { - "$ref": "#/components/operationBindings/sqs" - }, - "stomp": { - "$ref": "#/components/operationBindings/stomp" - }, - "ws": { - "$ref": "#/components/operationBindings/ws" - } - }, - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} diff --git a/test/definitions/3.0.0/models/reference/index.mjs b/test/definitions/3.0.0/models/reference/index.mjs deleted file mode 100644 index ec55a2e8..00000000 --- a/test/definitions/3.0.0/models/reference/index.mjs +++ /dev/null @@ -1,6 +0,0 @@ -import {describe} from 'vitest'; - -describe('Reference Test Suite', async () => { - await import('./reference'); - await import('./reference object'); -}); \ No newline at end of file diff --git a/test/definitions/3.0.0/models/reference/reference object/index.mjs b/test/definitions/3.0.0/models/reference/reference object.test.mjs similarity index 60% rename from test/definitions/3.0.0/models/reference/reference object/index.mjs rename to test/definitions/3.0.0/models/reference/reference object.test.mjs index 58894933..f672a9f5 100644 --- a/test/definitions/3.0.0/models/reference/reference object/index.mjs +++ b/test/definitions/3.0.0/models/reference/reference object.test.mjs @@ -1,52 +1,77 @@ -import path from 'path'; -import TestHelper from '@test/test-helper'; +import TestHelper from '@test/test-helper.mjs'; const jsonSchema = require('@definitions/3.0.0/Reference.json'); describe('Reference Object', () => { it('$ref may be empty', () => TestHelper.objectIsValid( jsonSchema, - path.resolve(__dirname, './empty.json'), + { + "$ref": "" + }, )); it('$ref cannot be number', () => TestHelper.objectIsNotValid( jsonSchema, - path.resolve(__dirname, './number.json'), + { + "$ref": 1234 + }, ['must be string'] )); it('$ref cannot be object', () => TestHelper.objectIsNotValid( jsonSchema, - path.resolve(__dirname, './object.json'), + { + "$ref": { + "$ref": "#/components/schemas/user" + } + }, ['must be string'] )); it('$ref cannot be plain string', () => TestHelper.objectIsNotValid( jsonSchema, - path.resolve(__dirname, './string.json'), + { + "$ref": "string value" + }, ['must match format "uri-reference"'] )); it('$ref cannot be boolean', () => TestHelper.objectIsNotValid( jsonSchema, - path.resolve(__dirname, './boolean.json'), + { + "$ref": true + }, ['must be string'] )); it('$ref cannot be null', () => TestHelper.objectIsNotValid( jsonSchema, - path.resolve(__dirname, './null.json'), + { + "$ref": null + }, ['must be string'] )); it('$ref cannot be array', () => TestHelper.objectIsNotValid( jsonSchema, - path.resolve(__dirname, './array.json'), + { + "$ref": [ + 1, + null, + false, + "#/components/schemas/user", + { + "$ref": "#/components/schemas/user" + } + ] + }, ['must be string'] )); - it('$ref is URI', () => TestHelper.objectIsValid( + it('$ref MUST be URI', () => TestHelper.objectIsValid( jsonSchema, - path.resolve(__dirname, './uri.json'), + { + "$ref": "#/components/schemas/user" + }, )); }); diff --git a/test/definitions/3.0.0/models/reference/reference object/array.json b/test/definitions/3.0.0/models/reference/reference object/array.json deleted file mode 100644 index 04cdc564..00000000 --- a/test/definitions/3.0.0/models/reference/reference object/array.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "$ref": [ - 1, - null, - false, - "#/components/schemas/user", - { - "$ref": "#/components/schemas/user" - } - ] -} diff --git a/test/definitions/3.0.0/models/reference/reference object/boolean.json b/test/definitions/3.0.0/models/reference/reference object/boolean.json deleted file mode 100644 index a40732d9..00000000 --- a/test/definitions/3.0.0/models/reference/reference object/boolean.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "$ref": true -} diff --git a/test/definitions/3.0.0/models/reference/reference object/empty.json b/test/definitions/3.0.0/models/reference/reference object/empty.json deleted file mode 100644 index 61db4a8f..00000000 --- a/test/definitions/3.0.0/models/reference/reference object/empty.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "$ref": "" -} diff --git a/test/definitions/3.0.0/models/reference/reference object/null.json b/test/definitions/3.0.0/models/reference/reference object/null.json deleted file mode 100644 index 61dc3cea..00000000 --- a/test/definitions/3.0.0/models/reference/reference object/null.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "$ref": null -} diff --git a/test/definitions/3.0.0/models/reference/reference object/number.json b/test/definitions/3.0.0/models/reference/reference object/number.json deleted file mode 100644 index 2d652a0a..00000000 --- a/test/definitions/3.0.0/models/reference/reference object/number.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "$ref": 1234 -} diff --git a/test/definitions/3.0.0/models/reference/reference object/object.json b/test/definitions/3.0.0/models/reference/reference object/object.json deleted file mode 100644 index 44ae5b68..00000000 --- a/test/definitions/3.0.0/models/reference/reference object/object.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "$ref": { - "$ref": "#/components/schemas/user" - } -} diff --git a/test/definitions/3.0.0/models/reference/reference object/string.json b/test/definitions/3.0.0/models/reference/reference object/string.json deleted file mode 100644 index f7115df0..00000000 --- a/test/definitions/3.0.0/models/reference/reference object/string.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "$ref": "string value" -} diff --git a/test/definitions/3.0.0/models/reference/reference object/uri.json b/test/definitions/3.0.0/models/reference/reference object/uri.json deleted file mode 100644 index fd5bb0d1..00000000 --- a/test/definitions/3.0.0/models/reference/reference object/uri.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "$ref": "#/components/schemas/user" -} diff --git a/test/definitions/3.0.0/models/reference/reference.test.mjs b/test/definitions/3.0.0/models/reference/reference.test.mjs new file mode 100644 index 00000000..7869308f --- /dev/null +++ b/test/definitions/3.0.0/models/reference/reference.test.mjs @@ -0,0 +1,49 @@ +import { + JsonSchemaTestSuite, + JsonSchemaTestSuiteConfig, + JsonSchemaTestSuiteData +} from '@test/definitions/base-schema-test.mjs'; +import {describe} from 'vitest'; + +const jsonSchema = require('@definitions/3.0.0/Reference.json'); + +const config = new JsonSchemaTestSuiteConfig( + true, + ['must have required property \'$ref\''], + true, + [] +); + +const data = new JsonSchemaTestSuiteData( + jsonSchema, + [ + { + "$ref": "#/components/schemas/user" + } + ], + { + "$ref": "#/components/schemas/user" + }, + {}, + { + "$ref": "#/components/schemas/user", + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "$ref": "#/components/schemas/user", + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } +); + +describe('Reference', () => { + new JsonSchemaTestSuite(data, config).testSuite() +}); diff --git a/test/definitions/3.0.0/models/reference/reference/empty.json b/test/definitions/3.0.0/models/reference/reference/empty.json deleted file mode 100644 index 0967ef42..00000000 --- a/test/definitions/3.0.0/models/reference/reference/empty.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/test/definitions/3.0.0/models/reference/reference/example.json b/test/definitions/3.0.0/models/reference/reference/example.json deleted file mode 100644 index fd5bb0d1..00000000 --- a/test/definitions/3.0.0/models/reference/reference/example.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "$ref": "#/components/schemas/user" -} diff --git a/test/definitions/3.0.0/models/reference/reference/extended.json b/test/definitions/3.0.0/models/reference/reference/extended.json deleted file mode 100644 index 337eb3ec..00000000 --- a/test/definitions/3.0.0/models/reference/reference/extended.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "$ref": "#/components/schemas/user", - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} diff --git a/test/definitions/3.0.0/models/reference/reference/index.mjs b/test/definitions/3.0.0/models/reference/reference/index.mjs deleted file mode 100644 index a07cef17..00000000 --- a/test/definitions/3.0.0/models/reference/reference/index.mjs +++ /dev/null @@ -1,49 +0,0 @@ -import path from 'path'; -import TestHelper from '@test/test-helper'; - -const jsonSchema = require('@definitions/3.0.0/Reference.json'); - -describe('Reference', () => { - it('example is valid', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './example.json'), - )); - - it('can\'t be empty', () => TestHelper.objectIsNotValid( - jsonSchema, - path.resolve(__dirname, './empty.json'), - ['must have required property \'$ref\''] - )); - - it('is not valid without required properties', () => TestHelper.objectIsNotValid( - jsonSchema, - path.resolve(__dirname, './without required properties.json'), - ['must have required property \'$ref\''] - )); - - it('is valid with only required properties', () => () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './only required properties.json.json'), - )); - - it.skip('cannot be extended with valid extension names. add "additionalProperties": false', () => TestHelper.cantBeExtended( - jsonSchema, - path.resolve(__dirname, './extended.json'), - [ - 'x-number', - 'x-string', - 'x-object' - ] - )); - - it.skip('cannot be extended without valid extension names. add "additionalProperties": false', () => TestHelper.cantBeExtended( - jsonSchema, - path.resolve(__dirname, './wrongly extended.json'), - [ - 'x-number', - 'x-string', - 'x-object', - 'ext-number' - ] - )); -}); diff --git a/test/definitions/3.0.0/models/reference/reference/only required properties.json b/test/definitions/3.0.0/models/reference/reference/only required properties.json deleted file mode 100644 index fd5bb0d1..00000000 --- a/test/definitions/3.0.0/models/reference/reference/only required properties.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "$ref": "#/components/schemas/user" -} diff --git a/test/definitions/3.0.0/models/reference/reference/without required properties.json b/test/definitions/3.0.0/models/reference/reference/without required properties.json deleted file mode 100644 index 0967ef42..00000000 --- a/test/definitions/3.0.0/models/reference/reference/without required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/test/definitions/3.0.0/models/reference/reference/wrongly extended.json b/test/definitions/3.0.0/models/reference/reference/wrongly extended.json deleted file mode 100644 index 7981bdcc..00000000 --- a/test/definitions/3.0.0/models/reference/reference/wrongly extended.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "$ref": "#/components/schemas/user", - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} diff --git a/test/definitions/3.0.0/models/server/index.mjs b/test/definitions/3.0.0/models/server/index.mjs deleted file mode 100644 index 845c2a6c..00000000 --- a/test/definitions/3.0.0/models/server/index.mjs +++ /dev/null @@ -1,6 +0,0 @@ -import {describe} from 'vitest'; - -describe('Server Test Suite', async () => { - await import('./server'); - await import('./serverVariable'); -}); diff --git a/test/definitions/3.0.0/models/server/server variable.test.mjs b/test/definitions/3.0.0/models/server/server variable.test.mjs new file mode 100644 index 00000000..2fcbde63 --- /dev/null +++ b/test/definitions/3.0.0/models/server/server variable.test.mjs @@ -0,0 +1,75 @@ +import {describe} from 'vitest'; +import { + JsonSchemaTestSuite, + JsonSchemaTestSuiteConfig, + JsonSchemaTestSuiteData +} from '@test/definitions/base-schema-test.mjs'; + +const jsonSchema = require('@definitions/3.0.0/serverVariable.json'); + +const config = new JsonSchemaTestSuiteConfig( + false, + [], + true, + [] +); + +const data = new JsonSchemaTestSuiteData( + jsonSchema, + [ + { + "enum": [ + "8883", + "8884" + ], + "default": "8883", + "description": "To which port connect", + "examples": [ + "8883", + "8884" + ] + } + ], + {}, + { + "enum": [ + "8883", + "8884" + ], + "default": "8883", + "description": "To which port connect", + "examples": [ + "8883", + "8884" + ] + }, + { + "enum": [ + "8883", + "8884" + ], + "default": "8883", + "description": "To which port connect", + "examples": [ + "8883", + "8884" + ], + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } +); + +describe('Server Variable', () => { + new JsonSchemaTestSuite(data, config).testSuite() +}); \ No newline at end of file diff --git a/test/definitions/3.0.0/models/server/server.test.mjs b/test/definitions/3.0.0/models/server/server.test.mjs new file mode 100644 index 00000000..c064e0ac --- /dev/null +++ b/test/definitions/3.0.0/models/server/server.test.mjs @@ -0,0 +1,61 @@ +import {describe} from 'vitest'; +import { + JsonSchemaTestSuite, + JsonSchemaTestSuiteConfig, + JsonSchemaTestSuiteData +} from '@test/definitions/base-schema-test.mjs'; + +const jsonSchema = require('@definitions/3.0.0/server.json'); + +const config = new JsonSchemaTestSuiteConfig( + true, + [ + 'must have required property \'host\'', + 'must have required property \'protocol\'' + ], + true, + [] +); + +const data = new JsonSchemaTestSuiteData( + jsonSchema, + [ + { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/production", + "protocol": "amqp", + "description": "Production RabbitMQ broker (uses the `production` vhost)." + } + ], + { + "host": "rabbitmq.in.mycompany.com:5672", + "protocol": "amqp", + }, + { + "pathname": "/production", + "description": "Production RabbitMQ broker (uses the `production` vhost)." + }, + { + "host": "rabbitmq.in.mycompany.com:5672", + "protocol": "amqp", + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "host": "rabbitmq.in.mycompany.com:5672", + "protocol": "amqp", + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } +); + +describe('Server', () => { + new JsonSchemaTestSuite(data, config).testSuite() +}); \ No newline at end of file diff --git a/test/definitions/3.0.0/models/server/server/empty.json b/test/definitions/3.0.0/models/server/server/empty.json deleted file mode 100644 index 0967ef42..00000000 --- a/test/definitions/3.0.0/models/server/server/empty.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/test/definitions/3.0.0/models/server/server/example.json b/test/definitions/3.0.0/models/server/server/example.json deleted file mode 100644 index a12232e7..00000000 --- a/test/definitions/3.0.0/models/server/server/example.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "host" : "{username}.gigantic-server.com:{port}/{basePath}", - "protocol" : "secure-mqtt", - "protocolVersion" : "5", - "pathname" : "/messages", - "description" : "The production API server", - "title" : "secure-mqtt API server", - "summary" : "API server", - "variables" : { - "username" : { - "description" : "This value is assigned by the service provider, in this example `gigantic-server.com`", - "examples" : null, - "enum" : null, - "default" : "demo" - }, - "port" : { - "description" : null, - "examples" : null, - "enum" : [ "8883", "8884" ], - "default" : "8883" - }, - "basePath" : { - "$ref" : "#/components/serverVariables/basePath" - } - }, - "security" : [ { - "type" : "apiKey", - "description" : "apiKey", - "in" : "user" - }, { - "type" : "http", - "description" : "http", - "scheme" : "bearer", - "bearerFormat" : "JWT" - } ], - "tags" : [ { - "name" : "env:staging", - "description" : "This environment is a replica of the production environment", - "externalDocs" : null - } ], - "externalDocs" : { - "description" : "Find more info here", - "url" : "https://example.com" - }, - "bindings" : { - "amqp" : { - "$ref" : "#/components/serverBindings/amqp" - }, - "amqp1" : { }, - "anypointmq" : { }, - "googlepubsub" : { }, - "http" : { }, - "ibmmq" : { - "groupId" : "PRODCLSTR1", - "ccdtQueueManagerName" : "*", - "cipherSpec" : "ANY_TLS12_OR_HIGHER", - "multiEndpointServer" : false, - "heartBeatInterval" : 300, - "bindingVersion" : "0.1.0" - }, - "jms" : { }, - "kafka" : { - "schemaRegistryUrl" : "https://my-schema-registry.com", - "schemaRegistryVendor" : "confluent", - "bindingVersion" : "0.5.0" - }, - "mercure" : { }, - "mqtt" : { - "clientId" : "guest", - "cleanSession" : true, - "lastWill" : { - "topic" : "/last-wills", - "qos" : 2, - "message" : "Guest gone offline.", - "retain" : false - }, - "keepAlive" : 60, - "bindingVersion" : "0.1.0" - }, - "mqtt5" : { - "sessionExpiryInterval" : 60, - "bindingVersion" : "0.2.0" - }, - "nats" : { }, - "pulsar" : { - "tenant" : "contoso", - "bindingVersion" : "0.1.0" - }, - "redis" : { }, - "sns" : { }, - "solace" : { - "clientName": "transactions-broker", - "msgVpn": "ProdVPN", - "bindingVersion": "0.4.0" - }, - "sqs" : { }, - "stomp" : { }, - "ws" : { } - } -} diff --git a/test/definitions/3.0.0/models/server/server/index.mjs b/test/definitions/3.0.0/models/server/server/index.mjs deleted file mode 100644 index 86acf8c6..00000000 --- a/test/definitions/3.0.0/models/server/server/index.mjs +++ /dev/null @@ -1,45 +0,0 @@ -import {describe, it} from 'vitest'; -import TestHelper from '@test/test-helper'; -import path from 'path'; - -const jsonSchema = require('@definitions/3.0.0/server.json'); - -describe(`Server`, () => { - it.skip('example is valid. Reason: errors with bindings, external docs, ...', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './example.json'), - )); - - it('cannot be empty', () => TestHelper.objectIsNotValid( - jsonSchema, - path.resolve(__dirname, './empty.json'), - [ - 'must have required property \'host\'', - 'must have required property \'protocol\'' - ] - )); - - it.skip('is not valid without required properties. Reason: errors with bindings, external docs, ...', () => TestHelper.objectIsNotValid( - jsonSchema, - path.resolve(__dirname, './without required properties.json'), - [ - 'must have required property \'host\'', - 'must have required property \'protocol\'' - ] - )); - - it('is valid with only required properties', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './only required properties.json'), - )); - - it.skip('extended. Reason: schema doesn\'t check for extensions', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, '../../../extended.json') - )); - - it.skip('wrongly extended. Reason: schema doesn\'t check for extensions', () => TestHelper.wronglyExtended( - jsonSchema, - path.resolve(__dirname, '../../../../wrongly extended.json') - )); -}); diff --git a/test/definitions/3.0.0/models/server/server/only required properties.json b/test/definitions/3.0.0/models/server/server/only required properties.json deleted file mode 100644 index 91e9a02f..00000000 --- a/test/definitions/3.0.0/models/server/server/only required properties.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "host": "dev.env.lo", - "protocol": "mqtt" -} diff --git a/test/definitions/3.0.0/models/server/server/without required properties.json b/test/definitions/3.0.0/models/server/server/without required properties.json deleted file mode 100644 index a12232e7..00000000 --- a/test/definitions/3.0.0/models/server/server/without required properties.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "host" : "{username}.gigantic-server.com:{port}/{basePath}", - "protocol" : "secure-mqtt", - "protocolVersion" : "5", - "pathname" : "/messages", - "description" : "The production API server", - "title" : "secure-mqtt API server", - "summary" : "API server", - "variables" : { - "username" : { - "description" : "This value is assigned by the service provider, in this example `gigantic-server.com`", - "examples" : null, - "enum" : null, - "default" : "demo" - }, - "port" : { - "description" : null, - "examples" : null, - "enum" : [ "8883", "8884" ], - "default" : "8883" - }, - "basePath" : { - "$ref" : "#/components/serverVariables/basePath" - } - }, - "security" : [ { - "type" : "apiKey", - "description" : "apiKey", - "in" : "user" - }, { - "type" : "http", - "description" : "http", - "scheme" : "bearer", - "bearerFormat" : "JWT" - } ], - "tags" : [ { - "name" : "env:staging", - "description" : "This environment is a replica of the production environment", - "externalDocs" : null - } ], - "externalDocs" : { - "description" : "Find more info here", - "url" : "https://example.com" - }, - "bindings" : { - "amqp" : { - "$ref" : "#/components/serverBindings/amqp" - }, - "amqp1" : { }, - "anypointmq" : { }, - "googlepubsub" : { }, - "http" : { }, - "ibmmq" : { - "groupId" : "PRODCLSTR1", - "ccdtQueueManagerName" : "*", - "cipherSpec" : "ANY_TLS12_OR_HIGHER", - "multiEndpointServer" : false, - "heartBeatInterval" : 300, - "bindingVersion" : "0.1.0" - }, - "jms" : { }, - "kafka" : { - "schemaRegistryUrl" : "https://my-schema-registry.com", - "schemaRegistryVendor" : "confluent", - "bindingVersion" : "0.5.0" - }, - "mercure" : { }, - "mqtt" : { - "clientId" : "guest", - "cleanSession" : true, - "lastWill" : { - "topic" : "/last-wills", - "qos" : 2, - "message" : "Guest gone offline.", - "retain" : false - }, - "keepAlive" : 60, - "bindingVersion" : "0.1.0" - }, - "mqtt5" : { - "sessionExpiryInterval" : 60, - "bindingVersion" : "0.2.0" - }, - "nats" : { }, - "pulsar" : { - "tenant" : "contoso", - "bindingVersion" : "0.1.0" - }, - "redis" : { }, - "sns" : { }, - "solace" : { - "clientName": "transactions-broker", - "msgVpn": "ProdVPN", - "bindingVersion": "0.4.0" - }, - "sqs" : { }, - "stomp" : { }, - "ws" : { } - } -} diff --git a/test/definitions/3.0.0/models/server/serverVariable/empty.json b/test/definitions/3.0.0/models/server/serverVariable/empty.json deleted file mode 100644 index 0967ef42..00000000 --- a/test/definitions/3.0.0/models/server/serverVariable/empty.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/test/definitions/3.0.0/models/server/serverVariable/example.json b/test/definitions/3.0.0/models/server/serverVariable/example.json deleted file mode 100644 index f4dfc461..00000000 --- a/test/definitions/3.0.0/models/server/serverVariable/example.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "enum": [ - "8883", - "8884" - ], - "default": "8883", - "description": "To which port connect", - "examples": [ - "8883", - "8884" - ] -} diff --git a/test/definitions/3.0.0/models/server/serverVariable/extended.json b/test/definitions/3.0.0/models/server/serverVariable/extended.json deleted file mode 100644 index 95e1f7e2..00000000 --- a/test/definitions/3.0.0/models/server/serverVariable/extended.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "enum": [ - "8883", - "8884" - ], - "default": "8883", - "description": "To which port connect", - "examples": [ - "8883", - "8884" - ], - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} diff --git a/test/definitions/3.0.0/models/server/serverVariable/index.mjs b/test/definitions/3.0.0/models/server/serverVariable/index.mjs deleted file mode 100644 index 75a7dd95..00000000 --- a/test/definitions/3.0.0/models/server/serverVariable/index.mjs +++ /dev/null @@ -1,37 +0,0 @@ -import {describe, it} from 'vitest'; -import TestHelper from '@test/test-helper'; -import path from 'path'; - -const jsonSchema = require('@definitions/3.0.0/serverVariable.json'); - -describe('Server Variable', () => { - it('example is valid', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './example.json'), - )); - - it('can be empty', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './empty.json'), - )); - - it('is valid without required properties', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './without required properties.json'), - )); - - it('is valid with only required properties', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './only required properties.json'), - )); - - it('is valid when is extended', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, '../../../../extended.json') - )); - - it('is not valid when is wrongly extended', () => TestHelper.wronglyExtended( - jsonSchema, - path.resolve(__dirname, '../../../../wrongly extended.json') - )); -}); diff --git a/test/definitions/3.0.0/models/server/serverVariable/only required properties.json b/test/definitions/3.0.0/models/server/serverVariable/only required properties.json deleted file mode 100644 index 0967ef42..00000000 --- a/test/definitions/3.0.0/models/server/serverVariable/only required properties.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/test/definitions/3.0.0/models/server/serverVariable/without required properties.json b/test/definitions/3.0.0/models/server/serverVariable/without required properties.json deleted file mode 100644 index f4dfc461..00000000 --- a/test/definitions/3.0.0/models/server/serverVariable/without required properties.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "enum": [ - "8883", - "8884" - ], - "default": "8883", - "description": "To which port connect", - "examples": [ - "8883", - "8884" - ] -} diff --git a/test/definitions/3.0.0/models/tag/empty.json b/test/definitions/3.0.0/models/tag/empty.json deleted file mode 100644 index 0967ef42..00000000 --- a/test/definitions/3.0.0/models/tag/empty.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/test/definitions/3.0.0/models/tag/example.json b/test/definitions/3.0.0/models/tag/example.json deleted file mode 100644 index aa06e030..00000000 --- a/test/definitions/3.0.0/models/tag/example.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "user", - "description": "User-related messages", - "externalDocs": { - "description" : "Find more info here", - "url" : "https://example.com" - } -} diff --git a/test/definitions/3.0.0/models/tag/extended.json b/test/definitions/3.0.0/models/tag/extended.json deleted file mode 100644 index 52ba185f..00000000 --- a/test/definitions/3.0.0/models/tag/extended.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "user", - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - } -} diff --git a/test/definitions/3.0.0/models/tag/index.mjs b/test/definitions/3.0.0/models/tag/index.mjs deleted file mode 100644 index 44cc8026..00000000 --- a/test/definitions/3.0.0/models/tag/index.mjs +++ /dev/null @@ -1,39 +0,0 @@ -import {describe, it} from 'vitest'; -import TestHelper from '@test/test-helper'; -import path from 'path'; - -const jsonSchema = require('@definitions/3.0.0/tag.json'); - -describe('Tag', () => { - it('example is valid', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './example.json'), - )); - - it('cannot be empty', () => TestHelper.objectIsNotValid( - jsonSchema, - path.resolve(__dirname, './empty.json'), - ['must have required property \'name\''] - )); - - it('is not valid without required properties', () => TestHelper.objectIsNotValid( - jsonSchema, - path.resolve(__dirname, './without required properties.json'), - ['must have required property \'name\''] - )); - - it('is valid with only required properties', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './only required properties.json') - )); - - it('is valid when is extended', () => TestHelper.objectIsValid( - jsonSchema, - path.resolve(__dirname, './extended.json') - )); - - it('is not valid when is wrongly extended', () => TestHelper.wronglyExtended( - jsonSchema, - path.resolve(__dirname, './wrongly extended.json') - )); -}); diff --git a/test/definitions/3.0.0/models/tag/only required properties.json b/test/definitions/3.0.0/models/tag/only required properties.json deleted file mode 100644 index 20347ed0..00000000 --- a/test/definitions/3.0.0/models/tag/only required properties.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name": "user" -} diff --git a/test/definitions/3.0.0/models/tag/tag.test.mjs b/test/definitions/3.0.0/models/tag/tag.test.mjs new file mode 100644 index 00000000..b4ba0fd5 --- /dev/null +++ b/test/definitions/3.0.0/models/tag/tag.test.mjs @@ -0,0 +1,60 @@ +import {describe} from 'vitest'; +import { + JsonSchemaTestSuite, + JsonSchemaTestSuiteConfig, + JsonSchemaTestSuiteData +} from '@test/definitions/base-schema-test.mjs'; + +const jsonSchema = require('@definitions/3.0.0/tag.json'); + +const config = new JsonSchemaTestSuiteConfig( + true, + ['must have required property \'name\''], + true, + [] +); + +const data = new JsonSchemaTestSuiteData( + jsonSchema, + [ + { + "name": "user", + "description": "User-related messages", + "externalDocs": { + "description" : "Find more info here", + "url" : "https://example.com" + } + } + ], + { + "name": "user" + }, + { + "description": "User-related messages", + "externalDocs": { + "description" : "Find more info here", + "url" : "https://example.com" + } + }, + { + "name": "user", + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + } + }, + { + "name": "user", + "x-number": 0, + "x-string": "", + "x-object": { + "property": {} + }, + "ext-number": 1 + } +); + +describe('Tag', () => { + new JsonSchemaTestSuite(data, config).testSuite() +}); \ No newline at end of file diff --git a/test/definitions/3.0.0/models/tag/without required properties.json b/test/definitions/3.0.0/models/tag/without required properties.json deleted file mode 100644 index f3f99eda..00000000 --- a/test/definitions/3.0.0/models/tag/without required properties.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "description": "User-related messages", - "externalDocs": { - "description" : "Find more info here", - "url" : "https://example.com" - } -} diff --git a/test/definitions/3.0.0/models/tag/wrongly extended.json b/test/definitions/3.0.0/models/tag/wrongly extended.json deleted file mode 100644 index 9886a13d..00000000 --- a/test/definitions/3.0.0/models/tag/wrongly extended.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "user", - "x-number": 0, - "x-string": "", - "x-object": { - "property": {} - }, - "ext-number": 1 -} diff --git a/test/definitions/base-schema-test.mjs b/test/definitions/base-schema-test.mjs new file mode 100644 index 00000000..31c88720 --- /dev/null +++ b/test/definitions/base-schema-test.mjs @@ -0,0 +1,108 @@ +import {it} from 'vitest'; +import TestHelper from '@test/test-helper'; + +export class JsonSchemaTestSuiteData { + + constructor( + jsonSchema, + examples, + onlyRequiredProperties, + withoutRequiredProperties, + extended, + wronglyExtended + ) { + this.jsonSchema = jsonSchema; + this.examples = examples; + this.onlyRequiredProperties = onlyRequiredProperties; + this.withoutRequiredProperties = withoutRequiredProperties; + this.extended = extended; + this.wronglyExtended = wronglyExtended; + } + +} + +export class JsonSchemaTestSuiteConfig { + + constructor( + hasRequiredProperties= false, + expectedErrorsWhenIsWithoutRequiredProperties= [], + canBeExtended = true, + expectedErrorsWhenIsWronglyExtended= [], + ) { + this.hasRequiredProperties = hasRequiredProperties; + this.expectedErrorsWhenIsWithoutRequiredProperties = expectedErrorsWhenIsWithoutRequiredProperties; + this.canBeExtended = canBeExtended; + this.expectedErrorsWhenIsWronglyExtended = expectedErrorsWhenIsWronglyExtended; + } + +} + +export class JsonSchemaTestSuite { + + data; + config; + + /** + * Basic JsonSchema Test Suite. + * + * @param data test data + * @param config test suite config + */ + constructor(data, config = new JsonSchemaTestSuiteConfig()) { + this.data = data; + this.config = config; + } + + testSuite() { + + it(TestHelper.exampleIsValidTestName, () => TestHelper.objectIsValid( + this.data.jsonSchema, + this.data.examples[0], + )); + + if (this.config.hasRequiredProperties) { + + it(TestHelper.cannotBeEmptyTestName, () => TestHelper.objectIsNotValid( + this.data.jsonSchema, + {}, + this.config.expectedErrorsWhenIsWithoutRequiredProperties, + )); + + it(TestHelper.isNotValidWithoutRequiredPropertiesTestName, () => TestHelper.objectIsNotValid( + this.data.jsonSchema, + this.data.withoutRequiredProperties, + this.config.expectedErrorsWhenIsWithoutRequiredProperties + )); + + } else { + + it(TestHelper.canBeEmptyTestName, () => TestHelper.objectIsValid( + this.data.jsonSchema, + {}, + )); + + it(TestHelper.isValidWithoutRequiredPropertiesTestName, () => TestHelper.objectIsValid( + this.data.jsonSchema, + this.data.withoutRequiredProperties, + )); + + } + + it(TestHelper.isValidWithOnlyRequiredPropertiesTestName, () => TestHelper.objectIsValid( + this.data.jsonSchema, + this.data.onlyRequiredProperties, + )); + + it(TestHelper.isValidWhenIsExtendedTestName, () => TestHelper.objectIsValid( + this.data.jsonSchema, + this.data.extended, + )); + + it(TestHelper.isNotValidWhenIsWronglyExtendedTestName, () => TestHelper.wronglyExtended( + this.data.jsonSchema, + this.data.wronglyExtended, + )); + + } + +} \ No newline at end of file