diff --git a/springwolf-examples/springwolf-amqp-example/src/test/resources/asyncapi.json b/springwolf-examples/springwolf-amqp-example/src/test/resources/asyncapi.json index 0642b0534..b5aafdced 100644 --- a/springwolf-examples/springwolf-amqp-example/src/test/resources/asyncapi.json +++ b/springwolf-examples/springwolf-amqp-example/src/test/resources/asyncapi.json @@ -27,7 +27,7 @@ "channels": { "another-queue": { "messages": { - "another-queue_publish_receiveAnotherPayload.message": { + "io.github.stavshamir.springwolf.example.amqp.dtos.AnotherPayloadDto": { "headers": { "$ref": "#/components/schemas/HeadersNotDocumented" }, @@ -69,7 +69,7 @@ }, "example-producer-channel-publisher": { "messages": { - "example-producer-channel-publisher_subscribe.message": { + "io.github.stavshamir.springwolf.example.amqp.dtos.AnotherPayloadDto": { "headers": { "$ref": "#/components/schemas/HeadersNotDocumented" }, @@ -92,7 +92,7 @@ }, "example-queue": { "messages": { - "example-queue_publish_receiveExamplePayload.message": { + "io.github.stavshamir.springwolf.example.amqp.dtos.ExamplePayloadDto": { "headers": { "$ref": "#/components/schemas/HeadersNotDocumented" }, @@ -134,7 +134,7 @@ }, "example-topic-routing-key": { "messages": { - "example-topic-routing-key_publish_bindingsExample.message": { + "io.github.stavshamir.springwolf.example.amqp.dtos.AnotherPayloadDto": { "headers": { "$ref": "#/components/schemas/HeadersNotDocumented" }, @@ -176,7 +176,7 @@ }, "multi-payload-queue": { "messages": { - "multi-payload-queue_publish_bindingsBeanExample.message.0": { + "io.github.stavshamir.springwolf.example.amqp.dtos.AnotherPayloadDto": { "headers": { "$ref": "#/components/schemas/HeadersNotDocumented" }, @@ -194,7 +194,7 @@ } } }, - "multi-payload-queue_publish_bindingsBeanExample.message.1": { + "io.github.stavshamir.springwolf.example.amqp.dtos.ExamplePayloadDto": { "headers": { "$ref": "#/components/schemas/HeadersNotDocumented" }, @@ -307,13 +307,9 @@ }, "operations": { "another-queue_publish_receiveAnotherPayload": { - "action": "receive", - "channel": { - "$ref": "#/channels/another-queue" - }, - "description": "Auto-generated description", "bindings": { "amqp": { + "expiration": 0, "cc": [ "another-queue" ], @@ -322,22 +318,20 @@ }, "messages": [ { - "$ref": "#/channels/another-queue/messages/another-queue_publish_receiveAnotherPayload.message" + "$ref": "#/components/messages/io.github.stavshamir.springwolf.example.amqp.dtos.AnotherPayloadDto" } ] }, - "example-producer-channel-publisher_subscribe": { + "example-producer-channel-publisher": { "action": "send", - "channel": { - "$ref": "#/channels/example-producer-channel-publisher" - }, + "title": "example-producer-channel-publisher_subscribe", "description": "Custom, optional description defined in the AsyncPublisher annotation", "bindings": { "amqp": { "expiration": 0, - "cc": [], + "cc": [ ], "priority": 0, - "deliveryMode": 1, + "deliveryMode": 0, "mandatory": false, "timestamp": false, "ack": false, @@ -346,18 +340,14 @@ }, "messages": [ { - "$ref": "#/channels/example-producer-channel-publisher/messages/example-producer-channel-publisher_subscribe.message" + "$ref": "#/components/messages/io.github.stavshamir.springwolf.example.amqp.dtos.AnotherPayloadDto" } ] }, "example-queue_publish_receiveExamplePayload": { - "action": "receive", - "channel": { - "$ref": "#/channels/example-queue" - }, - "description": "Auto-generated description", "bindings": { "amqp": { + "expiration": 0, "cc": [ "example-queue" ], @@ -366,18 +356,14 @@ }, "messages": [ { - "$ref": "#/channels/example-queue/messages/example-queue_publish_receiveExamplePayload.message" + "$ref": "#/components/messages/io.github.stavshamir.springwolf.example.amqp.dtos.ExamplePayloadDto" } ] }, "example-topic-routing-key_publish_bindingsExample": { - "action": "receive", - "channel": { - "$ref": "#/channels/example-topic-routing-key" - }, - "description": "Auto-generated description", "bindings": { "amqp": { + "expiration": 0, "cc": [ "example-topic-routing-key" ], @@ -386,18 +372,14 @@ }, "messages": [ { - "$ref": "#/channels/example-topic-routing-key/messages/example-topic-routing-key_publish_bindingsExample.message" + "$ref": "#/components/messages/io.github.stavshamir.springwolf.example.amqp.dtos.AnotherPayloadDto" } ] }, "multi-payload-queue_publish_bindingsBeanExample": { - "action": "receive", - "channel": { - "$ref": "#/channels/multi-payload-queue" - }, - "description": "Auto-generated description", "bindings": { "amqp": { + "expiration": 0, "cc": [ "example-topic-routing-key" ], @@ -406,10 +388,10 @@ }, "messages": [ { - "$ref": "#/channels/multi-payload-queue/messages/multi-payload-queue_publish_bindingsBeanExample.message.0" + "$ref": "#/components/messages/io.github.stavshamir.springwolf.example.amqp.dtos.ExamplePayloadDto" }, { - "$ref": "#/channels/multi-payload-queue/messages/multi-payload-queue_publish_bindingsBeanExample.message.1" + "$ref": "#/components/messages/io.github.stavshamir.springwolf.example.amqp.dtos.AnotherPayloadDto" } ] } diff --git a/springwolf-examples/springwolf-cloud-stream-example/src/test/resources/asyncapi.json b/springwolf-examples/springwolf-cloud-stream-example/src/test/resources/asyncapi.json index d53ebacf5..b675cf5f6 100644 --- a/springwolf-examples/springwolf-cloud-stream-example/src/test/resources/asyncapi.json +++ b/springwolf-examples/springwolf-cloud-stream-example/src/test/resources/asyncapi.json @@ -12,129 +12,27 @@ "license": { "name": "Apache License 2.0" }, - "tags": [], "x-generator": "springwolf" }, "defaultContentType": "application/json", "servers": { "kafka": { - "host": "kafka:29092", + "host": "localhost:50025", "protocol": "kafka" } }, "channels": { "another-topic": { - "address": "another-topic", - "messages": { - "another-topic_publish_consumerMethod.message": { - "name": "io.github.stavshamir.springwolf.example.cloudstream.dtos.AnotherPayloadDto", - "title": "AnotherPayloadDto", - "payload": { - "schemaFormat": "application/vnd.oai.openapi+json;version=3.0.0", - "schema": { - "$ref": "#/components/schemas/AnotherPayloadDto" - } - }, - "headers": { - "$ref": "#/components/schemas/HeadersNotDocumented" - }, - "bindings": { - "kafka": {} - } - }, - "another-topic_subscribe_process.message": { - "name": "io.github.stavshamir.springwolf.example.cloudstream.dtos.AnotherPayloadDto", - "title": "AnotherPayloadDto", - "payload": { - "schemaFormat": "application/vnd.oai.openapi+json;version=3.0.0", - "schema": { - "$ref": "#/components/schemas/AnotherPayloadDto" - } - }, - "headers": { - "$ref": "#/components/schemas/HeadersNotDocumented" - }, - "bindings": { - "kafka": {} - } - } - }, "bindings": { - "kafka": {} + "kafka": { } } }, "example-topic": { - "address": "example-topic", - "messages": { - "example-topic_publish_process.message": { - "name": "io.github.stavshamir.springwolf.example.cloudstream.dtos.ExamplePayloadDto", - "title": "ExamplePayloadDto", - "payload": { - "schemaFormat": "application/vnd.oai.openapi+json;version=3.0.0", - "schema": { - "$ref": "#/components/schemas/ExamplePayloadDto" - } - }, - "headers": { - "$ref": "#/components/schemas/HeadersNotDocumented" - }, - "bindings": { - "kafka": {} - } - } - }, "bindings": { - "kafka": {} + "kafka": { } } } }, - "operations": { - "another-topic_publish_consumerMethod": { - "action": "receive", - "channel": { - "$ref": "#/channels/another-topic" - }, - "description": "Auto-generated description", - "bindings": { - "kafka": {} - }, - "messages": [ - { - "$ref": "#/channels/another-topic/messages/another-topic_publish_consumerMethod.message" - } - ] - }, - "another-topic_subscribe_process": { - "action": "send", - "channel": { - "$ref": "#/channels/another-topic" - }, - "description": "Auto-generated description", - "bindings": { - "kafka": {} - }, - "messages": [ - { - "$ref": "#/channels/another-topic/messages/another-topic_subscribe_process.message" - } - ] - }, - "example-topic_publish_process": { - "action": "receive", - "channel": { - "$ref": "#/channels/example-topic" - }, - "description": "Auto-generated description", - "bindings": { - "kafka": {} - }, - "messages": [ - { - "$ref": "#/channels/example-topic/messages/example-topic_publish_process.message" - } - ] - } - }, "components": { "schemas": { "AnotherPayloadDto": { @@ -200,9 +98,10 @@ }, "HeadersNotDocumented": { "type": "object", - "properties": {}, - "example": {} + "properties": { }, + "example": { } } } - } + }, + "operations": { } } \ No newline at end of file diff --git a/springwolf-examples/springwolf-jms-example/src/test/resources/asyncapi.json b/springwolf-examples/springwolf-jms-example/src/test/resources/asyncapi.json index 78cbb5266..35075dd87 100644 --- a/springwolf-examples/springwolf-jms-example/src/test/resources/asyncapi.json +++ b/springwolf-examples/springwolf-jms-example/src/test/resources/asyncapi.json @@ -12,138 +12,73 @@ "license": { "name": "Apache License 2.0" }, - "tags": [], "x-generator": "springwolf" }, "defaultContentType": "application/json", "servers": { "jms": { - "host": "activemq:61616", + "host": "tcp://localhost:61616", "protocol": "jms" } }, "channels": { "another-queue": { - "address": "another-queue", "messages": { - "another-queue_publish_receiveAnotherPayload.message": { - "name": "io.github.stavshamir.springwolf.example.jms.dtos.AnotherPayloadDto", - "title": "AnotherPayloadDto", - "payload": { - "schemaFormat": "application/vnd.oai.openapi+json;version=3.0.0", - "schema": { - "$ref": "#/components/schemas/io.github.stavshamir.springwolf.example.jms.dtos.AnotherPayloadDto" - } - }, + "io.github.stavshamir.springwolf.example.jms.dtos.AnotherPayloadDto": { "headers": { "$ref": "#/components/schemas/HeadersNotDocumented" }, - "bindings": { - "jms": {} - } - }, - "another-queue_subscribe.message": { - "name": "io.github.stavshamir.springwolf.example.jms.dtos.AnotherPayloadDto", - "title": "AnotherPayloadDto", - "description": "Another payload model", "payload": { - "schemaFormat": "application/vnd.oai.openapi+json;version=3.0.0", + "schemaFormat": "application/vnd.aai.asyncapi+json;version=3.0.0", "schema": { "$ref": "#/components/schemas/io.github.stavshamir.springwolf.example.jms.dtos.AnotherPayloadDto" } }, - "headers": { - "$ref": "#/components/schemas/HeadersNotDocumented" - }, + "name": "io.github.stavshamir.springwolf.example.jms.dtos.AnotherPayloadDto", + "title": "AnotherPayloadDto", + "description": "Another payload model", "bindings": { - "jms": {} + "jms": { + "bindingVersion": "0.0.1" + } } } } }, "example-queue": { - "address": "example-queue", "messages": { - "example-queue_publish_receiveExamplePayload.message": { - "name": "io.github.stavshamir.springwolf.example.jms.dtos.ExamplePayloadDto", - "title": "ExamplePayloadDto", + "io.github.stavshamir.springwolf.example.jms.dtos.ExamplePayloadDto": { + "headers": { + "$ref": "#/components/schemas/HeadersNotDocumented" + }, "payload": { - "schemaFormat": "application/vnd.oai.openapi+json;version=3.0.0", + "schemaFormat": "application/vnd.aai.asyncapi+json;version=3.0.0", "schema": { "$ref": "#/components/schemas/io.github.stavshamir.springwolf.example.jms.dtos.ExamplePayloadDto" } }, - "headers": { - "$ref": "#/components/schemas/HeadersNotDocumented" - }, + "name": "io.github.stavshamir.springwolf.example.jms.dtos.ExamplePayloadDto", + "title": "ExamplePayloadDto", "bindings": { - "jms": {} + "jms": { + "bindingVersion": "0.0.1" + } } } }, - "bindings": { - "jms": {} - } - } - }, - "operations": { - "another-queue_publish_receiveAnotherPayload": { - "action": "receive", - "channel": { - "$ref": "#/channels/another-queue" - }, - "description": "Auto-generated description", - "bindings": { - "jms": {} - }, - "messages": [ - { - "$ref": "#/channels/another-queue/messages/another-queue_publish_receiveAnotherPayload.message" - } - ] - }, - "another-queue_subscribe": { - "action": "send", - "channel": { - "$ref": "#/channels/another-queue" - }, - "description": "Custom, optional description defined in the AsyncPublisher annotation", "bindings": { "jms": { - "internal-field": "customValue", - "nested": { - "key": "nestedValue" - } + "bindingVersion": "0.0.1" } - }, - "messages": [ - { - "$ref": "#/channels/another-queue/messages/another-queue_subscribe.message" - } - ] - }, - "example-queue_publish_receiveExamplePayload": { - "action": "receive", - "channel": { - "$ref": "#/channels/example-queue" - }, - "description": "Auto-generated description", - "bindings": { - "jms": {} - }, - "messages": [ - { - "$ref": "#/channels/example-queue/messages/example-queue_publish_receiveExamplePayload.message" - } - ] + } } }, "components": { "schemas": { "HeadersNotDocumented": { "type": "object", - "properties": {}, - "example": {} + "properties": { }, + "example": { } }, "io.github.stavshamir.springwolf.example.jms.dtos.AnotherPayloadDto": { "required": [ @@ -207,5 +142,45 @@ } } } + }, + "operations": { + "another-queue": { + "action": "send", + "title": "another-queue_subscribe", + "description": "Custom, optional description defined in the AsyncPublisher annotation", + "bindings": { + "jms": { + "internal-field": "customValue", + "nested": { + "key": "nestedValue" + } + } + }, + "messages": [ + { + "$ref": "#/components/messages/io.github.stavshamir.springwolf.example.jms.dtos.AnotherPayloadDto" + } + ] + }, + "another-queue_publish_receiveAnotherPayload": { + "bindings": { + "jms": { } + }, + "messages": [ + { + "$ref": "#/components/messages/io.github.stavshamir.springwolf.example.jms.dtos.AnotherPayloadDto" + } + ] + }, + "example-queue_publish_receiveExamplePayload": { + "bindings": { + "jms": { } + }, + "messages": [ + { + "$ref": "#/components/messages/io.github.stavshamir.springwolf.example.jms.dtos.ExamplePayloadDto" + } + ] + } } } \ No newline at end of file diff --git a/springwolf-examples/springwolf-kafka-example/src/test/resources/asyncapi.json b/springwolf-examples/springwolf-kafka-example/src/test/resources/asyncapi.json index ba5f55984..19d6fc64e 100644 --- a/springwolf-examples/springwolf-kafka-example/src/test/resources/asyncapi.json +++ b/springwolf-examples/springwolf-kafka-example/src/test/resources/asyncapi.json @@ -12,7 +12,6 @@ "license": { "name": "Apache License 2.0" }, - "tags": [], "x-generator": "springwolf" }, "defaultContentType": "application/json", @@ -24,20 +23,19 @@ }, "channels": { "another-topic": { - "address": "another-topic", "messages": { - "another-topic_publish_receiveAnotherPayloadBatched.message": { - "name": "io.github.stavshamir.springwolf.example.kafka.dtos.AnotherPayloadDto", - "title": "AnotherPayloadDto", + "io.github.stavshamir.springwolf.example.kafka.dtos.AnotherPayloadDto": { + "headers": { + "$ref": "#/components/schemas/HeadersNotDocumented" + }, "payload": { - "schemaFormat": "application/vnd.oai.openapi+json;version=3.0.0", + "schemaFormat": "application/vnd.aai.asyncapi+json;version=3.0.0", "schema": { "$ref": "#/components/schemas/io.github.stavshamir.springwolf.example.kafka.dtos.AnotherPayloadDto" } }, - "headers": { - "$ref": "#/components/schemas/HeadersNotDocumented" - }, + "name": "io.github.stavshamir.springwolf.example.kafka.dtos.AnotherPayloadDto", + "title": "AnotherPayloadDto", "bindings": { "kafka": { "bindingVersion": "0.4.0" @@ -52,24 +50,19 @@ } }, "avro-topic": { - "publish": { - "operationId": "avro-topic_publish", - "description": "Requires a running kafka-schema-registry. See docker-compose.yml to start it", - "bindings": { - "kafka": { - "bindingVersion": "0.4.0" - } - }, - "message": { - "schemaFormat": "application/vnd.oai.openapi+json;version=3.0.0", - "name": "io.github.stavshamir.springwolf.example.kafka.dto.avro.ExamplePayloadAvroDto", - "title": "ExamplePayloadAvroDto", - "payload": { - "$ref": "#/components/schemas/io.github.stavshamir.springwolf.example.kafka.dto.avro.ExamplePayloadAvroDto" - }, + "messages": { + "io.github.stavshamir.springwolf.example.kafka.dto.avro.ExamplePayloadAvroDto": { "headers": { "$ref": "#/components/schemas/HeadersNotDocumented" }, + "payload": { + "schemaFormat": "application/vnd.aai.asyncapi+json;version=3.0.0", + "schema": { + "$ref": "#/components/schemas/io.github.stavshamir.springwolf.example.kafka.dto.avro.ExamplePayloadAvroDto" + } + }, + "name": "io.github.stavshamir.springwolf.example.kafka.dto.avro.ExamplePayloadAvroDto", + "title": "ExamplePayloadAvroDto", "bindings": { "kafka": { "bindingVersion": "0.4.0" @@ -79,20 +72,19 @@ } }, "example-topic": { - "address": "example-topic", "messages": { - "example-topic_publish_receiveExamplePayload.message": { - "name": "io.github.stavshamir.springwolf.example.kafka.dtos.ExamplePayloadDto", - "title": "ExamplePayloadDto", + "io.github.stavshamir.springwolf.example.kafka.dtos.ExamplePayloadDto": { + "headers": { + "$ref": "#/components/schemas/HeadersNotDocumented" + }, "payload": { - "schemaFormat": "application/vnd.oai.openapi+json;version=3.0.0", + "schemaFormat": "application/vnd.aai.asyncapi+json;version=3.0.0", "schema": { "$ref": "#/components/schemas/io.github.stavshamir.springwolf.example.kafka.dtos.ExamplePayloadDto" } }, - "headers": { - "$ref": "#/components/schemas/HeadersNotDocumented" - }, + "name": "io.github.stavshamir.springwolf.example.kafka.dtos.ExamplePayloadDto", + "title": "ExamplePayloadDto", "bindings": { "kafka": { "bindingVersion": "0.4.0" @@ -107,88 +99,77 @@ } }, "multi-payload-topic": { - "address": "multi-payload-topic", "messages": { - "multi-payload-topic_publish.message.0": { - "name": "io.github.stavshamir.springwolf.example.kafka.dtos.AnotherPayloadDto", - "title": "AnotherPayloadDto", + "io.github.stavshamir.springwolf.example.kafka.dtos.AnotherPayloadDto": { + "headers": { + "$ref": "#/components/schemas/SpringKafkaDefaultHeaders-AnotherPayloadDto" + }, "payload": { - "schemaFormat": "application/vnd.oai.openapi+json;version=3.0.0", + "schemaFormat": "application/vnd.aai.asyncapi+json;version=3.0.0", "schema": { "$ref": "#/components/schemas/io.github.stavshamir.springwolf.example.kafka.dtos.AnotherPayloadDto" } }, - "headers": { - "$ref": "#/components/schemas/SpringKafkaDefaultHeaders-AnotherPayloadDto" - }, + "name": "io.github.stavshamir.springwolf.example.kafka.dtos.AnotherPayloadDto", + "title": "AnotherPayloadDto", "bindings": { "kafka": { "bindingVersion": "0.4.0" } } }, - "multi-payload-topic_publish.message.1": { - "name": "io.github.stavshamir.springwolf.example.kafka.dtos.ExamplePayloadDto", - "title": "ExamplePayloadDto", + "io.github.stavshamir.springwolf.example.kafka.dtos.ExamplePayloadDto": { + "headers": { + "$ref": "#/components/schemas/SpringKafkaDefaultHeaders-ExamplePayloadDto" + }, "payload": { - "schemaFormat": "application/vnd.oai.openapi+json;version=3.0.0", + "schemaFormat": "application/vnd.aai.asyncapi+json;version=3.0.0", "schema": { "$ref": "#/components/schemas/io.github.stavshamir.springwolf.example.kafka.dtos.ExamplePayloadDto" } }, - "headers": { - "$ref": "#/components/schemas/SpringKafkaDefaultHeaders-ExamplePayloadDto" - }, + "name": "io.github.stavshamir.springwolf.example.kafka.dtos.ExamplePayloadDto", + "title": "ExamplePayloadDto", "bindings": { "kafka": { "bindingVersion": "0.4.0" } } }, - "multi-payload-topic_publish.message.2": { - "name": "javax.money.MonetaryAmount", - "title": "MonetaryAmount", + "javax.money.MonetaryAmount": { + "headers": { + "$ref": "#/components/schemas/SpringKafkaDefaultHeaders-MonetaryAmount" + }, "payload": { - "schemaFormat": "application/vnd.oai.openapi+json;version=3.0.0", + "schemaFormat": "application/vnd.aai.asyncapi+json;version=3.0.0", "schema": { "$ref": "#/components/schemas/io.github.stavshamir.springwolf.addons.common_model_converters.converters.monetaryamount.MonetaryAmount" } }, - "headers": { - "$ref": "#/components/schemas/SpringKafkaDefaultHeaders-MonetaryAmount" - }, + "name": "javax.money.MonetaryAmount", + "title": "MonetaryAmount", "bindings": { "kafka": { - "key": { - "type": "string", - "description": "Kafka Consumer Message Key", - "example": "example-key" - }, "bindingVersion": "0.4.0" } } } } }, - "protobuf-topic": { - "publish": { - "operationId": "protobuf-topic_publish_receiveExampleProtobufPayload", - "description": "Auto-generated description", - "bindings": { - "kafka": { - "bindingVersion": "0.4.0" - } - }, - "message": { - "schemaFormat": "application/vnd.oai.openapi+json;version=3.0.0", - "name": "io.github.stavshamir.springwolf.example.kafka.dto.proto.ExamplePayloadProtobufDto$Message", - "title": "Message", - "payload": { - "$ref": "#/components/schemas/io.github.stavshamir.springwolf.example.kafka.dto.proto.ExamplePayloadProtobufDto$Message" - }, + "primitive-topic": { + "messages": { + "java.lang.String": { "headers": { "$ref": "#/components/schemas/HeadersNotDocumented" }, + "payload": { + "schemaFormat": "application/vnd.aai.asyncapi+json;version=3.0.0", + "schema": { + "$ref": "#/components/schemas/String" + } + }, + "name": "java.lang.String", + "title": "String", "bindings": { "kafka": { "bindingVersion": "0.4.0" @@ -202,68 +183,20 @@ } } }, - "string-topic": { - "publish": { - "operationId": "string-topic_publish", - "description": "Final classes (like String) can be documented using an envelope class and the @AsyncApiPayload annotation.", - "bindings": { - "kafka": { - "bindingVersion": "0.4.0" - } - }, - "message": { - "oneOf": [ - { - "schemaFormat": "application/vnd.oai.openapi+json;version=3.0.0", - "name": "io.github.stavshamir.springwolf.example.kafka.consumers.StringConsumer$StringEnvelope", - "title": "StringEnvelope", - "payload": { - "$ref": "#/components/schemas/io.github.stavshamir.springwolf.example.kafka.consumers.StringConsumer$StringEnvelope" - }, - "headers": { - "$ref": "#/components/schemas/HeadersNotDocumented" - }, - "bindings": { - "kafka": { - "bindingVersion": "0.4.0" - } - } - }, - { - "schemaFormat": "application/vnd.oai.openapi+json;version=3.0.0", - "name": "java.lang.String", - "title": "String", - "payload": { - "$ref": "#/components/schemas/String" - }, - "headers": { - "$ref": "#/components/schemas/HeadersNotDocumented" - }, - "bindings": { - "kafka": { - "bindingVersion": "0.4.0" - } - } - } - ] - } - } - }, - "primitive-topic": { - "address": "primitive-topic", + "protobuf-topic": { "messages": { - "primitive-topic_publish_receivePrimitivePayload.message": { - "name": "java.lang.String", - "title": "String", + "io.github.stavshamir.springwolf.example.kafka.dto.proto.ExamplePayloadProtobufDto$Message": { + "headers": { + "$ref": "#/components/schemas/HeadersNotDocumented" + }, "payload": { - "schemaFormat": "application/vnd.oai.openapi+json;version=3.0.0", + "schemaFormat": "application/vnd.aai.asyncapi+json;version=3.0.0", "schema": { - "$ref": "#/components/schemas/String" + "$ref": "#/components/schemas/io.github.stavshamir.springwolf.example.kafka.dto.proto.ExamplePayloadProtobufDto$Message" } }, - "headers": { - "$ref": "#/components/schemas/HeadersNotDocumented" - }, + "name": "io.github.stavshamir.springwolf.example.kafka.dto.proto.ExamplePayloadProtobufDto$Message", + "title": "Message", "bindings": { "kafka": { "bindingVersion": "0.4.0" @@ -277,151 +210,68 @@ } } }, - "topic-defined-via-asyncPublisher-annotation": { - "address": "topic-defined-via-asyncPublisher-annotation", + "string-topic": { "messages": { - "topic-defined-via-asyncPublisher-annotation_subscribe.message": { - "name": "io.github.stavshamir.springwolf.example.kafka.dtos.NestedPayloadDto", - "title": "NestedPayloadDto", - "description": "Payload model with nested complex types", + "io.github.stavshamir.springwolf.example.kafka.consumers.StringConsumer$StringEnvelope": { + "headers": { + "$ref": "#/components/schemas/HeadersNotDocumented" + }, "payload": { - "schemaFormat": "application/vnd.oai.openapi+json;version=3.0.0", + "schemaFormat": "application/vnd.aai.asyncapi+json;version=3.0.0", "schema": { - "$ref": "#/components/schemas/io.github.stavshamir.springwolf.example.kafka.dtos.NestedPayloadDto" + "$ref": "#/components/schemas/io.github.stavshamir.springwolf.example.kafka.consumers.StringConsumer$StringEnvelope" } }, + "name": "io.github.stavshamir.springwolf.example.kafka.consumers.StringConsumer$StringEnvelope", + "title": "StringEnvelope", + "bindings": { + "kafka": { + "bindingVersion": "0.4.0" + } + } + }, + "java.lang.String": { "headers": { - "$ref": "#/components/schemas/SpringDefaultHeaderAndCloudEvent" + "$ref": "#/components/schemas/HeadersNotDocumented" }, + "payload": { + "schemaFormat": "application/vnd.aai.asyncapi+json;version=3.0.0", + "schema": { + "$ref": "#/components/schemas/String" + } + }, + "name": "java.lang.String", + "title": "String", "bindings": { "kafka": { - "key": { - "type": "string", - "description": "Kafka Producer Message Key", - "example": "example-key" - }, "bindingVersion": "0.4.0" } } } } - } - }, - "operations": { - "another-topic_publish_receiveAnotherPayloadBatched": { - "action": "receive", - "channel": { - "$ref": "#/channels/another-topic" - }, - "description": "Auto-generated description", - "bindings": { - "kafka": { - "groupId": { - "type": "string", - "enum": [ - "example-group-id" - ] - }, - "bindingVersion": "0.4.0" - } - }, - "messages": [ - { - "$ref": "#/channels/another-topic/messages/another-topic_publish_receiveAnotherPayloadBatched.message" - } - ] - }, - "example-topic_publish_receiveExamplePayload": { - "action": "receive", - "channel": { - "$ref": "#/channels/example-topic" - }, - "description": "Auto-generated description", - "bindings": { - "kafka": { - "bindingVersion": "0.4.0" - } - }, - "messages": [ - { - "$ref": "#/channels/example-topic/messages/example-topic_publish_receiveExamplePayload.message" - } - ] }, - "multi-payload-topic_publish": { - "action": "receive", - "channel": { - "$ref": "#/channels/multi-payload-topic" - }, - "description": "Override description in the AsyncListener annotation with servers at kafka:29092", - "bindings": { - "kafka": { - "groupId": { - "type": "string", - "enum": [ - "foo-groupId" - ] - }, - "clientId": { - "type": "string", - "enum": [ - "foo-clientId" - ] + "topic-defined-via-asyncPublisher-annotation": { + "messages": { + "io.github.stavshamir.springwolf.example.kafka.dtos.NestedPayloadDto": { + "headers": { + "$ref": "#/components/schemas/SpringDefaultHeaderAndCloudEvent" }, - "bindingVersion": "0.4.0" - } - }, - "messages": [ - { - "$ref": "#/channels/multi-payload-topic/messages/multi-payload-topic_publish.message.0" - }, - { - "$ref": "#/channels/multi-payload-topic/messages/multi-payload-topic_publish.message.1" - }, - { - "$ref": "#/channels/multi-payload-topic/messages/multi-payload-topic_publish.message.2" - } - ] - }, - "primitive-topic_publish_receivePrimitivePayload": { - "action": "receive", - "channel": { - "$ref": "#/channels/primitive-topic" - }, - "description": "Auto-generated description", - "bindings": { - "kafka": { - "bindingVersion": "0.4.0" - } - }, - "messages": [ - { - "$ref": "#/channels/primitive-topic/messages/primitive-topic_publish_receivePrimitivePayload.message" - } - ] - }, - "topic-defined-via-asyncPublisher-annotation_subscribe": { - "action": "send", - "channel": { - "$ref": "#/channels/topic-defined-via-asyncPublisher-annotation" - }, - "description": "Custom, optional description defined in the AsyncPublisher annotation", - "bindings": { - "kafka": { - "clientId": { - "type": "string", - "enum": [ - "foo-clientId" - ] + "payload": { + "schemaFormat": "application/vnd.aai.asyncapi+json;version=3.0.0", + "schema": { + "$ref": "#/components/schemas/io.github.stavshamir.springwolf.example.kafka.dtos.NestedPayloadDto" + } }, - "bindingVersion": "0.4.0" - } - }, - "messages": [ - { - "$ref": "#/channels/topic-defined-via-asyncPublisher-annotation/messages/topic-defined-via-asyncPublisher-annotation_subscribe.message" + "name": "io.github.stavshamir.springwolf.example.kafka.dtos.NestedPayloadDto", + "title": "NestedPayloadDto", + "description": "Payload model with nested complex types", + "bindings": { + "kafka": { + "bindingVersion": "0.4.0" + } + } } - ] + } } }, "components": { @@ -1023,5 +873,170 @@ } } } + }, + "operations": { + "another-topic_publish_receiveAnotherPayloadBatched": { + "bindings": { + "kafka": { + "groupId": { + "type": "string", + "enum": [ + "example-group-id" + ] + }, + "bindingVersion": "0.4.0" + } + }, + "messages": [ + { + "$ref": "#/components/messages/io.github.stavshamir.springwolf.example.kafka.dtos.AnotherPayloadDto" + } + ] + }, + "avro-topic": { + "action": "receive", + "title": "avro-topic_publish", + "description": "Requires a running kafka-schema-registry. See docker-compose.yml to start it", + "bindings": { + "kafka": { + "bindingVersion": "0.4.0" + } + }, + "messages": [ + { + "$ref": "#/components/messages/io.github.stavshamir.springwolf.example.kafka.dto.avro.ExamplePayloadAvroDto" + } + ] + }, + "avro-topic_publish_receiveExampleAvroPayload": { + "bindings": { + "kafka": { + "bindingVersion": "0.4.0" + } + }, + "messages": [ + { + "$ref": "#/components/messages/io.github.stavshamir.springwolf.example.kafka.dto.avro.ExamplePayloadAvroDto" + } + ] + }, + "example-topic_publish_receiveExamplePayload": { + "bindings": { + "kafka": { + "bindingVersion": "0.4.0" + } + }, + "messages": [ + { + "$ref": "#/components/messages/io.github.stavshamir.springwolf.example.kafka.dtos.ExamplePayloadDto" + } + ] + }, + "multi-payload-topic": { + "action": "receive", + "title": "multi-payload-topic_publish", + "description": "Override description in the AsyncListener annotation with servers at localhost:50082", + "bindings": { + "kafka": { + "groupId": { + "type": "string", + "enum": [ + "foo-groupId" + ] + }, + "clientId": { + "type": "string", + "enum": [ + "foo-clientId" + ] + }, + "bindingVersion": "0.4.0" + } + }, + "messages": [ + { + "$ref": "#/components/messages/javax.money.MonetaryAmount" + } + ] + }, + "multi-payload-topic_publish_ExampleClassLevelKafkaListener": { + "bindings": { + "kafka": { + "bindingVersion": "0.4.0" + } + } + }, + "primitive-topic_publish_receivePrimitivePayload": { + "bindings": { + "kafka": { + "bindingVersion": "0.4.0" + } + }, + "messages": [ + { + "$ref": "#/components/messages/java.lang.String" + } + ] + }, + "protobuf-topic_publish_receiveExampleProtobufPayload": { + "bindings": { + "kafka": { + "bindingVersion": "0.4.0" + } + }, + "messages": [ + { + "$ref": "#/components/messages/io.github.stavshamir.springwolf.example.kafka.dto.proto.ExamplePayloadProtobufDto$Message" + } + ] + }, + "string-topic": { + "action": "receive", + "title": "string-topic_publish", + "description": "Final classes (like String) can be documented using an envelope class and the @AsyncApiPayload annotation.", + "bindings": { + "kafka": { + "bindingVersion": "0.4.0" + } + }, + "messages": [ + { + "$ref": "#/components/messages/io.github.stavshamir.springwolf.example.kafka.consumers.StringConsumer$StringEnvelope" + } + ] + }, + "string-topic_publish_receiveStringPayload": { + "bindings": { + "kafka": { + "bindingVersion": "0.4.0" + } + }, + "messages": [ + { + "$ref": "#/components/messages/java.lang.String" + } + ] + }, + "topic-defined-via-asyncPublisher-annotation": { + "action": "send", + "title": "topic-defined-via-asyncPublisher-annotation_subscribe", + "description": "Custom, optional description defined in the AsyncPublisher annotation", + "bindings": { + "kafka": { + "clientId": { + "type": "string", + "enum": [ + "foo-clientId" + ] + }, + "bindingVersion": "0.4.0" + } + }, + "messages": [ + { + "$ref": "#/components/messages/io.github.stavshamir.springwolf.example.kafka.dtos.NestedPayloadDto" + } + ] + } } } diff --git a/springwolf-examples/springwolf-sns-example/src/test/resources/asyncapi.json b/springwolf-examples/springwolf-sns-example/src/test/resources/asyncapi.json index 0541a6823..08d3b9193 100644 --- a/springwolf-examples/springwolf-sns-example/src/test/resources/asyncapi.json +++ b/springwolf-examples/springwolf-sns-example/src/test/resources/asyncapi.json @@ -17,68 +17,49 @@ "defaultContentType": "application/json", "servers": { "sns": { - "host": "localhost:4566", + "host": "http://localhost:4566", "protocol": "sns" } }, "channels": { "another-topic": { - "address": "another-topic", "messages": { - "another-topic_publish.message": { - "name": "io.github.stavshamir.springwolf.example.sns.dtos.AnotherPayloadDto", - "title": "AnotherPayloadDto", - "description": "Another payload model", - "payload": { - "schemaFormat": "application/vnd.oai.openapi+json;version=3.0.0", - "schema": { - "$ref": "#/components/schemas/io.github.stavshamir.springwolf.example.sns.dtos.AnotherPayloadDto" - } - }, + "io.github.stavshamir.springwolf.example.sns.dtos.AnotherPayloadDto": { "headers": { "$ref": "#/components/schemas/HeadersNotDocumented" }, - "bindings": { - "sns": {} - } - }, - "another-topic_subscribe.message": { - "name": "io.github.stavshamir.springwolf.example.sns.dtos.AnotherPayloadDto", - "title": "AnotherPayloadDto", - "description": "Another payload model", "payload": { - "schemaFormat": "application/vnd.oai.openapi+json;version=3.0.0", + "schemaFormat": "application/vnd.aai.asyncapi+json;version=3.0.0", "schema": { "$ref": "#/components/schemas/io.github.stavshamir.springwolf.example.sns.dtos.AnotherPayloadDto" } }, - "headers": { - "$ref": "#/components/schemas/HeadersNotDocumented" - }, + "name": "io.github.stavshamir.springwolf.example.sns.dtos.AnotherPayloadDto", + "title": "AnotherPayloadDto", + "description": "Another payload model", "bindings": { - "sns": {} + "sns": { } } } } }, "example-topic": { - "address": "example-topic", "messages": { - "example-topic_publish.message": { - "name": "io.github.stavshamir.springwolf.example.sns.dtos.ExamplePayloadDto", - "title": "ExamplePayloadDto", - "description": "Example payload model", + "io.github.stavshamir.springwolf.example.sns.dtos.ExamplePayloadDto": { + "headers": { + "$ref": "#/components/schemas/HeadersNotDocumented" + }, "payload": { - "schemaFormat": "application/vnd.oai.openapi+json;version=3.0.0", + "schemaFormat": "application/vnd.aai.asyncapi+json;version=3.0.0", "schema": { "$ref": "#/components/schemas/io.github.stavshamir.springwolf.example.sns.dtos.ExamplePayloadDto" } }, - "headers": { - "$ref": "#/components/schemas/HeadersNotDocumented" - }, + "name": "io.github.stavshamir.springwolf.example.sns.dtos.ExamplePayloadDto", + "title": "ExamplePayloadDto", + "description": "Example payload model", "bindings": { - "sns": {} + "sns": { } } } } @@ -88,8 +69,8 @@ "schemas": { "HeadersNotDocumented": { "type": "object", - "properties": {}, - "example": {}, + "properties": { }, + "example": { }, "x-json-schema": { "$schema": "https://json-schema.org/draft-04/schema#", "name": "HeadersNotDocumented", @@ -241,78 +222,33 @@ } }, "operations": { - "another-topic_publish": { + "another-topic": { "action": "receive", - "channel": { - "$ref": "#/channels/another-topic" - }, + "title": "another-topic_publish", "description": "Auto-generated description", "bindings": { "sns": { - "consumers": [ - { - "protocol": "sqs", - "endpoint": { - "name": "myQueue" - }, - "rawMessageDelivery": false - } - ] - } - }, - "messages": [ - { - "$ref": "#/channels/another-topic/messages/another-topic_publish.message" - } - ] - }, - "another-topic_subscribe": { - "action": "send", - "channel": { - "$ref": "#/channels/another-topic" - }, - "description": "Custom, optional description defined in the AsyncPublisher annotation", - "bindings": { - "sns": { - "consumers": [ - { - "protocol": "sqs", - "endpoint": { - "name": "myQueue" - }, - "rawMessageDelivery": false - } - ] + "bindingVersion": "0.1.0" } }, "messages": [ { - "$ref": "#/channels/another-topic/messages/another-topic_subscribe.message" + "$ref": "#/components/messages/io.github.stavshamir.springwolf.example.sns.dtos.AnotherPayloadDto" } ] }, - "example-topic_publish": { + "example-topic": { "action": "receive", - "channel": { - "$ref": "#/channels/example-topic" - }, + "title": "example-topic_publish", "description": "Auto-generated description", "bindings": { "sns": { - "consumers": [ - { - "protocol": "sqs", - "endpoint": { - "name": "myQueue" - }, - "rawMessageDelivery": false - } - ] + "bindingVersion": "0.1.0" } }, "messages": [ { - "$ref": "#/channels/example-topic/messages/example-topic_publish.message" + "$ref": "#/components/messages/io.github.stavshamir.springwolf.example.sns.dtos.ExamplePayloadDto" } ] } diff --git a/springwolf-examples/springwolf-sqs-example/src/test/resources/asyncapi.json b/springwolf-examples/springwolf-sqs-example/src/test/resources/asyncapi.json index 8633462ba..1185bd2e9 100644 --- a/springwolf-examples/springwolf-sqs-example/src/test/resources/asyncapi.json +++ b/springwolf-examples/springwolf-sqs-example/src/test/resources/asyncapi.json @@ -24,7 +24,7 @@ "channels": { "another-queue": { "messages": { - "another-queue_publish_receiveAnotherPayload.message": { + "io.github.stavshamir.springwolf.example.sqs.dtos.AnotherPayloadDto": { "headers": { "$ref": "#/components/schemas/HeadersNotDocumented" }, @@ -36,32 +36,16 @@ }, "name": "io.github.stavshamir.springwolf.example.sqs.dtos.AnotherPayloadDto", "title": "AnotherPayloadDto", - "bindings": { - "sqs": {} - } - }, - "another-queue_subscribe.message": { "description": "Another payload model", - "headers": { - "$ref": "#/components/schemas/HeadersNotDocumented" - }, - "payload": { - "schemaFormat": "application/vnd.aai.asyncapi+json;version=3.0.0", - "schema": { - "$ref": "#/components/schemas/io.github.stavshamir.springwolf.example.sqs.dtos.AnotherPayloadDto" - } - }, - "name": "io.github.stavshamir.springwolf.example.sqs.dtos.AnotherPayloadDto", - "title": "AnotherPayloadDto", "bindings": { - "sqs": {} + "sqs": { } } } } }, "example-queue": { "messages": { - "example-queue_publish_receiveExamplePayload.message": { + "io.github.stavshamir.springwolf.example.sqs.dtos.ExamplePayloadDto": { "headers": { "$ref": "#/components/schemas/HeadersNotDocumented" }, @@ -74,16 +58,13 @@ "name": "io.github.stavshamir.springwolf.example.sqs.dtos.ExamplePayloadDto", "title": "ExamplePayloadDto", "bindings": { - "sqs": {} + "sqs": { } } } }, "bindings": { "sqs": { - "queue": { - "name": "example-queue", - "fifoQueue": true, - } + "bindingVersion": "0.2.0" } } } @@ -92,8 +73,8 @@ "schemas": { "HeadersNotDocumented": { "type": "object", - "properties": {}, - "example": {} + "properties": { }, + "example": { } }, "io.github.stavshamir.springwolf.example.sqs.dtos.AnotherPayloadDto": { "required": [ @@ -159,63 +140,45 @@ } }, "operations": { - "another-queue_publish_receiveAnotherPayload": { - "action": "receive", - "channel": { - "$ref": "#/channels/another-queue" - }, - "description": "Auto-generated description", + "another-queue": { + "action": "send", + "title": "another-queue_subscribe", + "description": "Custom, optional description defined in the AsyncPublisher annotation", "bindings": { "sqs": { - "queues": [{ - "name": "another-queue", - "fifoQueue": true, - }] + "internal-field": "customValue", + "nested": { + "key": "nestedValue" + } } }, "messages": [ { - "$ref": "#/channels/another-queue/messages/another-queue_publish_receiveAnotherPayload.message" + "$ref": "#/components/messages/io.github.stavshamir.springwolf.example.sqs.dtos.AnotherPayloadDto" } ] }, - "another-queue_subscribe": { - "action": "send", - "channel": { - "$ref": "#/channels/another-queue" - }, - "description": "Custom, optional description defined in the AsyncPublisher annotation", + "another-queue_publish_receiveAnotherPayload": { "bindings": { "sqs": { - "queues": [{ - "name": "another-queue", - "fifoQueue": true, - }] + "bindingVersion": "0.2.0" } }, "messages": [ { - "$ref": "#/channels/another-queue/messages/another-queue_subscribe.message" + "$ref": "#/components/messages/io.github.stavshamir.springwolf.example.sqs.dtos.AnotherPayloadDto" } ] }, "example-queue_publish_receiveExamplePayload": { - "action": "receive", - "channel": { - "$ref": "#/channels/example-queue" - }, - "description": "Auto-generated description", "bindings": { "sqs": { - "queues": [{ - "name": "another-queue", - "fifoQueue": true, - }] + "bindingVersion": "0.2.0" } }, "messages": [ { - "$ref": "#/channels/example-queue/messages/example-queue_publish_receiveExamplePayload.message" + "$ref": "#/components/messages/io.github.stavshamir.springwolf.example.sqs.dtos.ExamplePayloadDto" } ] }