jackson-modules-base icon indicating copy to clipboard operation
jackson-modules-base copied to clipboard

feat: add subtype module (2.21)

Open black-06 opened this issue 2 years ago • 4 comments

Adds a module that allows subtype to be registered without annotating the parent class.

It is implemented on SPI.

See https://github.com/FasterXML/jackson-databind/issues/2104

Its original version is https://github.com/black-06/jackson-modules-dynamic-subtype.

I removed the custom ServiceLoader and always use the standard library, which means that pojo always needs a no-parameter constructor.

black-06 avatar Nov 11 '23 06:11 black-06

Quick note: due to timing, decided that I will not try to get this in Jackson 2.16 -- so will need to be re-based to 2.17. This because there's a bit of work to be done here.

For example, I think that naming of @JsonSubType should change as the general rule is that only jackson-annotations has annotations with name starting with @Json (and for legacy reasons, some in jackson-databind). Modules can provide annotations that start with @Jackson prefix (or anything else that makes sense).

But I need to read the PR in bit more thought to make sure my feedback is relevant.

cowtowncoder avatar Nov 16 '23 02:11 cowtowncoder