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 is still presented in JSON #4381

Closed
alebastrov opened this issue Mar 10, 2023 · 1 comment
Closed

exampleSetFlag is still presented in JSON #4381

alebastrov opened this issue Mar 10, 2023 · 1 comment

Comments

@alebastrov
Copy link

alebastrov commented Mar 10, 2023

I found the reason for that in class
io.swagger.v3.oas.models.media.MediaType
That class has internal boolean field exampleSetFlag which is leaking to JSON schema definition.
I did 2 experiments:

  • renamed the field (the json file changed and started containing renamed field)
  • added @JsonIgnore on that field ( the json file changed and irritating field disappeared)

So I would suggest adding @JsonIgnore annotation on this field like below

public class MediaType {
...
  @JsonIgnore
    private boolean exampleSetFlag;
...
}
@frantuma
Copy link
Member

exampleSetFlag field is correctly ignored in serialization when using correctly configured object mapper, please see this comment about using the correctly configured object mapper.

closing ticket, please reopen if you're still experiencing issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants