-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Common: fix API Request Enrichment output deserialization #374
Comments
The bug manifests itself as a bad row produced by post-enrichment schema-validation. The offending entity is added by API Request enrichment. If its output schema requires integer type, the validator complains that "42 is a number, but integer expected", because in its internal representation, 42 is a number. |
What about SQL Query enrichment, @oguzhanunlu? It's inputs also seem to be affected, but I don't see any changes regarding to that. |
io.circe.jackson.mapper
deserializes all integers and numbers toJsonBigDecimal
and downstream in the codebase, it is converted toDecimalNode
bycirceToJackson()
iniglu-scala-client
, and the validator treatsDecimalNode
asnumber
which results in a bad row withnumber found, integer expected
error message in case output schema of API Request Enrichment containsinteger
propertyWe'll introduce a custom mapper whose only difference compared to the original mapper is how integers are deserialized. Unlike the original, it'll deserialize integers to
JsonLong
.Note that json schemas might contain integer values that don't fit into
Long
and this case will also result in a bad row, but we don't expect to see this case in real life.The actual diff happens in
CirceJsonDeserializer.deserialize
whereis replaced by
The text was updated successfully, but these errors were encountered: