Package io.micronaut.openapi.visitor
Class SchemaUtils
java.lang.Object
io.micronaut.openapi.visitor.SchemaUtils
Some schema util methods.
- Since:
- 4.5.0
-
Field Summary
Modifier and TypeFieldDescriptionstatic 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 TypeMethodDescriptionstatic io.swagger.v3.oas.models.media.Schema<?>
appendSchema
(io.swagger.v3.oas.models.media.Schema<?> s1, io.swagger.v3.oas.models.media.Schema<?> s2) 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 oneOpenAPI
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
getType
(String type, Collection<String> types) 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
prependIfMissing
(String str, String prefix) static void
processExtensions
(Map<String, Object> map, io.micronaut.core.annotation.AnnotationValue<io.swagger.v3.oas.annotations.extensions.Extension> extension) resolveSchemas
(io.swagger.v3.oas.models.OpenAPI openAPI) static String
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>
TsetSpecVersion
(T schema)
-
Field Details
-
COMPONENTS_CALLBACKS_PREFIX
- See Also:
-
COMPONENTS_SCHEMAS_PREFIX
- See Also:
-
TYPE_NULL
- See Also:
-
TYPE_OBJECT
- See Also:
-
TYPE_ARRAY
- See Also:
-
TYPE_STRING
- See Also:
-
TYPE_INTEGER
- See Also:
-
TYPE_NUMBER
- See Also:
-
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
-
prependIfMissing
-
resolveSchemas
-
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
-
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) -
appendSchema
public static io.swagger.v3.oas.models.media.Schema<?> appendSchema(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 oneOpenAPI
object to another.- Parameters:
to
- TheOpenAPI
object to copy tofrom
- TheOpenAPI
object to copy from
-
isIgnoredHeader
-
setNullable
public static io.swagger.v3.oas.models.media.Schema setNullable(io.swagger.v3.oas.models.media.Schema<?> schema) -
getType
-
getType
-
setAllowableValues
-
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)
-