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

Separate Control for Type Conversion of Numbers and Booleans in XML to JSON Conversion #841

Open
jagsgill opened this issue Dec 19, 2023 · 3 comments

Comments

@jagsgill
Copy link

Hello JSON-java maintainers,

I'm reaching out regarding the keepStrings flag. Currently, this flag controls the type conversion for both numbers and booleans uniformly. In my use case, I require more flexibility to sometimes convert numbers but keep booleans as strings, or vice versa, depending on the particular data representation I need when converting XML to JSON.

So, I am wondering about your thoughts to allow separate control over the type conversion for numbers and booleans.

I believe this change would align with the project's goals to address a major user inconvenience and could be achieved without breaking existing behavior (I'm still reviewing the source code, and would appreciate your comments on feasibility of such a change). Allowing users more control over the data representation would be highly beneficial. Thanks.

@stleary
Copy link
Owner

stleary commented Dec 19, 2023

@jagsgill Sounds reasonable, no objections to adding more granular flags for this purpose. Please use XMLParserConfiguration, avoid changing any constructors for this class, and use with*() methods to set the new values (there are plenty of example methods in that file). Try to use common and easily understood names for the new flags. Also, please add appropriate comments to the keepStrings flag and the new flags. Don't forget to add unit tests. Thanks!

@jagsgill
Copy link
Author

jagsgill commented Feb 8, 2024

We went with a different solution, so I will close this issue. Thanks for the consideration.

@jagsgill jagsgill closed this as not planned Won't fix, can't repro, duplicate, stale Feb 8, 2024
@rsel17
Copy link

rsel17 commented Feb 16, 2024

Hi @jagsgill

We are facing similar issue in our application, would like to know how you have resolved it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants