jsonb-api
jsonb-api copied to clipboard
JsonbSerializer's javadoc example is most likely misguided
This line of JsonbSerializer's javadoc's exemplifies its use by calling the method SerializationContext.serialize(T object, JsonGenerator generator)
, that is "intended to serialize inside JSON_ARRAYs"1, which is not the case.
The intended example is more likely
ctx.serialize("boxInnerObject",boxInnerObject,generator);
which uses the serialize
version with a key parameter.
1 - https://javaee.github.io/javaee-spec/javadocs/javax/json/bind/serializer/SerializationContext.html#serialize-T-javax.json.stream.JsonGenerator-
thanks for pointing this out @brunoabdon, it does indeed look like a bug in the javadoc