-
-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
discriminated union with dataType json causing SchemaError #519
Comments
You can't stringify |
I updated the code. The field addresses.additional.name is a required field and I would expect a validation error when empty string is submitted, but instead I get a schema error / crash from superforms ? Where would the default value be placed to fix the issue ? So far I have not had success with default values |
There was a problem with the recursive check for discriminated unions, will be fixed in the next release. No default will be required. |
Thanks for the fix! Sadly when assigning a default value on a nested discriminated union things break. Is this expected or should this work? |
Fixed now with 2.21.1 |
Error trace
From the repro: The testcase bad produces this error trace, testcase good works
Basically the feature is to provide one of three possible address types, something like
where the 'none' type has no additional fields
Repro
Code
Should this kind of schema work ? Should this be modeled differently?
The text was updated successfully, but these errors were encountered: