File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
src/main/java/io/dinject/javalin/generator/openapi Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -65,7 +65,11 @@ private OpenAPI initOpenAPI() {
6565
6666 OpenAPI openAPI = new OpenAPI ();
6767 openAPI .setPaths (new Paths ());
68- openAPI .setInfo (new Info ());
68+
69+ Info info = new Info ();
70+ info .setTitle ("" );
71+ info .setVersion ("" );
72+ openAPI .setInfo (info );
6973
7074 return openAPI ;
7175 }
@@ -137,6 +141,10 @@ public void readApiDefinition(Element element) {
137141 if (!info .description ().isEmpty ()) {
138142 openAPI .getInfo ().setDescription (info .description ());
139143 }
144+ if (!info .version ().isEmpty ()) {
145+ openAPI .getInfo ().setVersion (info .version ());
146+ }
147+
140148 }
141149
142150 public void writeApi () {
@@ -155,7 +163,7 @@ public void writeApi() {
155163 private ObjectMapper createObjectMapper () {
156164
157165 ObjectMapper mapper = new ObjectMapper ();
158- mapper .setDefaultPropertyInclusion (JsonInclude .Include .NON_EMPTY )
166+ mapper .setDefaultPropertyInclusion (JsonInclude .Include .NON_NULL )
159167 .configure (DeserializationFeature .FAIL_ON_UNKNOWN_PROPERTIES , false )
160168 .enable (SerializationFeature .INDENT_OUTPUT );
161169
You can’t perform that action at this time.
0 commit comments