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

Additional keys can't contain dashes #69

Closed
pixerius opened this issue Nov 2, 2022 · 2 comments
Closed

Additional keys can't contain dashes #69

pixerius opened this issue Nov 2, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@pixerius
Copy link

pixerius commented Nov 2, 2022

Adding custom key with dash results in error on react-json-from library side:
Screenshot 2022-11-02 at 12 37 09

For the above example the key was test-test.

@bhch bhch added the bug Something isn't working label Nov 2, 2022
@bhch
Copy link
Owner

bhch commented Nov 2, 2022

Internally, the dash (-) is used to chain nested objects and array items.

So, when the UI generation code sees test-test, it interprets the first test to be a dict and the second test to be a key in that dict.

It can be fixed if we use some other character to chain nested items. But even that won't be a permanent fix.

I'll try to release a fix in a couple of weeks. Until then, hopefully you can use the underscore (_) character.

@bhch
Copy link
Owner

bhch commented Nov 21, 2022

Fixed in v2.15.0. Please upgrade. Thank you for the bug report.

@bhch bhch closed this as completed Nov 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants