Skip to content

Commit dcb5e05

Browse files
committed
adding option to pom and pojo
1 parent c23bcc6 commit dcb5e05

File tree

6 files changed

+32
-1
lines changed

6 files changed

+32
-1
lines changed

src/main/resources/handlebars/Java/libraries/okhttp-gson/pom.mustache

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,13 @@
183183
<version>${swagger-core-version}</version>
184184
</dependency>
185185
{{/useOas2}}
186+
{{#notNullJacksonAnnotation}}
187+
<dependency>
188+
<groupId>com.fasterxml.jackson.core</groupId>
189+
<artifactId>jackson-annotations</artifactId>
190+
<version>2.10.1</version>
191+
</dependency>
192+
{{/notNullJacksonAnnotation}}
186193
<dependency>
187194
<groupId>com.squareup.okhttp</groupId>
188195
<artifactId>okhttp</artifactId>

src/main/resources/handlebars/Java/pojo.mustache

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
{{#description}}{{#useOas2}}@ApiModel{{/useOas2}}{{^useOas2}}@Schema{{/useOas2}}(description = "{{{description}}}"){{/description}}
55
{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{>xmlAnnotation}}
66

7+
{{#notNullJacksonAnnotation}}@JsonInclude(JsonInclude.Include.NON_NULL){{/notNullJacksonAnnotation}}
8+
79
public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#parcelableModel}}implements Parcelable {{#serializableModel}}, Serializable {{/serializableModel}}{{#interfaceModels}}{{#@first}}, {{/@first}}{{classname}}{{^@last}}, {{/@last}}{{#@last}} {{/@last}}{{/interfaceModels}}{{/parcelableModel}}{{^parcelableModel}}{{#serializableModel}}implements Serializable{{#interfaceModels}}, {{classname}}{{^@last}}, {{/@last}}{{#@last}} {{/@last}}{{/interfaceModels}}{{/serializableModel}}{{^serializableModel}}{{#interfaceModels}}{{#@first}}implements {{/@first}}{{classname}}{{^@last}}, {{/@last}}{{#@last}} {{/@last}}{{/interfaceModels}}{{/serializableModel}}{{/parcelableModel}}{
810
{{#serializableModel}}
911
private static final long serialVersionUID = 1L;

src/main/resources/handlebars/JavaSpring/libraries/spring-boot/pom.mustache

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,13 @@
9292
<artifactId>validation-api</artifactId>
9393
</dependency>
9494
{{/useBeanValidation}}
95+
{{#notNullJacksonAnnotation}}
96+
<dependency>
97+
<groupId>com.fasterxml.jackson.core</groupId>
98+
<artifactId>jackson-annotations</artifactId>
99+
<version>2.10.1</version>
100+
</dependency>
101+
{{/notNullJacksonAnnotation}}
95102

96103
<dependency>
97104
<groupId>org.springframework.boot</groupId>

src/main/resources/handlebars/JavaSpring/libraries/spring-cloud/pom.mustache

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,5 +111,12 @@
111111
<artifactId>spring-boot-starter-test</artifactId>
112112
<scope>test</scope>
113113
</dependency>
114+
{{#notNullJacksonAnnotation}}
115+
<dependency>
116+
<groupId>com.fasterxml.jackson.core</groupId>
117+
<artifactId>jackson-annotations</artifactId>
118+
<version>2.10.1</version>
119+
</dependency>
120+
{{/notNullJacksonAnnotation}}
114121
</dependencies>
115122
</project>

src/main/resources/handlebars/JavaSpring/libraries/spring-mvc/pom.mustache

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,13 @@
181181
</exclusion>
182182
</exclusions>
183183
</dependency>
184-
184+
{{#notNullJacksonAnnotation}}
185+
<dependency>
186+
<groupId>com.fasterxml.jackson.core</groupId>
187+
<artifactId>jackson-annotations</artifactId>
188+
<version>${jackson-version}</version>
189+
</dependency>
190+
{{/notNullJacksonAnnotation}}
185191
<dependency>
186192
<groupId>org.apache.httpcomponents</groupId>
187193
<artifactId>httpclient</artifactId>

src/main/resources/handlebars/JavaSpring/pojo.mustache

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
@ApiModel(description = "{{{description}}}"){{/description}}
55
{{#useBeanValidation}}@Validated{{/useBeanValidation}}
66
{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{>xmlAnnotation}}
7+
{{#notNullJacksonAnnotation}}@JsonInclude(JsonInclude.Include.NON_NULL){{/notNullJacksonAnnotation}}
8+
79
public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#serializableModel}}implements Serializable {{#interfaceModels}}, {{classname}}{{^@last}}, {{/@last}}{{#@last}} {{/@last}}{{/interfaceModels}}{{/serializableModel}}{{^serializableModel}}{{#interfaceModels}}{{#@first}}implements {{/@first}}{{classname}}{{^@last}}, {{/@last}}{{#@last}}{{/@last}}{{/interfaceModels}}{{/serializableModel}} {
810
{{#serializableModel}}
911
private static final long serialVersionUID = 1L;

0 commit comments

Comments
 (0)