jsonb-api icon indicating copy to clipboard operation
jsonb-api copied to clipboard

JsonbSerializer's javadoc example is most likely misguided

Open brunoabdon opened this issue 5 years ago • 1 comments

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-

brunoabdon avatar Aug 14 '19 01:08 brunoabdon

thanks for pointing this out @brunoabdon, it does indeed look like a bug in the javadoc

aguibert avatar Aug 27 '19 15:08 aguibert