@rjsf/utils 5.13.1 → 5.13.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/index.js +4 -6
- package/dist/index.js.map +2 -2
- package/dist/utils.esm.js +4 -6
- package/dist/utils.esm.js.map +2 -2
- package/dist/utils.umd.js +4 -6
- package/lib/parser/schemaParser.js +2 -3
- package/lib/parser/schemaParser.js.map +1 -1
- package/lib/schema/retrieveSchema.d.ts +9 -1
- package/lib/schema/retrieveSchema.js +13 -3
- package/lib/schema/retrieveSchema.js.map +1 -1
- package/package.json +3 -3
- package/src/parser/schemaParser.ts +2 -3
- package/src/schema/retrieveSchema.ts +12 -10
package/dist/index.js
CHANGED
|
@@ -708,7 +708,7 @@ function retrieveSchemaInternal(validator, schema, rootSchema, rawFormData, expa
|
|
|
708
708
|
return resolvedSchema;
|
|
709
709
|
});
|
|
710
710
|
}
|
|
711
|
-
function resolveAnyOrOneOfSchemas(validator, schema, rootSchema, expandAllBranches,
|
|
711
|
+
function resolveAnyOrOneOfSchemas(validator, schema, rootSchema, expandAllBranches, rawFormData) {
|
|
712
712
|
let anyOrOneOf;
|
|
713
713
|
const { oneOf, anyOf, ...remaining } = schema;
|
|
714
714
|
if (Array.isArray(oneOf)) {
|
|
@@ -720,7 +720,7 @@ function resolveAnyOrOneOfSchemas(validator, schema, rootSchema, expandAllBranch
|
|
|
720
720
|
const formData = rawFormData === void 0 && expandAllBranches ? {} : rawFormData;
|
|
721
721
|
const discriminator = getDiscriminatorFieldFromSchema(schema);
|
|
722
722
|
anyOrOneOf = anyOrOneOf.map((s) => {
|
|
723
|
-
return resolveAllReferences(s, rootSchema,
|
|
723
|
+
return resolveAllReferences(s, rootSchema, []);
|
|
724
724
|
});
|
|
725
725
|
const option = getFirstMatchingOption(validator, formData, anyOrOneOf, rootSchema, discriminator);
|
|
726
726
|
if (expandAllBranches) {
|
|
@@ -737,7 +737,6 @@ function resolveDependencies(validator, schema, rootSchema, expandAllBranches, r
|
|
|
737
737
|
remainingSchema,
|
|
738
738
|
rootSchema,
|
|
739
739
|
expandAllBranches,
|
|
740
|
-
recurseList,
|
|
741
740
|
formData
|
|
742
741
|
);
|
|
743
742
|
return resolvedSchemas.flatMap(
|
|
@@ -2637,13 +2636,12 @@ var ParserValidator = class {
|
|
|
2637
2636
|
|
|
2638
2637
|
// src/parser/schemaParser.ts
|
|
2639
2638
|
function parseSchema(validator, recurseList, rootSchema, schema) {
|
|
2640
|
-
const
|
|
2641
|
-
const schemas = retrieveSchemaInternal(validator, schema, rootSchema, void 0, true, recurseRefs);
|
|
2639
|
+
const schemas = retrieveSchemaInternal(validator, schema, rootSchema, void 0, true);
|
|
2642
2640
|
schemas.forEach((schema2) => {
|
|
2643
2641
|
const sameSchemaIndex = recurseList.findIndex((item) => (0, import_isEqual7.default)(item, schema2));
|
|
2644
2642
|
if (sameSchemaIndex === -1) {
|
|
2645
2643
|
recurseList.push(schema2);
|
|
2646
|
-
const allOptions = resolveAnyOrOneOfSchemas(validator, schema2, rootSchema, true
|
|
2644
|
+
const allOptions = resolveAnyOrOneOfSchemas(validator, schema2, rootSchema, true);
|
|
2647
2645
|
allOptions.forEach((s) => {
|
|
2648
2646
|
if (PROPERTIES_KEY in s && s[PROPERTIES_KEY]) {
|
|
2649
2647
|
(0, import_forEach.default)(schema2[PROPERTIES_KEY], (value) => {
|