You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've got a simple Schema example with two properties, each containing one property. The overarching properties are required to be in the formData, whereas the "sub properties" of each overarching property are optional.
The problem is that omitExtraData seems to trim out the overarching properties by default.
When clearing the formData, the default formData is created - which looks as expected. Further, entering something in one of the property fields and then deleting this content leads to the default formData again.
Expected behavior
I would expect that when I hit submit, I get the output equal to the formData - i.e. below:
{
"general": {
"device": {},
"security": {}
}
}
This output should come regardless of whether I simply load the Schema and immediately hit submit - or whether I enter something in a field and then deletes that again.
Actual behavior
Instead, if I simply load the Schema and hit submit with the default formData (without editing the fields), none of the properties are included in the output (see the console). Instead I get an empty formData output in the console.
If I change one of the property fields in the editor and clear that data again in the editor, the formData looks the same as the default - but now the console "correctly" outputs the property that I edited (but not the other property until I also edit this).
This issue is rather critical for cases where users want to ensure that the formData contains the expected "skeleton" structure (in our case the device and security fields) when these are included in the Schema, at least when they're explicitly required.
I would expect the omitExtraData to primarily be used for eliminating property fields that are not included in the Schema - not the properties actually listed in the Schema.
Version
This was done August 22, using the playground.
The text was updated successfully, but these errors were encountered:
Prerequisites
Description
I've got a simple Schema example with two properties, each containing one property. The overarching properties are required to be in the formData, whereas the "sub properties" of each overarching property are optional.
The problem is that omitExtraData seems to trim out the overarching properties by default.
Steps to Reproduce
See playground link:
Playground link
When clearing the formData, the default formData is created - which looks as expected. Further, entering something in one of the property fields and then deleting this content leads to the default formData again.
Expected behavior
I would expect that when I hit submit, I get the output equal to the formData - i.e. below:
This output should come regardless of whether I simply load the Schema and immediately hit submit - or whether I enter something in a field and then deletes that again.
Actual behavior
Instead, if I simply load the Schema and hit submit with the default formData (without editing the fields), none of the properties are included in the output (see the console). Instead I get an empty formData output in the console.
If I change one of the property fields in the editor and clear that data again in the editor, the formData looks the same as the default - but now the console "correctly" outputs the property that I edited (but not the other property until I also edit this).
This issue is rather critical for cases where users want to ensure that the formData contains the expected "skeleton" structure (in our case the
device
andsecurity
fields) when these are included in the Schema, at least when they're explicitly required.I would expect the omitExtraData to primarily be used for eliminating property fields that are not included in the Schema - not the properties actually listed in the Schema.
Version
This was done August 22, using the playground.
The text was updated successfully, but these errors were encountered: