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 (Jira)" <ji...@apache.org> on 2022/03/28 08:05:00 UTC

[jira] [Updated] (JOHNZON-364) JsonbVisibility must always win over default rules

     [ https://issues.apache.org/jira/browse/JOHNZON-364?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Struberg updated JOHNZON-364:
----------------------------------
    Description: 
It seems we trashed {{@JsonbVisibility}} for fields when we implemented JOHNZON-250.

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.


  was:
It seems we trashed {{@JsonbVisibility}} for fields when we implemented JONZON-250.

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.



> JsonbVisibility must always win over default rules
> --------------------------------------------------
>
>                 Key: JOHNZON-364
>                 URL: https://issues.apache.org/jira/browse/JOHNZON-364
>             Project: Johnzon
>          Issue Type: Task
>          Components: JSON-B
>    Affects Versions: 1.2.16
>            Reporter: Mark Struberg
>            Assignee: Mark Struberg
>            Priority: Major
>             Fix For: 1.2.17
>
>
> It seems we trashed {{@JsonbVisibility}} for fields when we implemented JOHNZON-250.
> 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.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)