score:1
Accepted answer
when you use validate
you get a list of errors.
json.validate[myclass] match {
case jssuccess(myclass, _) =>
// do something
case jserror(errors) =>
// do something with the errors
}
the errors are of type seq[(jspath, seq[jsonvalidationerror])]
.
you can transform this to whatever you want.
Source: stackoverflow.com
Related Query
- Play Json - custom JsResultException
- Custom JodaTime serializer using Play Framework's JSON library?
- Custom JSON validation constraints in Play Framework 2.3 (Scala)
- Scala Play Json JSResultException Validation Error
- Play Framework JSON Reader and custom JSErrors
- Serialize set to json with a custom Writes in Scala Play 2.4
- Simplest way to read an array into a list of custom objects with Play JSON API
- Play - Custom Json with Generic Crud
- Play custom filter JSON error
- How do I define json writer for custom object in Play + Scala?
- Play Framework JSON automated mapping with custom validation
- scala play json custom validation oneOf
- Create custom json definition in play scala
- Scala Play Json JSResultException Error API
- Custom Action composition to authorize based on JSON token in Play (Scala)
- Parse request body with custom content-type to json in Play Framework
- How to write Scala Play framework custom class's multiple JSON serializer deserializer?
- JsResultException - unable to successfully parse json - 2.4x Play Scala
- Play Json case class mapper with custom converter function
- Serializing a map of custom types to JSON using Scala and Play Framework
- Noise free JSON format for sealed traits with Play 2.2 library
- Play Framework - add a field to JSON object
- Defaults for missing properties in play 2 JSON formats
- parsing a Json Array in play framework JsObject
- Play Framework: How to serialize/deserialize an enumeration to/from JSON
- How to create a custom 404 page handler with Play 2.0?
- How to implement implicit Json Writes of embedded object in Play Framework 2.x
- How to load JSON file using Play with Scala
- Creating a custom field constructor in Play 2 (scala)
- Scala to JSON in Play Framework 2.1
More Query from same tag
- GraphX - Class file needed by Graph is missing
- adding google analytics jar via SBT to scala project
- How to specify a 'next' function in Scala for loop
- "update" method with variable-length index in Scala
- Proper function defining structure?
- putIfAbsent for immutable maps?
- How to use a path dependent type class
- Spark DataFrame - How to partition the data based on condition
- Scala Constructor Deprecation
- Sbt run tests from src/main/scala instead of src/test/scala?
- Scala Collection filtering on multiple items
- Scala - Passing a Seq/Map of derived class's class in place of base class's class
- Implicit class resolution for parameterized types
- Replace column values when matching keys in a Map
- Shorter Scala Script header
- will using "+" preserve my order in a map ? No right?
- Is there a way to use spray-route and spray-can together?
- Scala-redis Client connection to RedisCloud on Heroku issues
- Debug exceptions in AWT queue thread
- How do you read a zipped input stream without writing to a file?
- Scala object initialization bug
- Hiding closure boilerplate with macros?
- Injecting dependencies in tests in Play framework with scaldi
- Scala MergeSort
- In Scala, how do I access a case class's private constructor from its companion object
- Scala case class copy constructor with dynamic fields
- Multiply elements of list of lists with each other
- Is there a way to route messages according to the stash size in Akka(Scala)
- Play Scala Compile Error
- sbt how to get result (success/failed) of compile in an sbt task