Package dk.mada.jaxrs.openapi
Class SchemaParserV30
java.lang.Object
dk.mada.jaxrs.openapi.SchemaParserV30
- All Implemented Interfaces:
SchemaParser
OpenApi V3.0.x parser details.
https://spec.openapis.org/oas/v3.0.4.html (or newer from https://spec.openapis.org/)
-
Constructor Summary
ConstructorsConstructorDescriptionSchemaParserV30
(io.swagger.v3.oas.models.media.Schema<?> schema) Creates new parser instance. -
Method Summary
Modifier and TypeMethodDescription@Nullable String
format()
Returns the schema format, or null.boolean
isAnyOf()
Returns true if the schema defines a composition by anyOf.boolean
isArray()
Returns true if the schema defines an array.boolean
isBinary()
Returns true if the schema is a binary stream of data.boolean
isDate
(boolean acceptBrokenType) Returns true if the schema defines a date.boolean
isDateTime
(boolean acceptBrokenType) Returns if the schema defines a date-time.boolean
isMap()
Returns true if the schema defines a map.boolean
Returns true if the type is nullable.boolean
isNumber()
Returns true if the schema defines a number.boolean
isObject()
Returns true if the schema defines an object.boolean
isOneOf()
Returns true if the schema defines a composition by oneOf.boolean
isString()
Returns true if the schema defines a string.io.swagger.v3.oas.models.media.Schema
<?> schema()
Returns the OpenApi schema this parser operates on.@Nullable String
type()
Returns the schema type, or null.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface dk.mada.jaxrs.openapi.SchemaParser
anyOfSchemas, enumerationValues, isAllOf, isEnumeration, isRef, isTime, isUnique, itemsSchema, mapInnerSchema, name, oneOfSchemas
-
Constructor Details
-
SchemaParserV30
public SchemaParserV30(io.swagger.v3.oas.models.media.Schema<?> schema) Creates new parser instance.- Parameters:
schema
- the schema to parse
-
-
Method Details
-
schema
public io.swagger.v3.oas.models.media.Schema<?> schema()Description copied from interface:SchemaParser
Returns the OpenApi schema this parser operates on.- Specified by:
schema
in interfaceSchemaParser
- Returns:
- the OpenApi schema this parser operates on
-
type
Description copied from interface:SchemaParser
Returns the schema type, or null.- Specified by:
type
in interfaceSchemaParser
- Returns:
- the schema type, or null
-
format
Description copied from interface:SchemaParser
Returns the schema format, or null.- Specified by:
format
in interfaceSchemaParser
- Returns:
- the schema format, or null
-
isArray
public boolean isArray()Description copied from interface:SchemaParser
Returns true if the schema defines an array.- Specified by:
isArray
in interfaceSchemaParser
- Returns:
- true if the schema defines an array
-
isAnyOf
public boolean isAnyOf()Description copied from interface:SchemaParser
Returns true if the schema defines a composition by anyOf.- Specified by:
isAnyOf
in interfaceSchemaParser
- Returns:
- true if the schema defines a composition by anyOf
-
isOneOf
public boolean isOneOf()Description copied from interface:SchemaParser
Returns true if the schema defines a composition by oneOf.- Specified by:
isOneOf
in interfaceSchemaParser
- Returns:
- true if the schema defines a composition by oneOf
-
isBinary
public boolean isBinary()Description copied from interface:SchemaParser
Returns true if the schema is a binary stream of data.- Specified by:
isBinary
in interfaceSchemaParser
- Returns:
- true if the schema is a binary stream of data
-
isDate
public boolean isDate(boolean acceptBrokenType) Description copied from interface:SchemaParser
Returns true if the schema defines a date.- Specified by:
isDate
in interfaceSchemaParser
- Parameters:
acceptBrokenType
- if true, allows null/date to be recognized as a date- Returns:
- true if the schema defines a date
-
isDateTime
public boolean isDateTime(boolean acceptBrokenType) Description copied from interface:SchemaParser
Returns if the schema defines a date-time.- Specified by:
isDateTime
in interfaceSchemaParser
- Parameters:
acceptBrokenType
- if true, allows null/date-time to be recognized as a date-time- Returns:
- if the schema defines a date-time
-
isMap
public boolean isMap()Description copied from interface:SchemaParser
Returns true if the schema defines a map.- Specified by:
isMap
in interfaceSchemaParser
- Returns:
- true if the schema defines a map
-
isNullable
public boolean isNullable()Description copied from interface:SchemaParser
Returns true if the type is nullable.- Specified by:
isNullable
in interfaceSchemaParser
- Returns:
- true if the type is nullable
-
isNumber
public boolean isNumber()Description copied from interface:SchemaParser
Returns true if the schema defines a number.- Specified by:
isNumber
in interfaceSchemaParser
- Returns:
- true if the schema defines a number
-
isObject
public boolean isObject()Description copied from interface:SchemaParser
Returns true if the schema defines an object.- Specified by:
isObject
in interfaceSchemaParser
- Returns:
- true if the schema defines an object
-
isString
public boolean isString()Description copied from interface:SchemaParser
Returns true if the schema defines a string.- Specified by:
isString
in interfaceSchemaParser
- Returns:
- true if the schema defines a string
-