Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Reasons for making this change
Partially fix #3189 by allowing for changing the type of the
schema
via a new genericS
@rjsf/utils
to make theschema
androotSchema
props use a new generic typeS
StrictRJSFSchema
type as the alias toJSON7Schema
changingRJSFSchema
to beStrictRJSFSchema & GenericObjectType
RJSFSchemaDefinition
type in favor of accessing it indirectly via theS["<prop-with-definition>"]
syntaxS extends StrictRJSFSchema = RJSFSchema
to all types that directly or indirectly usedRJSFSchema
after theT = any
typeSchemaUtilsType
to add theF = any
generic to the whole interface, removing it from the definition of the two functions that need itRJSFSchema
to take the new generic, replacingRJSFSchema
withS
@rjsf/core
to insert theS extends StrictRJSFSchema = RJSFSchema
to every component that needed it, after theT = any
genericindex.ts
for theButtonTemplates
,field
,templates
andwidgets
to make them functions that take theT
,S
andF
genericsgetDefaultRegistry()
andtemplates()
to call the appropriate functionsRJSFSchema
andRJSFSchemaDefinition
withS
andS["<prop-with-definition>"]
RJSFSchema
type@rjsf/validator-ajv6
to fix a few type casts due to the change in theRJSFSchema
type@rjsf/validator-ajv8
to add theS extends StrictRJSFSchema = RJSFSchema
generic to thecustomizeValidator()
function and theAJV8Validator
classRJSFSchema
andRJSFSchemaDefinition
withS
andS["<prop-with-definition>"]
RJSFSchema
toS
where applicableRJSFSchema
typeChecklist
npm run test:update
to update snapshots, if needed.