[
https://issues.apache.org/jira/browse/JOHNZON-341?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17337204#comment-17337204
]
Markus Karg commented on JOHNZON-341:
-------------------------------------
While I can understand that for the sake of being backwards-compatible many
people will vote for keeping the current behavior as the default, from the view
of an ISV my personal preference clearly is to make strict spec compliance the
default. The reason is that as an ISV, our product must run UNCHANGED on all
implementations of JSON-B as it is up to downstream users of your solution to
decide whether to run them on Yasson, Johnzon or any other product WITHOUT
CHANGING ANYTHING but solely replacing the dependency.
> @JsonbProperty MUST NOT serialize NON-PUBLIC fields according to JSON-B
> specification
> -------------------------------------------------------------------------------------
>
> Key: JOHNZON-341
> URL: https://issues.apache.org/jira/browse/JOHNZON-341
> Project: Johnzon
> Issue Type: Bug
> Components: JSON-B
> Affects Versions: 1.2.10
> Reporter: Markus Karg
> Priority: Major
>
> The JSON-B specification unambiguously defines that @JsonbProperty's sole job
> is to define _the name mapping_ of properites, while ONLY PUBLIC fields are
> to be actually serialized.
> Due to https://issues.apache.org/jira/browse/JOHNZON-100 Johnzon 1.0.9
> actually serializes ALL non-public fields when they are annotated by
> @JsonbProperty.
> As a result, there is a difference between the serialized output of Johnzon
> and Yasson (the RI for JSON-B v1). As discussed in
> [https://github.com/eclipse-ee4j/jsonb-api/issues/271,] Johnzon's current
> behavior is non-compliant to the spec. Also it leads to confusion and
> possibly real problems when applications RELY on the serialized form
> intentionally OMITTING such fields (e. g. for technical or security reasons).
> To overcome the differences in the serialized output between Johnzon and
> Yasson, and to have a spec-compliant output produced by Johnzon, a solution
> is to be found, e. g. introduction of a configuration option which defines
> whether the output is compliant to the spec (only containing PUBLIC fields),
> or whether it is like before (containing ALL @JsonbProperty annotated
> fields).
--
This message was sent by Atlassian Jira
(v8.3.4#803005)