I'm using Rapture JSON with Argonaut backend (can change that if necessary).
Given an arbitrary JSON string, I need to parse it as a flat object (no nested JSON objects) to ideally obtain a list of tuples (fieldName, fieldType, fieldValue) for each field.
import rapture.json._
import rapture.json.jsonBackends.argonaut._
val j = json"""{"what":"stuff"}"""
val extracted: List[(String, FieldType, Any)] = j.someMagic()
// So I can do this
extracted.map { _ match {
case (k, JString, v) => println("I found a string!")
...
}}
UPDATE: this became a github issue in rapture-json