Scala Play Json JSResultException Validation Error -
i trying pass json string other method error,
play.api.libs.json.jsresultexception: jsresultexception(errors:list((,list(validationerror(error.expected.jsstring,wrappedarray())))))
i find strange occurs randomly, don't exception , do. ideas?
here json looks
val string = { "first_name" : { "type" : "string", "value" : "john" }, "id" : { "type" : "string", "value" : "123456789" }, "last_name" : { "type" : "string", "value" : "smith" } } i read
(string \ "first_name").as[string]
(string \ "first_name") gives jsvalue not jsstring as[string] not work.
but if need first name value can
val firstname = ((json \ "first_name") \ "value").as[string]
Comments
Post a Comment