Skip to content

Commit

Permalink
Merge pull request #492 from swagger-api/fix-resteasy
Browse files Browse the repository at this point in the history
fixes resteasy dateLibrary dependent code
  • Loading branch information
frantuma committed Oct 7, 2019
2 parents 2ab482a + eec82ba commit ccd7a53
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ public void processOpts() {
importMapping.put("OffsetDateTime", "java.time.OffsetDateTime");
}
} else if (dateLibrary.equals("legacy")) {
additionalProperties.put("legacyDates", "true");
additionalProperties.put("legacyDates", true);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class JacksonConfig implements ContextResolver<ObjectMapper> {
public JacksonConfig() throws Exception {
objectMapper = new ObjectMapper()
.setDateFormat(new RFC3339DateFormat())
.setDateFormat(new RFC3339DateFormat()){{#legacyDates}};{{/legacyDates}}
{{#java8}}
.registerModule(new JavaTimeModule());
{{/java8}}
Expand Down
11 changes: 10 additions & 1 deletion src/main/resources/handlebars/JavaJaxRS/resteasy/pom.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,14 @@
<version>1.2</version>
<scope>provided</scope>
</dependency>

{{#java8}}
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<version>${jackson-version}</version>
</dependency>
{{/java8}}
{{^java8}}
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-joda</artifactId>
Expand All @@ -137,6 +144,7 @@
<artifactId>joda-time</artifactId>
<version>2.7</version>
</dependency>
{{/java8}}
{{#useOas2}}
<dependency>
<groupId>io.swagger</groupId>
Expand Down Expand Up @@ -209,5 +217,6 @@
<slf4j-version>1.6.3</slf4j-version>
<junit-version>4.8.1</junit-version>
<servlet-api-version>2.5</servlet-api-version>
{{#java8}}<jackson-version>2.9.10</jackson-version>{{/java8}}
</properties>
</project>

0 comments on commit ccd7a53

Please sign in to comment.