Package io.micronaut.openapi.visitor
Class OpenApiNormalizeUtils
java.lang.Object
io.micronaut.openapi.visitor.OpenApiNormalizeUtils
Normalization methods for openAPI objects.
- Since:
- 6.6.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
findAndRemoveDuplicates
(io.swagger.v3.oas.models.media.Content content) static void
findAndRemoveDuplicates
(io.swagger.v3.oas.models.media.Schema<?> schema) static void
findAndRemoveDuplicates
(io.swagger.v3.oas.models.OpenAPI openApi) Find and remove duplicates in openApi object.static void
findAndRemoveDuplicates
(io.swagger.v3.oas.models.Operation operation) static void
normalizeContent
(io.swagger.v3.oas.models.media.Content content) static void
normalizeExamples
(Map<String, io.swagger.v3.oas.models.examples.Example> examples) static void
normalizeOpenApi
(io.swagger.v3.oas.models.OpenAPI openAPI) static void
normalizeOperation
(io.swagger.v3.oas.models.Operation operation) static io.swagger.v3.oas.models.media.Schema<?>
normalizeSchema
(io.swagger.v3.oas.models.media.Schema<?> schema) static void
normalizeSchemas
(Map<String, io.swagger.v3.oas.models.media.Schema> schemas) Sort schemas list in allOf block: schemas with ref must be first, next other schemas.static void
removeEmtpyComponents
(io.swagger.v3.oas.models.OpenAPI openAPI) static <T> void
sortComponent
(io.swagger.v3.oas.models.Components components, Function<io.swagger.v3.oas.models.Components, Map<String, T>> getter, BiConsumer<io.swagger.v3.oas.models.Components, Map<String, T>> setter)
-
Method Details
-
normalizeOpenApi
public static void normalizeOpenApi(io.swagger.v3.oas.models.OpenAPI openAPI) -
normalizeOperation
public static void normalizeOperation(io.swagger.v3.oas.models.Operation operation) -
normalizeContent
public static void normalizeContent(io.swagger.v3.oas.models.media.Content content) -
normalizeExamples
-
sortComponent
-
normalizeSchema
public static io.swagger.v3.oas.models.media.Schema<?> normalizeSchema(io.swagger.v3.oas.models.media.Schema<?> schema) -
normalizeSchemas
Sort schemas list in allOf block: schemas with ref must be first, next other schemas.- Parameters:
schemas
- all schema components
-
removeEmtpyComponents
public static void removeEmtpyComponents(io.swagger.v3.oas.models.OpenAPI openAPI) -
findAndRemoveDuplicates
public static void findAndRemoveDuplicates(io.swagger.v3.oas.models.OpenAPI openApi) Find and remove duplicates in openApi object.- Parameters:
openApi
- openAPI object
-
findAndRemoveDuplicates
public static void findAndRemoveDuplicates(io.swagger.v3.oas.models.Operation operation) -
findAndRemoveDuplicates
public static void findAndRemoveDuplicates(io.swagger.v3.oas.models.media.Content content) -
findAndRemoveDuplicates
public static void findAndRemoveDuplicates(io.swagger.v3.oas.models.media.Schema<?> schema)
-