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 Summary

    Modifier and Type
    Method
    Description
    static 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)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

      public static void normalizeHeaders(Map<String,io.swagger.v3.oas.models.headers.Header> headers, io.micronaut.inject.visitor.VisitorContext context)
    • normalizeContent

      public static void normalizeContent(io.swagger.v3.oas.models.media.Content content, io.micronaut.inject.visitor.VisitorContext context)
    • 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, 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 components
      context - 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)