Repository navigation
7.0.0-beta.3
Pre-release
Pre-release
·
2 commits
to main
since this release
New beta release
- Newer JSON Schema drafts: the
@rjsf/validator-ajv8/2019and@rjsf/validator-ajv8/2020entry points validate 2019-09 and 2020-12, and a schema declaring a draft its validator doesn't support fails every validation instead of being checked as the validator's own draft, so it has to import the matching entry point; the form readsdependentRequiredanddependentSchemasas it readsdependencies - Tuples under conditions: a tuple a
then,elseordependenciesschema declares is met with the field's own tuple position by position instead of replacing it, and the items onlyunevaluatedItemsdescribes render - Multi-selects: they read
ui:definitions,ui:enumDisabledandui:optgroupsas a single select does, and offer the options each item'sif/then/elseallows - Schema utilities: the standalone schema functions are deprecated in favor of the methods on the
SchemaUtilsTypethatcreateSchemaUtils()returns, and the ones only the v7 prereleases exported, such asgetUiRequiredErrorSchema(), are removed - Precompiled validators: code generated with an earlier 7.0.0 beta has to be regenerated
@rjsf/core
- BREAKING CHANGE: Change
FormRef.reset()to show eachanyOf/oneOffield on the option a form mounting on the seed shows, or the one it showed after the lastreset(saved), where it kept the option the user picked if the data fit both. See the upgrade guide (#6008, #5944) - BREAKING CHANGE: Change
Formto readdependentRequiredanddependentSchemasas it readsdependencies, where it ignored both: the fields they bring render, take their defaults and are marked required. See the upgrade guide (#6013) - BREAKING CHANGE: Fix
Formrendering an array field's tuple from the one athen,elseordependenciesschema declares for it alone, leaving out the items past that tuple's length and each item's own constraints, where it now renders and fills each position from both, and offers each option of aoneOf/anyOfthe field holds at a position merged with each option of one the branch holds there, as foritems. See the upgrade guide (#6024, #6000, #5976) - Fix
ArrayFieldrendering no field and no add button for the items past aprefixItemsoritemstuple that onlyunevaluatedItemsdescribes, andFormdropping them underomitExtraData(#6011) - Fix
FormthrowingCould not find a definitionfor a$refto an$anchorwhere the root schema declares no$schema(#6011) - Fix a
FormpassedformDatareading clean once you change another field yourself, such as a city filled in after a lookup: a value you pass doesn't make the form dirty, and the user's own edits stay dirty (#6007, #6006) - Fix
LayoutGridFieldrendering none of the cells of a discriminatedoneOf/anyOfoption that pins no discriminator value while the data holds none, or a value no option pins that the option takes, so picking that option in the selector did nothing (#6032, #6003) - Fix
FormthrowingNo precompiled validator function was foundunder a validator fromcreatePrecompiledValidator()whentransformChangerewrites a switch to ananyOf/oneOfoption merged from two lists (#6025, #5973) - Fix
Formnot marking a field as required, and live validation not reporting it, when a schema naming notype, the object's own or one nested in it such as a property, its items or adependenciesentry of it, lists it underrequiredand adependenciesentry, athen/elseor a merged option declares arequiredfor that schema too (#6013) - Fix a multi-select,
checkboxesincluded, ignoringui:definitions,ui:enumDisabledandui:optgroupswhere a single select of the same options reads them: it labels its options from theui:definitionsentry of each option's$refand of its items'$ref, and readsui:enumDisabledandui:optgroupsfrom its items or that entry; where the array sets one too, the array's wins (#6043, #6056, #6034, #6045) - Fix a multi-select offering the options its items'
if/then/elseallows the whole array rather than each item, such as only theelseoption where theiftests an item's value; an option the branch its own value takes doesn't list is offered only once it has been selected, and stays offered after it's cleared (#6056, #6044) - Add a development warning where a custom
AnyOfFieldorOneOfFieldrenders ananyOf/oneOfoption its schema doesn't list, whose dataFormfills, requires and omits by the schema's options, as in 6.11.1 (#6095, #6057, #6058, #6060, #6065) - Fix
Formkeeping the data of theanyOf/oneOfoption switched away from where a customAnyOfFieldorOneOfFieldhands the options to the default field in another order (#6095)
@rjsf/mantine
- Fix
BaseInputTemplatepassing thelargeStepandsmallStepoptions Mantine 9.9 added toNumberInputon to a text input as unknown attributes, where a field renders one, such as with aninputTypeoftel(#6082)
@rjsf/shadcn
- Change
@radix-ui/react-radio-groupto^1.5.2and@radix-ui/react-sliderto^1.6.2: the group of a disabledRadioWidgetgainsaria-disabled="true", and the slider of an enabledRangeWidgetno longer hasaria-disabled="false"(#6082)
@rjsf/utils
- BREAKING CHANGE: Change
retrieveSchema(),getDefaultFormState(),omitExtraData()and the other schema utilities to readdependentRequiredanddependentSchemasas they readdependencies, where they ignored both. See the upgrade guide (#6013) - BREAKING CHANGE: Fix
retrieveSchema()andgetDefaultFormState()letting a tupleitemsorprefixItemsthat athen,elseordependenciesschema declares replace a field's own tuple, dropping each position's own constraints and the positions past it, where the two are now met position by position, each position keeping therequiredof both as a singleitemsdoes, and the options of aoneOf/anyOfboth hold at a position are paired, as foritems. See the upgrade guide (#6024, #6000, #5976) - Fix
getItemSchema(),getDefaultFormState(),omitExtraData()andsanitizeDataForNewSchema()reading the items past aprefixItemsoritemstuple as undescribed where onlyunevaluatedItemsdescribes them (#6011) - Fix
retrieveSchema()andgetDefaultFormState()throwingCould not find a definitionfor a$refto an$anchorwhere the root schema declares no$schema, andcreateFieldTitleLookup()finding no title for a field under one, soapplyValidatorErrorTitles()left its key in the error's message (#6011) - Add
getOptionSelectorValue(), the value ananyOf/oneOfoption's selector pins it to: itsdefault, else itsconst, else the only entry of itsenum(#6032, #6003) - Fix a validator from
createPrecompiledValidator()throwingNo precompiled validator function was foundwhen the form scores ananyOf/oneOfoption merged from two lists, such as a field's own and anallOfentry's or athen's, or from a list both options of such a pair hold, which needs precompiled code generated with 7.0.0-beta.2 regenerated, sincegetValidationSchemas()lists more schemas (#6018, #6025, #5979) - Change
resolveUiSchema()to merge an option'sui:definitionsentry at the option's written position in a schemaretrieveSchema()narrowed, and add anentriesOrderedparameter for entries already in the narrowed order (#6029, #6010) - Add
isValidOption(), which checks data against ananyOf/oneOfoptionretrieveSchema()returned asgetFirstMatchingOption()checks it, also under a validator fromcreatePrecompiledValidator()(#6025, #5973) - Change
getValidationSchemas()to list two more kinds of schema fordependentSchemas: the condition eachoneOfoption of an entry is matched on, and the scoring copy of ananyOf/oneOfoption whose onlypropertiessit in an entry. Precompiled validator code generated with an earlier 7.0.0 beta for a schema holdingdependentSchemashas to be regenerated (#6013) - Fix
retrieveSchema()dropping therequiredof a schema naming notype, the object's own or one nested in it such as a property, its items or adependenciesentry of it, when adependenciesentry, athen/elseor a merged option declares arequiredfor it too: the two lists are now joined (#6013) - Change
retrieveSchema()to hand out the schema it retrieved for a field again for other data itsifs,dependenciesand options decide alike, so the rows of a list taking the same branches are retrieved once rather than once per row (#6064) - Fix
retrieveSchema()returning a declared property that apatternPropertiesentry also matches, or the optionselectedOptionnames, as built for an earlier call's data, where its ownif,dependenciesor extra keys depend on its value (#6064) - Deprecate the standalone
findFieldInSchema(),findSelectedOptionInXxxOf(),getClosestMatchingOption(),getDefaultFormState(),getFirstMatchingOption(),getFromSchema(),isFilesArray(),isMultiSelect(),isSelect(),omitExtraData(),retrieveSchema()andsanitizeDataForNewSchema(), kept through v7: call the method of the same name on theSchemaUtilsTypethatcreateSchemaUtils()returns. See the upgrade guide (#6070, #6068) - Remove the standalone
childFillOf(),constrainsAlike(),getFieldDefault(),getFilledDefault()andgetUiRequiredErrorSchema(), which only the v7 prereleases exported: call the method of the same name on theSchemaUtilsTypethatcreateSchemaUtils()returns (#6070, #6068) - Fix the
UiSchematype rejecting what works at runtime: a registered template's name ornullas aui:*Templatevalue, and auiSchema.itemsfunction returningnullorundefinedfor an item's default UI (#6076, #6072)
@rjsf/validator-ajv8
- BREAKING CHANGE: Change a schema whose
$schemanames a draft its validator doesn't support to no longer be validated as the validator's own draft, including where it has aoneOf,anyOforif: every validation reports one error that says what to change, such as the entry point to import the validator from, in place ofno schema with key or ref "…", andcompileSchemaValidators()throws it too, naming theAjvClassto pass.isValid(), which still matches options and conditions against a root schema declaring such a draft, logs one console warning that says the same. See the upgrade guide (#6009, #3750) - Fix errors under a
$refto an$anchornot naming their property by the label the form shows it with, where the root schema declares no$schema(#6011) - Add the
@rjsf/validator-ajv8/2019and@rjsf/validator-ajv8/2020entry points, whose default export andcustomizeValidator()validate JSON Schema 2019-09 and 2020-12, so an app no longer imports an Ajv class fromajvfor them (#6009, #3750)
@rjsf/validator-ata
- BREAKING CHANGE: Fix data reaching a
$refthat names nothing passing validation undernot,if, aoneOfbranch or acontainswithmaxContainsandminContains: 0, or naming a document by URI in anadditionalMetaSchemasorataOptionsOverrides.schemasentry. Undernot,if, aoneOfbranch,containswithmaxContains, or in a schema withunevaluatedPropertiesorunevaluatedItems, the whole validation now fails with onecannot resolve $referror on the root; elsewhere in an entry, a$refnaming a document by URI fails the field with it. A precompiled validator throwswas not compiled to a standalone validator. See the upgrade guide (#6040, #6014) - BREAKING CHANGE: Fix data reaching a
$refto a root$idthat is only a fragment and no anchor, such as$ref: '#1'in a root with$id: '#1', passingvalidateFormData()with only its first level checked. It now fails withcannot resolve $ref #1; a precompiled validator still reads the$refas the root. See the upgrade guide (#6040) - Fix errors under a
$refto an$anchornot naming their property by the label the form shows it with, where the root schema declares no$schema(#6011) - Change
ata-validatorto^1.66.1, which fixes other cases where validation accepted data it should reject, and letsataOptionsOverridessetpatternFallback. In a browser or edge build, a value other than'platform'needsimport 'ata-validator/pattern-fallback'in the app, withata-validatoras a direct dependency under pnpm.compileSchemaValidatorsCode()leaves out apatternFallbackfunction with a warning, as it doeskeywords, and under'reject'throws for a pattern outside ata's linear-time engine (#6040, #6014) - Fix the form showing the
elsebranch of anifwhose$refnames a definition by a name holding a lone surrogate, such as'a\uD800b'(#6040)
@rjsf/validator-cfworker
- Fix errors under a
$refto an$anchornot naming their property by the label the form shows it with, where the root schema declares no$schema(#6011) - Change
@cfworker/json-schemato^4.1.8, which rejects auriwhose authority after//is invalid, such as the port ofhttp://example.com:abc/path, and auri-referencesuch as//example.com:abc/path, where it read them as paths (#6082)