johnzon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Romain Manni-Bucau <rmannibu...@gmail.com>
Subject Re: Jsonschema module
Date Sun, 29 Apr 2018 18:12:28 GMT
Hi guys,

started to add it through
https://github.com/apache/johnzon/commit/947c91b8a6b17d87b464a8a87423ea7b577d27f7
(I'll continue later tonight or tomorrow probably)

Let me know if there is any issue, high level the usage is:

JsonObject schema = getJsonSchema();
JsonObject objectToValidateAgainstSchema = getObject();
JsonSchemaValidatorFactory factory = new JsonSchemaValidatorFactory();
JsonSchemaValidator validator = factory.newInstance(schema);
// runtime starts here
ValidatinResult result = validator.apply(objectToValidateAgainstSchema);
// if result.isSuccess, result.getErrors etc...
// end of runtime
validator.close();
factory.close();



Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>

2018-04-28 9:48 GMT+02:00 Romain Manni-Bucau <rmannibucau@gmail.com>:

> Hi guys
>
> Id like to add a jsonschema module supporting the representation and
> validation of an object from a schema.
>
> Wdyt? It would be jsonp based i think.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message