score:15
Accepted answer
The error is telling you that instead of /switch_id
it got an array. So it seems like you should read the JSON as a List[Switch]
instead of just Switch
Assuming your Reads
(didn't test them) are correct this should work:
val json: JsValue = Json.parse(jsonChunk)
println(json.validate[List[TheSwitch]])
Source: stackoverflow.com
Related Query
- Play ScalaJSON Reads[T] parsing ValidationError(error.path.missing,WrappedArray())
- Play ScalaJSON Reads[T] parsing
- Play ScalaJSON Reads[T] parsing type mismatch error
- parsing a Json Array in play framework JsObject
- How do I find the absolute path to a Play Framework app?
- How to handle optional fields in JSON parsing in play 2.1
- How to access a resource file using relative path in play framework project?
- Today's options for an easier migration path to Play 2
- Play 2.4 disable certain filters set based on request path or method
- play framework - error parsing expression in build.sbt
- UUID Path Bindable - Play Framework
- Parsing a Json String in Scala using Play framework
- Play Framework 2.0 BodyParser - push parsing XML streams
- Play framework parsing semicolons in query parameters
- Play Scala Akka WebSockets change actor path
- Parsing a JSArray object into a list of objects in Scala Play
- Play Framework and Scala Json, parsing for json containing JSArray and JSObject
- Dynamic path routing in Play for Scala
- How to refer external class path to play framework application?
- Play framework default tmp folder path
- Play change RUNNING_PID file path
- how to define optional path parameters in Play Framework routes
- how to display image( as image path ) from database in play framework
- Scala - parse JSON data from API with ScalaJson Play Framework
- PathBindable For Multiple Path Parameters In Play
- Common path prefix in Play framework 2.2.x scala JSON Reads
- Difference between query string and path parameter in play framework?
- QueryString parsing in Play
- Parsing HTTP request JSON body in scala with play
- Bind Enumeration to path or query in play
More Query from same tag
- How do I use tabulate with multiple named parameters in Scala?
- IntelliJ IDEA does not let me run ScalaTests from an SBT project any more
- How can I set a logicalType in a spark-avro 2.4 schema?
- Scala Map and ConcurrentHashMap throw a java.lang.UnsupportedOperationException
- How shutdown akka system without terminating messages immediately?
- Given an array of integers, return indices of the two numbers such that they add up to a specific target with Scala
- Idiomatic way to create a basic HTTP Post request with Akka HTTP
- Scala - TrieMap vs Vector
- Slick Join Left Option column
- Scala-Making a map from two lists
- Connecting AXI Stream to StreamFifo
- SimpleDateFormat showing inconsistent results
- Accessing (/importing) Scala Enumerations
- How to pass the command line argument to spark-shell scala script?
- Classcast exception on Scala map operation on List of Strings
- How to hide configuration management from the main function?
- define list from val in object
- Scala, Currying on multi parameter-group method?
- Performance of multiple generators in Scala 'for' expressions?
- How to scroll with wheel while dragging in JTable and JScrollPane
- DecodeJson not working after scalaz version update in application
- Scala Object Serialization
- How I make Scala code runs on EMR cluster by using SDK?
- scala play unmanaged jar added but import not working
- AWS S3 : Spark - java.lang.IllegalArgumentException: URI is not absolute... while saving dataframe to s3 location as json
- Idiomatic replacement for existential types
- Locating the next occurence of a character ===> (found Unit required Boolean, error)
- Implicit conversion on traits
- Scala: I have a Set[X] and function (X) => Future[Y] and want to output a Future[Map[X, Y]]
- Cannot find an implicit ExecutionContext. You might pass spray scala