New features
- New utility functions in
@rjsf/utils
used by the validators and core
@rjsf/antd
- Treat multiple as a boolean rather than comparing against
undefined
in theSelectWidget
, fixing #3595
@rjsf/core
- Switched
Form
to use the newvalidatorDataMerge()
andtoErrorList()
functions instead of the now deprecatedschemaUtils.mergeValidatorData()
andschemaUtils.getValidator().toErrorList()
- Added option to provide a callback function to
focusOnFirstError
(3590) - Updated
MultiSchemaField
to handle the OpenAPIdiscriminator
extension onanyOf/oneOf
fields by passing it intogetClosestMatchingOption()
if it exists, fixing #3512 - Updated
SchemaField
function to usegetSchemaType
rather thanschema.type
to set the proper class name.
@rjsf/utils
- Refactored the
createErrorHandler()
,toErrorList()
,toErrorSchema()
andunwrapErrorHandler()
functions from the@rjsf/validator-ajv6
and@rjsf/validator-ajv8
implementations since they were identical- As a result, the
mergeValidationData()
function was deprecated in favor of the newvalidationDataMerge()
function that uses the refactoredtoErrorList()
function - Refactored the
ROOT_SCHEMA_PREFIX
constant as well
- As a result, the
- Updated
ValidatorType
andSchemaUtilsType
to deprecate thetoErrorList()
andmergeValidationData()
functions, respectively - Updated the
getClosestMatchingOption()
andgetFirstMatchingOption()
to pass the newdiscriminatorField
to thegetMatchingOption()
function - Updated
getMatchingOption()
to usediscriminatorField
when it is present in theoptions
object properties to drill into the object to detect if that one field is valid - Updated
SchemaUtilsType
and the associated forward functions increateSchemaUtils
to add the newdiscriminatorField?: string
optional parameter - Updated
toIdSchema()
function to usegetSchemaType(schema) === 'object'
rather thanschema.type === 'object'
to get the proper pathing for ids, fixing #2044
@rjsf/validator-ajv6
- Removed the refactored functions and constant from the
AJV6Validator
in favor of using the new functions and constant from@rjsf/utils
@rjsf/validator-ajv8
- Removed the refactored functions and constant from the
AJV8Validator
in favor of using the new functions and constant from@rjsf/utils
Dev / docs / playground
- Updated the
utility-functions
documentation to describe the new refactored functions as well as deprecating themergeValidationData()
function - Updated the
playground
to properly restoreliveSettings
from shared links and added a switch fornoHtml5Validation
in the live settings rather than having it set totrue
always- Also added a new
Blank
example to help users easily paste their code
- Also added a new