Package dk.mada.jaxrs.openapi
Class SchemaParserV31
java.lang.Object
dk.mada.jaxrs.openapi.SchemaParserV31
- All Implemented Interfaces:
SchemaParser
OpenApi V3.1.x parser details.
https://spec.openapis.org/oas/v3.1.1.html (or newer from https://spec.openapis.org/)
-
Constructor Summary
ConstructorsConstructorDescriptionSchemaParserV31(io.swagger.v3.oas.models.media.Schema<?> schema) Creates new parser instance. -
Method Summary
Modifier and TypeMethodDescription@Nullable Stringformat()Returns the schema format, or null.booleanisAnyOf()Returns true if the schema defines a composition by anyOf.booleanisArray()Returns true if the schema defines an array.booleanisBinary()Returns true if the schema is a binary stream of data.booleanisDate(boolean acceptBrokenType) Returns true if the schema defines a date.booleanisDateTime(boolean acceptBrokenType) Returns if the schema defines a date-time.booleanisMap()Returns true if the schema defines a map.booleanReturns true if the type is nullable.booleanisNumber()Returns true if the schema defines a number.booleanisObject()Returns true if the schema defines an object.booleanisOneOf()Returns true if the schema defines a composition by oneOf.booleanisString()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 Stringtype()Returns the schema type, or null.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dk.mada.jaxrs.openapi.SchemaParser
anyOfSchemas, enumerationValues, getMapInnerSchema, isAllOf, isEnumeration, isFreeFormObject, isRef, isTime, isTypeless, isUnique, itemsSchema, name, oneOfSchemas
-
Constructor Details
-
SchemaParserV31
public SchemaParserV31(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:SchemaParserReturns the OpenApi schema this parser operates on.- Specified by:
schemain interfaceSchemaParser- Returns:
- the OpenApi schema this parser operates on
-
type
Description copied from interface:SchemaParserReturns the schema type, or null.- Specified by:
typein interfaceSchemaParser- Returns:
- the schema type, or null
-
format
Description copied from interface:SchemaParserReturns the schema format, or null.- Specified by:
formatin interfaceSchemaParser- Returns:
- the schema format, or null
-
isArray
public boolean isArray()Description copied from interface:SchemaParserReturns true if the schema defines an array.- Specified by:
isArrayin interfaceSchemaParser- Returns:
- true if the schema defines an array
-
isAnyOf
public boolean isAnyOf()Description copied from interface:SchemaParserReturns true if the schema defines a composition by anyOf.- Specified by:
isAnyOfin interfaceSchemaParser- Returns:
- true if the schema defines a composition by anyOf
-
isOneOf
public boolean isOneOf()Description copied from interface:SchemaParserReturns true if the schema defines a composition by oneOf.- Specified by:
isOneOfin interfaceSchemaParser- Returns:
- true if the schema defines a composition by oneOf
-
isBinary
public boolean isBinary()Description copied from interface:SchemaParserReturns true if the schema is a binary stream of data.- Specified by:
isBinaryin interfaceSchemaParser- Returns:
- true if the schema is a binary stream of data
-
isDate
public boolean isDate(boolean acceptBrokenType) Description copied from interface:SchemaParserReturns true if the schema defines a date.- Specified by:
isDatein 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:SchemaParserReturns if the schema defines a date-time.- Specified by:
isDateTimein 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:SchemaParserReturns true if the schema defines a map.- Specified by:
isMapin interfaceSchemaParser- Returns:
- true if the schema defines a map
-
isNullable
public boolean isNullable()Description copied from interface:SchemaParserReturns true if the type is nullable.- Specified by:
isNullablein interfaceSchemaParser- Returns:
- true if the type is nullable
-
isNumber
public boolean isNumber()Description copied from interface:SchemaParserReturns true if the schema defines a number.- Specified by:
isNumberin interfaceSchemaParser- Returns:
- true if the schema defines a number
-
isObject
public boolean isObject()Description copied from interface:SchemaParserReturns true if the schema defines an object.- Specified by:
isObjectin interfaceSchemaParser- Returns:
- true if the schema defines an object
-
isString
public boolean isString()Description copied from interface:SchemaParserReturns true if the schema defines a string.- Specified by:
isStringin interfaceSchemaParser- Returns:
- true if the schema defines a string
-