-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
transient-keyword should be ignored by jsonb #269
Comments
Hi @nimo23, think it is already covered https://github.com/eclipse-ee4j/jsonb-api/blob/cc5273d2b0ff06f778747428fb672830844337be/spec/src/main/asciidoc/jsonb.adoc:
and
and AFAIK it is expected because these fields are generally not serializable (generally speaking). |
@rmannibucau I think, you did not understand #269 (comment):
This is exactly what I don't like because Jsonb should behave like this:
Btw, I have explicitly marked a property with jsonb annotations (@JsonbProperty), and, unfortunately, the spec currently says: "Hey, I ignore my own annotation because of the The spec should behave like this:
|
@nimo23 well I see two points:
So overall I don't see the default changing since it prove to be the best but we can get a toggle to change it...and luckiyl it already exists with property visibility so I guess we must just ensure it works already and clarify this API more than changing anything else. |
To sum up:
Yes, I could add |
@nimo23 you mean |
We believe that Java modifiers like I am closing this issue as |
Yes, this is reasonable. After thinking about, I come to the same conclusion. |
Describe the bug
Properties with
transient
-keyword should not be a trigger for jsonb for not (de)serializing.To Reproduce
I have this:
With the above code, jsonb (with its implementation yasson) does not generate json for property user. Only when removing
transient
-keyword, then yasson will generate the json.Expected behavior
Jsonb should ignore the java keyword
transient
for its (de)serializing stuff. Only@JsonbTransient
should be a trigger for omitting properties. And if this is not possible, then marking a property with@JsonbProperty
should have priority overtransient
- keyword.The text was updated successfully, but these errors were encountered: