Closed
Description
Hello!
Is there any way to wire a custom JsonSerializer to the spring-graphql
? I have a custom serializer for setting the precision of double values. For example:
class Response {
@JsonSerialize(using = CustomFormatter::class)
@Precision(2)
val number: Double,
}
If for example, number
has a value 2.8503471831075
it will shrink precision to the 2.85
.
I have a similar serializer for an application with rest api using JsonSerializer and ContextualSerializer, but I can't make it work in a project with spring-graphql
. Maybe there is a different way to achieve this functionality?