File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
springdoc-openapi-common/src/main/java/org/springdoc/api Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 109
109
/**
110
110
* The type Abstract open api resource.
111
111
* @author bnasslahsen
112
+ * @author kevinraddatz
112
113
*/
113
114
public abstract class AbstractOpenApiResource extends SpecFilter {
114
115
@@ -1033,9 +1034,9 @@ protected String writeYamlValue(OpenAPI openAPI) throws JsonProcessingException
1033
1034
YAMLFactory factory = (YAMLFactory ) objectMapper .getFactory ();
1034
1035
factory .configure (Feature .USE_NATIVE_TYPE_ID , false );
1035
1036
if (!springDocConfigProperties .isWriterWithDefaultPrettyPrinter ())
1036
- result = objectMapper .writeValueAsString (openAPI );
1037
+ result = objectMapper .writerFor ( OpenAPI . class ). writeValueAsString (openAPI );
1037
1038
else
1038
- result = objectMapper .writerWithDefaultPrettyPrinter ().writeValueAsString (openAPI );
1039
+ result = objectMapper .writerWithDefaultPrettyPrinter ().forType ( OpenAPI . class ). writeValueAsString (openAPI );
1039
1040
return result ;
1040
1041
}
1041
1042
@@ -1096,9 +1097,9 @@ protected String writeJsonValue(OpenAPI openAPI) throws JsonProcessingException
1096
1097
if (springDocConfigProperties .isWriterWithOrderByKeys ())
1097
1098
sortOutput (objectMapper );
1098
1099
if (!springDocConfigProperties .isWriterWithDefaultPrettyPrinter ())
1099
- result = objectMapper .writeValueAsString (openAPI );
1100
+ result = objectMapper .writerFor ( OpenAPI . class ). writeValueAsString (openAPI );
1100
1101
else
1101
- result = objectMapper .writerWithDefaultPrettyPrinter ().writeValueAsString (openAPI );
1102
+ result = objectMapper .writerWithDefaultPrettyPrinter ().forType ( OpenAPI . class ). writeValueAsString (openAPI );
1102
1103
return result ;
1103
1104
}
1104
1105
You can’t perform that action at this time.
0 commit comments