You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@johnzon.apache.org by Mark Struberg <st...@yahoo.de.INVALID> on 2022/02/25 09:52:34 UTC

potentially trashed FieldVisibilityStrategy with JOHNZON-250?

Hi!

3.7.1 of the JSON-B spec defines the following visibility rules for fields

* if public setter/getter exists -> take that
* if non public setter/getter exists -> ignore
* OTHERWISE (no setter/getter at all) -> use fields


But all that must not get evaluted if an explicit VisibilityStrategy got applied, isn't?
That means if there is a FieldVisibilityStrategy which enables all fields, then it must not matter if there is e.g. a private getter/setter for that field, right?
It seems currently we still skip those fields, which is imo wrong! Because as of section 4.6 a custom JsonbVisibility always overrides default behaviour.


wdyt?

Will also create a ticket.

LieGrue,
strub


Re: potentially trashed FieldVisibilityStrategy with JOHNZON-250?

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi

Idea was to align on javabeans for getter/setters and use all but private
fields - dont recall if v3 enables private but dont think so.
So, AFAIK, it is not an else but an OR - otherwise it can only break users
in case of homogeneous codebase inheritence.

For custom impl we should 100% delzgate and apply the same "method
overrides field" rule if both are retruning true.

Le ven. 25 févr. 2022 à 10:52, Mark Struberg <st...@yahoo.de.invalid> a
écrit :

> Hi!
>
> 3.7.1 of the JSON-B spec defines the following visibility rules for fields
>
> * if public setter/getter exists -> take that
> * if non public setter/getter exists -> ignore
> * OTHERWISE (no setter/getter at all) -> use fields
>
>
> But all that must not get evaluted if an explicit VisibilityStrategy got
> applied, isn't?
> That means if there is a FieldVisibilityStrategy which enables all fields,
> then it must not matter if there is e.g. a private getter/setter for that
> field, right?
> It seems currently we still skip those fields, which is imo wrong! Because
> as of section 4.6 a custom JsonbVisibility always overrides default
> behaviour.
>
>
> wdyt?
>
> Will also create a ticket.
>
> LieGrue,
> strub
>
>