-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Open
Labels
Description
Prerequisites
- I have searched the existing issues
- I understand that providing a SSCCE example is tremendously useful to the maintainers.
- I have read the documentation
- Ideally, I'm providing a sample JSFiddle, Codesandbox.io or preferably a shared playground link demonstrating the issue.
What theme are you using?
core
Version
5.x
Current Behavior
If you want to support conditions and defaults in refs in additionalProperties you need to do like this:
1. support conditions in refs in additionalProperties:
retriveSchema.ts
if (REF_KEY in schema.additionalProperties!) {
additionalProperties = resolveAllReferences<S>(schema.additionalProperties as S, rootSchema as S, []);
instead of
additionalProperties = retrieveSchema<T, S, F>(
validator,
{ $ref: get(schema.additionalProperties, [REF_KEY]) } as S,
rootSchema,
formData as T
);
2. support defaults for refs in additional properties
objectField.tsx
defaultValue = schemaUtils.getDefaultFormState(apSchema, defaultValue);
instead of
defaultValue = apSchema.default;
hope this can be helpful, I spent already much time to fix it!
Expected Behavior
No response
Steps To Reproduce
This is an example problematic schema:
Environment
No response
Anything else?
No response