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

Pojo to ignore null value fields #6488

Closed
dougbacelar opened this issue Sep 13, 2017 · 10 comments
Closed

Pojo to ignore null value fields #6488

dougbacelar opened this issue Sep 13, 2017 · 10 comments
Assignees
Milestone

Comments

@dougbacelar
Copy link

dougbacelar commented Sep 13, 2017

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.

@mbracero
Copy link

+1

8 similar comments
@apurvjain17
Copy link

+1

@manudevelopia
Copy link

+1

@pleali
Copy link

pleali commented Oct 1, 2018

+1

@gserracalahorra
Copy link

+1

@P3tronius
Copy link

+1

@anshchauhan
Copy link

+1

@sendhilcoep
Copy link

+1

@LuGaXu
Copy link

LuGaXu commented Dec 5, 2019

+1

@frantuma frantuma added this to the M1 milestone Apr 27, 2020
@frantuma frantuma modified the milestones: M1, M2 May 13, 2020
gracekarina added a commit that referenced this issue May 20, 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
@gracekarina
Copy link
Contributor

PR’s de NotNull option:
Master Branch:
#10269
v3 codegen-generators:
swagger-api/swagger-codegen-generators#690
v3 codegen:
#10268

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