JsonValidationError

play.api.libs.json.JsonValidationError$
See theJsonValidationError companion class

Attributes

Companion
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type

Members list

Type members

Classlikes

object Detailed

Extracts the first error details (message and its first argument).

Extracts the first error details (message and its first argument).

import play.api.libs.json.JsonValidationError

def details(err: JsonValidationError): Option[(String, Any)] = err match {
 case JsonValidationError.Detailed(msg, arg) => Some(msg -> arg)
 case _ => None
}

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Detailed.type
object Message

Extracts the first error message.

Extracts the first error message.

import play.api.libs.json.JsonValidationError

def msg(err: JsonValidationError): Option[String] = err match {
 case JsonValidationError.Message(msg) => Some(msg)
 case _ => None
}

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Message.type

Inherited types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror
type MirroredLabel <: String

The name of the type

The name of the type

Attributes

Inherited from:
Mirror

Value members

Concrete methods

def apply(message: String, args: Any*): JsonValidationError
import play.api.libs.json.JsonValidationError

val simpleError = JsonValidationError("error.key1")

val detailedError = JsonValidationError("error.key1", "details")

Attributes