@rjsf/core 5.13.6 → 5.14.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/core.umd.js CHANGED
@@ -3222,7 +3222,7 @@
3222
3222
  let schemaValidationErrors = state.schemaValidationErrors;
3223
3223
  let schemaValidationErrorSchema = state.schemaValidationErrorSchema;
3224
3224
  if (mustValidate) {
3225
- const schemaValidation = this.validate(formData, schema, schemaUtils);
3225
+ const schemaValidation = this.validate(formData, schema, schemaUtils, retrievedSchema);
3226
3226
  errors = schemaValidation.errors;
3227
3227
  errorSchema = schemaValidation.errorSchema;
3228
3228
  schemaValidationErrors = errors;
@@ -3274,10 +3274,10 @@
3274
3274
  * @param schema - The schema used to validate against
3275
3275
  * @param altSchemaUtils - The alternate schemaUtils to use for validation
3276
3276
  */
3277
- validate(formData, schema = this.props.schema, altSchemaUtils) {
3277
+ validate(formData, schema = this.props.schema, altSchemaUtils, retrievedSchema) {
3278
3278
  const schemaUtils = altSchemaUtils ? altSchemaUtils : this.state.schemaUtils;
3279
3279
  const { customValidate, transformErrors, uiSchema } = this.props;
3280
- const resolvedSchema = schemaUtils.retrieveSchema(schema, formData);
3280
+ const resolvedSchema = retrievedSchema ?? schemaUtils.retrieveSchema(schema, formData);
3281
3281
  return schemaUtils.getValidator().validateFormData(formData, resolvedSchema, customValidate, transformErrors, uiSchema);
3282
3282
  }
3283
3283
  /** Renders any errors contained in the `state` in using the `ErrorList`, if not disabled by `showErrorList`. */
package/dist/index.esm.js CHANGED
@@ -3568,7 +3568,7 @@ var Form = class extends Component5 {
3568
3568
  let schemaValidationErrors = state.schemaValidationErrors;
3569
3569
  let schemaValidationErrorSchema = state.schemaValidationErrorSchema;
3570
3570
  if (mustValidate) {
3571
- const schemaValidation = this.validate(formData, schema, schemaUtils);
3571
+ const schemaValidation = this.validate(formData, schema, schemaUtils, retrievedSchema);
3572
3572
  errors = schemaValidation.errors;
3573
3573
  errorSchema = schemaValidation.errorSchema;
3574
3574
  schemaValidationErrors = errors;
@@ -3620,10 +3620,10 @@ var Form = class extends Component5 {
3620
3620
  * @param schema - The schema used to validate against
3621
3621
  * @param altSchemaUtils - The alternate schemaUtils to use for validation
3622
3622
  */
3623
- validate(formData, schema = this.props.schema, altSchemaUtils) {
3623
+ validate(formData, schema = this.props.schema, altSchemaUtils, retrievedSchema) {
3624
3624
  const schemaUtils = altSchemaUtils ? altSchemaUtils : this.state.schemaUtils;
3625
3625
  const { customValidate, transformErrors, uiSchema } = this.props;
3626
- const resolvedSchema = schemaUtils.retrieveSchema(schema, formData);
3626
+ const resolvedSchema = retrievedSchema ?? schemaUtils.retrieveSchema(schema, formData);
3627
3627
  return schemaUtils.getValidator().validateFormData(formData, resolvedSchema, customValidate, transformErrors, uiSchema);
3628
3628
  }
3629
3629
  /** Renders any errors contained in the `state` in using the `ErrorList`, if not disabled by `showErrorList`. */