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

Serialization does not provide type info for numeric literals #66

Closed
ledsoft opened this issue Jun 7, 2024 · 0 comments · Fixed by #76
Closed

Serialization does not provide type info for numeric literals #66

ledsoft opened this issue Jun 7, 2024 · 0 comments · Fixed by #76
Assignees

Comments

@ledsoft
Copy link
Contributor

ledsoft commented Jun 7, 2024

When serializing a numeric literal value, JB4JSON-LD simply outputs the value as JSON number, regardless of the particular type. However, this makes serialization and deserialization not compatible in case of floating point numbers, because a double is serialized as a number but the Jakarta JSON processor reads it as BigDecimal because it cannot know whether the value will fit in a double with the right precission.

JB4JSON-LD should provide the type info with the value (e.g., xsd:double for Java double) so that when the same object is deserialized, correct type is resolved.

@ledsoft ledsoft self-assigned this Dec 16, 2024
ledsoft added a commit that referenced this issue Dec 17, 2024
ledsoft added a commit that referenced this issue Dec 17, 2024
@ledsoft ledsoft linked a pull request Dec 17, 2024 that will close this issue
ledsoft added a commit that referenced this issue Dec 17, 2024
ledsoft added a commit that referenced this issue Dec 17, 2024
@ledsoft ledsoft closed this as completed Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant