kmongo icon indicating copy to clipboard operation
kmongo copied to clipboard

KMongo unable to save field with name "isClosed" and type "String"

Open himanshuvaish93 opened this issue 3 years ago • 3 comments

Hi Team,

I have observed that when we are trying to save a document using kmongo methods, field "isClosed" is ignored if it is of type String. However same field name with Boolean data type works. Also, if document contains an additional field with name "closed" and type String along with "isClosed", it doesn't save "closed" and rather saves "isClosed". We have a use case where we need to persist isClosed field name but facing issue.

Is this something which is expected or isClosed as string is some keyword ?

himanshuvaish93 avatar Sep 22 '22 14:09 himanshuvaish93

Indeed there is a bug. Workaround: data class Test1(@get:JsonProperty("isClosed") val isClosed:String)

zigzago avatar Sep 26 '22 20:09 zigzago

Looks like a bug in jackson-module-kotlin lib https://github.com/FasterXML/jackson-module-kotlin/issues/575

zigzago avatar Sep 26 '22 20:09 zigzago

Thank you for reviewing. We are using the workaround for now.

himanshuvaish93 avatar Sep 28 '22 03:09 himanshuvaish93