I'm using Rapture JSON to parse a JSON message this way
for {
id <- parsedJson.inputEvent.fields.id.as[String]
inputFields <- parsedJson.fieldSet.fields.as[Map[String, Any]]
additionalFields <- extractAdditionalFields(parsedJson)
} yield (
(id, inputFields),
additionalFields)
The problem is that inputFields
is parsed always as a Map[String,String]] and I can't seem to make it parse as a Double/Integer correctly. I'm rather sure it used to work correctly but right now it does not. The JSON is valid, well formed and other parsers parse the values as numbers and not string. Is there an elegant way to enforce the correct parsing?