Class SchemaUtils

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

@Internal public final class SchemaUtils extends Object
Some schema util methods.
Since:
4.5.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     
    static final io.swagger.v3.oas.models.media.Schema<?>
     
    static final io.swagger.v3.oas.models.media.Schema<?>
     
    static final io.swagger.v3.oas.models.media.Schema<?>
     
    static final io.swagger.v3.oas.models.media.Schema<?>
     
    static final io.swagger.v3.oas.models.media.Schema<?>
     
    static final io.swagger.v3.oas.models.media.Schema<?>
     
    static final io.swagger.v3.oas.models.media.Schema<?>
     
    static final io.swagger.v3.oas.models.media.Schema<?>
     
    static final io.swagger.v3.oas.models.media.Schema<?>
     
    static final io.swagger.v3.oas.models.media.Schema<?>
     
    static final io.swagger.v3.oas.models.media.Schema<?>
     
    static final io.swagger.v3.oas.models.media.Schema<?>
     
    static final io.swagger.v3.oas.models.media.Schema<?>
     
    static final io.swagger.v3.oas.models.media.Schema<?>
     
    static final io.swagger.v3.oas.models.media.Schema<?>
     
    static final io.swagger.v3.oas.models.media.Schema<?>
     
    static final io.swagger.v3.oas.models.media.Schema<?>
     
    static final io.swagger.v3.oas.models.media.Schema<?>
     
    static final io.swagger.v3.oas.models.media.Schema<?>
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static io.swagger.v3.oas.models.media.ArraySchema
    arraySchema(io.swagger.v3.oas.models.media.Schema<?> schema)
     
    static void
    copyOpenApi(io.swagger.v3.oas.models.OpenAPI to, io.swagger.v3.oas.models.OpenAPI from)
    Copy information from one OpenAPI object to another.
    static io.swagger.v3.oas.models.Operation
    getOperationOnPathItem(io.swagger.v3.oas.models.PathItem pathItem, io.micronaut.http.HttpMethod httpMethod)
     
    static io.swagger.v3.oas.models.media.Schema<?>
    getSchemaByRef(io.swagger.v3.oas.models.media.Schema<?> schema, io.swagger.v3.oas.models.OpenAPI openApi)
     
    static io.swagger.v3.oas.models.media.Schema<?>
    getSchemaByRef(String schemaRef, io.swagger.v3.oas.models.OpenAPI openApi)
     
    static String
    getType(io.swagger.v3.oas.models.media.Schema<?> schema)
     
    static String
     
    static boolean
    isEmptySchema(io.swagger.v3.oas.models.media.Schema<?> schema)
     
    static boolean
    isIgnoredHeader(String headerName)
     
    static io.swagger.v3.oas.models.responses.ApiResponse
    mergeApiResponse(io.swagger.v3.oas.models.responses.ApiResponse ar1, io.swagger.v3.oas.models.responses.ApiResponse ar2)
     
    static io.swagger.v3.oas.models.media.Content
    mergeContent(io.swagger.v3.oas.models.media.Content c1, io.swagger.v3.oas.models.media.Content c2)
     
    static io.swagger.v3.oas.models.headers.Header
    mergeHeader(io.swagger.v3.oas.models.headers.Header h1, io.swagger.v3.oas.models.headers.Header h2)
     
    static io.swagger.v3.oas.models.links.Link
    mergeLink(io.swagger.v3.oas.models.links.Link l1, io.swagger.v3.oas.models.links.Link l2)
     
    static io.swagger.v3.oas.models.Operation
    mergeOperations(io.swagger.v3.oas.models.Operation op1, io.swagger.v3.oas.models.Operation op2)
     
    static io.swagger.v3.oas.models.parameters.Parameter
    mergeParameter(io.swagger.v3.oas.models.parameters.Parameter p1, io.swagger.v3.oas.models.parameters.Parameter p2)
     
    static io.swagger.v3.oas.models.parameters.RequestBody
    mergeRequestBody(io.swagger.v3.oas.models.parameters.RequestBody rb1, io.swagger.v3.oas.models.parameters.RequestBody rb2)
     
    static io.swagger.v3.oas.models.media.Schema<?>
    mergeSchema(io.swagger.v3.oas.models.media.Schema<?> s1, io.swagger.v3.oas.models.media.Schema<?> s2)
     
    static String
     
    static void
    processExtensions(Map<String,Object> map, io.micronaut.core.annotation.AnnotationValue<io.swagger.v3.oas.annotations.extensions.Extension> extension)
     
    static Map<String,io.swagger.v3.oas.models.media.Schema>
    resolveSchemas(io.swagger.v3.oas.models.OpenAPI openAPI)
     
    static String
    schemaRef(String schemaName)
     
    static void
    setAllowableValues(io.swagger.v3.oas.models.media.Schema schema, String[] allowableValues, io.micronaut.inject.ast.Element element, String elType, String elFormat, io.micronaut.inject.visitor.VisitorContext context)
     
    static io.swagger.v3.oas.models.media.Schema
    setNullable(io.swagger.v3.oas.models.media.Schema<?> schema)
     
    static void
    setOperationOnPathItem(io.swagger.v3.oas.models.PathItem pathItem, io.micronaut.http.HttpMethod httpMethod, io.swagger.v3.oas.models.Operation operation)
     
    static <T extends io.swagger.v3.oas.models.media.Schema>
    T
    setSpecVersion(T schema)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • COMPONENTS_CALLBACKS_PREFIX

      public static final String COMPONENTS_CALLBACKS_PREFIX
      See Also:
    • COMPONENTS_SCHEMAS_PREFIX

      public static final String COMPONENTS_SCHEMAS_PREFIX
      See Also:
    • TYPE_NULL

      public static final String TYPE_NULL
      See Also:
    • TYPE_OBJECT

      public static final String TYPE_OBJECT
      See Also:
    • TYPE_ARRAY

      public static final String TYPE_ARRAY
      See Also:
    • TYPE_STRING

      public static final String TYPE_STRING
      See Also:
    • TYPE_INTEGER

      public static final String TYPE_INTEGER
      See Also:
    • TYPE_NUMBER

      public static final String TYPE_NUMBER
      See Also:
    • TYPE_BOOLEAN

      public static final String TYPE_BOOLEAN
      See Also:
    • EMPTY_SCHEMA

      public static final io.swagger.v3.oas.models.media.Schema<?> EMPTY_SCHEMA
    • EMPTY_ARRAY_SCHEMA

      public static final io.swagger.v3.oas.models.media.Schema<?> EMPTY_ARRAY_SCHEMA
    • EMPTY_BINARY_SCHEMA

      public static final io.swagger.v3.oas.models.media.Schema<?> EMPTY_BINARY_SCHEMA
    • EMPTY_BOOLEAN_SCHEMA

      public static final io.swagger.v3.oas.models.media.Schema<?> EMPTY_BOOLEAN_SCHEMA
    • EMPTY_BYTE_ARRAY_SCHEMA

      public static final io.swagger.v3.oas.models.media.Schema<?> EMPTY_BYTE_ARRAY_SCHEMA
    • EMPTY_COMPOSED_SCHEMA

      public static final io.swagger.v3.oas.models.media.Schema<?> EMPTY_COMPOSED_SCHEMA
    • EMPTY_DATE_SCHEMA

      public static final io.swagger.v3.oas.models.media.Schema<?> EMPTY_DATE_SCHEMA
    • EMPTY_DATE_TIME_SCHEMA

      public static final io.swagger.v3.oas.models.media.Schema<?> EMPTY_DATE_TIME_SCHEMA
    • EMPTY_EMAIL_SCHEMA

      public static final io.swagger.v3.oas.models.media.Schema<?> EMPTY_EMAIL_SCHEMA
    • EMPTY_FILE_SCHEMA

      public static final io.swagger.v3.oas.models.media.Schema<?> EMPTY_FILE_SCHEMA
    • EMPTY_INTEGER_SCHEMA

      public static final io.swagger.v3.oas.models.media.Schema<?> EMPTY_INTEGER_SCHEMA
    • EMPTY_JSON_SCHEMA

      public static final io.swagger.v3.oas.models.media.Schema<?> EMPTY_JSON_SCHEMA
    • EMPTY_MAP_SCHEMA

      public static final io.swagger.v3.oas.models.media.Schema<?> EMPTY_MAP_SCHEMA
    • EMPTY_NUMBER_SCHEMA

      public static final io.swagger.v3.oas.models.media.Schema<?> EMPTY_NUMBER_SCHEMA
    • EMPTY_OBJECT_SCHEMA

      public static final io.swagger.v3.oas.models.media.Schema<?> EMPTY_OBJECT_SCHEMA
    • EMPTY_PASSWORD_SCHEMA

      public static final io.swagger.v3.oas.models.media.Schema<?> EMPTY_PASSWORD_SCHEMA
    • EMPTY_STRING_SCHEMA

      public static final io.swagger.v3.oas.models.media.Schema<?> EMPTY_STRING_SCHEMA
    • EMPTY_UUID_SCHEMA

      public static final io.swagger.v3.oas.models.media.Schema<?> EMPTY_UUID_SCHEMA
    • EMPTY_SIMPLE_SCHEMA

      public static final io.swagger.v3.oas.models.media.Schema<?> EMPTY_SIMPLE_SCHEMA
  • Method Details

    • isEmptySchema

      public static boolean isEmptySchema(io.swagger.v3.oas.models.media.Schema<?> schema)
    • processExtensions

      public static void processExtensions(Map<String,Object> map, io.micronaut.core.annotation.AnnotationValue<io.swagger.v3.oas.annotations.extensions.Extension> extension)
    • prependIfMissing

      public static String prependIfMissing(String str, String prefix)
    • resolveSchemas

      public static Map<String,io.swagger.v3.oas.models.media.Schema> resolveSchemas(io.swagger.v3.oas.models.OpenAPI openAPI)
    • setSpecVersion

      public static <T extends io.swagger.v3.oas.models.media.Schema> T setSpecVersion(T schema)
    • arraySchema

      public static io.swagger.v3.oas.models.media.ArraySchema arraySchema(io.swagger.v3.oas.models.media.Schema<?> schema)
    • schemaRef

      public static String schemaRef(String schemaName)
    • getOperationOnPathItem

      public static io.swagger.v3.oas.models.Operation getOperationOnPathItem(io.swagger.v3.oas.models.PathItem pathItem, io.micronaut.http.HttpMethod httpMethod)
    • setOperationOnPathItem

      public static void setOperationOnPathItem(io.swagger.v3.oas.models.PathItem pathItem, io.micronaut.http.HttpMethod httpMethod, io.swagger.v3.oas.models.Operation operation)
    • mergeOperations

      public static io.swagger.v3.oas.models.Operation mergeOperations(io.swagger.v3.oas.models.Operation op1, io.swagger.v3.oas.models.Operation op2)
    • mergeApiResponse

      public static io.swagger.v3.oas.models.responses.ApiResponse mergeApiResponse(io.swagger.v3.oas.models.responses.ApiResponse ar1, io.swagger.v3.oas.models.responses.ApiResponse ar2)
    • mergeLink

      public static io.swagger.v3.oas.models.links.Link mergeLink(io.swagger.v3.oas.models.links.Link l1, io.swagger.v3.oas.models.links.Link l2)
    • mergeHeader

      public static io.swagger.v3.oas.models.headers.Header mergeHeader(io.swagger.v3.oas.models.headers.Header h1, io.swagger.v3.oas.models.headers.Header h2)
    • mergeParameter

      public static io.swagger.v3.oas.models.parameters.Parameter mergeParameter(io.swagger.v3.oas.models.parameters.Parameter p1, io.swagger.v3.oas.models.parameters.Parameter p2)
    • mergeRequestBody

      public static io.swagger.v3.oas.models.parameters.RequestBody mergeRequestBody(io.swagger.v3.oas.models.parameters.RequestBody rb1, io.swagger.v3.oas.models.parameters.RequestBody rb2)
    • mergeContent

      public static io.swagger.v3.oas.models.media.Content mergeContent(io.swagger.v3.oas.models.media.Content c1, io.swagger.v3.oas.models.media.Content c2)
    • mergeSchema

      public static io.swagger.v3.oas.models.media.Schema<?> mergeSchema(io.swagger.v3.oas.models.media.Schema<?> s1, io.swagger.v3.oas.models.media.Schema<?> s2)
    • copyOpenApi

      public static void copyOpenApi(io.swagger.v3.oas.models.OpenAPI to, io.swagger.v3.oas.models.OpenAPI from)
      Copy information from one OpenAPI object to another.
      Parameters:
      to - The OpenAPI object to copy to
      from - The OpenAPI object to copy from
    • isIgnoredHeader

      public static boolean isIgnoredHeader(String headerName)
    • setNullable

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

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

      public static String getType(String type, Collection<String> types)
    • setAllowableValues

      public static void setAllowableValues(io.swagger.v3.oas.models.media.Schema schema, String[] allowableValues, io.micronaut.inject.ast.Element element, String elType, String elFormat, io.micronaut.inject.visitor.VisitorContext context)
    • getSchemaByRef

      public static io.swagger.v3.oas.models.media.Schema<?> getSchemaByRef(io.swagger.v3.oas.models.media.Schema<?> schema, io.swagger.v3.oas.models.OpenAPI openApi)
    • getSchemaByRef

      public static io.swagger.v3.oas.models.media.Schema<?> getSchemaByRef(String schemaRef, io.swagger.v3.oas.models.OpenAPI openApi)