Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
/**
* The type Abstract open api resource.
* @author bnasslahsen
* @author kevinraddatz
*/
public abstract class AbstractOpenApiResource extends SpecFilter {

Expand Down Expand Up @@ -1033,9 +1034,9 @@ protected String writeYamlValue(OpenAPI openAPI) throws JsonProcessingException
YAMLFactory factory = (YAMLFactory) objectMapper.getFactory();
factory.configure(Feature.USE_NATIVE_TYPE_ID, false);
if (!springDocConfigProperties.isWriterWithDefaultPrettyPrinter())
result = objectMapper.writeValueAsString(openAPI);
result = objectMapper.writerFor(OpenAPI.class).writeValueAsString(openAPI);
else
result = objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(openAPI);
result = objectMapper.writerWithDefaultPrettyPrinter().forType(OpenAPI.class).writeValueAsString(openAPI);
return result;
}

Expand Down Expand Up @@ -1096,9 +1097,9 @@ protected String writeJsonValue(OpenAPI openAPI) throws JsonProcessingException
if (springDocConfigProperties.isWriterWithOrderByKeys())
sortOutput(objectMapper);
if (!springDocConfigProperties.isWriterWithDefaultPrettyPrinter())
result = objectMapper.writeValueAsString(openAPI);
result = objectMapper.writerFor(OpenAPI.class).writeValueAsString(openAPI);
else
result = objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(openAPI);
result = objectMapper.writerWithDefaultPrettyPrinter().forType(OpenAPI.class).writeValueAsString(openAPI);
return result;
}

Expand Down