Skip to content
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

'exampleSetFlag' value from Swagger-Core is leaked into the JSON serialized specification #169

Closed
ctasada opened this issue May 8, 2023 · 2 comments · Fixed by #170
Closed
Labels
bug Something isn't working

Comments

@ctasada
Copy link
Collaborator

ctasada commented May 8, 2023

Describe the bug
When creating the asyncapi.json file it contains properties that do not belong to the AsyncAPI specification, but that are swagger-core internals.

Unexpected values

  • exampleSetFlag
  • types[]

A similar issue is reported at swagger-api/swagger-core#3637 (comment)

Dependencies and versions used
springwolf-core version 0.10.0.

Code example
Serialized value

          "bindings" : {
            "kafka" : {
              "key" : {
                "type" : "string",
                "exampleSetFlag" : false,
                "types" : [ "string" ]
              },
              "bindingVersion" : "binding-version-1"
            }
          }

Expected value

          "bindings" : {
            "kafka" : {
              "key" : {
                "type" : "string"
              },
              "bindingVersion" : "binding-version-1"
            }
          }
@ctasada ctasada added the bug Something isn't working label May 8, 2023
ctasada pushed a commit to ctasada/springwolf-core that referenced this issue May 8, 2023
@timonback
Copy link
Member

Re-opening as the underlying issue is not solved.
Relates to: #160

@timonback timonback reopened this May 12, 2023
ctasada pushed a commit to ctasada/springwolf-core that referenced this issue May 12, 2023
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
ctasada pushed a commit to ctasada/springwolf-core that referenced this issue May 13, 2023
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
@ctasada
Copy link
Collaborator Author

ctasada commented May 15, 2023

@timonback this specific issue should be now fixed

timonback added a commit that referenced this issue May 27, 2023
* 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 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants