diff --git a/asyncapi-core/src/test/kotlin/com/asyncapi/v2/_6_0/binding/channel/amqp/AMQPChannelBindingTest.kt b/asyncapi-core/src/test/kotlin/com/asyncapi/v2/_6_0/binding/channel/amqp/AMQPChannelBindingTest.kt index 0dcc276c..ee98a034 100644 --- a/asyncapi-core/src/test/kotlin/com/asyncapi/v2/_6_0/binding/channel/amqp/AMQPChannelBindingTest.kt +++ b/asyncapi-core/src/test/kotlin/com/asyncapi/v2/_6_0/binding/channel/amqp/AMQPChannelBindingTest.kt @@ -14,26 +14,6 @@ class AMQPChannelBindingTest { private val objectMapper = ObjectMapper() - private fun build(): AMQPChannelBinding { - return AMQPChannelBinding.builder() - .`is`("routingKey") - .queue(AMQPChannelBinding.QueueProperties.builder() - .name("my-queue-name") - .durable(true) - .exclusive(true) - .autoDelete(false) - .build() - ) - .exchange(AMQPChannelBinding.ExchangeProperties.builder() - .name("myExchange") - .type("topic") - .durable(true) - .autoDelete(false) - .build() - ) - .build() - } - @Test @DisplayName("Compare hand crafted model with parsed json") fun compareModelWithParsedJson() { @@ -45,4 +25,27 @@ class AMQPChannelBindingTest { ) } + companion object { + @JvmStatic + fun build(): AMQPChannelBinding { + return AMQPChannelBinding.builder() + .`is`("routingKey") + .queue(AMQPChannelBinding.QueueProperties.builder() + .name("my-queue-name") + .durable(true) + .exclusive(true) + .autoDelete(false) + .build() + ) + .exchange(AMQPChannelBinding.ExchangeProperties.builder() + .name("myExchange") + .type("topic") + .durable(true) + .autoDelete(false) + .build() + ) + .build() + } + } + } \ No newline at end of file diff --git a/asyncapi-core/src/test/kotlin/com/asyncapi/v2/_6_0/binding/channel/anypointmq/AnypointMQChannelBindingTest.kt b/asyncapi-core/src/test/kotlin/com/asyncapi/v2/_6_0/binding/channel/anypointmq/AnypointMQChannelBindingTest.kt index 8e92557a..1495c8db 100644 --- a/asyncapi-core/src/test/kotlin/com/asyncapi/v2/_6_0/binding/channel/anypointmq/AnypointMQChannelBindingTest.kt +++ b/asyncapi-core/src/test/kotlin/com/asyncapi/v2/_6_0/binding/channel/anypointmq/AnypointMQChannelBindingTest.kt @@ -14,13 +14,6 @@ class AnypointMQChannelBindingTest { private val objectMapper = ObjectMapper() - private fun build(): AnypointMQChannelBinding { - return AnypointMQChannelBinding.builder() - .destination("user-signup-exchg") - .destinationType("exchange") - .build() - } - @Test @DisplayName("Compare hand crafted model with parsed json") fun compareModelWithParsedJson() { @@ -32,4 +25,14 @@ class AnypointMQChannelBindingTest { ) } + companion object { + @JvmStatic + fun build(): AnypointMQChannelBinding { + return AnypointMQChannelBinding.builder() + .destination("user-signup-exchg") + .destinationType("exchange") + .build() + } + } + } \ No newline at end of file diff --git a/asyncapi-core/src/test/kotlin/com/asyncapi/v2/_6_0/binding/channel/googlepubsub/GooglePubSubChannelBindingTest.kt b/asyncapi-core/src/test/kotlin/com/asyncapi/v2/_6_0/binding/channel/googlepubsub/GooglePubSubChannelBindingTest.kt index 3c37d22d..7bed4b83 100644 --- a/asyncapi-core/src/test/kotlin/com/asyncapi/v2/_6_0/binding/channel/googlepubsub/GooglePubSubChannelBindingTest.kt +++ b/asyncapi-core/src/test/kotlin/com/asyncapi/v2/_6_0/binding/channel/googlepubsub/GooglePubSubChannelBindingTest.kt @@ -10,33 +10,6 @@ class GooglePubSubChannelBindingTest { private val objectMapper = ObjectMapper() - private fun build(): GooglePubSubChannelBinding { - return GooglePubSubChannelBinding.builder() - .topic("projects/your-project/topics/topic-proto-schema") - .messageRetentionDuration("86400s") - .messageStoragePolicy(GooglePubSubChannelBinding.MessageStoragePolicy( - listOf( - "us-central1", - "us-central2", - "us-east1", - "us-east4", - "us-east5", - "us-east7", - "us-south1", - "us-west1", - "us-west2", - "us-west3", - "us-west4" - ) - )) - .schemaSettings(GooglePubSubChannelBinding.SchemaSettings.builder() - .encoding("binary") - .name("projects/your-project/schemas/message-proto") - .build() - ) - .build() - } - @Test @DisplayName("Compare hand crafted model with parsed json") fun compareModelWithParsedJson() { @@ -48,4 +21,34 @@ class GooglePubSubChannelBindingTest { ) } + companion object { + @JvmStatic + fun build(): GooglePubSubChannelBinding { + return GooglePubSubChannelBinding.builder() + .topic("projects/your-project/topics/topic-proto-schema") + .messageRetentionDuration("86400s") + .messageStoragePolicy(GooglePubSubChannelBinding.MessageStoragePolicy( + listOf( + "us-central1", + "us-central2", + "us-east1", + "us-east4", + "us-east5", + "us-east7", + "us-south1", + "us-west1", + "us-west2", + "us-west3", + "us-west4" + ) + )) + .schemaSettings(GooglePubSubChannelBinding.SchemaSettings.builder() + .encoding("binary") + .name("projects/your-project/schemas/message-proto") + .build() + ) + .build() + } + } + } \ No newline at end of file diff --git a/asyncapi-core/src/test/kotlin/com/asyncapi/v2/_6_0/binding/channel/ibmmq/IBMMQChannelBindingTest.kt b/asyncapi-core/src/test/kotlin/com/asyncapi/v2/_6_0/binding/channel/ibmmq/IBMMQChannelBindingTest.kt index bb07a774..da82e75c 100644 --- a/asyncapi-core/src/test/kotlin/com/asyncapi/v2/_6_0/binding/channel/ibmmq/IBMMQChannelBindingTest.kt +++ b/asyncapi-core/src/test/kotlin/com/asyncapi/v2/_6_0/binding/channel/ibmmq/IBMMQChannelBindingTest.kt @@ -11,26 +11,6 @@ class IBMMQChannelBindingTest { private val objectMapper = ObjectMapper() - private fun build(): IBMMQChannelBinding { - return IBMMQChannelBinding.builder() - .destinationType("topic") - .queue(IBMMQChannelBinding.Queue.builder() - .objectName("message") - .isPartitioned(false) - .exclusive(true) - .build() - ) - .topic(Topic.builder() - .string("messages") - .objectName("message") - .durablePermitted(true) - .lastMsgRetained(true) - .build() - ) - .maxMsgLength(1024) - .build() - } - @Test @DisplayName("Compare hand crafted model with parsed json") fun compareModelWithParsedJson() { @@ -42,4 +22,27 @@ class IBMMQChannelBindingTest { ) } + companion object { + @JvmStatic + fun build(): IBMMQChannelBinding { + return IBMMQChannelBinding.builder() + .destinationType("topic") + .queue(IBMMQChannelBinding.Queue.builder() + .objectName("message") + .isPartitioned(false) + .exclusive(true) + .build() + ) + .topic(Topic.builder() + .string("messages") + .objectName("message") + .durablePermitted(true) + .lastMsgRetained(true) + .build() + ) + .maxMsgLength(1024) + .build() + } + } + } \ No newline at end of file diff --git a/asyncapi-core/src/test/kotlin/com/asyncapi/v2/_6_0/binding/channel/kafka/KafkaChannelBindingTest.kt b/asyncapi-core/src/test/kotlin/com/asyncapi/v2/_6_0/binding/channel/kafka/KafkaChannelBindingTest.kt index 470d44ea..0431fe4f 100644 --- a/asyncapi-core/src/test/kotlin/com/asyncapi/v2/_6_0/binding/channel/kafka/KafkaChannelBindingTest.kt +++ b/asyncapi-core/src/test/kotlin/com/asyncapi/v2/_6_0/binding/channel/kafka/KafkaChannelBindingTest.kt @@ -14,22 +14,6 @@ class KafkaChannelBindingTest { private val objectMapper = ObjectMapper() - private fun build(): KafkaChannelBinding { - return KafkaChannelBinding.builder() - .topic("my-specific-topic-name") - .partitions(20) - .replicas(3) - .topicConfiguration(KafkaChannelBinding.TopicConfiguration.builder() - .cleanupPolicy(listOf("delete", "compact")) - .retentionMs(604_800_000) - .retentionBytes(1_000_000_000) - .deleteRetentionMs(86_400_000) - .maxMessageBytes(1_048_588) - .build() - ) - .build() - } - @Test @DisplayName("Compare hand crafted model with parsed json") fun compareModelWithParsedJson() { @@ -41,4 +25,23 @@ class KafkaChannelBindingTest { ) } + companion object { + @JvmStatic + fun build(): KafkaChannelBinding { + return KafkaChannelBinding.builder() + .topic("my-specific-topic-name") + .partitions(20) + .replicas(3) + .topicConfiguration(KafkaChannelBinding.TopicConfiguration.builder() + .cleanupPolicy(listOf("delete", "compact")) + .retentionMs(604_800_000) + .retentionBytes(1_000_000_000) + .deleteRetentionMs(86_400_000) + .maxMessageBytes(1_048_588) + .build() + ) + .build() + } + } + } \ No newline at end of file diff --git a/asyncapi-core/src/test/kotlin/com/asyncapi/v2/_6_0/binding/channel/pulsar/PulsarChannelBindingTest.kt b/asyncapi-core/src/test/kotlin/com/asyncapi/v2/_6_0/binding/channel/pulsar/PulsarChannelBindingTest.kt index a3f20fd8..bc0dbe3e 100644 --- a/asyncapi-core/src/test/kotlin/com/asyncapi/v2/_6_0/binding/channel/pulsar/PulsarChannelBindingTest.kt +++ b/asyncapi-core/src/test/kotlin/com/asyncapi/v2/_6_0/binding/channel/pulsar/PulsarChannelBindingTest.kt @@ -10,22 +10,6 @@ class PulsarChannelBindingTest { private val objectMapper = ObjectMapper() - private fun build(): PulsarChannelBinding { - return PulsarChannelBinding.builder() - .namespace("staging") - .persistence("persistent") - .compaction(1000) - .geoReplication(listOf("us-east1", "us-west1")) - .retention(PulsarChannelBinding.RetentionDefinition.builder() - .time(7) - .size(1000) - .build() - ) - .ttl(360) - .deduplication(false) - .build() - } - @Test @DisplayName("Compare hand crafted model with parsed json") fun compareModelWithParsedJson() { @@ -37,4 +21,23 @@ class PulsarChannelBindingTest { ) } + companion object { + @JvmStatic + fun build(): PulsarChannelBinding { + return PulsarChannelBinding.builder() + .namespace("staging") + .persistence("persistent") + .compaction(1000) + .geoReplication(listOf("us-east1", "us-west1")) + .retention(PulsarChannelBinding.RetentionDefinition.builder() + .time(7) + .size(1000) + .build() + ) + .ttl(360) + .deduplication(false) + .build() + } + } + } \ No newline at end of file diff --git a/asyncapi-core/src/test/kotlin/com/asyncapi/v2/_6_0/binding/channel/ws/WebSocketsChannelBindingTest.kt b/asyncapi-core/src/test/kotlin/com/asyncapi/v2/_6_0/binding/channel/ws/WebSocketsChannelBindingTest.kt index 46c2985e..e4c5d581 100644 --- a/asyncapi-core/src/test/kotlin/com/asyncapi/v2/_6_0/binding/channel/ws/WebSocketsChannelBindingTest.kt +++ b/asyncapi-core/src/test/kotlin/com/asyncapi/v2/_6_0/binding/channel/ws/WebSocketsChannelBindingTest.kt @@ -14,30 +14,6 @@ class WebSocketsChannelBindingTest { private val objectMapper = ObjectMapper() - private fun build(): WebSocketsChannelBinding { - return WebSocketsChannelBinding.builder() - .method("GET") - .query(mapOf( - Pair("type", "object"), - Pair("properties", mapOf( - Pair("ref", mapOf( - Pair("type", "string"), - Pair("description", "Referral.") - )) - )), - )) - .headers(mapOf( - Pair("type", "object"), - Pair("properties", mapOf( - Pair("Authentication", mapOf( - Pair("type", "string"), - Pair("description", "Authentication token") - )) - )), - )) - .build() - } - @Test @DisplayName("Compare hand crafted model with parsed json") fun compareModelWithParsedJson() { @@ -49,4 +25,31 @@ class WebSocketsChannelBindingTest { ) } + companion object { + @JvmStatic + fun build(): WebSocketsChannelBinding { + return WebSocketsChannelBinding.builder() + .method("GET") + .query(mapOf( + Pair("type", "object"), + Pair("properties", mapOf( + Pair("ref", mapOf( + Pair("type", "string"), + Pair("description", "Referral.") + )) + )), + )) + .headers(mapOf( + Pair("type", "object"), + Pair("properties", mapOf( + Pair("Authentication", mapOf( + Pair("type", "string"), + Pair("description", "Authentication token") + )) + )), + )) + .build() + } + } + } \ No newline at end of file diff --git a/asyncapi-core/src/test/kotlin/com/asyncapi/v2/_6_0/model/channel/ChannelItemTest.kt b/asyncapi-core/src/test/kotlin/com/asyncapi/v2/_6_0/model/channel/ChannelItemTest.kt new file mode 100644 index 00000000..b4ad78ea --- /dev/null +++ b/asyncapi-core/src/test/kotlin/com/asyncapi/v2/_6_0/model/channel/ChannelItemTest.kt @@ -0,0 +1,81 @@ +package com.asyncapi.v2._6_0.model.channel + +import com.asyncapi.v2.ClasspathUtils +import com.asyncapi.v2._6_0.binding.channel.amqp.AMQPChannelBindingTest +import com.asyncapi.v2._6_0.binding.channel.anypointmq.AnypointMQChannelBindingTest +import com.asyncapi.v2._6_0.binding.channel.googlepubsub.GooglePubSubChannelBindingTest +import com.asyncapi.v2._6_0.binding.channel.ibmmq.IBMMQChannelBindingTest +import com.asyncapi.v2._6_0.binding.channel.kafka.KafkaChannelBindingTest +import com.asyncapi.v2._6_0.binding.channel.pulsar.PulsarChannelBindingTest +import com.asyncapi.v2._6_0.binding.channel.ws.WebSocketsChannelBindingTest +import com.asyncapi.v2._6_0.model.Reference +import com.asyncapi.v2._6_0.model.channel.message.* +import com.asyncapi.v2._6_0.model.channel.operation.OperationTest +import com.asyncapi.v2._6_0.model.schema.Schema +import com.fasterxml.jackson.databind.ObjectMapper +import org.junit.jupiter.api.Assertions +import org.junit.jupiter.api.DisplayName +import org.junit.jupiter.api.Test + +class ChannelItemTest { + + private val objectMapper = ObjectMapper() + + @Test + @DisplayName("Compare hand crafted model with parsed json") + fun compareModelWithParsedJson() { + val model = ClasspathUtils.readAsString("/json/2.6.0/model/channel/channelItem.json") + + Assertions.assertEquals( + objectMapper.readValue(model, ChannelItem::class.java), + build() + ) + } + + companion object { + @JvmStatic + fun build(): ChannelItem { + val subscribe = OperationTest.build() + subscribe.message = OneOfMessages(listOf( + Reference("#/components/schemas/sendMessage"), + MessageTest.build() + )) + val publish = OperationTest.build() + publish.message = MessageTest.build() + val userIdParameter = ParameterTest.build() + userIdParameter.schema = Schema.builder().type("string").build() + + return ChannelItem.builder() + .description("This channel is used to exchange messages about users signing up") + .servers(listOf("stage.sign")) + .subscribe(subscribe) + .publish(publish) + .parameters(mapOf( + Pair("userId", userIdParameter) + )) + .bindings(mapOf( + Pair("amqp", AMQPChannelBindingTest.build()), + Pair("amqp1", Reference("#/components/channelBindings/amqp1")), + Pair("anypointmq", AnypointMQChannelBindingTest.build()), + Pair("googlepubsub", GooglePubSubChannelBindingTest.build()), + Pair("http", Reference("#/components/channelBindings/http")), + Pair("ibmmq", IBMMQChannelBindingTest.build()), + Pair("jms", Reference("#/components/channelBindings/jms")), + Pair("kafka", KafkaChannelBindingTest.build()), + Pair("mercure", Reference("#/components/channelBindings/mercure")), + Pair("mqtt", Reference("#/components/channelBindings/mqtt")), + Pair("mqtt5", Reference("#/components/channelBindings/mqtt5")), + Pair("nats", Reference("#/components/channelBindings/nats")), + Pair("pulsar", PulsarChannelBindingTest.build()), + Pair("redis", Reference("#/components/channelBindings/redis")), + Pair("sns", Reference("#/components/channelBindings/sns")), + Pair("solace", Reference("#/components/channelBindings/solace")), + Pair("sqs", Reference("#/components/channelBindings/sqs")), + Pair("stomp", Reference("#/components/channelBindings/stomp")), + Pair("ws", WebSocketsChannelBindingTest.build()) + )) + .build() + } + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/kotlin/com/asyncapi/v2/_6_0/model/channel/ParameterTest.kt b/asyncapi-core/src/test/kotlin/com/asyncapi/v2/_6_0/model/channel/ParameterTest.kt index 769c921f..fc2aa113 100644 --- a/asyncapi-core/src/test/kotlin/com/asyncapi/v2/_6_0/model/channel/ParameterTest.kt +++ b/asyncapi-core/src/test/kotlin/com/asyncapi/v2/_6_0/model/channel/ParameterTest.kt @@ -14,7 +14,7 @@ class ParameterTest { @Test @DisplayName("Compare hand crafted model with parsed json") - fun schema() { + fun schemaReference() { val model = ClasspathUtils.readAsString("/json/2.6.0/model/channel/parameter with reference to schema.json") val parameter = build() @@ -27,7 +27,7 @@ class ParameterTest { @Test @DisplayName("Compare hand crafted model with parsed json") - fun schemaReference() { + fun schema() { val model = ClasspathUtils.readAsString("/json/2.6.0/model/channel/parameter with schema.json") val parameter = build() diff --git a/asyncapi-core/src/test/kotlin/com/asyncapi/v2/_6_0/model/channel/operation/OperationTest.kt b/asyncapi-core/src/test/kotlin/com/asyncapi/v2/_6_0/model/channel/operation/OperationTest.kt index 316adc2f..8922e93b 100644 --- a/asyncapi-core/src/test/kotlin/com/asyncapi/v2/_6_0/model/channel/operation/OperationTest.kt +++ b/asyncapi-core/src/test/kotlin/com/asyncapi/v2/_6_0/model/channel/operation/OperationTest.kt @@ -21,52 +21,6 @@ class OperationTest { private val objectMapper = ObjectMapper() - private fun build(): Operation { - return Operation.builder() - .operationId("sendMessage") - .summary("Send message") - .description("Send message to remote server") - .security(listOf( - mapOf( - Pair("api_key", listOf("write:messages")) - ) - )) - .tags(listOf( - Tag.builder() - .name("messages") - .description("operations with messages") - .externalDocs(ExternalDocumentation("Messages validation rules", "messages/validation-rules")) - .build() - )) - .externalDocs(ExternalDocumentation("Messages sending rules", "messages/sending-rules")) - .bindings(mapOf( - Pair("amqp", AMQPOperationBindingTest.build()), - Pair("amqp1", Reference("#/components/operationBindings/amqp1")), - Pair("anypointmq", Reference("#/components/operationBindings/anypointmq")), - Pair("googlepubsub", Reference("#/components/operationBindings/googlepubsub")), - Pair("http", HTTPOperationBindingTest.build()), - Pair("ibmmq", Reference("#/components/operationBindings/ibmmq")), - Pair("jms", Reference("#/components/operationBindings/jms")), - Pair("kafka", KafkaOperationBindingTest.build()), - Pair("mercure", Reference("#/components/operationBindings/mercure")), - Pair("mqtt", MQTTOperationBindingTest.build()), - Pair("mqtt5", Reference("#/components/operationBindings/mqtt5")), - Pair("nats", NATSOperationBindingTest.build()), - Pair("pulsar", Reference("#/components/operationBindings/pulsar")), - Pair("redis", Reference("#/components/operationBindings/redis")), - Pair("sns", Reference("#/components/operationBindings/sns")), - Pair("solace", SolaceOperationBindingTest.build()), - Pair("sqs", Reference("#/components/operationBindings/sqs")), - Pair("stomp", Reference("#/components/operationBindings/stomp")), - Pair("ws", Reference("#/components/operationBindings/ws")) - )) - .traits(listOf( - Reference("#/components/operationTraits/sendMessage"), - OperationTraitTest.build() - )) - .build() - } - @Test @DisplayName("Operation with reference to message") fun referenceToMessage() { @@ -109,4 +63,53 @@ class OperationTest { ) } + companion object { + @JvmStatic + fun build(): Operation { + return Operation.builder() + .operationId("sendMessage") + .summary("Send message") + .description("Send message to remote server") + .security(listOf( + mapOf( + Pair("api_key", listOf("write:messages")) + ) + )) + .tags(listOf( + Tag.builder() + .name("messages") + .description("operations with messages") + .externalDocs(ExternalDocumentation("Messages validation rules", "messages/validation-rules")) + .build() + )) + .externalDocs(ExternalDocumentation("Messages sending rules", "messages/sending-rules")) + .bindings(mapOf( + Pair("amqp", AMQPOperationBindingTest.build()), + Pair("amqp1", Reference("#/components/operationBindings/amqp1")), + Pair("anypointmq", Reference("#/components/operationBindings/anypointmq")), + Pair("googlepubsub", Reference("#/components/operationBindings/googlepubsub")), + Pair("http", HTTPOperationBindingTest.build()), + Pair("ibmmq", Reference("#/components/operationBindings/ibmmq")), + Pair("jms", Reference("#/components/operationBindings/jms")), + Pair("kafka", KafkaOperationBindingTest.build()), + Pair("mercure", Reference("#/components/operationBindings/mercure")), + Pair("mqtt", MQTTOperationBindingTest.build()), + Pair("mqtt5", Reference("#/components/operationBindings/mqtt5")), + Pair("nats", NATSOperationBindingTest.build()), + Pair("pulsar", Reference("#/components/operationBindings/pulsar")), + Pair("redis", Reference("#/components/operationBindings/redis")), + Pair("sns", Reference("#/components/operationBindings/sns")), + Pair("solace", SolaceOperationBindingTest.build()), + Pair("sqs", Reference("#/components/operationBindings/sqs")), + Pair("stomp", Reference("#/components/operationBindings/stomp")), + Pair("ws", Reference("#/components/operationBindings/ws")) + )) + .traits(listOf( + Reference("#/components/operationTraits/sendMessage"), + OperationTraitTest.build() + )) + .build() + } + } + } \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/2.6.0/model/channel/channelItem.json b/asyncapi-core/src/test/resources/json/2.6.0/model/channel/channelItem.json new file mode 100644 index 00000000..68fc336b --- /dev/null +++ b/asyncapi-core/src/test/resources/json/2.6.0/model/channel/channelItem.json @@ -0,0 +1,1148 @@ +{ + "description": "This channel is used to exchange messages about users signing up", + "servers": [ + "stage.sign" + ], + "subscribe": { + "operationId": "sendMessage", + "summary": "Send message", + "description": "Send message to remote server", + "security": [ + { + "api_key": [ + "write:messages" + ] + } + ], + "tags": [ + { + "name": "messages", + "description": "operations with messages", + "externalDocs": { + "description": "Messages validation rules", + "url": "messages/validation-rules" + } + } + ], + "externalDocs": { + "description": "Messages sending rules", + "url": "messages/sending-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": { + "type": "request", + "method": "GET", + "query": { + "type": "object", + "required": [ + "companyId" + ], + "properties": { + "companyId": { + "type": "number", + "minimum": 1, + "description": "The Id of the company." + }, + "additionalProperties": false + } + }, + "bindingVersion": "0.1.0" + }, + "ibmmq": { + "$ref": "#/components/operationBindings/ibmmq" + }, + "jms": { + "$ref": "#/components/operationBindings/jms" + }, + "kafka": { + "groupId": { + "type": "string", + "enum": [ + "myGroupId" + ] + }, + "clientId": { + "type": "string", + "enum": [ + "myClientId" + ] + }, + "bindingVersion": "0.4.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": { + "destinations": [ + { + "destinationType": "queue", + "queue": { + "name": "CreatedHREvents", + "topicSubscriptions": [ + "person/*/created" + ], + "accessType": "exclusive", + "maxMsgSpoolSize": "1,500", + "maxTtl": "60" + } + }, + { + "destinationType": "queue", + "queue": { + "name": "UpdatedHREvents", + "topicSubscriptions": [ + "person/*/updated" + ] + }, + "topic": { + "topicSubscriptions": [ + "person/*/updated" + ] + } + } + ], + "bindingVersion": "0.3.0" + }, + "sqs": { + "$ref": "#/components/operationBindings/sqs" + }, + "stomp": { + "$ref": "#/components/operationBindings/stomp" + }, + "ws": { + "$ref": "#/components/operationBindings/ws" + } + }, + "traits": [ + { + "$ref": "#/components/operationTraits/sendMessage" + }, + { + "operationId": "sendMessage", + "summary": "Send message", + "description": "Send message to remote server", + "security": [ + { + "api_key": [ + "write:messages" + ] + } + ], + "tags": [ + { + "name": "messages", + "description": "operations with messages", + "externalDocs": { + "description": "Messages validation rules", + "url": "messages/validation-rules" + } + } + ], + "externalDocs": { + "description": "Messages sending rules", + "url": "messages/sending-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": { + "type": "request", + "method": "GET", + "query": { + "type": "object", + "required": [ + "companyId" + ], + "properties": { + "companyId": { + "type": "number", + "minimum": 1, + "description": "The Id of the company." + }, + "additionalProperties": false + } + }, + "bindingVersion": "0.1.0" + }, + "ibmmq": { + "$ref": "#/components/operationBindings/ibmmq" + }, + "jms": { + "$ref": "#/components/operationBindings/jms" + }, + "kafka": { + "groupId": { + "type": "string", + "enum": [ + "myGroupId" + ] + }, + "clientId": { + "type": "string", + "enum": [ + "myClientId" + ] + }, + "bindingVersion": "0.4.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": { + "destinations": [ + { + "destinationType": "queue", + "queue": { + "name": "CreatedHREvents", + "topicSubscriptions": [ + "person/*/created" + ], + "accessType": "exclusive", + "maxMsgSpoolSize": "1,500", + "maxTtl": "60" + } + }, + { + "destinationType": "queue", + "queue": { + "name": "UpdatedHREvents", + "topicSubscriptions": [ + "person/*/updated" + ] + }, + "topic": { + "topicSubscriptions": [ + "person/*/updated" + ] + } + } + ], + "bindingVersion": "0.3.0" + }, + "sqs": { + "$ref": "#/components/operationBindings/sqs" + }, + "stomp": { + "$ref": "#/components/operationBindings/stomp" + }, + "ws": { + "$ref": "#/components/operationBindings/ws" + } + } + } + ], + "message": { + "oneOf": [ + { + "$ref": "#/components/schemas/sendMessage" + }, + { + "messageId": "userSignup", + "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" + }, + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "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.4.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": [ + { "$ref": "#/components/messageTraits/commonHeaders" } + ] + } + ] + } + }, + "publish": { + "operationId": "sendMessage", + "summary": "Send message", + "description": "Send message to remote server", + "security": [ + { + "api_key": [ + "write:messages" + ] + } + ], + "tags": [ + { + "name": "messages", + "description": "operations with messages", + "externalDocs": { + "description": "Messages validation rules", + "url": "messages/validation-rules" + } + } + ], + "externalDocs": { + "description": "Messages sending rules", + "url": "messages/sending-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": { + "type": "request", + "method": "GET", + "query": { + "type": "object", + "required": [ + "companyId" + ], + "properties": { + "companyId": { + "type": "number", + "minimum": 1, + "description": "The Id of the company." + }, + "additionalProperties": false + } + }, + "bindingVersion": "0.1.0" + }, + "ibmmq": { + "$ref": "#/components/operationBindings/ibmmq" + }, + "jms": { + "$ref": "#/components/operationBindings/jms" + }, + "kafka": { + "groupId": { + "type": "string", + "enum": [ + "myGroupId" + ] + }, + "clientId": { + "type": "string", + "enum": [ + "myClientId" + ] + }, + "bindingVersion": "0.4.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": { + "destinations": [ + { + "destinationType": "queue", + "queue": { + "name": "CreatedHREvents", + "topicSubscriptions": [ + "person/*/created" + ], + "accessType": "exclusive", + "maxMsgSpoolSize": "1,500", + "maxTtl": "60" + } + }, + { + "destinationType": "queue", + "queue": { + "name": "UpdatedHREvents", + "topicSubscriptions": [ + "person/*/updated" + ] + }, + "topic": { + "topicSubscriptions": [ + "person/*/updated" + ] + } + } + ], + "bindingVersion": "0.3.0" + }, + "sqs": { + "$ref": "#/components/operationBindings/sqs" + }, + "stomp": { + "$ref": "#/components/operationBindings/stomp" + }, + "ws": { + "$ref": "#/components/operationBindings/ws" + } + }, + "traits": [ + { + "$ref": "#/components/operationTraits/sendMessage" + }, + { + "operationId": "sendMessage", + "summary": "Send message", + "description": "Send message to remote server", + "security": [ + { + "api_key": [ + "write:messages" + ] + } + ], + "tags": [ + { + "name": "messages", + "description": "operations with messages", + "externalDocs": { + "description": "Messages validation rules", + "url": "messages/validation-rules" + } + } + ], + "externalDocs": { + "description": "Messages sending rules", + "url": "messages/sending-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": { + "type": "request", + "method": "GET", + "query": { + "type": "object", + "required": [ + "companyId" + ], + "properties": { + "companyId": { + "type": "number", + "minimum": 1, + "description": "The Id of the company." + }, + "additionalProperties": false + } + }, + "bindingVersion": "0.1.0" + }, + "ibmmq": { + "$ref": "#/components/operationBindings/ibmmq" + }, + "jms": { + "$ref": "#/components/operationBindings/jms" + }, + "kafka": { + "groupId": { + "type": "string", + "enum": [ + "myGroupId" + ] + }, + "clientId": { + "type": "string", + "enum": [ + "myClientId" + ] + }, + "bindingVersion": "0.4.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": { + "destinations": [ + { + "destinationType": "queue", + "queue": { + "name": "CreatedHREvents", + "topicSubscriptions": [ + "person/*/created" + ], + "accessType": "exclusive", + "maxMsgSpoolSize": "1,500", + "maxTtl": "60" + } + }, + { + "destinationType": "queue", + "queue": { + "name": "UpdatedHREvents", + "topicSubscriptions": [ + "person/*/updated" + ] + }, + "topic": { + "topicSubscriptions": [ + "person/*/updated" + ] + } + } + ], + "bindingVersion": "0.3.0" + }, + "sqs": { + "$ref": "#/components/operationBindings/sqs" + }, + "stomp": { + "$ref": "#/components/operationBindings/stomp" + }, + "ws": { + "$ref": "#/components/operationBindings/ws" + } + } + } + ], + "message": { + "messageId": "userSignup", + "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" + }, + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "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.4.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": [ + { "$ref": "#/components/messageTraits/commonHeaders" } + ] + } + }, + "parameters": { + "userId": { + "description": "Id of the user.", + "schema": { + "type": "string" + }, + "location": "$message.payload#/user/id" + } + }, + "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.4.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" + } + } + } + } + } +} \ No newline at end of file