OpenAPITools / jackson-databind-nullable

JsonNullable wrapper class and Jackson module to support meaningful null values
Apache License 2.0
99 stars 31 forks source link

RFE: Make JsonNullable serialize properly to XML #10

Closed bkabrda closed 5 years ago

bkabrda commented 5 years ago

As discussed in https://github.com/OpenAPITools/openapi-generator/pull/3474 it would be awesome if JsonNullable would serialize correctly to XML as well. IIUC most of the heavy machinery is already present in this package and it'd only be necessary to implement the custom XML serializer which would look much like the custom JSON serializer.

cbornet commented 5 years ago

Of course ! Would you do a PR ? It should be close to how it's done for Optional

bkabrda commented 5 years ago

Yeah, I'll try to give it a shot and reach out if I can't make something work.

bkabrda commented 5 years ago

Heh, I was actually doing it wrong, JsonNullable works fine even with XML when properly registered on the XmlMapper. Do you want me to make a note in the README.md about this?

cbornet commented 5 years ago

Good news ! Yes we could have a note on how to register the module in the readme for both ObjectMapper and XmlMapper.

cbornet commented 5 years ago

Closed by #11