-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DateTime examples in yaml show validation error in https://studio.asyncapi.com/ (issue raised in AsyncAPI Studio) #534
Comments
Thank you for the report, the issue has been addressed in the new release. Feel free to reopen this issue if there is still something missing. |
Hi, I tested the generated asyncapi 3.0.0 generate yaml and it is pretty much OK, except for a few things I had to fix by hand. I can not disclose neither the source code, nor the generated asyncapi file , but I can share the fix I made by hand:
same goes for createdOn: 2015-07-20T15:49:04-07:00 -> createdOn: "2015-07-20T15:49:04-07:00"
so I fixed these like so:
also occurring under operation:
and I fixed it like so:
not working:
I had to change it like so:
Still, the asyncapi 3.0.0 it's a great step forward, and I really want to thank you (and all contributors) for this. I hope my feedback is sufficient for you to investigate. Regards, Pascal |
Additional note about "schemaFormat" and "schema" issue: https://studio.asyncapi.com/ does NOT report the presence of these 2 elements as being an issue, BUT the IntelliJ AsyncAPI plugin https://plugins.jetbrains.com/plugin/15673-asyncapi does. |
Thanks for the update. I updated the release notes -> migration guide to explicitly mention the I took a quick look at the There: Can you adapt one of the springwolf examples (for example kafka) so that we can reproduce the issues there? You can test the yaml output locally by running the ApiIntegrationTest (requires docker). Just change the url in Line 35 in a3b4743
String url = "/springwolf/docs.yaml";
|
Hi, I am using Rabbit, not Kafka. In the mean time, I'll try to debug on my side. |
Hi @pdalfarr, |
Hi Debugging com.fasterxml.jackson.core.io.SegmentedStringWriter gave a first insight: One of my Rabbit messages classes is a generic:
and it seems yamlMapper has an hard time serializing this cfr Line 31 in a8f18eb
Which eventually leads to hence the "?" in the generated yaml I keep digging. |
Hi @pdalfarr, any update on what you have discovered? |
Hi @timonback , I did some tests and, starting with your test, I could only reproduce the "date format" issue reported by https://studio.asyncapi.com/
and https://studio.asyncapi.com/ is reporting this as an issue.
Important: PR available: I created PR #669 with the modification I did in ApiIntegrationTest.java so you can have a look. In this PR, I am willingly leaving ´localDate: "2015-07-20"´ which set the test in failure.
but it does NOT complain about missing double quotes for localDateTime ...
In the meantime, I would suggest that we close (put on hold ..?) this issue, as I can't tell for sure whether it's related or not to my 'old SpringBoot 2.x setup'. |
Hi @pdalfarr, we believe that this is a bug in the async api parser and created an issue for it: asyncapi/parser-js#980 |
Hi @pdalfarr, the issue got a response indicating that springwolf generates a valid async api spec. The issue seems to be in the js-yaml library that is used by AsyncApi Studio. As a workaround you should be able to specify your own example for LocalDate fields by using the @Schema(example = "\"2000-01-01T02:00:00+02:00\"")
private OffsetDateTime offsetDateTimet; @pdalfarr Please let us know if it works. |
Thanks for your suggestion. Some tests I made to try to obtain
leads to this in yaml
-> the
leads to this in yaml
-> it seems the example is not taken into account and generated example use the '2015-07-20' default value (where does is come from?). And still no double quotes. Question: Thanks. |
FYI, I think I have a better understanding of the cause regarding enums being between
generated yaml is:
No problem here:
So, having enum being Component, seems to 'trigger' the bug (I guess this is a bug...?),
into
Which is NOT correct
So, exactly the same as before EXCEPT FOR I could not find this bug being reported in https://github.com/asyncapi/parser-js/issues?q=is%3Aissue+is%3Aopen+enum Can I kindly ask you to help me reporting this bug / initiate an inquiry ? I am not sure where I should send this info? Thanks. Pascal |
Hi @pdalfarr, thanks a lot for putting so much effort in analyzing. I think we have multiple points here.
I think this is a bug and I can reproduce it in core.
This was just a quick guess for a workaround. I had look at what happens when the example is generated and I can see that with the double quotes, there is no example in the schema at all. This is why the default date is returned. Without the escaped double quotes, the schema contains the example as one would expect. So unfortunately it is not possible to use it as a workaround. |
Great news, thanks! |
I will move the problem with the enums to a new issue to have the different issues separated and close this one. |
Describe the bug
Using the https://www.springwolf.dev/docs/configuration/#actuator-support feature, I downloaded the docs.yaml from my back-end using url http://localhost:8450/actuator/springwolf/docs.yaml
Then I used this docs.yaml in both https://studio.asyncapi.com/ and https://editor.swagger.io/ but validation errors occurs
Dependencies and versions used
springwolf-core and springwolf-amqp 0.17.0
Code example
No code example as I cannot disclose my asyncapi definition.
One can use its own docs.yaml and follow the procedure describe above to reproduce this 'bug'
Stack trace and error logs
No stacktrace, as the problem is not an exception, but rather, a possible issue in the generated docs.yaml
Question
I noticed that asyncapi version in generated docs.yaml is 2.6.0. Maybe it would be better if it was 3.0.0 ?
How can I make Springwolf generate a 3.0.0 asyncapi docs.yaml file?
The text was updated successfully, but these errors were encountered: