Skip to content
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

annotations within class should have higher precedence than class annotations #304

Closed
nimo23 opened this issue Aug 10, 2019 · 2 comments
Closed
Labels
duplicate Already covered by another item

Comments

@nimo23
Copy link

nimo23 commented Aug 10, 2019

I have this:

@JsonbVisibility(value = PrivateVisibilityStrategy.class)
public class Task{

@JsonbProperty(nillable = true)
public Set<Item> getItems(){
return ...;
}
}

Now, even I explicitly assign @JsonbProperty on a getter, the value is not (de)serialized because of @JsonbVisibility(value = PrivateVisibilityStrategy.class). Is this okay? If I choose to select a getter to (de)serialize as an exception, then json-b should take the inner annotation with higher priority than the class level annotation.

So the precedence should be (from higher to lower):

runtime configuration > property/getter/setter annotations > class level annotations

@nimo23 nimo23 changed the title inner class annotations should have higher precedence than class annotations annotations within class should have higher precedence than class annotations Aug 10, 2019
@aguibert
Copy link
Member

This issue on the JSON-B spec repo looks similar to what you are suggesting:
jakartaee/jsonb-api#61

If you agree, we can close this issue as a duplicate of it

@nimo23
Copy link
Author

nimo23 commented Aug 11, 2019

yes, close this issue, if you think it s the same.

@aguibert aguibert added the duplicate Already covered by another item label Aug 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Already covered by another item
Projects
None yet
Development

No branches or pull requests

2 participants