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

XMLParserConfiguration defined json arrays option #646

Merged
merged 6 commits into from
Dec 4, 2021

Conversation

Zetmas
Copy link
Contributor

@Zetmas Zetmas commented Nov 20, 2021

  • Added a member variable named Set<String> forceList to XMLParserConfiguration with corresponding constructor/getter/setter
  • After configuring forceList in XMLParserConfiguration, XML.toJSONObject will now set the corresponding values as arrays, regardless of their number of occurrences
  • If the returning value is originally "", it will be replaced by []

@Zetmas Zetmas marked this pull request as ready for review November 20, 2021 03:39
@Zetmas Zetmas changed the title Fixes stleary/JSON-java#595 Fixes #595 How to convert a node of xml to json array Nov 20, 2021
Copy link
Contributor

@johnjaylward johnjaylward left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks decent enough to me. Thanks

@stleary
Copy link
Owner

stleary commented Nov 24, 2021

What problem does this code solve?
Enhancement for unconditional parsing of XML elements to array

Risks
Low

Changes to the API?
Added a new XML config option

Will this require a new release?
No

Should the documentation be updated?
Yes (Do we even have an XMLConfiguration topic?)

Does it break the unit tests?
No

Was any code refactored in this commit?
No

Review status
APPROVED

@stleary
Copy link
Owner

stleary commented Nov 24, 2021

Starting a 7 day comment window (won't be able to complete a code review rght away)

@stleary stleary changed the title Fixes #595 How to convert a node of xml to json array XMLParserConfiguration support for xml to json arrays Dec 4, 2021
@stleary stleary merged commit cff5cc6 into stleary:master Dec 4, 2021
@stleary stleary changed the title XMLParserConfiguration support for xml to json arrays XMLParserConfiguration defined json arrays option Dec 5, 2021
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

Successfully merging this pull request may close these issues.

3 participants