Schemas converted to String type, when default content type changed to application/yaml
Describe the bug
When I changed default-content-type to application/yaml
generated file and springwolf-ui received in Schemas section all POJO's as String object.
Dependencies and versions used tested on latest master version(1.3.0-SNAPSHOT) and 1.2.0 of springwolf-amqp springwolf-ui
Code example
Proper working
springwolf.docket.default-content-type=application/json (default)
Issue springwolf.docket.default-content-type=application/yaml I was working on yours AMQP example (https://github.com/springwolf/springwolf-core/tree/master/springwolf-examples/springwolf-amqp-example), and I changed default-content-type in docker-compose.yaml
version: '3'
services:
app:
image: stavshamir/springwolf-amqp-example:${SPRINGWOLF_VERSION}
environment:
- SPRINGWOLF_DOCKET_DEFAULT-CONTENT-TYPE=application/yaml
links:
- amqp
ports:
- "8080:8080"
depends_on:
- amqp
amqp:
image: rabbitmq:3.8-management-alpine
ports:
# AMQP protocol port
- '5672:5672'
# HTTP management UI
- '15672:15672'
Result:
Welcome to Springwolf. Thanks a lot for reporting your first issue. Please check out our contributors guide and feel free to join us on discord.
Hi @MrOli1412 This is a workaround so that async api studio can render the asyncapi.yaml file, see https://github.com/springwolf/springwolf-core/blob/master/springwolf-core%2Fsrc%2Fmain%2Fjava%2Fio%2Fgithub%2Fspringwolf%2Fcore%2Fasyncapi%2Fcomponents%2Fexamples%2Fwalkers%2Fyaml%2FExampleYamlValueGenerator.java#L42
Feel free to upvote/comment the linked issue https://github.com/asyncapi/spec/issues/1038
We suggested the code change https://github.com/stoplightio/spectral/pull/2625, which we believe will address the underlying issue.
When merged & released, we will remove the workaround from Springwolf.
The change is staged for release and will be part of the next release.
If you want to try and verify it in your application today, use the latest 1.X.0-SNAPSHOT build as described in our README.md > Testing SNAPSHOT version
Thank you for the report/contribution!
Hi @MrOli1412,
as a workaround, we introduced with the latest release a configuration property springwolf.studio-compatibility, which you can disable to avoid "fixing" the schema type for yaml content-type.
The change is available in the latest release. 🎉
Thank you for the report/contribution and making Springwolf better!