commit | c815f522ec1f36747c88fb0f409a5293b40a461c | [log] [tgz] |
---|---|---|
author | Andrew Guibert <andy.guibert@gmail.com> | Sat Aug 10 23:32:25 2019 -0500 |
committer | Andrew Guibert <andy.guibert@gmail.com> | Sat Aug 10 23:32:25 2019 -0500 |
tree | 6469df0e41446306d15c1ff8344313de75dd47b3 | |
parent | a96a982e25cb4bfc1e0ba924e642a29a7b0f9026 [diff] |
Do not include property values in error messages
Yasson is a Java framework which provides a standard binding layer between Java classes and JSON documents. This is similar to what JAXB is doing in the XML world. Yasson is an official reference implementation of JSON Binding (JSR-367).
It defines a default mapping algorithm for converting existing Java classes to JSON suitable for the most cases:
Jsonb jsonb = JsonbBuilder.create(); String result = jsonb.toJson(someObject);
For whom it's not enough it provides rich customization abilities through a set of annotations and rich programmatic API:
// Create custom configuration JsonbConfig config = new JsonbConfig() .withNullValues(true) .withFormating(true); // Create Jsonb with custom configuration Jsonb jsonb = JsonbBuilder.create(config); // Use it! String result = jsonb.toJson(someObject);