[ 
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)

Reply via email to