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

Swagger generation issue with @JsonInclude(JsonInclude.Include.NON_NULL) #12515

Open
amanagarwal09 opened this issue Jan 10, 2025 · 0 comments
Open

Comments

@amanagarwal09
Copy link

Description

When I am trying to create model and pojo class using Swager code generation, I wanted to have @JsonInclude(JsonInclude.Include.NON_NULL) annotation in some module but not all modules Can we have this as configuration in pom.xml file for the module where we need this?

Swagger-codegen version

3.0.3

Swagger maven plugin version

3.0.3

Language

jaxrs-jersey

JSON include , definition.yaml
Swagger declaration file content or url

We added this to pojo.mustache class
{{#notNullJacksonAnnotation}}
@JsonInclude(JsonInclude.Include.NON_NULL)
{{/notNullJacksonAnnotation}}

We added this to model.mustache class
import com.fasterxml.jackson.annotation.JsonInclude;

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

1 participant