val s = """ { "name" : "bob" } """
//Works
Json.parse(s) match { case json""" { "name" : $n } """ => n }
//Does not work
Json.parse(s) match { case Json.parse(""" { "name" : $n } """) => n }
Am I missing anything here?
The reason I'd like to use this as I am building out generic function in order to substitute any pattern in
Example:
val s = """ { "name" : "bob" } """
val attribute = "name"
val pattern = """ { """" + attribute + """" : $n }"""
Json.parse(s) match { case Json.parse(pattern) => n }
Would this be possible?