- Companion
- class
Type members
Classlikes
Types
Value members
Concrete methods
Create a custom validator
Create a custom validator
- Value Params
- doValidate
Validation function
- showMessage
Custom message
Create an enumeration validator, with the given possible values.
Create an enumeration validator, with the given possible values.
To represent the enumerated values in documentation, an encoding function needs to be provided. This can be done: * by using the
overloaded enumeration method with an encode
parameter * by adding an encode function on an Validator.Enumeration instance
using one of the .encode
functions * by adding the validator directly to a codec (see Mapping.addEncodeToEnumValidator * when
the values possible values are of a basic type (numbers, strings), the encode function is inferred if not present, when being added to
the schema, see Schema.validate
Create an enumeration validator, with the given possible values, an optional encoding function (so that the enumerated values can be represented in documentation), and an optional name (to create a reusable documentation component).
Create an enumeration validator, with the given possible values, an optional encoding function (so that the enumerated values can be represented in documentation), and an optional name (to create a reusable documentation component).
- Value Params
- encode
Specify how values of this type can be encoded to a raw value, which will be used for documentation.
Inherited methods
Creates an enum validator where all subtypes of the sealed hierarchy T
are object
s. This enumeration will only be used for
documentation, as a value outside of the allowed values will not be decoded in the first place (the decoder has no other option than
to fail).
Creates an enum validator where all subtypes of the sealed hierarchy T
are object
s. This enumeration will only be used for
documentation, as a value outside of the allowed values will not be decoded in the first place (the decoder has no other option than
to fail).
- Inherited from
- ValidatorMacros