HubSpot / jinjava

Jinja template engine for Java
Apache License 2.0
690 stars 168 forks source link

Use Jdk8Module to serialize Optional values #1175

Closed jasmith-hs closed 4 months ago

jasmith-hs commented 4 months ago

Generally, optional values are unwrapped, but if they are nested within a collection or a bean, they will be serialized as {"empty": false, "present": true} without the use of Jdk8Module.

By registering Jdk8Module, we can serialize Optional values properly.