struberg commented on PR #142:
URL: https://github.com/apache/johnzon/pull/142#issuecomment-4989269273

   But `@JsonbTransient` would reverse the logic which is mostly used in the 
JSON-B spec. I do agree that it is not crystal clear, but the spec always talks 
about _"..serialization of field or record component (or JavaBean property) to 
JSON document"_
   
   So as far as I interpret it the spec says fields, record components (that 
record fields only, not it's methods!) and Java Bean property. A method 
`toBuilder()` is not a Java Bean property. We would need to further clarify 
whether `getCompoundName()` on a Java Record qualifies as 'Java Bean property' 
with the name "compoundName" and should get rendered as well for Records? 
   
   But `toBuilder()` is clearly not a Bean Property in respect to the Java 
Beans 1.1 specification. That was imo even a clear bug in our implementation. 
So if we do any changes the new behaviour is to omit Record methods by default, 
unless they have a `@JsonbProperty` annotation on them. This part is again very 
underspecified, the spec says nothing about it, but that seems sensible, right?
   
   That said, Romain is correct to point out that we should have a 
configuration option to have applications switch back to our old Record 
handling for some time (maybe even mark it with a deprecation warning?) for 
compatibility reasons.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to