Parse Simple Json Array in Play Framework

﹥>﹥吖頭↗ 提交于 2020-01-06 14:01:15

问题


I'm sure there is a simple way to do this, but I haven't found a way to do it. How do I go about parsing a simple json array: [1] as a List[Integer] or List[String] with the play framework Json Library in scala?

All of the examples I have seen in the documentation assume you are working with an object and are accessing an attribute in the object. When I try to parse the json I get an error:

jsonResult.as[List[String]]

JsError(List((,List(ValidationError(error.expected.jsarray,WrappedArray())))))

来源:https://stackoverflow.com/questions/27365763/parse-simple-json-array-in-play-framework

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!