You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bug description
When a producer (possibly consumer as well - not tested) payload class is annotated by Swagger @Schema annotation with name the name is used in the schema definitions but in the channel payload message a class simple name is used and therefore there is a mismatch between those 2 which leads to invalid AsyncAPI definition.
See the details in the AsyncAPI result bellow (ExamplePayloadDto vs ExampleProducerPayload)
Dependencies and versions used springwolf-core version 0.7.0 swagger-annotations version 2.1.0
Code example
Example Payload DTO:
import io.swagger.v3.oas.annotations.media.Schema;
@Schema(name = "ExampleProducerPayload")
public class ExamplePayloadDto {
private String someString;
public String getSomeString() {
return someString;
}
public void setSomeString(String someString) {
this.someString = someString;
}
}
AsyncApiDocket configuration:
@Bean
public AsyncApiDocket asyncApiDocket() {
Info info = Info.builder()
.version("1.0.0")
.title("Springwolf example project")
.build();
ProducerData exampleProducerData = ProducerData.builder()
.channelName("example-producer-topic")
.operationBinding(Map.of("pubsub", new KafkaOperationBinding()))
.payloadType(ExamplePayloadDto.class)
.build();
return AsyncApiDocket.builder()
.info(info)
.producer(exampleProducerData)
.build();
}
jn-monster
changed the title
Inconsistency between Channel Message and Schema object name
Mismatch between Channel Message and Schema object name
Oct 6, 2022
Bug description
When a producer (possibly consumer as well - not tested) payload class is annotated by Swagger
@Schema
annotation withname
the name is used in the schema definitions but in the channel payload message a class simple name is used and therefore there is a mismatch between those 2 which leads to invalid AsyncAPI definition.See the details in the AsyncAPI result bellow (
ExamplePayloadDto
vsExampleProducerPayload
)Dependencies and versions used
springwolf-core
version0.7.0
swagger-annotations
version2.1.0
Code example
Example Payload DTO:
AsyncApiDocket configuration:
AsyncAPI result
The text was updated successfully, but these errors were encountered: