jakartaee / jakartaee/jsonb-api
Support AnnotatedType
- Dominant language
- Java
- Stars
- 95
- Forks
- 41
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 35
Description
Since Java 8 introduced TYPE_USE annotations, and this API is a Java standard as well, one would expect the two to work together.
I suggest JSON-B is enhanced (the implementation at least, if not the spec) to support `AnnotatedType`.
Namely, the following methods should exist:
* `Jsonb#fromJson(String, AnnotatedType)`
* `JsonbDeserializer#deserialize(JsonParser, DeserializationContext, AnnotatedType)`
The rationale is that the deserializer gains the ability to make decisions based on the type annotations.
E.g.
For a type such as `List<@Base64 Key>` it would be possible to create a (de)serializer that performs custom logic (e.g. Base64-encode/decode the value on the way in/out) for types annotated with `@Base64` regardless of their class.
Contributor guide
Research direction
No files or tests are named. Start by reviewing the Jsonb and JsonbDeserializer API definitions and determine whether support belongs in the specification, implementation, or both; done means the proposed AnnotatedType methods are defined and type annotations can guide deserialization, with tests covering the stated List<@Base64 Key> example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100