On Tue, May 15, 2018 at 1:40 AM, Psycho Punch <[email protected]> wrote:
> Tatu,
>
> I really appreciate your responses to my question. Thank you very much.
>
> I did a very quick investigation on our code base and found that in both
> setup, the ObjectMapper has ParameterNamesModule registered, so I don't
> think that's where the problem is. I'll continue monitoring this as much as
> I can and get back to you if I find something that might be of interest to
> other Jackson users. However, based on our conversation, we probably need
> this behavior locked down to make it more concrete so it doesn't introduce
> uncertainty in projects depending on Jackson. I'm not sure if I can help,
> but if you point me to where to start, I'll take a look.

What I was mostly suggesting was to simply change declarations as

@JsonCreator(mode=Mode.DELEGATING)

but alternatively you could consider custom sub-class of
`JacksonAnnotationIntrospector`, overriding:

   public JsonCreator.Mode findCreatorAnnotation(MapperConfig<?>
config, Annotated a);

to return this in case annotation is found, but with default mode
(Mode.DEFAULT or something).

I do not have solid plan for how detection should change for
jackson-databind itself, but any change to
logic will have to wait until 3.0. And further there are pretty badly
conflicting wishes from users as to
how things should work, divided into 2 main themes:

1. "I don't want to use any Jackson annotations, ever, it should just
work the way I use it" (which may be
   "always properties", or might be not -- these are personal
preferences in the end)
2. "I want logic to be fully predictable and stable, to minimize
change of things breaking".

I think both are reasonable wishes, but unfortunately they are in
direct conflict when it comes to finding an
implementation.

One possible route might be to expose yet another abstraction like
`CreatorResolver` (or such), which would be called
to resolve ambiguous cases.

Finally, all of this probably has to wait until property introspection
rewrite for 3.0, wherein detection starts with creator
detection, completing fully before considering other property
accessors. This is needed to fully unify logic and annotation
access and solve other unresolved issues. But changes included will
affect handing of properties-vs-delegating case too.

-+ Tatu +-

-- 
You received this message because you are subscribed to the Google Groups 
"jackson-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to