File tree 3 files changed +8
-2
lines changed
springdoc-openapi-common/src/main/java/org/springdoc/core
springdoc-openapi-webmvc-core/src/test
java/test/org/springdoc/api/v30/app173
3 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 37
37
import java .util .stream .Collectors ;
38
38
import java .util .stream .Stream ;
39
39
40
+ import com .fasterxml .jackson .annotation .JsonInclude .Include ;
40
41
import com .fasterxml .jackson .core .JsonProcessingException ;
41
42
import com .fasterxml .jackson .databind .ObjectMapper ;
42
43
import io .swagger .v3 .core .jackson .TypeNameResolver ;
@@ -249,6 +250,9 @@ public OpenAPI build(Locale locale) {
249
250
try {
250
251
ObjectMapper objectMapper = ObjectMapperProvider .createJson (springDocConfigProperties );
251
252
calculatedOpenAPI = objectMapper .readValue (objectMapper .writeValueAsString (openAPI ), OpenAPI .class );
253
+ objectMapper .setSerializationInclusion (Include .ALWAYS );
254
+ Map extensionsClone = objectMapper .readValue (objectMapper .writeValueAsString (openAPI .getExtensions ()), Map .class );
255
+ calculatedOpenAPI .extensions (extensionsClone );
252
256
}
253
257
catch (JsonProcessingException e ) {
254
258
LOGGER .warn ("Json Processing Exception occurred: {}" , e .getMessage ());
Original file line number Diff line number Diff line change 22
22
23
23
package test .org .springdoc .api .v30 .app173 ;
24
24
25
+ import java .util .Collections ;
25
26
import java .util .Locale ;
26
27
27
28
import io .swagger .v3 .oas .models .OpenAPI ;
@@ -65,7 +66,7 @@ private void testApp(Locale locale) throws Exception {
65
66
static class SpringDocTestApp {
66
67
@ Bean
67
68
public OpenAPI openAPI () {
68
- return new OpenAPI ();
69
+ return new OpenAPI (). extensions ( Collections . singletonMap ( "TEST" , "HELLO" )) ;
69
70
}
70
71
}
71
72
Original file line number Diff line number Diff line change 48
48
}
49
49
}
50
50
},
51
- "components" : {}
51
+ "components" : {},
52
+ "TEST" : " HELLO"
52
53
}
You can’t perform that action at this time.
0 commit comments