-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
implements exampleSetFlag to flag deserialization of null example vs missing #3637
Conversation
@frantuma, I think I'm getting a collateral effect of this change in the Parser. When serializing the OpenAPI object, the
|
it's possible that you're not using You would use them e.g by calling |
@frantuma, well I'm using exactly this with openapi-generator and swagger-parser 2.0.20:
And it being working well, but after moving to the 2.0.22-SNAPSHOT the problem appears. |
@cvgaviao I am not able to reproduce this, it successfully tests in core and latest parser. Possibly the ObjectMapper used gets customized somehow, disabling If you're still experiencing the issues, please provide a reproducible test case |
@frantuma, I'm in a rush here and I downgraded the version in order to keep things running ok. I was not able to find any Serialization test in this code, just found Deserialization ones. Could you point it to me? I'll try to look at it, and if were necessary to create a reproducer this weekend. |
@cvgaviao I produce the same issue. I downgrade my swagger-core version to 2.1.3 to resolve my issue. My point of view can be wrong, but I think the issue is in this class : When the boolean exampleSetFlag is a primitive field and not a Boolean object, the ObjectMapper will always serialize the boolean value (false if not set, true if the method public void setExample(Object example) is called. |
Fixes springwolf#169 The `exampleSetFlag` and `types` properties belong to `swagger-core` internals and are not part of the AsyncAPI specification. See swagger-api/swagger-core#3637 (comment) for some details. This PR replaces the custom JSON ObjectMapper by the `swagger-core` one, which already contains all the needed `mixins` to properly serialize the specification. Fixes springwolf#169 for Json Serialization
Fixes springwolf#169 The `exampleSetFlag` and `types` properties belong to `swagger-core` internals and are not part of the AsyncAPI specification. See swagger-api/swagger-core#3637 (comment) for some details. This PR replaces the custom JSON ObjectMapper by the `swagger-core` one, which already contains all the needed `mixins` to properly serialize the specification. Fixes springwolf#169 for Json Serialization
* fix: Fixed JSON serializer to not leak unintended values Fixes #169 The `exampleSetFlag` and `types` properties belong to `swagger-core` internals and are not part of the AsyncAPI specification. See swagger-api/swagger-core#3637 (comment) for some details. This PR replaces the custom JSON ObjectMapper by the `swagger-core` one, which already contains all the needed `mixins` to properly serialize the specification. Fixes #169 for Json Serialization * chore: Use swagger objectmapper The swagger objectmapper uses jackson underneath. Besides registering serializers, also the mapper is configured automatically. --------- Co-authored-by: Timon Back <timon.back+git@gmail.com>
No description provided.