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, io.micronaut.inject.visitor.VisitorContext context) static void
normalizeExamples
(Map<String, io.swagger.v3.oas.models.examples.Example> examples) static void
normalizeHeaders
(Map<String, io.swagger.v3.oas.models.headers.Header> headers, io.micronaut.inject.visitor.VisitorContext context) static void
normalizeOpenApi
(io.swagger.v3.oas.models.OpenAPI openAPI, io.micronaut.inject.visitor.VisitorContext context) static void
normalizeOperation
(io.swagger.v3.oas.models.Operation operation, io.micronaut.inject.visitor.VisitorContext context) static io.swagger.v3.oas.models.media.Schema<?>
normalizeSchema
(io.swagger.v3.oas.models.media.Schema<?> schema, io.micronaut.inject.visitor.VisitorContext context) static void
normalizeSchemas
(Map<String, io.swagger.v3.oas.models.media.Schema> schemas, io.micronaut.inject.visitor.VisitorContext context) Sort schemas list in allOf block: schemas with ref must be first, next other schemas.static void
removeEmptyComponents
(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, io.micronaut.inject.visitor.VisitorContext context) -
normalizeOperation
public static void normalizeOperation(io.swagger.v3.oas.models.Operation operation, io.micronaut.inject.visitor.VisitorContext context) -
normalizeHeaders
-
normalizeContent
public static void normalizeContent(io.swagger.v3.oas.models.media.Content content, io.micronaut.inject.visitor.VisitorContext context) -
normalizeExamples
-
sortComponent
-
normalizeSchema
public static io.swagger.v3.oas.models.media.Schema<?> normalizeSchema(io.swagger.v3.oas.models.media.Schema<?> schema, io.micronaut.inject.visitor.VisitorContext context) -
normalizeSchemas
public static void normalizeSchemas(Map<String, io.swagger.v3.oas.models.media.Schema> schemas, io.micronaut.inject.visitor.VisitorContext context) Sort schemas list in allOf block: schemas with ref must be first, next other schemas.- Parameters:
schemas
- all schema componentscontext
- Visitor context
-
removeEmptyComponents
public static void removeEmptyComponents(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)
-