-
Notifications
You must be signed in to change notification settings - Fork 25
Usage
Since 0.8.x the validator is a class and needs to be instantiated.
val validator = SchemaValidator()
validator.validate(...)
A new feature allows handling of custom reference within the schema, for instance the validator now allows references to JSON files that lie on the classpath if an appropriate URL handler has been registered. For examples, please see the test cases here.
Version 0.7.0 introduced some breaking changes, since the dependency to the Unified Validation library
has been removed, i.e. the respective types are not part of the API anymore. This means that
VA
isn't exposed anymore as well as the toJson
acting on
Seq[(JsPath, Seq[ValidationError])]
instead of Seq[(Path, Seq[ValidationError])]
.
As a replacement for VA
we now use JsResult
to express the result of a schema validation, which is already part of play-json.
Play 2.5.x dropped support for Scala 2.10, hence versions >= 0.7.0 are only available for Scala 2.11.
For, Play 2.4.x, the current version is 0.6.5, which supports Scala 2.10 and 2.11
libraryDependencies ++= Seq(
"com.eclipsesource" %% "play-json-schema-validator" % "0.6.5"
)