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 `@JsonTypeInfo.skipWritingDefault` #49

Closed cowtowncoder closed 9 years ago

cowtowncoder commented 9 years ago

(note: related to https://github.com/FasterXML/jackson-databind/issues/644)

It should be possible to indicate via annotation that the type id writing may be skipped, if the type is the same as indicated by @JsonProperty.defaultImpl. Note that type id writer may have some limitations regarding when suppression is possible (and/or how); so this annotation is more of a suggestion, and it should not be assumed that type id will absolutely not be written. Rather, it can be seen as an optimization for reducing writing of unnecessary type ids.