-
Notifications
You must be signed in to change notification settings - Fork 121
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
Mandate usage of JSON-B instance provided by user's ContextResolver<Jsonb> #742
Comments
+1 Unfortunately we would need to add this to the spec document, which isn't available yet. |
+1 Very much in favour of this and indeed should be targeted for 2.3. |
+1 This would also allow to use default type adapters for generic type (so you cannot register them at the class itself as neither the class nor the generic class is yours), e. g. when dealing with |
Added to Discussion 2.3 in the WIKI: https://github.com/eclipse-ee4j/jaxrs-api/wiki/JAX-RS-2.3-Discussion. |
Anybody working on this one already or shall I set up a proposal? |
Hi @mkarg, thanks for the reminder about this. I haven't started writing anything up yet, but I can. My original plan (before forgetting about this issue... :-) ) was to basically duplicate the text from the JAXBContext. If you want to take it, please feel free. Otherwise, I can write up a proposal on Monday or Tuesday. |
@mkarg Wanted to start but did not, if somebody wants to take it from me, feel free. Thx. |
Ok will post a draft so we can discuss it. |
Glassfish/Jersey contains a nifty feature that allows a user to specify a
ContextResolver<Jsonb>
provider. The returned instance ofJsonb
is then used by Glassfish to serialize and deserialize JSON objects. That way a customer could, for instance, serialize private fields.While this feature exists in the RI, it is not mandated by the spec, and so other JAX-RS implementations (CXF, RestEasy - and the app servers that consume them including Liberty, Thorntail/Wildfly, TomEE, etc.) do not implement this feature.
Adam Bien wrote a popular blog post on the topic here:
http://www.adam-bien.com/roller/abien/entry/private_fields_serialization_with_json
And that has caused some confusion when users discover that this feature is not portable, such as:
OpenLiberty/open-liberty#5903
As @WhiteCat22 mentioned in his comments, there is a requirement in the spec to support a JAXBContext returned from a ContextResolver, but no such requirement for a Jsonb instance.
Adding this requirement will enhance portability.
The text was updated successfully, but these errors were encountered: