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 new choice for `JsonFormat.Shape`, `NATURAL` #65

Closed cowtowncoder closed 8 years ago

cowtowncoder commented 9 years ago

(for background, see https://github.com/FasterXML/jackson-databind/issues/865)

In addition to existing choices, including pseudo-value of ANY (which is similar to null as annotations do not allow explicit null value), it would make sense to add something to indicate use of the "most natural" binding (in case where there are more than one physical shape, but different structure; mostly for OBJECT, but possibly also ARRAY or even STRING), or, in case of type extensions, an alternative underlying format. An example of latter would be binary type (matching byte[]) that some formats (like Smile, CBOR, Protobuf) support. While it would also be possible to add explicit BINARY type, it seems better use a logical higher-level concept of "NATIVE" or "NATURAL", since this can be used for all kinds of underlying "exotic" types; for example, type menagerie exposed by BSON.

Of choices, NATURAL seems slightly preferable.