This component validates/approves content against schemas
Properties:
- name (string, required)
- type (string, required)
- number
- integer
- double
- array
- boolean
- string
- object
- oneOf (require setChildSchemas)
- required (bool, default=false)
- nullable (bool, default=false)
- patterns (string, optional)
only used for type: string - format (string, optional)
only used for type: string - minLength (int, optional)
only used for type: number, integer, double - maxLength (int, optional)
only used for type: number, integer, double - minItems (int, optional)
only used for type: array - maxItems (int, optional)
only used for type: array - minRange (float, optional)
only used for type: number, integer, double - maxRange (float, optional)
only used for type: number, integer, double - multipleOf (float, optional)
only used for type: number, integer, double - enum (scalar, optional)
only used for type: number, integer, double - childSchemas (arrayOf ObjectValueSchema, optional)
verifies if the type is one of
- oneOf
calls method::validate but covered in a try/catch.
In case of catch the method returns false. Otherwise, the method returns true.
Validate the content against
- contentType
- validateArray
- validateString
- validateNumber
- validateFormat
- validateEnum
- validateMultipleTypes (e.g. oneOf)
Method try to solve some content : schema mismatches that could be solved.
In case of being able to solve a mismatch, the method
- set the type of the schema to the converted one
- returns the converted value
Examples
- expected type: integer, given "12"
- expected type: boolean, given "yes"