Hi Gunnar,
See my answers inline.
On 10/03/2017, 00:12, "gunnar.morling_at_googlemail.com" <gunnar.morling_at_googlemail.com> wrote:
* JsonbConfig#withFormatting() and withNullValues(): why do these take
a Boolean instead of a primitive boolean? What's the semantics of
passing null?
Jsonb configuration is just a Map<String, Object>. It’s possible to get/put properties there using JsonbConfig::getProperty/setProperty methods. It’s possible to set the formatting property this way:
Config.setProperty(JsonbConfig.FORMATTING, Boolean.valueOf(true));
Assuming above we have object wrapper in withFormatting and with NullValues methods.
* JsonbConfig#withAdapters(): how are those applied exactly? If I e.g.
pass an adapter for A, will it be applied for B extends A? It seems not
to be the case with the RI currently, but that'd seem useful. If an
adapter is given via @JsonbTypeAdapter, does it take precedence over a
matching adapter given via withAdapters()? I couldn't find rules for
adapter resolution.
Adapters are applied to the exact type you specify and JsonbTypeAdapter annotation has a higher priority than JsonbConfig.withAdapters.
* JsonbTypeAdapter: It supports targets ANNOTATION_TYPE, TYPE, FIELD,
and METHOD, but the javadocs only mention the latter two
Javadoc is fixed. ☺
Serializer/Deserialized javadocs had the same problem. I fixed it as well.
* Serialization of graphs with cycles: the RI caused me a stack
overflow when trying to do this; shouldn't rather an exception be
raised that a cycle was detected, indicating the involved nodes? I
couldn't find anything on this topic in the spec. @JsonbTransient
together with something like JAXB's afterUnmarshal() [1] might help to
address this case
Spec doesn’t specify this behaviour. It’s up to implementations how to handle it.
* 3.6 Untyped Mapping: for true/false, why is it Boolean over boolean?
It’s for *unspecified* type or if type is *java.lang.Object*. If the target type is primitive it’s specified, isn’t it? ;)
* Jsonb: JavaDocs mention fromJson()/toJson() accepting a File, but
it's not there in the code
Wrong Javadoc. I changed it to FileReader/FileWriter.
* Jsonb#toJson(): What is the purpose of the type parameter? In which
situation would this be different from the given object's type?
In case of generics.
* Jsonb/JsonbBuilder: Are implementations supposed to be thread-safe?
I.e. can one safely keep them as application-scoped beans?
The spec doesn’t have thread safety requirements, so it’s up to implementations. Yasson is thread-safe.
* JsonbProvider: I'd suggest to add a provider() overload accepting a
classloader which can be passed to the service loader
We will think about it for the next version.
Thanks,
Dmitry
[1]
http://docs.oracle.com/javaee/7/api/javax/xml/bind/Unmarshaller.Listene
r.html#afterUnmarshal-java.lang.Object-java.lang.Object-