justify icon indicating copy to clipboard operation
justify copied to clipboard

JSONB Bind to Object + Default value support

Open mmadson opened this issue 4 years ago • 1 comments

Hi there!

Thanks for the great library. I'm digging into the examples but haven't been able to figure it out yet. Is there a way to perform the jsonb binding while also supporting default values; so that the serialized objects have the default values as specified in the spec?

Much appreciated.

mmadson avatar Feb 24 '21 01:02 mmadson

@mmadson

Sorry for late reply. I have added an experimental example which fills a Java object with default values specified in the JSON schema. https://github.com/leadpony/justify-examples/tree/binding-default/justify-examples-yasson

Unfortunately, we must use Yasson-specific API directly because pure JSON-B API does not accept JsonParser generated by an external library such as Justify.

leadpony avatar Feb 28 '21 08:02 leadpony