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

Empty string field should result in null value #7

Open
henhuy opened this issue Jan 27, 2022 · 1 comment
Open

Empty string field should result in null value #7

henhuy opened this issue Jan 27, 2022 · 1 comment

Comments

@henhuy
Copy link
Contributor

henhuy commented Jan 27, 2022

This is a bit tricky, as JSON validation does not allow a type string to become null.
One workaround is to make field with two possible types (see json-editor/json-editor#649)
but this creates a strange dropdown.
Unfortunately, I think this must be handled using JS...

@jh-RLI
Copy link
Contributor

jh-RLI commented Jan 27, 2022

if JSON validation does not allow string fields to be null it means that the null values are not used correctly as default for all fields in the oemetadata. What would be a better practice? simply "string": ""

We figured that null is always okay for unused JSON fields like this. If this is not true we can also consider specifying a different value for empty fields.

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

2 participants