Class OpenApiNormalizeUtils

java.lang.Object
io.micronaut.openapi.visitor.OpenApiNormalizeUtils

@Internal public final class OpenApiNormalizeUtils extends Object
Normalization methods for openAPI objects.
Since:
6.6.0
  • 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

      public static void normalizeExamples(Map<String,io.swagger.v3.oas.models.examples.Example> examples)
    • sortComponent

      public 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)
    • normalizeSchema

      public static io.swagger.v3.oas.models.media.Schema<?> normalizeSchema(io.swagger.v3.oas.models.media.Schema<?> schema)
    • normalizeSchemas

      public 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.
      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)