Closed JJSarrasin closed 1 year ago
One addition, I just find out that if I use @JsonNames instead of @SerializedName, it works.
It is per documentation for JsonNamingStrategy
(https://kotlinlang.org/api/kotlinx.serialization/kotlinx-serialization-json/kotlinx.serialization.json/-json-naming-strategy/):
Due to the nature of kotlinx.serialization framework, naming strategy transformation is applied to all properties regardless of whether their serial name was taken from the property name or provided by @SerialName annotation. Effectively it means one cannot avoid transformation by explicitly specifying the serial name.
If one wants to preserve the original serial name for deserialization, one should use the JsonNames annotation, as its values are not transformed.
All my libraries and tools are up-to-date (stable versions).
All the content of the APIs I'm reaching are in snake_case, that's why I use the namingStrategy JsonNamingStrategy.SnakeCase
Only one route's content is in CamelCase, I'm trying to define my object like this:
The JSON I get:
And when I print my values, all of them are 0. Any idea why ? Wrong use or bug in the converter ?