Skip to content

Issue with GSON builder throwing "NaN is not a valid double value as per JSON specification." #1415

@BrakefieldMN

Description

@BrakefieldMN

Clear description of my expectations versus reality
An object with a double value set as Double.NaN should be persisted. In reality, javers' gson builder throws an error because it does not leverage "serializeSpecialFloatingPointValues".

Steps To Reproduce
I have a **runnable test case ** which isolates the bug and allows Javers Core Team to easily reproduce it. I have pushed this test case to my fork of this repository:

https://github.com/BrakefieldMN/javers/blob/master/javers-spring-boot-starter-mongo/src/test/groovy/org/javers/spring/boot/mongo/JaversMongoStarterNullDoubleTest.groovy

Javers' Version
7.6.2

Additional context
This issue was identified a few years ago.
https://stackoverflow.com/questions/54573968/issue-in-infinity-is-not-a-valid-double-value-as-per-json-specification-with-flo

I also intend to open a PR to make the adjustment in the gson builder.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions