Hello. I have a question why you don't test jackso...
# graphql-kotlin
f
Hello. I have a question why you don't test jackson serialization of Defined boolean input? see this test https://github.com/ExpediaGroup/graphql-kotlin/blob/master/clients/graphql-kotlin-[…]up/graphql/client/jackson/GraphQLClientJacksonSerializerTest.kt I found this issue in my project, when trying to use
Defined(true)
optional input. This value is skipped in serialization and generated json does not contain my boolean value. I created a draft branch there: https://github.com/ExpediaGroup/graphql-kotlin/pull/1513/files
d
Boolean is a scalar so it should behave the same as any other scalar (hence no test).
f
Hi, thank you for your reply. It is strange because all numbers and strings are serialized correctly, but Boolean value is not included in resulted JSON (it was somehow treated as
undefined
). I do not use custom ObjectMapper
I probably found the issue -> I have boolean named as
isSomething
. This
is
prefix can probably cause some issues https://github.com/FasterXML/jackson-module-kotlin/issues/80
It is strange that it worked with old version of graphql-kotlin
d
it might be the linked issue that jackson has issues with
is
prefix (it is a Java library so it follows java bean naming convention to locate fields)
f
I understand. With this issue using the latest graphql-kotlin is no way because we would need to rename some fields in graphql schema which is a breaking change. I saw this workaround, until jackson fix the issue ->
@get:JsonProperty("_isSomething_")
(see this comment). Maybe we could add this to all inputs generated by graphql-kotlin?
d
It is the same issue as reported here -> https://github.com/ExpediaGroup/graphql-kotlin/issues/1486 I dont think it will be fixed anytime soon