Package org.brapi.schematools.core.utils
Class OpenAPIUtils
java.lang.Object
org.brapi.schematools.core.utils.OpenAPIUtils
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringprettyPrint(io.swagger.v3.oas.models.OpenAPI openAPI) Pretty print an OpenAPI object to a JSON String, with a default indentation of 4 spaces.static StringprettyPrint(io.swagger.v3.oas.models.OpenAPI openAPI, int indent, String format) Pretty print an OpenAPI object to a JSON String.static StringprettyPrint(io.swagger.v3.oas.models.OpenAPI openAPI, String format) Pretty print an OpenAPI object to a JSON String, with a default indentation of 4 spaces.
-
Field Details
-
OUTPUT_FORMAT_YAML
- See Also:
-
OUTPUT_FORMAT_JSON
- See Also:
-
-
Constructor Details
-
OpenAPIUtils
public OpenAPIUtils()
-
-
Method Details
-
prettyPrint
public static String prettyPrint(io.swagger.v3.oas.models.OpenAPI openAPI) throws com.fasterxml.jackson.core.JsonProcessingException Pretty print an OpenAPI object to a JSON String, with a default indentation of 4 spaces.- Parameters:
openAPI- the object to be Pretty printed- Returns:
- Pretty print JSON String version of the object
- Throws:
com.fasterxml.jackson.core.JsonProcessingException- if the object cannot be converted to JSON.
-
prettyPrint
public static String prettyPrint(io.swagger.v3.oas.models.OpenAPI openAPI, String format) throws com.fasterxml.jackson.core.JsonProcessingException Pretty print an OpenAPI object to a JSON String, with a default indentation of 4 spaces.- Parameters:
openAPI- the object to be Pretty printed- Returns:
- Pretty print JSON String version of the object
- Throws:
com.fasterxml.jackson.core.JsonProcessingException- if the object cannot be converted to JSON.
-
prettyPrint
public static String prettyPrint(io.swagger.v3.oas.models.OpenAPI openAPI, int indent, String format) throws com.fasterxml.jackson.core.JsonProcessingException Pretty print an OpenAPI object to a JSON String.- Parameters:
openAPI- the object to be Pretty printedindent- the number of spaces to indent- Returns:
- Pretty print JSON String version of the object
- Throws:
com.fasterxml.jackson.core.JsonProcessingException- if the object cannot be converted to JSON.
-