-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Pojo to ignore null value fields #6488
Milestone
Comments
+1 |
8 similar comments
+1 |
+1 |
+1 |
+1 |
+1 |
+1 |
+1 |
+1 |
gracekarina
added a commit
that referenced
this issue
May 12, 2020
gracekarina
added a commit
that referenced
this issue
May 15, 2020
gracekarina
added a commit
that referenced
this issue
May 21, 2020
gracekarina
added a commit
that referenced
this issue
May 22, 2020
gracekarina
added a commit
that referenced
this issue
May 22, 2020
author gracekarina <[email protected]> 1589324390 -0500 committer gracekarina <[email protected]> 1590159623 -0500 parent a68e470 author gracekarina <[email protected]> 1589324390 -0500 committer gracekarina <[email protected]> 1590159561 -0500 refs - #6488 NotNullJacksonAnnotation option and tests docs: standalone generator development updated asp samples v3 and v2.2 added script files for aspnet core 2.2 prepare release 3.0.20 bump snapshot 3.0.21-SNAPSHOT
PR’s de NotNull option: |
This was referenced Jun 1, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
I have an issue where I need the pojo to ignore null value fields.
The same issue is described by this guy here
I was wondering if it is possible to make this work(some kind of setting or parameter), without having to edit the swagger-codegen code, like the guy above did.
If it is not possible, shouldn't this be the default behaviour? Shouldn't the pojo ignore null value fields by default?
Guess I would expect
@JsonInclude(JsonInclude.Include.NON_NULL)
to be populated on the pojo by default, do I have the wrong idea?Not sure if it is the right file, but I checked pojo.mustache and it doesn't seem to have anything doing that.
Swagger-codegen version
2.3.0
Related issues/PRs
I found this issue but I am not sure if it is related:
#1413
Ps
I am new to swagger-codegen so I apologize if this does not make sense.
I solved my problem for the time being by adding
spring.jackson.serialization-inclusion=non_null
, but I would rather have a class-level solution, instead of project-level.The text was updated successfully, but these errors were encountered: