-
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
Easier control over quotes / always quote string values in YAML? #820
Comments
Hi @ccudennec-otto, Exposing the ObjectMappers sounds like a good idea. Springwolf currently uses multiple ObjectMappers for serialization:
You are welcome to allow ObjectMapper customization as a contribution. |
Hi @sam0r040! I've just tried Spring Wolf 1.5.0 but for me it does not generate different output. The reason is that your code changes did not change the implementation of I can contribute the code changes if you agree that this is missing. 😃 Cheers, Christopher |
Hi @ccudennec-otto, Actually, you can configure the objectMapper of the Of course you are welcome to contribute a code change. As a side note, lately we have been seeing activity in studio to address the issue there as well: asyncapi/studio#1124 |
I don't know when the code for the example generation is actually used. I generate the AsyncAPI documentation by GETting the YAML response from the I try to prepare a PR to illustrate the changes.
Getting the fix in AsyncAPI studio would be even better. 😃 I've also raised an issue on their side to fix the issue a while ago: asyncapi/studio#1119 |
Validation of type |
Hello, welcome and thank you @aeworxet I just merged #881 so that we got the updated parser-js now. @ccudennec-otto You can try the snapshot version, probably with springwold asyncapi compatibility mode turn off. Springwolf generates the asyncapi document, that you http GET, in multiple steps. First, it scans for methods. Then creates the examples (that is the code @sam0r040 changed, as there are json, yaml or xml examples possible, which is independent from the document content type). The examples contain the date strings. Last, you http get the document and use the defaultserializerservice (and its objectmapper). |
I've just tested the code in Studio and it looks good now! |
Great, nothing further to do on this issue. I will re-open the issue for tracking purposes of the next release, |
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, Thank you for the report/contribution! |
After removing the compatibility mode in #898, this issue can be closed |
The change is available in the latest release. 🎉 Thank you for the report/contribution and making Springwolf better! |
Describe the feature request
I'm trying to render my asyncapi.yaml in https://studio.asyncapi.com/ but that tool seems to have problems if the values in the YAML are not quoted. As an example: I have an object that defines a date field and defines the example as
appointmentDate: 2015-07-20
. In that case AsyncAPI studio shows me an error. If I quote the value using double quotes it does not show an error.I was able to solve the issue by implementing my own
AsyncApiSerializerService
and defining it as a bean. My implementation will additionally disable the featureFeature.MINIMIZE_QUOTES
for YAML.Motivation
I think this is rather an issue of AsyncAPI studio, because the unquoted value is fine according to the JSON schema specification.
But it would be nice to instantly see the result in AsyncAPI studio anyway. Giving easier control over the way the output is rendered would be a good feature anyway IMHO.
Technical details
Describe alternatives you've considered
As explained above, my current solution defines my own implementation of
AsyncApiSerializerService
with customized behaviour.I'm happy to get your thoughts and feedback.
Cheers,
Christopher
The text was updated successfully, but these errors were encountered: