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

Change to loose json parsing for boolean and number types to allow string values #3146

Closed
wants to merge 1 commit into from

Conversation

rPraml
Copy link
Contributor

@rPraml rPraml commented Aug 8, 2023

We use parser.getValueAsXXX as it does some auto-detection, if the data type does not match exactly.
This allows to read jsons from other sources, where numeric values are encoded as string òr boolean values are encoded as 1 or 0 or "true","false"

rPraml added a commit to FOCONIS/ebean that referenced this pull request Aug 10, 2023
@rob-bygrave
Copy link
Contributor

This isn't strictly a BugFix, it is more a change to allow more loose json parsing for numbers and boolean to allow string values.

Although it might look benign enough this puts a limitation on future json parsing to similarly provide loose parsing for those types. For example, this might be something that is not supported by some future Vector API based json parser.

As such I'll change the title on this issue.

Additionally note that this is something that I feel is problematic in terms of future json parsing options so seems unlikely to be merged / adopted.

@rob-bygrave rob-bygrave changed the title FIX: ScalarTypes can handle String values Change to loose json parsing for boolean and number types to allow string values Aug 11, 2023
@rPraml
Copy link
Contributor Author

rPraml commented Aug 11, 2023

The problem was, that we have changed a datatype from "string" to "integer" (there were only numbers stored in the varchar column, unfortunately, exported jsons become unreadable after this change)

I'll talk with my team, if we can find an other solution @SimonBuettner FYI

@rbygrave
Copy link
Member

Can we close this PR?

@rPraml rPraml closed this Feb 23, 2024
rPraml added a commit to FOCONIS/ebean that referenced this pull request Oct 9, 2024
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.

4 participants