jakartaee / jsonb-api

Jakarta JSON Binding
https://eclipse-ee4j.github.io/jsonb-api/
Other
79 stars 39 forks source link

Support Optional<primitive> in @JsonbCreator #307

Closed dansiviter closed 2 years ago

dansiviter commented 2 years ago

Related to #121, new spec. doesn't mention OptionalInt, OptionalLong and OptionalDouble primitive wrappers. So small clarification to the spec. to permit these types.

Verdent commented 2 years ago

Each of the Optional types is not listed explicitly, but I would say this is covered by the following sentences: If the parameter is any type other than Optional or its variations, then the null value is used. If the parameter is Optional or its variations, then the corresponding empty object must be used.

rmannibucau commented 2 years ago

+1 to clarify it, @dansiviter think you can feel free to PR the text clarification

Verdent commented 2 years ago

+1 Sure, I am not against it :-)

dansiviter commented 2 years ago

@rmannibucau Ahhh, that's some subtle wording, thanks for pointing it out. I suppose it is sufficient as it is and hopefully implementors honour it.