FasterXML / jackson-annotations

Core annotations (annotations that only depend on jackson-core) for Jackson data processor
https://github.com/FasterXML/jackson
Apache License 2.0
1.03k stars 330 forks source link

Add `JsonFormat.Shape.BINARY` #159

Closed cowtowncoder closed 5 years ago

cowtowncoder commented 5 years ago

Looks like "binary" representation is not available, yet. Although one can use NATURAL in many cases (like, say, byte[]), there are cases where one might want to use binary representation even if it was not the default. For example, when serializing java.util.UUID as JSON, natural representation is Shape.STRING, but one could conceivably want to use "binary", which in case of JSON would mean Base64 encoding. But more importantly, it may be important to distinguish shape representations for formats that do have native binary values: it is likely that Avro and Protobuf formats would need such a Shape descriptor for customizations.