File tree Expand file tree Collapse file tree
main/java/com/backbase/oss/codegen/marina
test/java/com/backbase/oss/codegen/marina Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5353 <version >4.3.1</version >
5454 </dependency >
5555
56+ <dependency >
57+ <groupId >com.fasterxml.jackson.datatype</groupId >
58+ <artifactId >jackson-datatype-jsr310</artifactId >
59+ </dependency >
60+
5661 <dependency >
5762 <groupId >com.backbase.oss</groupId >
5863 <artifactId >boat-engine</artifactId >
Original file line number Diff line number Diff line change 33import com .fasterxml .jackson .annotation .JsonInclude ;
44import com .fasterxml .jackson .databind .ObjectMapper ;
55import com .fasterxml .jackson .databind .SerializationFeature ;
6+ import com .fasterxml .jackson .datatype .jsr310 .JavaTimeModule ;
67import com .github .jknack .handlebars .Context ;
78import com .github .jknack .handlebars .Handlebars ;
89import com .github .jknack .handlebars .Helper ;
@@ -78,6 +79,8 @@ boolean isValidField(
7879 return "" ;
7980 });
8081 ObjectMapper objectMapper = new ObjectMapper ();
82+ objectMapper .registerModule (new JavaTimeModule ());
83+ objectMapper .disable (SerializationFeature .WRITE_DATES_AS_TIMESTAMPS );
8184 objectMapper .enable (SerializationFeature .INDENT_OUTPUT );
8285 objectMapper .setSerializationInclusion (JsonInclude .Include .NON_NULL );
8386 Helper <Object > instance = new Jackson2Helper (objectMapper );
Original file line number Diff line number Diff line change @@ -30,6 +30,15 @@ void testGenerate() throws IOException {
3030 }
3131 }
3232
33+ @ Test
34+ void testGenerateDocsWithDateTimeExamples () throws IOException {
35+ generateDocs (getFile ("/openapi-with-examples/openapi-with-multiple-permissions.yaml" ));
36+
37+ File index = new File ("target/marina-docs/api.js" );
38+ String generated = String .join (" " , Files .readAllLines (Paths .get (index .getPath ())));
39+ assertTrue (generated .contains ("2017-10-04T14:54:36Z" ));
40+ }
41+
3342 @ Test
3443 void testGenerateDocs () throws IOException {
3544 generateDocs (getFile ("/openapi-with-examples/openapi-with-json.yaml" ));
You can’t perform that action at this time.
0 commit comments