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

Feature Request - Ability to open JSON files that begin with an array #389

Open
stevebow opened this issue May 7, 2024 · 2 comments
Open

Comments

@stevebow
Copy link

stevebow commented May 7, 2024

When trying to open a JSON file that begins with an array (character "["), XmlNotepad (2.9.0.10) displays the following error:

XmlNodeConverter can only convert JSON that begins with an object. Path '', line 1, postition 1.

Would it be possible for the XmlNodeConverter to convert JSON files that begin with an array please? Example JSON file attached.

Also, should the Path single quotes in the error message contain anything?

Thanks.

70.zip

@lovettchris
Copy link
Member

We could, but XML can only have one root element, so we'd have to invent the name of that root container. Or we take only the first element in the array? Which is your preference? If you want to invent a root element name, what name would you choose?

@stevebow
Copy link
Author

stevebow commented May 7, 2024

I do think all elements ought to be imported, if that is what you meant. As for a root container name? Perhaps simply the filename stem? The user could change it after import if they prefer something else. Sorry, I'm not terribly imaginative when it comes to names. :^/

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