From e3c4c926ca5cf3def3ffda163ef018cba3a23121 Mon Sep 17 00:00:00 2001 From: Timon Back Date: Mon, 29 Dec 2025 15:04:31 +0100 Subject: [PATCH 1/2] chore: resolve some maintainer notes with breaking changes --- .../json_schema/JsonSchemaCustomizerTest.java | 3 +- .../json_schema/JsonSchemaGeneratorTest.java | 7 ++- .../v3/model/components/ComponentSchema.java | 2 +- .../v3/model/schema/SchemaObject.java | 26 -------- .../v3/bindings/kafka/KafkaBindingTest.java | 7 ++- .../v3/bindings/mqtt/MQTTBindingTest.java | 5 +- ...ncApiSerializerServiceIntegrationTest.java | 9 +-- .../asyncapi/v3/model/AsyncAPITest.java | 27 ++++---- .../v3/model/channel/MessageTest.java | 9 +-- .../asyncapi/v3/model/schema/SchemaTest.java | 61 +++++++++++-------- .../KafkaMessageBindingProcessor.java | 3 +- .../KafkaOperationBindingProcessor.java | 3 +- .../core/asyncapi/AsyncApiService.java | 9 +-- .../asyncapi/grouping/GroupingService.java | 4 +- .../annotation/AsyncAnnotationUtil.java | 5 +- .../headers/AsyncHeadersNotDocumented.java | 3 +- .../common/headers/AsyncHeadersNotUsed.java | 3 +- .../common/headers/HeaderClassExtractor.java | 3 +- .../headers/HeaderSchemaObjectMerger.java | 3 +- .../payload/internal/PayloadService.java | 3 +- .../asyncapi/schemas/SwaggerSchemaMapper.java | 19 +++--- .../SpringwolfConfigProperties.java | 15 ----- .../core/controller/AsyncApiController.java | 8 --- ...faultComponentsServiceIntegrationTest.java | 37 +++++------ .../components/SwaggerSchemaMapperTest.java | 32 +++++----- .../annotation/AsyncAnnotationUtilTest.java | 13 ++-- .../HeaderClassExtractorIntegrationTest.java | 11 ++-- .../headers/HeaderClassExtractorTest.java | 11 ++-- .../PublishingPayloadCreatorTest.java | 51 ++++++++++------ springwolf-examples/e2e/playwright.config.ts | 2 +- .../examples/amqp/ApiIntegrationTest.java | 14 ++++- .../examples/kafka/ApiIntegrationTest.java | 14 ++++- .../kafka/KafkaProducerSystemTest.java | 4 +- ...ustomPathConfigurationIntegrationTest.java | 2 +- .../headers/AsyncHeadersForAmqpBuilder.java | 3 +- .../controller/SpringwolfAmqpController.java | 2 +- ...unctionChannelsScannerIntegrationTest.java | 25 +++++--- .../controller/SpringwolfJmsController.java | 2 +- ...pringwolfJmsControllerIntegrationTest.java | 14 ++--- .../AsyncHeadersForSpringKafkaBuilder.java | 5 +- .../scanners/common/KafkaListenerUtil.java | 3 +- .../controller/SpringwolfKafkaController.java | 2 +- .../common/KafkaListenerUtilTest.java | 3 +- ...ingwolfKafkaControllerIntegrationTest.java | 16 ++--- .../controller/SpringwolfSnsController.java | 2 +- .../controller/SpringwolfSqsController.java | 2 +- .../header/AsyncHeadersForStompBuilder.java | 3 +- .../src/app/service/endpoint.service.ts | 2 +- 48 files changed, 266 insertions(+), 246 deletions(-) diff --git a/springwolf-add-ons/springwolf-json-schema/src/test/java/io/github/springwolf/addons/json_schema/JsonSchemaCustomizerTest.java b/springwolf-add-ons/springwolf-json-schema/src/test/java/io/github/springwolf/addons/json_schema/JsonSchemaCustomizerTest.java index 51ec3b6a7..bf5e42ae2 100644 --- a/springwolf-add-ons/springwolf-json-schema/src/test/java/io/github/springwolf/addons/json_schema/JsonSchemaCustomizerTest.java +++ b/springwolf-add-ons/springwolf-json-schema/src/test/java/io/github/springwolf/addons/json_schema/JsonSchemaCustomizerTest.java @@ -10,6 +10,7 @@ import org.junit.jupiter.api.Test; import java.util.Map; +import java.util.Set; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.ArgumentMatchers.any; @@ -44,7 +45,7 @@ void shouldAddJsonSchemaExtensionTest() throws Exception { // given AsyncAPI asyncAPI = createAsyncApi(); SchemaObject schemaObject = new SchemaObject(); - schemaObject.setType(SchemaType.OBJECT); + schemaObject.setType(Set.of(SchemaType.OBJECT)); asyncAPI.getComponents().setSchemas(Map.of("schema", ComponentSchema.of(schemaObject))); when(jsonSchemaGenerator.fromSchema(any(), any())).thenReturn("mock-string"); diff --git a/springwolf-add-ons/springwolf-json-schema/src/test/java/io/github/springwolf/addons/json_schema/JsonSchemaGeneratorTest.java b/springwolf-add-ons/springwolf-json-schema/src/test/java/io/github/springwolf/addons/json_schema/JsonSchemaGeneratorTest.java index 47a320063..60d344549 100644 --- a/springwolf-add-ons/springwolf-json-schema/src/test/java/io/github/springwolf/addons/json_schema/JsonSchemaGeneratorTest.java +++ b/springwolf-add-ons/springwolf-json-schema/src/test/java/io/github/springwolf/addons/json_schema/JsonSchemaGeneratorTest.java @@ -28,6 +28,7 @@ import java.math.BigDecimal; import java.util.List; import java.util.Map; +import java.util.Set; import java.util.TreeMap; import java.util.function.Supplier; import java.util.stream.Stream; @@ -54,14 +55,14 @@ void validateJsonSchemaTest(String expectedJsonSchema, Supplier> async // ref cycle ping -> pingField -> pong -> pongField -> ping (repeat) SchemaObject pingSchema = new SchemaObject(); - pingSchema.setType(SchemaType.OBJECT); + pingSchema.setType(Set.of(SchemaType.OBJECT)); pingSchema.setProperties(Map.of("pingfield", ComponentSchema.of(SchemaReference.toSchema("PongSchema")))); SchemaObject pongSchema = new SchemaObject(); - pongSchema.setType(SchemaType.OBJECT); + pongSchema.setType(Set.of(SchemaType.OBJECT)); pongSchema.setProperties(Map.of("pongField", ComponentSchema.of(SchemaReference.toSchema("PingSchema")))); SchemaObject stringSchema = new SchemaObject(); - stringSchema.setType(SchemaType.STRING); + stringSchema.setType(Set.of(SchemaType.STRING)); Map definitions = Map.of( "StringRef", diff --git a/springwolf-asyncapi/src/main/java/io/github/springwolf/asyncapi/v3/model/components/ComponentSchema.java b/springwolf-asyncapi/src/main/java/io/github/springwolf/asyncapi/v3/model/components/ComponentSchema.java index 84499c17d..3e3b34c78 100644 --- a/springwolf-asyncapi/src/main/java/io/github/springwolf/asyncapi/v3/model/components/ComponentSchema.java +++ b/springwolf-asyncapi/src/main/java/io/github/springwolf/asyncapi/v3/model/components/ComponentSchema.java @@ -12,7 +12,7 @@ import lombok.ToString; /** - * Container class representing a schema in the 'components' block of an AsnycApi document. Contains either + * Container class representing a schema in the 'components' block of an AsyncAPI document. Contains either *
    *
  • a {@link SchemaObject} instance, which represents an schema formatted with the default asyncapi schema format
  • *
  • a {@link SchemaReference}} instance, pointing to an other schema
  • diff --git a/springwolf-asyncapi/src/main/java/io/github/springwolf/asyncapi/v3/model/schema/SchemaObject.java b/springwolf-asyncapi/src/main/java/io/github/springwolf/asyncapi/v3/model/schema/SchemaObject.java index 8e8caff8a..d1d6c7d2c 100644 --- a/springwolf-asyncapi/src/main/java/io/github/springwolf/asyncapi/v3/model/schema/SchemaObject.java +++ b/springwolf-asyncapi/src/main/java/io/github/springwolf/asyncapi/v3/model/schema/SchemaObject.java @@ -142,30 +142,4 @@ public class SchemaObject extends ExtendableObject implements Schema { @JsonProperty(value = "maxItems") private Integer maxItems; - - public void setType(String type) { - // maintainer note: review with OpenAPI 3.1 - this.type = Set.of(type); - } - - public void setTypes(Set types) { - // maintainer note: review with OpenAPI 3.1 - this.type = types; - } - - public static class SchemaObjectBuilder { - // maintainer note: remove custom builder in next major release and use Lomboks provided version - - public SchemaObjectBuilder type(Set type) { - this.type = type; - return this; - } - - public SchemaObjectBuilder type(String type) { - if (type != null) { - this.type = Set.of(type); - } - return this; - } - } } diff --git a/springwolf-asyncapi/src/test/java/io/github/springwolf/asyncapi/v3/bindings/kafka/KafkaBindingTest.java b/springwolf-asyncapi/src/test/java/io/github/springwolf/asyncapi/v3/bindings/kafka/KafkaBindingTest.java index 9ef06253e..e43de6da7 100644 --- a/springwolf-asyncapi/src/test/java/io/github/springwolf/asyncapi/v3/bindings/kafka/KafkaBindingTest.java +++ b/springwolf-asyncapi/src/test/java/io/github/springwolf/asyncapi/v3/bindings/kafka/KafkaBindingTest.java @@ -15,6 +15,7 @@ import java.util.List; import java.util.Map; +import java.util.Set; import static net.javacrumbs.jsonunit.assertj.JsonAssertions.assertThatJson; @@ -52,11 +53,11 @@ void shouldSerializeKafkaOperationBinding() throws Exception { "kafka", KafkaOperationBinding.builder() .groupId(SchemaObject.builder() - .type(SchemaType.STRING) + .type(Set.of(SchemaType.STRING)) .enumValues(List.of("myGroupId")) .build()) .clientId(SchemaObject.builder() - .type(SchemaType.STRING) + .type(Set.of(SchemaType.STRING)) .enumValues(List.of("myClientId")) .build()) .build())) @@ -140,7 +141,7 @@ void shouldSerializeKafkaMessage() throws Exception { KafkaMessageBinding.builder() .key( SchemaObject.builder() - .type(SchemaType.STRING) + .type(Set.of(SchemaType.STRING)) .enumValues(List.of("myKey")) .build()) .schemaIdLocation("payload") diff --git a/springwolf-asyncapi/src/test/java/io/github/springwolf/asyncapi/v3/bindings/mqtt/MQTTBindingTest.java b/springwolf-asyncapi/src/test/java/io/github/springwolf/asyncapi/v3/bindings/mqtt/MQTTBindingTest.java index cec9c9987..ff7f05f99 100644 --- a/springwolf-asyncapi/src/test/java/io/github/springwolf/asyncapi/v3/bindings/mqtt/MQTTBindingTest.java +++ b/springwolf-asyncapi/src/test/java/io/github/springwolf/asyncapi/v3/bindings/mqtt/MQTTBindingTest.java @@ -11,6 +11,7 @@ import java.math.BigDecimal; import java.util.Map; +import java.util.Set; import static net.javacrumbs.jsonunit.assertj.JsonAssertions.assertThatJson; @@ -58,12 +59,12 @@ void shouldSerializeMQTTServerExample2() throws Exception { "mqtt", MQTTServerBinding.builder() .sessionExpiryInterval(SchemaObject.builder() - .type(SchemaType.INTEGER) + .type(Set.of(SchemaType.INTEGER)) .minimum(new BigDecimal("30")) .maximum(new BigDecimal("1200")) .build()) .maximumPacketSize(SchemaObject.builder() - .type(SchemaType.INTEGER) + .type(Set.of(SchemaType.INTEGER)) .minimum(new BigDecimal("256")) .build()) .build())) diff --git a/springwolf-asyncapi/src/test/java/io/github/springwolf/asyncapi/v3/jackson/DefaultAsyncApiSerializerServiceIntegrationTest.java b/springwolf-asyncapi/src/test/java/io/github/springwolf/asyncapi/v3/jackson/DefaultAsyncApiSerializerServiceIntegrationTest.java index 8d0a62b41..bb997cea6 100644 --- a/springwolf-asyncapi/src/test/java/io/github/springwolf/asyncapi/v3/jackson/DefaultAsyncApiSerializerServiceIntegrationTest.java +++ b/springwolf-asyncapi/src/test/java/io/github/springwolf/asyncapi/v3/jackson/DefaultAsyncApiSerializerServiceIntegrationTest.java @@ -37,6 +37,7 @@ import java.nio.charset.StandardCharsets; import java.util.List; import java.util.Map; +import java.util.Set; import java.util.stream.Stream; import static net.javacrumbs.jsonunit.assertj.JsonAssertions.assertThatJson; @@ -80,7 +81,7 @@ private AsyncAPI getAsyncAPITestObject(SchemaFormat schemaFormat) { KafkaMessageBinding.builder() // FIXME: We should have a SchemaString (Schema) .key(SchemaObject.builder() - .type(SchemaType.STRING) + .type(Set.of(SchemaType.STRING)) .build()) .build())) .build(); @@ -88,7 +89,7 @@ private AsyncAPI getAsyncAPITestObject(SchemaFormat schemaFormat) { SchemaObject groupId = new SchemaObject(); groupId.setEnumValues(List.of("myGroupId")); - groupId.setType(SchemaType.STRING); + groupId.setType(Set.of(SchemaType.STRING)); OperationBinding operationBinding = KafkaOperationBinding.builder().groupId(groupId).build(); @@ -126,9 +127,9 @@ private Map createPayloadSchema(SchemaFormat schemaForm switch (schemaFormat) { case DEFAULT: { SchemaObject examplePayloadSchema = new SchemaObject(); - examplePayloadSchema.setType(SchemaType.OBJECT); + examplePayloadSchema.setType(Set.of(SchemaType.OBJECT)); SchemaObject stringSchema = new SchemaObject(); - stringSchema.setType(SchemaType.STRING); + stringSchema.setType(Set.of(SchemaType.STRING)); examplePayloadSchema.setProperties(Map.of("s", stringSchema)); return Map.of("ExamplePayload", ComponentSchema.of(examplePayloadSchema)); } diff --git a/springwolf-asyncapi/src/test/java/io/github/springwolf/asyncapi/v3/model/AsyncAPITest.java b/springwolf-asyncapi/src/test/java/io/github/springwolf/asyncapi/v3/model/AsyncAPITest.java index de50a3d0c..8d6dd777c 100644 --- a/springwolf-asyncapi/src/test/java/io/github/springwolf/asyncapi/v3/model/AsyncAPITest.java +++ b/springwolf-asyncapi/src/test/java/io/github/springwolf/asyncapi/v3/model/AsyncAPITest.java @@ -30,6 +30,7 @@ import java.math.BigDecimal; import java.util.List; import java.util.Map; +import java.util.Set; import static net.javacrumbs.jsonunit.assertj.JsonAssertions.assertThatJson; @@ -41,16 +42,16 @@ void shouldCreateSimpleAsyncAPI() throws Exception { var userSignUpMessage = MessageObject.builder() .messageId("UserSignedUp") .payload(MessagePayload.of(SchemaObject.builder() - .type(SchemaType.OBJECT) + .type(Set.of(SchemaType.OBJECT)) .properties(Map.of( "displayName", SchemaObject.builder() - .type(SchemaType.STRING) + .type(Set.of(SchemaType.STRING)) .description("Name of the user") .build(), "email", SchemaObject.builder() - .type(SchemaType.STRING) + .type(Set.of(SchemaType.STRING)) .format("email") .description("Email of the user") .build())) @@ -285,11 +286,11 @@ void shouldCreateStreetlightsKafkaAsyncAPI() throws Exception { .schemas(Map.of( "lightMeasuredPayload", ComponentSchema.of(SchemaObject.builder() - .type(SchemaType.OBJECT) + .type(Set.of(SchemaType.OBJECT)) .properties(Map.of( "lumens", SchemaObject.builder() - .type(SchemaType.INTEGER) + .type(Set.of(SchemaType.INTEGER)) .minimum(BigDecimal.ZERO) .description("Light intensity measured in lumens.") .build(), @@ -298,11 +299,11 @@ void shouldCreateStreetlightsKafkaAsyncAPI() throws Exception { .build()), "turnOnOffPayload", ComponentSchema.of(SchemaObject.builder() - .type(SchemaType.OBJECT) + .type(Set.of(SchemaType.OBJECT)) .properties(Map.of( "command", SchemaObject.builder() - .type(SchemaType.STRING) + .type(Set.of(SchemaType.STRING)) .enumValues(List.of("on", "off")) .description("Whether to turn on or off the light.") .build(), @@ -311,11 +312,11 @@ void shouldCreateStreetlightsKafkaAsyncAPI() throws Exception { .build()), "dimLightPayload", ComponentSchema.of(SchemaObject.builder() - .type(SchemaType.OBJECT) + .type(Set.of(SchemaType.OBJECT)) .properties(Map.of( "percentage", SchemaObject.builder() - .type(SchemaType.INTEGER) + .type(Set.of(SchemaType.INTEGER)) .description( "Percentage to which the light should be dimmed to.") .minimum(BigDecimal.ZERO) @@ -326,7 +327,7 @@ void shouldCreateStreetlightsKafkaAsyncAPI() throws Exception { .build()), "sentAt", ComponentSchema.of(SchemaObject.builder() - .type(SchemaType.STRING) + .type(Set.of(SchemaType.STRING)) .format("date-time") .description("Date and time when the message was sent.") .build()))) @@ -350,11 +351,11 @@ void shouldCreateStreetlightsKafkaAsyncAPI() throws Exception { "commonHeaders", MessageTrait.builder() .headers(MessageHeaders.of(SchemaObject.builder() - .type(SchemaType.OBJECT) + .type(Set.of(SchemaType.OBJECT)) .properties(Map.of( "my-app-header", SchemaObject.builder() - .type(SchemaType.INTEGER) + .type(Set.of(SchemaType.INTEGER)) .minimum(BigDecimal.ZERO) .maximum(new BigDecimal("100")) .build())) @@ -367,7 +368,7 @@ void shouldCreateStreetlightsKafkaAsyncAPI() throws Exception { "kafka", KafkaOperationBinding.builder() .clientId(SchemaObject.builder() - .type(SchemaType.STRING) + .type(Set.of(SchemaType.STRING)) .enumValues(List.of("my-app-id")) .build()) .build())) diff --git a/springwolf-asyncapi/src/test/java/io/github/springwolf/asyncapi/v3/model/channel/MessageTest.java b/springwolf-asyncapi/src/test/java/io/github/springwolf/asyncapi/v3/model/channel/MessageTest.java index 90c26aed5..acc0007f8 100644 --- a/springwolf-asyncapi/src/test/java/io/github/springwolf/asyncapi/v3/model/channel/MessageTest.java +++ b/springwolf-asyncapi/src/test/java/io/github/springwolf/asyncapi/v3/model/channel/MessageTest.java @@ -16,6 +16,7 @@ import java.util.List; import java.util.Map; +import java.util.Set; import static net.javacrumbs.jsonunit.assertj.JsonAssertions.assertThatJson; @@ -35,22 +36,22 @@ void shouldSerializeMessage() throws Exception { Tag.builder().name("signup").build(), Tag.builder().name("register").build())) .headers(MessageHeaders.of(SchemaObject.builder() - .type(SchemaType.OBJECT) + .type(Set.of(SchemaType.OBJECT)) .properties(Map.of( "correlationId", SchemaObject.builder() .description("Correlation ID set by application") - .type(SchemaType.STRING) + .type(Set.of(SchemaType.STRING)) .build(), "applicationInstanceId", SchemaObject.builder() .description( "Unique identifier for a given instance of the publishing application") - .type(SchemaType.STRING) + .type(Set.of(SchemaType.STRING)) .build())) .build())) .payload(MessagePayload.of(SchemaObject.builder() - .type(SchemaType.OBJECT) + .type(Set.of(SchemaType.OBJECT)) .properties(Map.of( "user", SchemaReference.toSchema("userCreate"), "signup", SchemaReference.toSchema("signup"))) diff --git a/springwolf-asyncapi/src/test/java/io/github/springwolf/asyncapi/v3/model/schema/SchemaTest.java b/springwolf-asyncapi/src/test/java/io/github/springwolf/asyncapi/v3/model/schema/SchemaTest.java index 7f71bc45f..347bc3e29 100644 --- a/springwolf-asyncapi/src/test/java/io/github/springwolf/asyncapi/v3/model/schema/SchemaTest.java +++ b/springwolf-asyncapi/src/test/java/io/github/springwolf/asyncapi/v3/model/schema/SchemaTest.java @@ -8,6 +8,7 @@ import java.math.BigDecimal; import java.util.List; import java.util.Map; +import java.util.Set; import static net.javacrumbs.jsonunit.assertj.JsonAssertions.assertThatJson; @@ -16,8 +17,10 @@ class SchemaTest { @Test void shouldSerializePrimitiveSample() throws Exception { - var schema = - SchemaObject.builder().type(SchemaType.STRING).format("email").build(); + var schema = SchemaObject.builder() + .type(Set.of(SchemaType.STRING)) + .format("email") + .build(); String example = """ @@ -32,14 +35,17 @@ void shouldSerializePrimitiveSample() throws Exception { @Test void shouldSerializeSimpleModel() throws Exception { var schema = SchemaObject.builder() - .type(SchemaType.OBJECT) + .type(Set.of(SchemaType.OBJECT)) .required(List.of("name")) .properties(Map.of( - "name", SchemaObject.builder().type(SchemaType.STRING).build(), + "name", + SchemaObject.builder() + .type(Set.of(SchemaType.STRING)) + .build(), "address", SchemaReference.toSchema("Address"), "age", SchemaObject.builder() - .type(SchemaType.INTEGER) + .type(Set.of(SchemaType.INTEGER)) .format("int32") .minimum(BigDecimal.ZERO) .build())) @@ -73,9 +79,9 @@ void shouldSerializeSimpleModel() throws Exception { @Test void shouldSerializeStringToStringMapping() throws Exception { var schema = SchemaObject.builder() - .type(SchemaType.OBJECT) + .type(Set.of(SchemaType.OBJECT)) .additionalProperties(ComponentSchema.of( - SchemaObject.builder().type(SchemaType.STRING).build())) + SchemaObject.builder().type(Set.of(SchemaType.STRING)).build())) .build(); var example = @@ -93,7 +99,7 @@ void shouldSerializeStringToStringMapping() throws Exception { @Test void shouldSerializeModelMapping() throws Exception { var schema = SchemaObject.builder() - .type(SchemaType.OBJECT) + .type(Set.of(SchemaType.OBJECT)) .additionalProperties(ComponentSchema.of(SchemaReference.toSchema("ComplexModel"))) .build(); @@ -112,14 +118,17 @@ void shouldSerializeModelMapping() throws Exception { @Test void shouldSerializeModelWithExample() throws Exception { var schema = SchemaObject.builder() - .type(SchemaType.OBJECT) + .type(Set.of(SchemaType.OBJECT)) .properties(Map.of( "id", SchemaObject.builder() - .type(SchemaType.INTEGER) + .type(Set.of(SchemaType.INTEGER)) .format("int64") .build(), - "name", SchemaObject.builder().type(SchemaType.STRING).build())) + "name", + SchemaObject.builder() + .type(Set.of(SchemaType.STRING)) + .build())) .required(List.of("name")) .examples(List.of(Map.of("name", "Puma", "id", 1))) .build(); @@ -154,7 +163,7 @@ void shouldSerializeModelWithExample() throws Exception { @Test void shouldSerializeModelWithBooleans() throws Exception { var schema = SchemaObject.builder() - .type(SchemaType.OBJECT) + .type(Set.of(SchemaType.OBJECT)) .properties(Map.of( "anySchema", true, "cannotBeDefined", false)) @@ -184,16 +193,16 @@ void shouldSerializeModelsWithComposition() throws Exception { Map.of( "ErrorModel", SchemaObject.builder() - .type(SchemaType.OBJECT) + .type(Set.of(SchemaType.OBJECT)) .required(List.of("message", "code")) .properties(Map.of( "message", SchemaObject.builder() - .type(SchemaType.STRING) + .type(Set.of(SchemaType.STRING)) .build(), "code", SchemaObject.builder() - .type(SchemaType.INTEGER) + .type(Set.of(SchemaType.INTEGER)) .minimum(new BigDecimal("100")) .maximum(new BigDecimal("600")) .build())) @@ -203,12 +212,12 @@ void shouldSerializeModelsWithComposition() throws Exception { .allOf(List.of( ComponentSchema.of(SchemaReference.toSchema("ErrorModel")), ComponentSchema.of(SchemaObject.builder() - .type(SchemaType.OBJECT) + .type(Set.of(SchemaType.OBJECT)) .required(List.of("rootCause")) .properties(Map.of( "rootCause", SchemaObject.builder() - .type(SchemaType.STRING) + .type(Set.of(SchemaType.STRING)) .build())) .build()))) .build())); @@ -265,16 +274,16 @@ void shouldSerializeModelsWithPolimorphismSupport() throws Exception { Map.of( "Pet", SchemaObject.builder() - .type(SchemaType.OBJECT) + .type(Set.of(SchemaType.OBJECT)) .discriminator("petType") .properties(Map.of( "name", SchemaObject.builder() - .type(SchemaType.STRING) + .type(Set.of(SchemaType.STRING)) .build(), "petType", SchemaObject.builder() - .type(SchemaType.STRING) + .type(Set.of(SchemaType.STRING)) .build())) .required(List.of("name", "petType")) .build(), @@ -285,11 +294,11 @@ void shouldSerializeModelsWithPolimorphismSupport() throws Exception { .allOf(List.of( ComponentSchema.of(SchemaReference.toSchema("Pet")), ComponentSchema.of(SchemaObject.builder() - .type(SchemaType.OBJECT) + .type(Set.of(SchemaType.OBJECT)) .properties(Map.of( "huntingSkill", SchemaObject.builder() - .type(SchemaType.STRING) + .type(Set.of(SchemaType.STRING)) .description("The measured skill for hunting") .enumValues( List.of( @@ -308,11 +317,11 @@ void shouldSerializeModelsWithPolimorphismSupport() throws Exception { .allOf(List.of( ComponentSchema.of(SchemaReference.toSchema("Pet")), ComponentSchema.of(SchemaObject.builder() - .type(SchemaType.OBJECT) + .type(Set.of(SchemaType.OBJECT)) .properties(Map.of( "packSize", SchemaObject.builder() - .type(SchemaType.INTEGER) + .type(Set.of(SchemaType.INTEGER)) .format("int32") .description("the size of the pack the dog is from") .minimum(BigDecimal.ZERO) @@ -327,7 +336,7 @@ void shouldSerializeModelsWithPolimorphismSupport() throws Exception { .allOf(List.of( ComponentSchema.of(SchemaReference.toSchema("Pet")), ComponentSchema.of(SchemaObject.builder() - .type(SchemaType.OBJECT) + .type(Set.of(SchemaType.OBJECT)) .properties(Map.of( "petType", SchemaObject.builder() @@ -335,7 +344,7 @@ void shouldSerializeModelsWithPolimorphismSupport() throws Exception { .build(), "color", SchemaObject.builder() - .type(SchemaType.STRING) + .type(Set.of(SchemaType.STRING)) .build())) .required(List.of("color")) .build()))) diff --git a/springwolf-bindings/springwolf-kafka-binding/src/main/java/io/github/springwolf/bindings/kafka/scanners/messages/KafkaMessageBindingProcessor.java b/springwolf-bindings/springwolf-kafka-binding/src/main/java/io/github/springwolf/bindings/kafka/scanners/messages/KafkaMessageBindingProcessor.java index 9121e9ca0..a075eeff3 100644 --- a/springwolf-bindings/springwolf-kafka-binding/src/main/java/io/github/springwolf/bindings/kafka/scanners/messages/KafkaMessageBindingProcessor.java +++ b/springwolf-bindings/springwolf-kafka-binding/src/main/java/io/github/springwolf/bindings/kafka/scanners/messages/KafkaMessageBindingProcessor.java @@ -16,6 +16,7 @@ import java.util.Arrays; import java.util.List; import java.util.Optional; +import java.util.Set; @RequiredArgsConstructor public class KafkaMessageBindingProcessor implements MessageBindingProcessor { @@ -56,7 +57,7 @@ private Schema resolveSchemaOrNull(KafkaAsyncOperationBinding.KafkaAsyncMessageB break; case STRING_KEY: schemaDefinition = SchemaObject.builder() - .type(SchemaType.STRING) + .type(Set.of(SchemaType.STRING)) .examples(List.of(messageBinding.key().example())) .description(resolveOrNull(messageBinding.key().description())) .build(); diff --git a/springwolf-bindings/springwolf-kafka-binding/src/main/java/io/github/springwolf/bindings/kafka/scanners/operations/KafkaOperationBindingProcessor.java b/springwolf-bindings/springwolf-kafka-binding/src/main/java/io/github/springwolf/bindings/kafka/scanners/operations/KafkaOperationBindingProcessor.java index 0b92a62a7..9f8ae07f0 100644 --- a/springwolf-bindings/springwolf-kafka-binding/src/main/java/io/github/springwolf/bindings/kafka/scanners/operations/KafkaOperationBindingProcessor.java +++ b/springwolf-bindings/springwolf-kafka-binding/src/main/java/io/github/springwolf/bindings/kafka/scanners/operations/KafkaOperationBindingProcessor.java @@ -12,6 +12,7 @@ import org.springframework.util.StringValueResolver; import java.util.List; +import java.util.Set; public class KafkaOperationBindingProcessor extends AbstractOperationBindingProcessor { @@ -42,7 +43,7 @@ private static SchemaObject createStringSchema(String value) { if (value != null && !value.isEmpty()) { SchemaObject schema = new SchemaObject(); schema.setEnumValues(List.of(value)); - schema.setType(SchemaType.STRING); + schema.setType(Set.of(SchemaType.STRING)); return schema; } return null; diff --git a/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/AsyncApiService.java b/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/AsyncApiService.java index a8e071cc4..23e9c72ef 100644 --- a/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/AsyncApiService.java +++ b/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/AsyncApiService.java @@ -9,12 +9,5 @@ public interface AsyncApiService { AsyncAPI getAsyncAPI(); - /** - * Default implementation was added to avoid breaking (compiler) change. - *

    - * Maintainer note: remove default implementation - */ - default Optional getForGroupName(String groupName) { - return Optional.ofNullable(getAsyncAPI()); - } + Optional getForGroupName(String groupName); } diff --git a/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/grouping/GroupingService.java b/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/grouping/GroupingService.java index c3d686d70..678be679b 100644 --- a/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/grouping/GroupingService.java +++ b/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/grouping/GroupingService.java @@ -210,8 +210,8 @@ private void markSchemas(AsyncAPI fullAsyncApi, MarkingContext markingContext, S */ private static Set findUnmarkedNestedSchemas( MarkingContext markingContext, ComponentSchema componentSchema) { - // ComponentSchema can contain an AsyncApi SchemaObject instance or an MultiformatSchema, which in turn contains - // a schema. + // ComponentSchema can contain an AsyncAPI SchemaObject instance or an MultiformatSchema, which in turn contains + // an schema. if (componentSchema.getSchema() != null) { return findUnmarkedNestedSchemasForAsyncAPISchema(markingContext, componentSchema.getSchema()); } diff --git a/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/scanners/common/annotation/AsyncAnnotationUtil.java b/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/scanners/common/annotation/AsyncAnnotationUtil.java index ae3b93fe1..3932002e5 100644 --- a/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/scanners/common/annotation/AsyncAnnotationUtil.java +++ b/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/scanners/common/annotation/AsyncAnnotationUtil.java @@ -29,6 +29,7 @@ import java.util.List; import java.util.Map; import java.util.Optional; +import java.util.Set; import java.util.stream.Collectors; import static io.github.springwolf.core.asyncapi.scanners.common.headers.HeaderSchemaObjectMerger.generateHeaderSchemaName; @@ -54,7 +55,7 @@ public static SchemaObject getAsyncHeaders(AsyncOperation op, StringValueResolve : null; SchemaObject headerSchema = new SchemaObject(); - headerSchema.setType(SchemaType.OBJECT); + headerSchema.setType(Set.of(SchemaType.OBJECT)); headerSchema.setTitle(headerSchemaTitle); headerSchema.setDescription(headerDescription); headerSchema.setProperties(new HashMap<>()); @@ -65,7 +66,7 @@ public static SchemaObject getAsyncHeaders(AsyncOperation op, StringValueResolve String propertyName = stringValueResolver.resolveStringValue(headerName); SchemaObject property = new SchemaObject(); - property.setType(SchemaType.STRING); + property.setType(Set.of(SchemaType.STRING)); property.setTitle(propertyName); property.setDescription(getDescription(headersValues, stringValueResolver)); diff --git a/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/scanners/common/headers/AsyncHeadersNotDocumented.java b/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/scanners/common/headers/AsyncHeadersNotDocumented.java index 66b05b280..7b5c717e0 100644 --- a/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/scanners/common/headers/AsyncHeadersNotDocumented.java +++ b/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/scanners/common/headers/AsyncHeadersNotDocumented.java @@ -6,6 +6,7 @@ import io.github.springwolf.core.asyncapi.scanners.common.payload.PayloadSchemaObject; import java.util.Map; +import java.util.Set; public class AsyncHeadersNotDocumented implements AsyncHeadersBuilder { /** @@ -13,7 +14,7 @@ public class AsyncHeadersNotDocumented implements AsyncHeadersBuilder { * There can be headers, but don't have to be. */ public static final SchemaObject NOT_DOCUMENTED = SchemaObject.builder() - .type(SchemaType.OBJECT) + .type(Set.of(SchemaType.OBJECT)) .title("HeadersNotDocumented") .description("There can be headers, but they are not explicitly documented.") .properties(Map.of()) diff --git a/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/scanners/common/headers/AsyncHeadersNotUsed.java b/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/scanners/common/headers/AsyncHeadersNotUsed.java index 448a07162..0a6902ea9 100644 --- a/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/scanners/common/headers/AsyncHeadersNotUsed.java +++ b/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/scanners/common/headers/AsyncHeadersNotUsed.java @@ -6,13 +6,14 @@ import io.github.springwolf.core.asyncapi.scanners.common.payload.PayloadSchemaObject; import java.util.Map; +import java.util.Set; public class AsyncHeadersNotUsed implements AsyncHeadersBuilder { /** * Explicitly document that no headers are used. */ public static final SchemaObject NOT_USED = SchemaObject.builder() - .type(SchemaType.OBJECT) + .type(Set.of(SchemaType.OBJECT)) .title("HeadersNotUsed") .description("No headers are present.") .properties(Map.of()) diff --git a/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/scanners/common/headers/HeaderClassExtractor.java b/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/scanners/common/headers/HeaderClassExtractor.java index c3e2444dc..037c41db8 100644 --- a/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/scanners/common/headers/HeaderClassExtractor.java +++ b/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/scanners/common/headers/HeaderClassExtractor.java @@ -13,6 +13,7 @@ import java.lang.reflect.Method; import java.lang.reflect.Parameter; import java.util.HashMap; +import java.util.Set; @Slf4j @AllArgsConstructor @@ -24,7 +25,7 @@ public SchemaObject extractHeader(Method method, PayloadSchemaObject payload) { log.debug("Extract header for {}", methodName); SchemaObject headers = SchemaObject.builder() - .type(SchemaType.OBJECT) + .type(Set.of(SchemaType.OBJECT)) .title(payload.name() + "Headers") .properties(new HashMap<>()) .build(); diff --git a/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/scanners/common/headers/HeaderSchemaObjectMerger.java b/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/scanners/common/headers/HeaderSchemaObjectMerger.java index 4ebf188aa..538fd7f20 100644 --- a/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/scanners/common/headers/HeaderSchemaObjectMerger.java +++ b/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/scanners/common/headers/HeaderSchemaObjectMerger.java @@ -8,6 +8,7 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; +import java.util.Set; public class HeaderSchemaObjectMerger { @@ -22,7 +23,7 @@ public static SchemaObject merge(SchemaObject initial, SchemaObject... schemas) } SchemaObject.SchemaObjectBuilder headerSchemaBuilder = - SchemaObject.builder().type(SchemaType.OBJECT); + SchemaObject.builder().type(Set.of(SchemaType.OBJECT)); String description = initial.getDescription(); Map headerProperties = new HashMap<>(initial.getProperties()); diff --git a/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/scanners/common/payload/internal/PayloadService.java b/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/scanners/common/payload/internal/PayloadService.java index 21cb3efd6..c18c2ff27 100644 --- a/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/scanners/common/payload/internal/PayloadService.java +++ b/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/scanners/common/payload/internal/PayloadService.java @@ -12,6 +12,7 @@ import java.lang.reflect.Type; import java.util.Map; +import java.util.Set; @Slf4j @RequiredArgsConstructor @@ -24,7 +25,7 @@ public class PayloadService { PAYLOAD_NOT_USED_KEY, PAYLOAD_NOT_USED_KEY, ComponentSchema.of(SchemaObject.builder() - .type(SchemaType.OBJECT) + .type(Set.of(SchemaType.OBJECT)) .title(PAYLOAD_NOT_USED_KEY) .description("No payload specified") .properties(Map.of()) diff --git a/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/schemas/SwaggerSchemaMapper.java b/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/schemas/SwaggerSchemaMapper.java index bfbb93168..2d6711883 100644 --- a/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/schemas/SwaggerSchemaMapper.java +++ b/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/schemas/SwaggerSchemaMapper.java @@ -37,7 +37,7 @@ public Map mapSchemasMap(Map schemaMap) /** * creates a {@link ComponentSchema} from the given Swagger schema. If the given Swagger schema represents a * Reference, the resulting {@link ComponentSchema} will contain a corresponding {@link SchemaReference} to the - * referenced location. Otherwise, the given Swagger schema is converted to an AsnycApi {@link SchemaObject} and + * referenced location. Otherwise, the given Swagger schema is converted to an AsyncAPI {@link SchemaObject} and * put into the resulting {@link ComponentSchema} * * @param swaggerSchema the Swagger schema to convert @@ -60,7 +60,7 @@ public ComponentSchema mapSchemaOrRef(Schema swaggerSchema) { * * @param * @param swaggerSchema the given Swagger schema instance - * @return the resulting AsnycApi SchemaObject + * @return the resulting AsyncAPI SchemaObject */ public ComponentSchema mapSchema(Schema swaggerSchema) { PayloadSchemaFormat payloadSchemaFormat = @@ -197,12 +197,13 @@ private SchemaObject mapSwaggerSchemaToAsyncApiSchema(Schema swaggerSchema) { } private static void assignType(Schema swaggerSchema, SchemaObject.SchemaObjectBuilder builder, boolean isNullable) { - Set types = - swaggerSchema.getTypes() == null ? new HashSet<>() : new HashSet(swaggerSchema.getTypes()); - if (!types.contains(swaggerSchema.getType())) { - // contradicting types; prefer type for backward compatibility - // maintainer note: remove condition in next major release - builder.type(swaggerSchema.getType()); + Set schemaTypes = swaggerSchema.getTypes(); + Set types = schemaTypes == null ? new HashSet<>() : new HashSet<>(schemaTypes); + + String schemaType = swaggerSchema.getType(); + if (!types.contains(schemaType)) { + // required while swagger v2 does not populate types + builder.type(Set.of(schemaType)); return; } @@ -238,7 +239,7 @@ private Object unwrapSchema(Object schema) { } /** - * tries to transform the given schema object to a Swagger Schema. 'schema' may be an asnycapi {@link SchemaObject} + * tries to transform the given schema object to a Swagger Schema. 'schema' may be an AsyncAPI {@link SchemaObject} * or an {@link ComponentSchema} object. If schema is a {@link ComponentSchema} it may contain: *

      *
    • a {@link SchemaObject} which is handled the same way a directly provided {@link SchemaObject} is handled
    • diff --git a/springwolf-core/src/main/java/io/github/springwolf/core/configuration/properties/SpringwolfConfigProperties.java b/springwolf-core/src/main/java/io/github/springwolf/core/configuration/properties/SpringwolfConfigProperties.java index d995a4dc2..03d77d915 100644 --- a/springwolf-core/src/main/java/io/github/springwolf/core/configuration/properties/SpringwolfConfigProperties.java +++ b/springwolf-core/src/main/java/io/github/springwolf/core/configuration/properties/SpringwolfConfigProperties.java @@ -67,9 +67,6 @@ public enum InitMode { */ private boolean studioCompatibility = true; - @Deprecated(forRemoval = true) - private Paths paths = new Paths(); - private Path path = new Path(); @Nullable @@ -90,18 +87,6 @@ public enum InitMode { @Nullable private Payload payload = new Payload(); - @Getter - @Setter - public static class Paths { - - /** - * Deprecated in favor of springwolf.path.docs to control - * only the sub path for the docs endpoint - */ - @Deprecated(forRemoval = true) - private String docs = "/springwolf/docs"; - } - @Getter @Setter public static class Path { diff --git a/springwolf-core/src/main/java/io/github/springwolf/core/controller/AsyncApiController.java b/springwolf-core/src/main/java/io/github/springwolf/core/controller/AsyncApiController.java index b54ec6594..8782e07c7 100644 --- a/springwolf-core/src/main/java/io/github/springwolf/core/controller/AsyncApiController.java +++ b/springwolf-core/src/main/java/io/github/springwolf/core/controller/AsyncApiController.java @@ -24,11 +24,7 @@ public class AsyncApiController { @GetMapping( path = { - "${springwolf.paths.docs:/springwolf/docs}", // maintainer note: remove, path.base instead - "${springwolf.paths.docs:/springwolf/docs}.json", // maintainer note: remove, path.base instead "${springwolf.path.base:/springwolf}${springwolf.path.docs:/docs}", - "${springwolf.path.base:/springwolf}${springwolf.path.docs:/docs}.json", // maintainer note: remove, use - // accept header instead "${springwolf.path.base:/springwolf}${springwolf.path.docs:/docs}/{group}" }, produces = MediaType.APPLICATION_JSON_VALUE) @@ -38,11 +34,7 @@ public String asyncApiJson(@PathVariable(required = false) Optional grou @GetMapping( path = { - "${springwolf.paths.docs:/springwolf/docs}", // maintainer note: remove, path.base instead - "${springwolf.paths.docs:/springwolf/docs}.yaml", // maintainer note: remove, path.base instead "${springwolf.path.base:/springwolf}${springwolf.path.docs:/docs}", - "${springwolf.path.base:/springwolf}${springwolf.path.docs:/docs}.yaml", // maintainer note: remove, use - // accept header instead "${springwolf.path.base:/springwolf}${springwolf.path.docs:/docs}/{group}", }, produces = "application/yaml") diff --git a/springwolf-core/src/test/java/io/github/springwolf/core/asyncapi/components/DefaultComponentsServiceIntegrationTest.java b/springwolf-core/src/test/java/io/github/springwolf/core/asyncapi/components/DefaultComponentsServiceIntegrationTest.java index b6934d163..ea534f282 100644 --- a/springwolf-core/src/test/java/io/github/springwolf/core/asyncapi/components/DefaultComponentsServiceIntegrationTest.java +++ b/springwolf-core/src/test/java/io/github/springwolf/core/asyncapi/components/DefaultComponentsServiceIntegrationTest.java @@ -21,6 +21,7 @@ import java.math.BigDecimal; import java.util.List; import java.util.Map; +import java.util.Set; import static org.assertj.core.api.Assertions.assertThat; @@ -53,11 +54,11 @@ void getStringSchemas() { assertThat(componentSchema.getSchema()) .isEqualTo(SchemaObject.builder() .title("title") - .type(SchemaType.OBJECT) + .type(Set.of(SchemaType.OBJECT)) .properties(Map.of( "s", ComponentSchema.of(SchemaObject.builder() - .type(SchemaType.STRING) + .type(Set.of(SchemaType.STRING)) .minLength(1) .maxLength(10) .examples(List.of("\"example\"")) @@ -81,13 +82,13 @@ void getArraySchemas() { assertThat(componentSchema.getSchema()) .isEqualTo(SchemaObject.builder() .title("title") - .type(SchemaType.OBJECT) + .type(Set.of(SchemaType.OBJECT)) .properties(Map.of( "array", ComponentSchema.of(SchemaObject.builder() - .type(SchemaType.ARRAY) + .type(Set.of(SchemaType.ARRAY)) .items(ComponentSchema.of(SchemaObject.builder() - .type(SchemaType.STRING) + .type(Set.of(SchemaType.STRING)) .description("items description") .build())) .maxItems(10) @@ -109,22 +110,22 @@ void getRefSchemas() { assertThat(componentSchema.getSchema()) .isEqualTo(SchemaObject.builder() .title("title") - .type(SchemaType.OBJECT) + .type(Set.of(SchemaType.OBJECT)) .properties(Map.of( "ref", ComponentSchema.of(SchemaObject.builder() - .type(SchemaType.OBJECT) + .type(Set.of(SchemaType.OBJECT)) .not(ComponentSchema.of(SchemaObject.builder() - .type(SchemaType.OBJECT) + .type(Set.of(SchemaType.OBJECT)) .build())) .oneOf(List.of(ComponentSchema.of(SchemaObject.builder() - .type(SchemaType.STRING) + .type(Set.of(SchemaType.STRING)) .build()))) .anyOf(List.of(ComponentSchema.of(SchemaObject.builder() - .type(SchemaType.STRING) + .type(Set.of(SchemaType.STRING)) .build()))) .allOf(List.of(ComponentSchema.of(SchemaObject.builder() - .type(SchemaType.STRING) + .type(Set.of(SchemaType.STRING)) .build()))) .build()))) .build()); @@ -142,11 +143,11 @@ void getNumberSchemas() { assertThat(componentSchema.getSchema()) .isEqualTo(SchemaObject.builder() .title("title") - .type(SchemaType.OBJECT) + .type(Set.of(SchemaType.OBJECT)) .properties(Map.of( "number", ComponentSchema.of(SchemaObject.builder() - .type(SchemaType.NUMBER) + .type(Set.of(SchemaType.NUMBER)) .format("double") .multipleOf(BigDecimal.ONE) .exclusiveMaximum(BigDecimal.valueOf(5)) @@ -168,7 +169,7 @@ void getNotSupportedSchemas() { assertThat(componentSchema.getSchema()) .isEqualTo(SchemaObject.builder() .title("title") - .type(SchemaType.OBJECT) + .type(Set.of(SchemaType.OBJECT)) .build()); } @@ -262,7 +263,7 @@ void stringEnvelopTest() { schemas.get(StringEnvelop.class.getName().replace("$", ".")); assertThat(componentSchema.getSchema()) .isEqualTo(SchemaObject.builder() - .type(SchemaType.STRING) + .type(Set.of(SchemaType.STRING)) .description("The payload in the envelop") .maxLength(10) .build()); @@ -282,17 +283,17 @@ void illegalEnvelopTest() { .replace("$", ".")); assertThat(componentSchema.getSchema()) .isEqualTo(SchemaObject.builder() - .type(SchemaType.OBJECT) + .type(Set.of(SchemaType.OBJECT)) .title("EnvelopWithMultipleAsyncApiPayloadAnnotations") .properties(Map.of( "otherField", ComponentSchema.of(SchemaObject.builder() - .type(SchemaType.INTEGER) + .type(Set.of(SchemaType.INTEGER)) .format("int32") .build()), "payload", ComponentSchema.of(SchemaObject.builder() - .type(SchemaType.STRING) + .type(Set.of(SchemaType.STRING)) .description("The payload in the envelop") .maxLength(10) .build()))) diff --git a/springwolf-core/src/test/java/io/github/springwolf/core/asyncapi/components/SwaggerSchemaMapperTest.java b/springwolf-core/src/test/java/io/github/springwolf/core/asyncapi/components/SwaggerSchemaMapperTest.java index 771c703bc..8ee532137 100644 --- a/springwolf-core/src/test/java/io/github/springwolf/core/asyncapi/components/SwaggerSchemaMapperTest.java +++ b/springwolf-core/src/test/java/io/github/springwolf/core/asyncapi/components/SwaggerSchemaMapperTest.java @@ -477,7 +477,7 @@ void mapDiscriminator() { ComponentSchema componentSchema = swaggerSchemaMapper.mapSchema(schema); // then - // ensure that componentSchema contains an AsnycApi SchemaObjekt. + // ensure that componentSchema contains an AsyncAPI SchemaObject. assertThat(componentSchema.getSchema()).isNotNull(); assertThat(componentSchema.getSchema().getDiscriminator()).isEqualTo("name"); @@ -495,7 +495,7 @@ void mapAllOf() { ComponentSchema componentSchema = swaggerSchemaMapper.mapSchema(schema); // then - // ensure that componentSchema contains an AsnycApi SchemaObjekt. + // ensure that componentSchema contains an AsyncAPI SchemaObject. assertThat(componentSchema.getSchema()).isNotNull(); assertThat((componentSchema.getSchema().getAllOf().get(0).getSchema()).getType()) @@ -514,7 +514,7 @@ void mapOneOf() { ComponentSchema componentSchema = swaggerSchemaMapper.mapSchema(schema); // then - // ensure that componentSchema contains an AsnycApi SchemaObjekt. + // ensure that componentSchema contains an AsyncAPI SchemaObject. assertThat(componentSchema.getSchema()).isNotNull(); assertThat((componentSchema.getSchema().getOneOf().get(0).getSchema()).getType()) @@ -533,7 +533,7 @@ void mapAnyOf() { ComponentSchema componentSchema = swaggerSchemaMapper.mapSchema(schema); // then - // ensure that componentSchema contains an AsnycApi SchemaObjekt. + // ensure that componentSchema contains an AsyncAPI SchemaObject. assertThat(componentSchema.getSchema()).isNotNull(); assertThat((componentSchema.getSchema().getAnyOf().get(0).getSchema()).getType()) .containsExactly(anyOf.getType()); @@ -549,7 +549,7 @@ void mapConst() { ComponentSchema componentSchema = swaggerSchemaMapper.mapSchema(schema); // then - // ensure that componentSchema contains an AsnycApi SchemaObjekt. + // ensure that componentSchema contains an AsyncAPI SchemaObject. assertThat(componentSchema.getSchema()).isNotNull(); assertThat(componentSchema.getSchema().getConstValue()).isEqualTo(schema.getConst()); } @@ -566,7 +566,7 @@ void mapNot() { ComponentSchema componentSchema = swaggerSchemaMapper.mapSchema(schema); // then - // ensure that componentSchema contains an AsnycApi SchemaObjekt. + // ensure that componentSchema contains an AsyncAPI SchemaObject. assertThat(componentSchema.getSchema()).isNotNull(); assertThat((componentSchema.getSchema().getNot().getSchema()).getType()) .containsExactly(not.getType()); @@ -585,7 +585,7 @@ void mapItems() { ComponentSchema componentSchema = swaggerSchemaMapper.mapSchema(schema); // then - // ensure that componentSchema contains an AsnycApi SchemaObjekt. + // ensure that componentSchema contains an AsyncAPI SchemaObject. assertThat(componentSchema.getSchema()).isNotNull(); assertThat((componentSchema.getSchema().getItems().getSchema()).getType()) .containsExactly(item.getType()); @@ -601,7 +601,7 @@ void mapUniqueItems() { ComponentSchema componentSchema = swaggerSchemaMapper.mapSchema(schema); // then - // ensure that componentSchema contains an AsnycApi SchemaObjekt. + // ensure that componentSchema contains an AsyncAPI SchemaObject. assertThat(componentSchema.getSchema()).isNotNull(); assertThat(componentSchema.getSchema().getUniqueItems()).isEqualTo(schema.getUniqueItems()); } @@ -616,7 +616,7 @@ void mapMinItems() { ComponentSchema componentSchema = swaggerSchemaMapper.mapSchema(schema); // then - // ensure that componentSchema contains an AsnycApi SchemaObjekt. + // ensure that componentSchema contains an AsyncAPI SchemaObject. assertThat(componentSchema.getSchema()).isNotNull(); assertThat(componentSchema.getSchema().getMinItems()).isEqualTo(schema.getMinItems()); } @@ -631,7 +631,7 @@ void mapMaxItems() { ComponentSchema componentSchema = swaggerSchemaMapper.mapSchema(schema); // then - // ensure that componentSchema contains an AsnycApi SchemaObjekt. + // ensure that componentSchema contains an AsyncAPI SchemaObject. assertThat(componentSchema.getSchema()).isNotNull(); assertThat(componentSchema.getSchema().getMaxItems()).isEqualTo(schema.getMaxItems()); } @@ -670,7 +670,7 @@ void mapDescription() { void mapFormat() { // given SchemaObject schema = new SchemaObject(); - schema.setType(SchemaType.STRING); + schema.setType(Set.of(SchemaType.STRING)); schema.setFormat("email"); // when @@ -712,7 +712,7 @@ void mapNullableEnum() { // given SchemaObject schema = new SchemaObject(); schema.setEnumValues(Stream.of("enum1", "enum2", null).toList()); - schema.setTypes(Set.of(SchemaType.STRING, SchemaType.NULL)); // nullable + schema.setType(Set.of(SchemaType.STRING, SchemaType.NULL)); // nullable // when Schema swaggerSchema = swaggerSchemaMapper.mapToSwagger(schema); @@ -726,7 +726,7 @@ void mapNullableEnum() { void mapType() { // given SchemaObject schema = new SchemaObject(); - schema.setType(SchemaType.STRING); + schema.setType(Set.of(SchemaType.STRING)); // when Schema swaggerSchema = swaggerSchemaMapper.mapToSwagger(schema); @@ -739,7 +739,7 @@ void mapType() { void mapProperties() { // given SchemaObject property = new SchemaObject(); - property.setType(SchemaType.STRING); + property.setType(Set.of(SchemaType.STRING)); SchemaObject schema = new SchemaObject(); schema.setProperties(Map.of("property", ComponentSchema.of(property))); @@ -757,7 +757,7 @@ void mapProperties() { void mapComponentSchemaSchema() { // given SchemaObject schema = new SchemaObject(); - schema.setType(SchemaType.STRING); + schema.setType(Set.of(SchemaType.STRING)); MultiFormatSchema multiFormatSchema = new MultiFormatSchema(SchemaFormat.DEFAULT.toString(), schema); ComponentSchema componentSchema = ComponentSchema.of(multiFormatSchema); @@ -773,7 +773,7 @@ void mapComponentSchemaSchema() { void mapMultiFormatSchema() { // given SchemaObject schema = new SchemaObject(); - schema.setType(SchemaType.STRING); + schema.setType(Set.of(SchemaType.STRING)); MultiFormatSchema multiFormatSchema = new MultiFormatSchema(SchemaFormat.DEFAULT.toString(), schema); diff --git a/springwolf-core/src/test/java/io/github/springwolf/core/asyncapi/scanners/common/annotation/AsyncAnnotationUtilTest.java b/springwolf-core/src/test/java/io/github/springwolf/core/asyncapi/scanners/common/annotation/AsyncAnnotationUtilTest.java index 3388cdf7b..f76f58685 100644 --- a/springwolf-core/src/test/java/io/github/springwolf/core/asyncapi/scanners/common/annotation/AsyncAnnotationUtilTest.java +++ b/springwolf-core/src/test/java/io/github/springwolf/core/asyncapi/scanners/common/annotation/AsyncAnnotationUtilTest.java @@ -26,6 +26,7 @@ import java.util.Collections; import java.util.List; import java.util.Map; +import java.util.Set; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.ArgumentMatchers.any; @@ -99,12 +100,12 @@ void getAsyncHeadersWithoutSchemaName() throws Exception { // then assertThat(headers) .isEqualTo(SchemaObject.builder() - .type(SchemaType.OBJECT) + .type(Set.of(SchemaType.OBJECT)) .title("Headers-1585401221") .properties(Map.of( "headerResolved", SchemaObject.builder() - .type(SchemaType.STRING) + .type(Set.of(SchemaType.STRING)) .title("headerResolved") .description("descriptionResolved") .format(null) @@ -126,12 +127,12 @@ void getAsyncHeadersWithoutValue() throws Exception { // then assertThat(headers) .isEqualTo(SchemaObject.builder() - .type(SchemaType.OBJECT) + .type(Set.of(SchemaType.OBJECT)) .title("Headers-1612438838") .properties(Map.of( "headerResolved", SchemaObject.builder() - .type(SchemaType.STRING) + .type(Set.of(SchemaType.STRING)) .title("headerResolved") .description("descriptionResolved") .format(null) @@ -153,12 +154,12 @@ void getAsyncHeadersWithFormat() throws Exception { // then assertThat(headers) .isEqualTo(SchemaObject.builder() - .type(SchemaType.OBJECT) + .type(Set.of(SchemaType.OBJECT)) .title("Headers-1701213112") .properties(Map.of( "headerResolved", SchemaObject.builder() - .type(SchemaType.STRING) + .type(Set.of(SchemaType.STRING)) .format("int32Resolved") .title("headerResolved") .description("descriptionResolved") diff --git a/springwolf-core/src/test/java/io/github/springwolf/core/asyncapi/scanners/common/headers/HeaderClassExtractorIntegrationTest.java b/springwolf-core/src/test/java/io/github/springwolf/core/asyncapi/scanners/common/headers/HeaderClassExtractorIntegrationTest.java index 9b5ab8f40..1f53b8c2e 100644 --- a/springwolf-core/src/test/java/io/github/springwolf/core/asyncapi/scanners/common/headers/HeaderClassExtractorIntegrationTest.java +++ b/springwolf-core/src/test/java/io/github/springwolf/core/asyncapi/scanners/common/headers/HeaderClassExtractorIntegrationTest.java @@ -19,6 +19,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Set; import static org.assertj.core.api.Assertions.assertThat; @@ -38,7 +39,7 @@ class HeaderClassExtractorIntegrationTest { private final PayloadSchemaObject payloadSchemaName = new PayloadSchemaObject( "payloadSchemaName", String.class.getSimpleName(), ComponentSchema.of(new SchemaObject())); private final SchemaObject stringSchema = - SchemaObject.builder().type(SchemaType.STRING).build(); + SchemaObject.builder().type(Set.of(SchemaType.STRING)).build(); @AfterAll static void tearDownClass() { @@ -63,7 +64,7 @@ void getHeaderWithSingleHeaderAnnotation() throws Exception { // then SchemaObject expectedHeaders = SchemaObject.builder() - .type(SchemaType.OBJECT) + .type(Set.of(SchemaType.OBJECT)) .title("payloadSchemaNameHeaders") .properties(new HashMap<>()) .build(); @@ -80,7 +81,7 @@ void getHeaderWithMultipleHeaderAnnotation() throws Exception { // then SchemaObject expectedHeaders = SchemaObject.builder() - .type(SchemaType.OBJECT) + .type(Set.of(SchemaType.OBJECT)) .title("payloadSchemaNameHeaders") .properties(new HashMap<>()) .build(); @@ -98,7 +99,7 @@ void getHeaderWithObjectHeaderAnnotation() throws Exception { // then SchemaObject expectedHeaders = SchemaObject.builder() - .type(SchemaType.OBJECT) + .type(Set.of(SchemaType.OBJECT)) .title("payloadSchemaNameHeaders") .properties(new HashMap<>()) .build(); @@ -107,7 +108,7 @@ void getHeaderWithObjectHeaderAnnotation() throws Exception { .put( "myHeader", ComponentSchema.of(SchemaObject.builder() - .type(SchemaType.OBJECT) + .type(Set.of(SchemaType.OBJECT)) .title("MyHeader") .properties(Map.of("key", ComponentSchema.of(stringSchema))) .build())); diff --git a/springwolf-core/src/test/java/io/github/springwolf/core/asyncapi/scanners/common/headers/HeaderClassExtractorTest.java b/springwolf-core/src/test/java/io/github/springwolf/core/asyncapi/scanners/common/headers/HeaderClassExtractorTest.java index 3c85c5719..f697d126c 100644 --- a/springwolf-core/src/test/java/io/github/springwolf/core/asyncapi/scanners/common/headers/HeaderClassExtractorTest.java +++ b/springwolf-core/src/test/java/io/github/springwolf/core/asyncapi/scanners/common/headers/HeaderClassExtractorTest.java @@ -16,6 +16,7 @@ import java.lang.reflect.Method; import java.util.HashMap; import java.util.Map; +import java.util.Set; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; @@ -29,9 +30,9 @@ class HeaderClassExtractorTest { private final PayloadSchemaObject payloadSchemaName = new PayloadSchemaObject( "payloadSchemaName", String.class.getSimpleName(), ComponentSchema.of(new SchemaObject())); private final SchemaObject stringSchema = - SchemaObject.builder().type(SchemaType.STRING).build(); - private final ComponentSchema stringSwaggerSchema = - ComponentSchema.of(SchemaObject.builder().type(SchemaType.STRING).build()); + SchemaObject.builder().type(Set.of(SchemaType.STRING)).build(); + private final ComponentSchema stringSwaggerSchema = ComponentSchema.of( + SchemaObject.builder().type(Set.of(SchemaType.STRING)).build()); private static final SchemaTitleModelConverter titleModelConverter = new SchemaTitleModelConverter(); @@ -73,7 +74,7 @@ void getHeaderWithSingleHeaderAnnotation() throws Exception { // then SchemaObject expectedHeaders = SchemaObject.builder() - .type(SchemaType.OBJECT) + .type(Set.of(SchemaType.OBJECT)) .title("payloadSchemaNameHeaders") .properties(new HashMap<>()) .build(); @@ -94,7 +95,7 @@ void getHeaderWithMultipleHeaderAnnotation() throws Exception { // then SchemaObject expectedHeaders = SchemaObject.builder() - .type(SchemaType.OBJECT) + .type(Set.of(SchemaType.OBJECT)) .title("payloadSchemaNameHeaders") .properties(new HashMap<>()) .build(); diff --git a/springwolf-core/src/test/java/io/github/springwolf/core/controller/PublishingPayloadCreatorTest.java b/springwolf-core/src/test/java/io/github/springwolf/core/controller/PublishingPayloadCreatorTest.java index 0212d588a..fdcedee5d 100644 --- a/springwolf-core/src/test/java/io/github/springwolf/core/controller/PublishingPayloadCreatorTest.java +++ b/springwolf-core/src/test/java/io/github/springwolf/core/controller/PublishingPayloadCreatorTest.java @@ -16,6 +16,7 @@ import java.util.Map; import java.util.Optional; +import java.util.Set; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.when; @@ -59,8 +60,9 @@ void shouldResolveBooleanPayload() throws Exception { when(componentsService.getSchemas()) .thenReturn(Map.of( type, - ComponentSchema.of( - SchemaObject.builder().type(SchemaType.BOOLEAN).build()))); + ComponentSchema.of(SchemaObject.builder() + .type(Set.of(SchemaType.BOOLEAN)) + .build()))); when(jsonMapper.readValue(payload, Boolean.class)).thenReturn(typed); // when @@ -83,8 +85,9 @@ void shouldResolveIntegerPayload() throws Exception { when(componentsService.getSchemas()) .thenReturn(Map.of( type, - ComponentSchema.of( - SchemaObject.builder().type(SchemaType.INTEGER).build()))); + ComponentSchema.of(SchemaObject.builder() + .type(Set.of(SchemaType.INTEGER)) + .build()))); when(jsonMapper.readValue(payload, Long.class)).thenReturn(typed); // when @@ -107,8 +110,9 @@ void shouldResolveLongPayload() throws Exception { when(componentsService.getSchemas()) .thenReturn(Map.of( type, - ComponentSchema.of( - SchemaObject.builder().type(SchemaType.INTEGER).build()))); + ComponentSchema.of(SchemaObject.builder() + .type(Set.of(SchemaType.INTEGER)) + .build()))); when(jsonMapper.readValue(payload, Long.class)).thenReturn(typed); // when @@ -131,8 +135,9 @@ void shouldResolveFloatPayload() throws Exception { when(componentsService.getSchemas()) .thenReturn(Map.of( type, - ComponentSchema.of( - SchemaObject.builder().type(SchemaType.NUMBER).build()))); + ComponentSchema.of(SchemaObject.builder() + .type(Set.of(SchemaType.NUMBER)) + .build()))); when(jsonMapper.readValue(payload, Double.class)).thenReturn(typed); // when @@ -155,8 +160,9 @@ void shouldResolveDoublePayload() throws Exception { when(componentsService.getSchemas()) .thenReturn(Map.of( type, - ComponentSchema.of( - SchemaObject.builder().type(SchemaType.NUMBER).build()))); + ComponentSchema.of(SchemaObject.builder() + .type(Set.of(SchemaType.NUMBER)) + .build()))); when(jsonMapper.readValue(payload, Double.class)).thenReturn(typed); // when @@ -179,8 +185,9 @@ void shouldResolveObjectPayload() throws Exception { when(componentsService.getSchemas()) .thenReturn(Map.of( type, - ComponentSchema.of( - SchemaObject.builder().type(SchemaType.OBJECT).build()))); + ComponentSchema.of(SchemaObject.builder() + .type(Set.of(SchemaType.OBJECT)) + .build()))); when(jsonMapper.readValue(payload, ObjectClass.class)).thenReturn(typed); // when @@ -203,8 +210,9 @@ void shouldResolveStringPayload() throws Exception { when(componentsService.getSchemas()) .thenReturn(Map.of( type, - ComponentSchema.of( - SchemaObject.builder().type(SchemaType.STRING).build()))); + ComponentSchema.of(SchemaObject.builder() + .type(Set.of(SchemaType.STRING)) + .build()))); when(jsonMapper.readValue(payload, String.class)).thenReturn(typed); // when @@ -226,8 +234,9 @@ void shouldReturnEmptyPayloadForUnknownClass() { when(componentsService.getSchemas()) .thenReturn(Map.of( type, - ComponentSchema.of( - SchemaObject.builder().type(SchemaType.OBJECT).build()))); + ComponentSchema.of(SchemaObject.builder() + .type(Set.of(SchemaType.OBJECT)) + .build()))); // when PublishingPayloadCreator.Result result = publishingPayloadCreator.createPayloadObject(message); @@ -249,8 +258,9 @@ void shouldReturnEmptyPayloadForInvalidJson() throws Exception { when(componentsService.getSchemas()) .thenReturn(Map.of( type, - ComponentSchema.of( - SchemaObject.builder().type(SchemaType.OBJECT).build()))); + ComponentSchema.of(SchemaObject.builder() + .type(Set.of(SchemaType.OBJECT)) + .build()))); when(jsonMapper.readValue(payload, ObjectClass.class)) .thenThrow(new JsonProcessingException("invalid json") {}); @@ -276,8 +286,9 @@ void shouldReturnEmptyPayloadForUnsupportedSchemaType() { when(componentsService.getSchemas()) .thenReturn(Map.of( type, - ComponentSchema.of( - SchemaObject.builder().type(SchemaType.ARRAY).build()))); + ComponentSchema.of(SchemaObject.builder() + .type(Set.of(SchemaType.ARRAY)) + .build()))); // when PublishingPayloadCreator.Result result = publishingPayloadCreator.createPayloadObject(message); diff --git a/springwolf-examples/e2e/playwright.config.ts b/springwolf-examples/e2e/playwright.config.ts index 0a9480339..8f1f9d948 100644 --- a/springwolf-examples/e2e/playwright.config.ts +++ b/springwolf-examples/e2e/playwright.config.ts @@ -76,7 +76,7 @@ export default defineConfig({ webServer: { cwd: '../springwolf-' + getExampleProject() + '-example', command: 'docker compose down -v && docker compose up', - url: 'http://127.0.0.1:8080/springwolf/docs.json', + url: 'http://127.0.0.1:8080/springwolf/docs', reuseExistingServer: !process.env.CI, }, }); diff --git a/springwolf-examples/springwolf-amqp-example/src/test/java/io/github/springwolf/examples/amqp/ApiIntegrationTest.java b/springwolf-examples/springwolf-amqp-example/src/test/java/io/github/springwolf/examples/amqp/ApiIntegrationTest.java index a9c747327..d19f01bc7 100644 --- a/springwolf-examples/springwolf-amqp-example/src/test/java/io/github/springwolf/examples/amqp/ApiIntegrationTest.java +++ b/springwolf-examples/springwolf-amqp-example/src/test/java/io/github/springwolf/examples/amqp/ApiIntegrationTest.java @@ -7,12 +7,17 @@ import org.springframework.boot.resttestclient.TestRestTemplate; import org.springframework.boot.resttestclient.autoconfigure.AutoConfigureTestRestTemplate; import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.http.HttpEntity; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.MediaType; import org.springframework.test.context.ActiveProfiles; import java.io.InputStream; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; +import java.util.List; import static org.assertj.core.api.Assertions.assertThat; @@ -50,8 +55,13 @@ void asyncApiResourceJsonArtifactTest() throws Exception { @Test void asyncApiResourceYamlArtifactTest() throws Exception { - String url = "/springwolf/docs.yaml"; - String actual = restTemplate.getForObject(url, String.class); + String url = "/springwolf/docs"; + HttpHeaders headers = new HttpHeaders(); + headers.setAccept(List.of(MediaType.APPLICATION_YAML)); + HttpEntity entity = new HttpEntity<>(headers); + + String actual = + restTemplate.exchange(url, HttpMethod.GET, entity, String.class).getBody(); String actualPatched = actual.replace(amqpHost + ":" + amqpPort, "amqp:5672"); Files.writeString(Path.of("src", "test", "resources", "asyncapi.actual.yaml"), actualPatched); diff --git a/springwolf-examples/springwolf-kafka-example/src/test/java/io/github/springwolf/examples/kafka/ApiIntegrationTest.java b/springwolf-examples/springwolf-kafka-example/src/test/java/io/github/springwolf/examples/kafka/ApiIntegrationTest.java index 40c30ac46..5a5a363df 100644 --- a/springwolf-examples/springwolf-kafka-example/src/test/java/io/github/springwolf/examples/kafka/ApiIntegrationTest.java +++ b/springwolf-examples/springwolf-kafka-example/src/test/java/io/github/springwolf/examples/kafka/ApiIntegrationTest.java @@ -7,11 +7,16 @@ import org.springframework.boot.resttestclient.TestRestTemplate; import org.springframework.boot.resttestclient.autoconfigure.AutoConfigureTestRestTemplate; import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.http.HttpEntity; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.MediaType; import java.io.InputStream; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; +import java.util.List; import static org.assertj.core.api.Assertions.assertThat; @@ -43,8 +48,13 @@ void asyncApiResourceArtifactTest() throws Exception { @Test void asyncApiResourceArtifactYamlTest() throws Exception { - String url = "/springwolf/docs.yaml"; - String actual = restTemplate.getForObject(url, String.class); + String url = "/springwolf/docs"; + HttpHeaders headers = new HttpHeaders(); + headers.setAccept(List.of(MediaType.APPLICATION_YAML)); + HttpEntity entity = new HttpEntity<>(headers); + + String actual = + restTemplate.exchange(url, HttpMethod.GET, entity, String.class).getBody(); // When running with EmbeddedKafka, the kafka bootstrap server does run on random ports String actualPatched = actual.replace(bootstrapServers, "kafka:29092").trim(); Files.writeString(Path.of("src", "test", "resources", "asyncapi.actual.yaml"), actualPatched); diff --git a/springwolf-examples/springwolf-kafka-example/src/test/java/io/github/springwolf/examples/kafka/KafkaProducerSystemTest.java b/springwolf-examples/springwolf-kafka-example/src/test/java/io/github/springwolf/examples/kafka/KafkaProducerSystemTest.java index 2343fca3e..877baadc9 100644 --- a/springwolf-examples/springwolf-kafka-example/src/test/java/io/github/springwolf/examples/kafka/KafkaProducerSystemTest.java +++ b/springwolf-examples/springwolf-kafka-example/src/test/java/io/github/springwolf/examples/kafka/KafkaProducerSystemTest.java @@ -83,7 +83,7 @@ void producerCanUseSpringwolfConfigurationToSendMessage() throws Exception { + " \"payload\": \"" + payloadAsString + "\"\n" + "}"; - String url = baseUrl() + "/springwolf/kafka/publish?topic=" + topic; + String url = baseUrl() + "/springwolf/plugin/kafka/publish?topic=" + topic; HttpEntity request = new HttpEntity<>(message, headers); Awaitility.await().atMost(10, TimeUnit.SECONDS).untilAsserted(() -> { @@ -117,7 +117,7 @@ void producerCanUseSpringwolfConfigurationToSendAvroMessage() throws Exception { + "}"; String topic = "avro-topic"; - String url = baseUrl() + "/springwolf/kafka/publish?topic=" + topic; + String url = baseUrl() + "/springwolf/plugin/kafka/publish?topic=" + topic; HttpEntity request = new HttpEntity<>(message, headers); Awaitility.await().atMost(10, TimeUnit.SECONDS).untilAsserted(() -> { diff --git a/springwolf-examples/springwolf-sqs-example/src/test/java/io/github/springwolf/examples/sqs/CustomPathConfigurationIntegrationTest.java b/springwolf-examples/springwolf-sqs-example/src/test/java/io/github/springwolf/examples/sqs/CustomPathConfigurationIntegrationTest.java index 5ada635ea..e55da5ad9 100644 --- a/springwolf-examples/springwolf-sqs-example/src/test/java/io/github/springwolf/examples/sqs/CustomPathConfigurationIntegrationTest.java +++ b/springwolf-examples/springwolf-sqs-example/src/test/java/io/github/springwolf/examples/sqs/CustomPathConfigurationIntegrationTest.java @@ -42,7 +42,7 @@ void getSpec() { @Test void canPublish() { - String url = "/my-custom/springwolf/endpoint/test/sqs/publish"; + String url = "/my-custom/springwolf/endpoint/test/plugin/sqs/publish"; ResponseEntity responseEntity = restTemplate.getForEntity(url, String.class); assertThat(responseEntity.getStatusCode()).isEqualTo(HttpStatus.OK); diff --git a/springwolf-plugins/springwolf-amqp-plugin/src/main/java/io/github/springwolf/plugins/amqp/asyncapi/scanners/common/headers/AsyncHeadersForAmqpBuilder.java b/springwolf-plugins/springwolf-amqp-plugin/src/main/java/io/github/springwolf/plugins/amqp/asyncapi/scanners/common/headers/AsyncHeadersForAmqpBuilder.java index 485532523..613ea7a57 100644 --- a/springwolf-plugins/springwolf-amqp-plugin/src/main/java/io/github/springwolf/plugins/amqp/asyncapi/scanners/common/headers/AsyncHeadersForAmqpBuilder.java +++ b/springwolf-plugins/springwolf-amqp-plugin/src/main/java/io/github/springwolf/plugins/amqp/asyncapi/scanners/common/headers/AsyncHeadersForAmqpBuilder.java @@ -7,11 +7,12 @@ import io.github.springwolf.core.asyncapi.scanners.common.payload.PayloadSchemaObject; import java.util.Map; +import java.util.Set; public class AsyncHeadersForAmqpBuilder implements AsyncHeadersBuilder { private static final SchemaObject headers = SchemaObject.builder() - .type(SchemaType.OBJECT) + .type(Set.of(SchemaType.OBJECT)) .title("SpringRabbitListenerDefaultHeaders") .properties(Map.of()) .build(); diff --git a/springwolf-plugins/springwolf-amqp-plugin/src/main/java/io/github/springwolf/plugins/amqp/controller/SpringwolfAmqpController.java b/springwolf-plugins/springwolf-amqp-plugin/src/main/java/io/github/springwolf/plugins/amqp/controller/SpringwolfAmqpController.java index 5171f91d9..b0f027400 100644 --- a/springwolf-plugins/springwolf-amqp-plugin/src/main/java/io/github/springwolf/plugins/amqp/controller/SpringwolfAmqpController.java +++ b/springwolf-plugins/springwolf-amqp-plugin/src/main/java/io/github/springwolf/plugins/amqp/controller/SpringwolfAmqpController.java @@ -10,7 +10,7 @@ import org.springframework.web.bind.annotation.RestController; @RestController -@RequestMapping("${springwolf.path.base:/springwolf}/amqp") +@RequestMapping("${springwolf.path.base:/springwolf}/plugin/amqp") @Slf4j public class SpringwolfAmqpController extends PublishingBaseController { diff --git a/springwolf-plugins/springwolf-cloud-stream-plugin/src/test/java/io/github/springwolf/plugins/cloudstream/asyncapi/scanners/channels/CloudStreamFunctionChannelsScannerIntegrationTest.java b/springwolf-plugins/springwolf-cloud-stream-plugin/src/test/java/io/github/springwolf/plugins/cloudstream/asyncapi/scanners/channels/CloudStreamFunctionChannelsScannerIntegrationTest.java index 9ff733a18..ae2143241 100644 --- a/springwolf-plugins/springwolf-cloud-stream-plugin/src/test/java/io/github/springwolf/plugins/cloudstream/asyncapi/scanners/channels/CloudStreamFunctionChannelsScannerIntegrationTest.java +++ b/springwolf-plugins/springwolf-cloud-stream-plugin/src/test/java/io/github/springwolf/plugins/cloudstream/asyncapi/scanners/channels/CloudStreamFunctionChannelsScannerIntegrationTest.java @@ -53,6 +53,7 @@ import java.util.Collections; import java.util.List; import java.util.Map; +import java.util.Set; import java.util.function.BiConsumer; import java.util.function.BiFunction; import java.util.function.Consumer; @@ -136,7 +137,9 @@ void consumerBinding() { .name(String.class.getName()) .title("string") .payload(MessagePayload.of(MultiFormatSchema.builder() - .schema(SchemaObject.builder().type(SchemaType.STRING).build()) + .schema(SchemaObject.builder() + .type(Set.of(SchemaType.STRING)) + .build()) .build())) .headers(MessageHeaders.of( SchemaReference.toSchema(AsyncHeadersNotDocumented.NOT_DOCUMENTED.getTitle()))) @@ -182,7 +185,9 @@ void biConsumerBinding() { .name(String.class.getName()) .title("string") .payload(MessagePayload.of(MultiFormatSchema.builder() - .schema(SchemaObject.builder().type(SchemaType.STRING).build()) + .schema(SchemaObject.builder() + .type(Set.of(SchemaType.STRING)) + .build()) .build())) .headers(MessageHeaders.of( SchemaReference.toSchema(AsyncHeadersNotDocumented.NOT_DOCUMENTED.getTitle()))) @@ -229,7 +234,9 @@ void supplierBinding() { .name(String.class.getName()) .title("string") .payload(MessagePayload.of(MultiFormatSchema.builder() - .schema(SchemaObject.builder().type(SchemaType.STRING).build()) + .schema(SchemaObject.builder() + .type(Set.of(SchemaType.STRING)) + .build()) .build())) .headers(MessageHeaders.of( SchemaReference.toSchema(AsyncHeadersNotDocumented.NOT_DOCUMENTED.getTitle()))) @@ -451,7 +458,9 @@ void kStreamFunctionBinding() { .name(String.class.getName()) .title("string") .payload(MessagePayload.of(MultiFormatSchema.builder() - .schema(SchemaObject.builder().type(SchemaType.STRING).build()) + .schema(SchemaObject.builder() + .type(Set.of(SchemaType.STRING)) + .build()) .build())) .headers(MessageHeaders.of( SchemaReference.toSchema(AsyncHeadersNotDocumented.NOT_DOCUMENTED.getTitle()))) @@ -480,7 +489,7 @@ void kStreamFunctionBinding() { .title("integer") .payload(MessagePayload.of(MultiFormatSchema.builder() .schema(SchemaObject.builder() - .type(SchemaType.INTEGER) + .type(Set.of(SchemaType.INTEGER)) .format("int32") .build()) .build())) @@ -539,7 +548,9 @@ void functionBindingWithSameTopicName() { .name(String.class.getName()) .title("string") .payload(MessagePayload.of(MultiFormatSchema.builder() - .schema(SchemaObject.builder().type(SchemaType.STRING).build()) + .schema(SchemaObject.builder() + .type(Set.of(SchemaType.STRING)) + .build()) .build())) .headers(MessageHeaders.of( SchemaReference.toSchema(AsyncHeadersNotDocumented.NOT_DOCUMENTED.getTitle()))) @@ -560,7 +571,7 @@ void functionBindingWithSameTopicName() { .title("integer") .payload(MessagePayload.of(MultiFormatSchema.builder() .schema(SchemaObject.builder() - .type(SchemaType.INTEGER) + .type(Set.of(SchemaType.INTEGER)) .format("int32") .build()) .build())) diff --git a/springwolf-plugins/springwolf-jms-plugin/src/main/java/io/github/springwolf/plugins/jms/controller/SpringwolfJmsController.java b/springwolf-plugins/springwolf-jms-plugin/src/main/java/io/github/springwolf/plugins/jms/controller/SpringwolfJmsController.java index bab60f5f3..1c3d610c0 100644 --- a/springwolf-plugins/springwolf-jms-plugin/src/main/java/io/github/springwolf/plugins/jms/controller/SpringwolfJmsController.java +++ b/springwolf-plugins/springwolf-jms-plugin/src/main/java/io/github/springwolf/plugins/jms/controller/SpringwolfJmsController.java @@ -10,7 +10,7 @@ import org.springframework.web.bind.annotation.RestController; @RestController -@RequestMapping("${springwolf.path.base:/springwolf}/jms") +@RequestMapping("${springwolf.path.base:/springwolf}/plugin/jms") @Slf4j public class SpringwolfJmsController extends PublishingBaseController { diff --git a/springwolf-plugins/springwolf-jms-plugin/src/test/java/io/github/springwolf/plugins/jms/controller/SpringwolfJmsControllerIntegrationTest.java b/springwolf-plugins/springwolf-jms-plugin/src/test/java/io/github/springwolf/plugins/jms/controller/SpringwolfJmsControllerIntegrationTest.java index 6e20c5cfe..ffbe10ee5 100644 --- a/springwolf-plugins/springwolf-jms-plugin/src/test/java/io/github/springwolf/plugins/jms/controller/SpringwolfJmsControllerIntegrationTest.java +++ b/springwolf-plugins/springwolf-jms-plugin/src/test/java/io/github/springwolf/plugins/jms/controller/SpringwolfJmsControllerIntegrationTest.java @@ -111,7 +111,7 @@ void setup() { class CanPublish { @Test void controllerShouldReturnOkWhenPublishingIsEnabled() throws Exception { - mvc.perform(get("/springwolf/jms/publish").contentType(MediaType.APPLICATION_JSON)) + mvc.perform(get("/springwolf/plugin/jms/publish").contentType(MediaType.APPLICATION_JSON)) .andExpect(status().is2xxSuccessful()); } @@ -119,7 +119,7 @@ void controllerShouldReturnOkWhenPublishingIsEnabled() throws Exception { void controllerShouldReturnNotFoundWhenPublishingIsDisabled() throws Exception { when(springwolfJmsProducer.isEnabled()).thenReturn(false); - mvc.perform(get("/springwolf/jms/publish").contentType(MediaType.APPLICATION_JSON)) + mvc.perform(get("/springwolf/plugin/jms/publish").contentType(MediaType.APPLICATION_JSON)) .andExpect(status().is4xxClientError()); } } @@ -133,7 +133,7 @@ void controllerShouldReturnBadRequestIfPayloadIsEmpty() throws Exception { "headers": null, "payload": "" }"""; - mvc.perform(post("/springwolf/jms/publish?topic=test-topic") + mvc.perform(post("/springwolf/plugin/jms/publish?topic=test-topic") .contentType(MediaType.APPLICATION_JSON) .content(content)) .andExpect(status().is2xxSuccessful()); @@ -149,7 +149,7 @@ void controllerShouldAcceptIfPayloadIsNotSet() throws Exception { "bindings": null, "headers": null }"""; - mvc.perform(post("/springwolf/jms/publish?topic=test-topic") + mvc.perform(post("/springwolf/plugin/jms/publish?topic=test-topic") .contentType(MediaType.APPLICATION_JSON) .content(content)) .andExpect(status().is2xxSuccessful()); @@ -168,7 +168,7 @@ void controllerShouldReturnNotFoundIfNoJmsProducerIsEnabled() throws Exception { "headers": null, "payload": "{ \\"some-payload-key\\" : \\"some-payload-value\\" }" }"""; - mvc.perform(post("/springwolf/jms/publish?topic=test-topic") + mvc.perform(post("/springwolf/plugin/jms/publish?topic=test-topic") .contentType(MediaType.APPLICATION_JSON) .content(content)) .andExpect(status().isNotFound()); @@ -187,7 +187,7 @@ void controllerShouldCallJmsProducerIfOnlyPayloadIsSend() throws Exception { "type": "io.github.springwolf.plugins.jms.controller.SpringwolfJmsControllerIntegrationTest$PayloadDto" }"""; - mvc.perform(post("/springwolf/jms/publish") + mvc.perform(post("/springwolf/plugin/jms/publish") .param("topic", "test-topic") .contentType(MediaType.APPLICATION_JSON) .content(content)) @@ -214,7 +214,7 @@ void controllerShouldCallJmsProducerIfPayloadAndHeadersAreSend() throws Exceptio } """; - mvc.perform(post("/springwolf/jms/publish?topic=test-topic") + mvc.perform(post("/springwolf/plugin/jms/publish?topic=test-topic") .contentType(MediaType.APPLICATION_JSON) .content(content)) .andExpect(status().isOk()); diff --git a/springwolf-plugins/springwolf-kafka-plugin/src/main/java/io/github/springwolf/plugins/kafka/asyncapi/components/header/AsyncHeadersForSpringKafkaBuilder.java b/springwolf-plugins/springwolf-kafka-plugin/src/main/java/io/github/springwolf/plugins/kafka/asyncapi/components/header/AsyncHeadersForSpringKafkaBuilder.java index 9c28c5f1d..3a3d85c11 100644 --- a/springwolf-plugins/springwolf-kafka-plugin/src/main/java/io/github/springwolf/plugins/kafka/asyncapi/components/header/AsyncHeadersForSpringKafkaBuilder.java +++ b/springwolf-plugins/springwolf-kafka-plugin/src/main/java/io/github/springwolf/plugins/kafka/asyncapi/components/header/AsyncHeadersForSpringKafkaBuilder.java @@ -7,6 +7,7 @@ import java.util.HashMap; import java.util.List; +import java.util.Set; public class AsyncHeadersForSpringKafkaBuilder { private final SchemaObject headers; @@ -17,7 +18,7 @@ public AsyncHeadersForSpringKafkaBuilder() { public AsyncHeadersForSpringKafkaBuilder(String schemaName) { this.headers = SchemaObject.builder() - .type(SchemaType.OBJECT) + .type(Set.of(SchemaType.OBJECT)) .title(schemaName) .properties(new HashMap<>()) .build(); @@ -35,7 +36,7 @@ public AsyncHeadersForSpringKafkaBuilder withTypeIdHeader(String exampleTypeId, private AsyncHeadersForSpringKafkaBuilder withHeader( String headerName, List types, String exampleType, String description) { SchemaObject header = new SchemaObject(); - header.setType(SchemaType.STRING); + header.setType(Set.of(SchemaType.STRING)); header.setTitle(headerName); header.setDescription(description); header.setExamples(List.of(exampleType)); diff --git a/springwolf-plugins/springwolf-kafka-plugin/src/main/java/io/github/springwolf/plugins/kafka/asyncapi/scanners/common/KafkaListenerUtil.java b/springwolf-plugins/springwolf-kafka-plugin/src/main/java/io/github/springwolf/plugins/kafka/asyncapi/scanners/common/KafkaListenerUtil.java index 2cf4cc975..52aceeb7a 100644 --- a/springwolf-plugins/springwolf-kafka-plugin/src/main/java/io/github/springwolf/plugins/kafka/asyncapi/scanners/common/KafkaListenerUtil.java +++ b/springwolf-plugins/springwolf-kafka-plugin/src/main/java/io/github/springwolf/plugins/kafka/asyncapi/scanners/common/KafkaListenerUtil.java @@ -19,6 +19,7 @@ import java.util.Arrays; import java.util.List; import java.util.Map; +import java.util.Set; import java.util.stream.Stream; import static java.util.stream.Collectors.toList; @@ -82,7 +83,7 @@ private static SchemaObject createStringSchema(String value) { if (value != null && !value.isEmpty()) { SchemaObject schema = new SchemaObject(); schema.setEnumValues(List.of(value)); - schema.setType(SchemaType.STRING); + schema.setType(Set.of(SchemaType.STRING)); return schema; } return null; diff --git a/springwolf-plugins/springwolf-kafka-plugin/src/main/java/io/github/springwolf/plugins/kafka/controller/SpringwolfKafkaController.java b/springwolf-plugins/springwolf-kafka-plugin/src/main/java/io/github/springwolf/plugins/kafka/controller/SpringwolfKafkaController.java index 6f52a20a2..87e1a6350 100644 --- a/springwolf-plugins/springwolf-kafka-plugin/src/main/java/io/github/springwolf/plugins/kafka/controller/SpringwolfKafkaController.java +++ b/springwolf-plugins/springwolf-kafka-plugin/src/main/java/io/github/springwolf/plugins/kafka/controller/SpringwolfKafkaController.java @@ -10,7 +10,7 @@ import org.springframework.web.bind.annotation.RestController; @RestController -@RequestMapping("${springwolf.path.base:/springwolf}/kafka") +@RequestMapping("${springwolf.path.base:/springwolf}/plugin/kafka") @Slf4j public class SpringwolfKafkaController extends PublishingBaseController { diff --git a/springwolf-plugins/springwolf-kafka-plugin/src/test/java/io/github/springwolf/plugins/kafka/asyncapi/scanners/common/KafkaListenerUtilTest.java b/springwolf-plugins/springwolf-kafka-plugin/src/test/java/io/github/springwolf/plugins/kafka/asyncapi/scanners/common/KafkaListenerUtilTest.java index 05870c633..78bc0f9e5 100644 --- a/springwolf-plugins/springwolf-kafka-plugin/src/test/java/io/github/springwolf/plugins/kafka/asyncapi/scanners/common/KafkaListenerUtilTest.java +++ b/springwolf-plugins/springwolf-kafka-plugin/src/test/java/io/github/springwolf/plugins/kafka/asyncapi/scanners/common/KafkaListenerUtilTest.java @@ -18,6 +18,7 @@ import org.springframework.util.StringValueResolver; import java.util.Map; +import java.util.Set; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; @@ -114,7 +115,7 @@ void includeKafkaKeyHeader() { // given SchemaObject headerSchema = new SchemaObject(); SchemaObject keySchema = - SchemaObject.builder().type(SchemaType.STRING).build(); + SchemaObject.builder().type(Set.of(SchemaType.STRING)).build(); headerSchema.setProperties(Map.of(KafkaHeaders.RECEIVED_KEY, keySchema)); // when diff --git a/springwolf-plugins/springwolf-kafka-plugin/src/test/java/io/github/springwolf/plugins/kafka/controller/SpringwolfKafkaControllerIntegrationTest.java b/springwolf-plugins/springwolf-kafka-plugin/src/test/java/io/github/springwolf/plugins/kafka/controller/SpringwolfKafkaControllerIntegrationTest.java index eb635d9ad..e016fcc37 100644 --- a/springwolf-plugins/springwolf-kafka-plugin/src/test/java/io/github/springwolf/plugins/kafka/controller/SpringwolfKafkaControllerIntegrationTest.java +++ b/springwolf-plugins/springwolf-kafka-plugin/src/test/java/io/github/springwolf/plugins/kafka/controller/SpringwolfKafkaControllerIntegrationTest.java @@ -111,7 +111,7 @@ void setup() { class CanPublish { @Test void controllerShouldReturnOkWhenPublishingIsEnabled() throws Exception { - mvc.perform(get("/springwolf/kafka/publish").contentType(MediaType.APPLICATION_JSON)) + mvc.perform(get("/springwolf/plugin/kafka/publish").contentType(MediaType.APPLICATION_JSON)) .andExpect(status().is2xxSuccessful()); } @@ -119,7 +119,7 @@ void controllerShouldReturnOkWhenPublishingIsEnabled() throws Exception { void controllerShouldReturnNotFoundWhenPublishingIsDisabled() throws Exception { when(springwolfKafkaProducer.isEnabled()).thenReturn(false); - mvc.perform(get("/springwolf/kafka/publish").contentType(MediaType.APPLICATION_JSON)) + mvc.perform(get("/springwolf/plugin/kafka/publish").contentType(MediaType.APPLICATION_JSON)) .andExpect(status().is4xxClientError()); } } @@ -133,7 +133,7 @@ void controllerShouldReturnBadRequestIfPayloadIsEmpty() throws Exception { "headers": null, "payload": "" }"""; - mvc.perform(post("/springwolf/kafka/publish?topic=test-topic") + mvc.perform(post("/springwolf/plugin/kafka/publish?topic=test-topic") .contentType(MediaType.APPLICATION_JSON) .content(content)) .andExpect(status().is2xxSuccessful()); @@ -149,7 +149,7 @@ void controllerShouldAcceptIfPayloadIsNotSet() throws Exception { "bindings": null, "headers": null }"""; - mvc.perform(post("/springwolf/kafka/publish?topic=test-topic") + mvc.perform(post("/springwolf/plugin/kafka/publish?topic=test-topic") .contentType(MediaType.APPLICATION_JSON) .content(content)) .andExpect(status().is2xxSuccessful()); @@ -168,7 +168,7 @@ void controllerShouldReturnNotFoundIfNoKafkaProducerIsEnabled() throws Exception "headers": null, "payload": "{ \\"some-payload-key\\" : \\"some-payload-value\\" }" }"""; - mvc.perform(post("/springwolf/kafka/publish?topic=test-topic") + mvc.perform(post("/springwolf/plugin/kafka/publish?topic=test-topic") .contentType(MediaType.APPLICATION_JSON) .content(content)) .andExpect(status().isNotFound()); @@ -187,7 +187,7 @@ void controllerShouldCallKafkaProducerIfOnlyPayloadIsSend() throws Exception { "type": "io.github.springwolf.plugins.kafka.controller.SpringwolfKafkaControllerIntegrationTest$PayloadDto" }"""; - mvc.perform(post("/springwolf/kafka/publish") + mvc.perform(post("/springwolf/plugin/kafka/publish") .param("topic", "test-topic") .contentType(MediaType.APPLICATION_JSON) .content(content)) @@ -214,7 +214,7 @@ void controllerShouldCallKafkaProducerIfPayloadAndHeadersAreSend() throws Except } """; - mvc.perform(post("/springwolf/kafka/publish?topic=test-topic") + mvc.perform(post("/springwolf/plugin/kafka/publish?topic=test-topic") .contentType(MediaType.APPLICATION_JSON) .content(content)) .andExpect(status().isOk()); @@ -244,7 +244,7 @@ void controllerShouldCallKafkaProducerIfPayloadAndHeadersAndBindingsAreSend() th "type": "io.github.springwolf.plugins.kafka.controller.SpringwolfKafkaControllerIntegrationTest$PayloadDto" }"""; - mvc.perform(post("/springwolf/kafka/publish?topic=test-topic") + mvc.perform(post("/springwolf/plugin/kafka/publish?topic=test-topic") .contentType(MediaType.APPLICATION_JSON) .content(content)) .andExpect(status().isOk()); diff --git a/springwolf-plugins/springwolf-sns-plugin/src/main/java/io/github/springwolf/plugins/sns/controller/SpringwolfSnsController.java b/springwolf-plugins/springwolf-sns-plugin/src/main/java/io/github/springwolf/plugins/sns/controller/SpringwolfSnsController.java index 542fe12b4..52b29da94 100644 --- a/springwolf-plugins/springwolf-sns-plugin/src/main/java/io/github/springwolf/plugins/sns/controller/SpringwolfSnsController.java +++ b/springwolf-plugins/springwolf-sns-plugin/src/main/java/io/github/springwolf/plugins/sns/controller/SpringwolfSnsController.java @@ -11,7 +11,7 @@ @Slf4j @RestController -@RequestMapping("${springwolf.path.base:/springwolf}/sns") +@RequestMapping("${springwolf.path.base:/springwolf}/plugin/sns") public class SpringwolfSnsController extends PublishingBaseController { private final SpringwolfSnsProducer producer; diff --git a/springwolf-plugins/springwolf-sqs-plugin/src/main/java/io/github/springwolf/plugins/sqs/controller/SpringwolfSqsController.java b/springwolf-plugins/springwolf-sqs-plugin/src/main/java/io/github/springwolf/plugins/sqs/controller/SpringwolfSqsController.java index 70d8d0980..2dde78768 100644 --- a/springwolf-plugins/springwolf-sqs-plugin/src/main/java/io/github/springwolf/plugins/sqs/controller/SpringwolfSqsController.java +++ b/springwolf-plugins/springwolf-sqs-plugin/src/main/java/io/github/springwolf/plugins/sqs/controller/SpringwolfSqsController.java @@ -10,7 +10,7 @@ import org.springframework.web.bind.annotation.RestController; @RestController -@RequestMapping("${springwolf.path.base:/springwolf}/sqs") +@RequestMapping("${springwolf.path.base:/springwolf}/plugin/sqs") @Slf4j public class SpringwolfSqsController extends PublishingBaseController { diff --git a/springwolf-plugins/springwolf-stomp-plugin/src/main/java/io/github/springwolf/plugins/stomp/asyncapi/scanners/common/header/AsyncHeadersForStompBuilder.java b/springwolf-plugins/springwolf-stomp-plugin/src/main/java/io/github/springwolf/plugins/stomp/asyncapi/scanners/common/header/AsyncHeadersForStompBuilder.java index 9ebc4ba69..03eb88fbb 100644 --- a/springwolf-plugins/springwolf-stomp-plugin/src/main/java/io/github/springwolf/plugins/stomp/asyncapi/scanners/common/header/AsyncHeadersForStompBuilder.java +++ b/springwolf-plugins/springwolf-stomp-plugin/src/main/java/io/github/springwolf/plugins/stomp/asyncapi/scanners/common/header/AsyncHeadersForStompBuilder.java @@ -7,11 +7,12 @@ import io.github.springwolf.core.asyncapi.scanners.common.payload.PayloadSchemaObject; import java.util.Map; +import java.util.Set; public class AsyncHeadersForStompBuilder implements AsyncHeadersBuilder { private static final SchemaObject headers = SchemaObject.builder() - .type(SchemaType.OBJECT) + .type(Set.of(SchemaType.OBJECT)) .title("SpringStompDefaultHeaders") .properties(Map.of()) .build(); diff --git a/springwolf-ui/src/app/service/endpoint.service.ts b/springwolf-ui/src/app/service/endpoint.service.ts index 21c10d188..d6690a9dc 100644 --- a/springwolf-ui/src/app/service/endpoint.service.ts +++ b/springwolf-ui/src/app/service/endpoint.service.ts @@ -15,6 +15,6 @@ export class EndpointService { } public static getPublishEndpoint(protocol: string): string { - return EndpointService.contextPath + `/${protocol}/publish`; + return EndpointService.contextPath + `/plugin/${protocol}/publish`; } } From ca51e8f93bcf0ad0fb2fe855395e32a083ba726b Mon Sep 17 00:00:00 2001 From: Timon Back Date: Wed, 31 Dec 2025 14:08:31 +0100 Subject: [PATCH 2/2] chore(core): moved OperationCustomizer annotation --- .../operations/{annotations => }/OperationCustomizer.java | 4 +--- .../AsyncAnnotationClassLevelOperationsScanner.java | 1 + .../AsyncAnnotationMethodLevelOperationsScanner.java | 1 + .../SpringAnnotationClassLevelOperationsScanner.java | 1 + .../SpringAnnotationMethodLevelOperationsScanner.java | 1 + .../core/configuration/SpringwolfScannerConfiguration.java | 2 +- .../AsyncAnnotationClassLevelOperationsScannerTest.java | 1 + .../AsyncAnnotationMethodLevelOperationsScannerTest.java | 1 + .../SpringAnnotationClassLevelOperationsScannerTest.java | 1 + .../SpringAnnotationMethodLevelOperationsScannerTest.java | 1 + .../configuration/SpringwolfAmqpScannerConfiguration.java | 2 +- .../jms/configuration/SpringwolfJmsScannerConfiguration.java | 2 +- .../configuration/SpringwolfKafkaScannerConfiguration.java | 2 +- .../scanners/operation/annotations/SendToCustomizer.java | 2 +- .../scanners/operation/annotations/SendToUserCustomizer.java | 2 +- .../configuration/SpringwolfStompScannerConfiguration.java | 2 +- 16 files changed, 16 insertions(+), 10 deletions(-) rename springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/scanners/operations/{annotations => }/OperationCustomizer.java (67%) diff --git a/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/scanners/operations/annotations/OperationCustomizer.java b/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/scanners/operations/OperationCustomizer.java similarity index 67% rename from springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/scanners/operations/annotations/OperationCustomizer.java rename to springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/scanners/operations/OperationCustomizer.java index dd05db485..16821863e 100644 --- a/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/scanners/operations/annotations/OperationCustomizer.java +++ b/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/scanners/operations/OperationCustomizer.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package io.github.springwolf.core.asyncapi.scanners.operations.annotations; +package io.github.springwolf.core.asyncapi.scanners.operations; import io.github.springwolf.asyncapi.v3.model.operation.Operation; @@ -7,8 +7,6 @@ /** * Allows for customization of the Operation object after it has been finalized by the scanner. - *

      - * Maintainer note: This interface should not be part of the annotations package */ public interface OperationCustomizer { void customize(Operation operation, Method method); diff --git a/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/scanners/operations/annotations/AsyncAnnotationClassLevelOperationsScanner.java b/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/scanners/operations/annotations/AsyncAnnotationClassLevelOperationsScanner.java index 0deb535f0..661017fe9 100644 --- a/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/scanners/operations/annotations/AsyncAnnotationClassLevelOperationsScanner.java +++ b/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/scanners/operations/annotations/AsyncAnnotationClassLevelOperationsScanner.java @@ -9,6 +9,7 @@ import io.github.springwolf.core.asyncapi.scanners.common.annotation.AnnotationUtil; import io.github.springwolf.core.asyncapi.scanners.common.annotation.MethodAndAnnotation; import io.github.springwolf.core.asyncapi.scanners.common.operation.AsyncAnnotationOperationService; +import io.github.springwolf.core.asyncapi.scanners.operations.OperationCustomizer; import io.github.springwolf.core.asyncapi.scanners.operations.OperationsInClassScanner; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; diff --git a/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/scanners/operations/annotations/AsyncAnnotationMethodLevelOperationsScanner.java b/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/scanners/operations/annotations/AsyncAnnotationMethodLevelOperationsScanner.java index 7fcec7dd9..8c8f48a58 100644 --- a/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/scanners/operations/annotations/AsyncAnnotationMethodLevelOperationsScanner.java +++ b/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/scanners/operations/annotations/AsyncAnnotationMethodLevelOperationsScanner.java @@ -7,6 +7,7 @@ import io.github.springwolf.core.asyncapi.scanners.common.annotation.AnnotationScannerUtil; import io.github.springwolf.core.asyncapi.scanners.common.annotation.MethodAndAnnotation; import io.github.springwolf.core.asyncapi.scanners.common.operation.AsyncAnnotationOperationService; +import io.github.springwolf.core.asyncapi.scanners.operations.OperationCustomizer; import io.github.springwolf.core.asyncapi.scanners.operations.OperationsInClassScanner; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; diff --git a/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/scanners/operations/annotations/SpringAnnotationClassLevelOperationsScanner.java b/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/scanners/operations/annotations/SpringAnnotationClassLevelOperationsScanner.java index bf44efdd5..2ee097092 100644 --- a/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/scanners/operations/annotations/SpringAnnotationClassLevelOperationsScanner.java +++ b/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/scanners/operations/annotations/SpringAnnotationClassLevelOperationsScanner.java @@ -6,6 +6,7 @@ import io.github.springwolf.core.asyncapi.scanners.common.annotation.AnnotationUtil; import io.github.springwolf.core.asyncapi.scanners.common.annotation.MethodAndAnnotation; import io.github.springwolf.core.asyncapi.scanners.common.operation.SpringAnnotationOperationsService; +import io.github.springwolf.core.asyncapi.scanners.operations.OperationCustomizer; import io.github.springwolf.core.asyncapi.scanners.operations.OperationsInClassScanner; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; diff --git a/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/scanners/operations/annotations/SpringAnnotationMethodLevelOperationsScanner.java b/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/scanners/operations/annotations/SpringAnnotationMethodLevelOperationsScanner.java index 7ce1dfb3a..854d54b60 100644 --- a/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/scanners/operations/annotations/SpringAnnotationMethodLevelOperationsScanner.java +++ b/springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/scanners/operations/annotations/SpringAnnotationMethodLevelOperationsScanner.java @@ -9,6 +9,7 @@ import io.github.springwolf.core.asyncapi.scanners.common.operation.SpringAnnotationOperationService; import io.github.springwolf.core.asyncapi.scanners.common.payload.PayloadMethodParameterService; import io.github.springwolf.core.asyncapi.scanners.common.payload.PayloadSchemaObject; +import io.github.springwolf.core.asyncapi.scanners.operations.OperationCustomizer; import io.github.springwolf.core.asyncapi.scanners.operations.OperationsInClassScanner; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; diff --git a/springwolf-core/src/main/java/io/github/springwolf/core/configuration/SpringwolfScannerConfiguration.java b/springwolf-core/src/main/java/io/github/springwolf/core/configuration/SpringwolfScannerConfiguration.java index addc5a649..da4ec42d5 100644 --- a/springwolf-core/src/main/java/io/github/springwolf/core/configuration/SpringwolfScannerConfiguration.java +++ b/springwolf-core/src/main/java/io/github/springwolf/core/configuration/SpringwolfScannerConfiguration.java @@ -22,10 +22,10 @@ import io.github.springwolf.core.asyncapi.scanners.common.message.AsyncAnnotationMessageService; import io.github.springwolf.core.asyncapi.scanners.common.operation.AsyncAnnotationOperationService; import io.github.springwolf.core.asyncapi.scanners.common.utils.StringValueResolverProxy; +import io.github.springwolf.core.asyncapi.scanners.operations.OperationCustomizer; import io.github.springwolf.core.asyncapi.scanners.operations.OperationsInClassScannerAdapter; import io.github.springwolf.core.asyncapi.scanners.operations.annotations.AsyncAnnotationClassLevelOperationsScanner; import io.github.springwolf.core.asyncapi.scanners.operations.annotations.AsyncAnnotationMethodLevelOperationsScanner; -import io.github.springwolf.core.asyncapi.scanners.operations.annotations.OperationCustomizer; import io.github.springwolf.core.configuration.docket.AsyncApiDocketService; import io.github.springwolf.core.standalone.StandaloneConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; diff --git a/springwolf-core/src/test/java/io/github/springwolf/core/asyncapi/scanners/operations/annotations/AsyncAnnotationClassLevelOperationsScannerTest.java b/springwolf-core/src/test/java/io/github/springwolf/core/asyncapi/scanners/operations/annotations/AsyncAnnotationClassLevelOperationsScannerTest.java index 4d874a406..a5d6d7e6c 100644 --- a/springwolf-core/src/test/java/io/github/springwolf/core/asyncapi/scanners/operations/annotations/AsyncAnnotationClassLevelOperationsScannerTest.java +++ b/springwolf-core/src/test/java/io/github/springwolf/core/asyncapi/scanners/operations/annotations/AsyncAnnotationClassLevelOperationsScannerTest.java @@ -6,6 +6,7 @@ import io.github.springwolf.core.asyncapi.annotations.AsyncOperation; import io.github.springwolf.core.asyncapi.scanners.common.AsyncAnnotationProvider; import io.github.springwolf.core.asyncapi.scanners.common.operation.AsyncAnnotationOperationService; +import io.github.springwolf.core.asyncapi.scanners.operations.OperationCustomizer; import org.junit.jupiter.api.Test; import java.lang.annotation.Retention; diff --git a/springwolf-core/src/test/java/io/github/springwolf/core/asyncapi/scanners/operations/annotations/AsyncAnnotationMethodLevelOperationsScannerTest.java b/springwolf-core/src/test/java/io/github/springwolf/core/asyncapi/scanners/operations/annotations/AsyncAnnotationMethodLevelOperationsScannerTest.java index 3c9f2d6bd..5786dcf95 100644 --- a/springwolf-core/src/test/java/io/github/springwolf/core/asyncapi/scanners/operations/annotations/AsyncAnnotationMethodLevelOperationsScannerTest.java +++ b/springwolf-core/src/test/java/io/github/springwolf/core/asyncapi/scanners/operations/annotations/AsyncAnnotationMethodLevelOperationsScannerTest.java @@ -8,6 +8,7 @@ import io.github.springwolf.core.asyncapi.scanners.common.AsyncAnnotationProvider; import io.github.springwolf.core.asyncapi.scanners.common.operation.AsyncAnnotationOperationService; import io.github.springwolf.core.asyncapi.scanners.common.utils.StringValueResolverProxy; +import io.github.springwolf.core.asyncapi.scanners.operations.OperationCustomizer; import org.junit.jupiter.api.Test; import java.util.List; diff --git a/springwolf-core/src/test/java/io/github/springwolf/core/asyncapi/scanners/operations/annotations/SpringAnnotationClassLevelOperationsScannerTest.java b/springwolf-core/src/test/java/io/github/springwolf/core/asyncapi/scanners/operations/annotations/SpringAnnotationClassLevelOperationsScannerTest.java index cbe84e244..ee587fe22 100644 --- a/springwolf-core/src/test/java/io/github/springwolf/core/asyncapi/scanners/operations/annotations/SpringAnnotationClassLevelOperationsScannerTest.java +++ b/springwolf-core/src/test/java/io/github/springwolf/core/asyncapi/scanners/operations/annotations/SpringAnnotationClassLevelOperationsScannerTest.java @@ -3,6 +3,7 @@ import io.github.springwolf.asyncapi.v3.model.operation.Operation; import io.github.springwolf.core.asyncapi.scanners.common.operation.SpringAnnotationOperationsService; +import io.github.springwolf.core.asyncapi.scanners.operations.OperationCustomizer; import org.junit.jupiter.api.Test; import java.lang.annotation.Retention; diff --git a/springwolf-core/src/test/java/io/github/springwolf/core/asyncapi/scanners/operations/annotations/SpringAnnotationMethodLevelOperationsScannerTest.java b/springwolf-core/src/test/java/io/github/springwolf/core/asyncapi/scanners/operations/annotations/SpringAnnotationMethodLevelOperationsScannerTest.java index d663dbff1..cdd78b03f 100644 --- a/springwolf-core/src/test/java/io/github/springwolf/core/asyncapi/scanners/operations/annotations/SpringAnnotationMethodLevelOperationsScannerTest.java +++ b/springwolf-core/src/test/java/io/github/springwolf/core/asyncapi/scanners/operations/annotations/SpringAnnotationMethodLevelOperationsScannerTest.java @@ -5,6 +5,7 @@ import io.github.springwolf.core.asyncapi.scanners.common.headers.HeaderClassExtractor; import io.github.springwolf.core.asyncapi.scanners.common.operation.SpringAnnotationOperationService; import io.github.springwolf.core.asyncapi.scanners.common.payload.PayloadMethodParameterService; +import io.github.springwolf.core.asyncapi.scanners.operations.OperationCustomizer; import org.junit.jupiter.api.Test; import java.lang.annotation.Retention; diff --git a/springwolf-plugins/springwolf-amqp-plugin/src/main/java/io/github/springwolf/plugins/amqp/configuration/SpringwolfAmqpScannerConfiguration.java b/springwolf-plugins/springwolf-amqp-plugin/src/main/java/io/github/springwolf/plugins/amqp/configuration/SpringwolfAmqpScannerConfiguration.java index abfcca4fd..b4f03c809 100644 --- a/springwolf-plugins/springwolf-amqp-plugin/src/main/java/io/github/springwolf/plugins/amqp/configuration/SpringwolfAmqpScannerConfiguration.java +++ b/springwolf-plugins/springwolf-amqp-plugin/src/main/java/io/github/springwolf/plugins/amqp/configuration/SpringwolfAmqpScannerConfiguration.java @@ -16,8 +16,8 @@ import io.github.springwolf.core.asyncapi.scanners.common.operation.SpringAnnotationOperationService; import io.github.springwolf.core.asyncapi.scanners.common.operation.SpringAnnotationOperationsService; import io.github.springwolf.core.asyncapi.scanners.common.payload.PayloadMethodParameterService; +import io.github.springwolf.core.asyncapi.scanners.operations.OperationCustomizer; import io.github.springwolf.core.asyncapi.scanners.operations.OperationsInClassScannerAdapter; -import io.github.springwolf.core.asyncapi.scanners.operations.annotations.OperationCustomizer; import io.github.springwolf.core.asyncapi.scanners.operations.annotations.SpringAnnotationClassLevelOperationsScanner; import io.github.springwolf.core.asyncapi.scanners.operations.annotations.SpringAnnotationMethodLevelOperationsScanner; import io.github.springwolf.core.standalone.StandaloneConfiguration; diff --git a/springwolf-plugins/springwolf-jms-plugin/src/main/java/io/github/springwolf/plugins/jms/configuration/SpringwolfJmsScannerConfiguration.java b/springwolf-plugins/springwolf-jms-plugin/src/main/java/io/github/springwolf/plugins/jms/configuration/SpringwolfJmsScannerConfiguration.java index 5adaa8483..2894c1026 100644 --- a/springwolf-plugins/springwolf-jms-plugin/src/main/java/io/github/springwolf/plugins/jms/configuration/SpringwolfJmsScannerConfiguration.java +++ b/springwolf-plugins/springwolf-jms-plugin/src/main/java/io/github/springwolf/plugins/jms/configuration/SpringwolfJmsScannerConfiguration.java @@ -14,8 +14,8 @@ import io.github.springwolf.core.asyncapi.scanners.common.message.SpringAnnotationMessageService; import io.github.springwolf.core.asyncapi.scanners.common.operation.SpringAnnotationOperationService; import io.github.springwolf.core.asyncapi.scanners.common.payload.PayloadMethodParameterService; +import io.github.springwolf.core.asyncapi.scanners.operations.OperationCustomizer; import io.github.springwolf.core.asyncapi.scanners.operations.OperationsInClassScannerAdapter; -import io.github.springwolf.core.asyncapi.scanners.operations.annotations.OperationCustomizer; import io.github.springwolf.core.asyncapi.scanners.operations.annotations.SpringAnnotationMethodLevelOperationsScanner; import io.github.springwolf.core.standalone.StandaloneConfiguration; import io.github.springwolf.plugins.jms.asyncapi.scanners.bindings.JmsBindingFactory; diff --git a/springwolf-plugins/springwolf-kafka-plugin/src/main/java/io/github/springwolf/plugins/kafka/configuration/SpringwolfKafkaScannerConfiguration.java b/springwolf-plugins/springwolf-kafka-plugin/src/main/java/io/github/springwolf/plugins/kafka/configuration/SpringwolfKafkaScannerConfiguration.java index 192022069..cd18ac456 100644 --- a/springwolf-plugins/springwolf-kafka-plugin/src/main/java/io/github/springwolf/plugins/kafka/configuration/SpringwolfKafkaScannerConfiguration.java +++ b/springwolf-plugins/springwolf-kafka-plugin/src/main/java/io/github/springwolf/plugins/kafka/configuration/SpringwolfKafkaScannerConfiguration.java @@ -16,8 +16,8 @@ import io.github.springwolf.core.asyncapi.scanners.common.operation.SpringAnnotationOperationService; import io.github.springwolf.core.asyncapi.scanners.common.operation.SpringAnnotationOperationsService; import io.github.springwolf.core.asyncapi.scanners.common.payload.PayloadMethodParameterService; +import io.github.springwolf.core.asyncapi.scanners.operations.OperationCustomizer; import io.github.springwolf.core.asyncapi.scanners.operations.OperationsInClassScannerAdapter; -import io.github.springwolf.core.asyncapi.scanners.operations.annotations.OperationCustomizer; import io.github.springwolf.core.asyncapi.scanners.operations.annotations.SpringAnnotationClassLevelOperationsScanner; import io.github.springwolf.core.asyncapi.scanners.operations.annotations.SpringAnnotationMethodLevelOperationsScanner; import io.github.springwolf.core.standalone.StandaloneConfiguration; diff --git a/springwolf-plugins/springwolf-stomp-plugin/src/main/java/io/github/springwolf/plugins/stomp/asyncapi/scanners/operation/annotations/SendToCustomizer.java b/springwolf-plugins/springwolf-stomp-plugin/src/main/java/io/github/springwolf/plugins/stomp/asyncapi/scanners/operation/annotations/SendToCustomizer.java index 4e4836f24..0709b0d02 100644 --- a/springwolf-plugins/springwolf-stomp-plugin/src/main/java/io/github/springwolf/plugins/stomp/asyncapi/scanners/operation/annotations/SendToCustomizer.java +++ b/springwolf-plugins/springwolf-stomp-plugin/src/main/java/io/github/springwolf/plugins/stomp/asyncapi/scanners/operation/annotations/SendToCustomizer.java @@ -7,7 +7,7 @@ import io.github.springwolf.asyncapi.v3.model.operation.OperationReply; import io.github.springwolf.core.asyncapi.scanners.common.annotation.AnnotationUtil; import io.github.springwolf.core.asyncapi.scanners.common.payload.PayloadMethodReturnService; -import io.github.springwolf.core.asyncapi.scanners.operations.annotations.OperationCustomizer; +import io.github.springwolf.core.asyncapi.scanners.operations.OperationCustomizer; import io.github.springwolf.plugins.stomp.asyncapi.scanners.bindings.StompBindingSendToFactory; import lombok.RequiredArgsConstructor; import org.springframework.messaging.handler.annotation.SendTo; diff --git a/springwolf-plugins/springwolf-stomp-plugin/src/main/java/io/github/springwolf/plugins/stomp/asyncapi/scanners/operation/annotations/SendToUserCustomizer.java b/springwolf-plugins/springwolf-stomp-plugin/src/main/java/io/github/springwolf/plugins/stomp/asyncapi/scanners/operation/annotations/SendToUserCustomizer.java index 086899c39..845a333ae 100644 --- a/springwolf-plugins/springwolf-stomp-plugin/src/main/java/io/github/springwolf/plugins/stomp/asyncapi/scanners/operation/annotations/SendToUserCustomizer.java +++ b/springwolf-plugins/springwolf-stomp-plugin/src/main/java/io/github/springwolf/plugins/stomp/asyncapi/scanners/operation/annotations/SendToUserCustomizer.java @@ -7,7 +7,7 @@ import io.github.springwolf.asyncapi.v3.model.operation.OperationReply; import io.github.springwolf.core.asyncapi.scanners.common.annotation.AnnotationUtil; import io.github.springwolf.core.asyncapi.scanners.common.payload.PayloadMethodReturnService; -import io.github.springwolf.core.asyncapi.scanners.operations.annotations.OperationCustomizer; +import io.github.springwolf.core.asyncapi.scanners.operations.OperationCustomizer; import io.github.springwolf.plugins.stomp.asyncapi.scanners.bindings.StompBindingSendToUserFactory; import lombok.RequiredArgsConstructor; import org.springframework.messaging.simp.annotation.SendToUser; diff --git a/springwolf-plugins/springwolf-stomp-plugin/src/main/java/io/github/springwolf/plugins/stomp/configuration/SpringwolfStompScannerConfiguration.java b/springwolf-plugins/springwolf-stomp-plugin/src/main/java/io/github/springwolf/plugins/stomp/configuration/SpringwolfStompScannerConfiguration.java index dc676844e..3ee3aef31 100644 --- a/springwolf-plugins/springwolf-stomp-plugin/src/main/java/io/github/springwolf/plugins/stomp/configuration/SpringwolfStompScannerConfiguration.java +++ b/springwolf-plugins/springwolf-stomp-plugin/src/main/java/io/github/springwolf/plugins/stomp/configuration/SpringwolfStompScannerConfiguration.java @@ -18,8 +18,8 @@ import io.github.springwolf.core.asyncapi.scanners.common.operation.SpringAnnotationOperationsService; import io.github.springwolf.core.asyncapi.scanners.common.payload.PayloadMethodParameterService; import io.github.springwolf.core.asyncapi.scanners.common.payload.PayloadMethodReturnService; +import io.github.springwolf.core.asyncapi.scanners.operations.OperationCustomizer; import io.github.springwolf.core.asyncapi.scanners.operations.OperationsInClassScannerAdapter; -import io.github.springwolf.core.asyncapi.scanners.operations.annotations.OperationCustomizer; import io.github.springwolf.core.asyncapi.scanners.operations.annotations.SpringAnnotationClassLevelOperationsScanner; import io.github.springwolf.core.asyncapi.scanners.operations.annotations.SpringAnnotationMethodLevelOperationsScanner; import io.github.springwolf.core.standalone.StandaloneConfiguration;