-
Notifications
You must be signed in to change notification settings - Fork 419
Closed
Milestone
Description
Describe the bug
- createDefaultValue returns empty object in the "anyOf" example when new element is added in "Addresses or Users (AnyOf Array Items)"
- createDefaultValue should also pass the rootSchema when it tries to resolve the the schema based on schema.$ref
Expected behavior
the createDefaultValue should have returned empty array rather than empty object
we get
{
"addressOrUser": {
"street_address": "1600 Pennsylvania Avenue NW",
"city": "Washington",
"state": "DC"
},
"addressesOrUsersAnyOfItems": [
{}
]
}
instead of
{
"addressOrUser": {
"street_address": "1600 Pennsylvania Avenue NW",
"city": "Washington",
"state": "DC"
},
"addressesOrUsersAnyOfItems": [
[]
]
}
Steps to reproduce the issue
- Go to generated example app
- Select Example 'anyOf'
- Scroll down to 'Addresses or Users (AnyOf Array Items)'
- Click on the '+' to add new element in "Addresses or Users (AnyOf Array Items)" array
- See that added element under addressesOrUsersAnyOfItems is an empty object rather than empty array
Screenshots
No response
Which Version of JSON Forms are you using?
3.4.1
Package
Core
Additional context
No response
Metadata
Metadata
Assignees
Labels
No labels