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/02/25 10:01:00 UTC

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

Mark Struberg created JOHNZON-364:
-------------------------------------

             Summary: 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
             Fix For: 1.2.17


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.




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