Skip to content
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

Bug: Nullable Subschema (anyOf with null) causes UI exception #167

Open
gersmann opened this issue May 29, 2024 · 0 comments
Open

Bug: Nullable Subschema (anyOf with null) causes UI exception #167

gersmann opened this issue May 29, 2024 · 0 comments

Comments

@gersmann
Copy link

A schema with this top level defiinition:
'anyOf': [{'$ref': '#/$defs/TestModel'}, {'type': 'null'}]

Leads to an UI error, whent he null option is selected.

Initial:
image

After selecting null option:
image

The widget should probably replace / reinitialize the form data, if another anyOf option is selected.

Console:

Error: No matching subschema found in 'anyOf' for data '' (type: string)
    T http://localhost:8000/static/django_jsonform/react-json-form.js:1
    <anonymous> http://localhost:8000/static/django_jsonform/react-json-form.js:1
    render http://localhost:8000/static/django_jsonform/react-json-form.js:1
    React 23
[add:12714:25](http://localhost:8000/admin/returns/returnregistration/add/?account=1)
    overrideMethod http://localhost:8000/admin/returns/returnregistration/add/?account=1:12714
    React 25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant