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

Inconsistent naming of XML nodes with and w/out attributes #7

Open
rimutaka opened this issue Oct 19, 2020 · 0 comments
Open

Inconsistent naming of XML nodes with and w/out attributes #7

rimutaka opened this issue Oct 19, 2020 · 0 comments

Comments

@rimutaka
Copy link
Collaborator

XML elements can be defined in its XML schema as optional. Usually, a missing XML attribute is assigned a NULL value at de-serialization. Consider these 2 examples:

  1. <a attr1="val1">some text</a>
  2. <a>some text</a>

which should both deserialize to some struct called a with a member for the text node. However, they are converted differently:

  1. {"a":{"text":"some text","attr1":"val1"}}
  2. {"a":"some text"} when a more appropriate output would be `{"a":{"text":"some text"}}

This is somewhat similar to issue #6 and can probably be solved through a config option to force some simple XML nodes into an object form of JSON.

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