jakartaee / jakartaee/jsonb-api

Feature Request: Allow access in JsonbSerializer and JsonbDeserializer for the AnnotatedElement being processed

Open
#375 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
95
Forks
41
Avg merge
1d 6h
Merged PRs (30d)
35

Description

There are cases during serialization and deserialization where it would be useful to have the current `java.lang.reflect.AnnotatedElement` of the object being serialized or deserialized. The `AnnotatedElement` could be found on the current `SerializationContext` or `DeserializationContext` context or new methods could be added to the `JsonbSerializer` and the `JsonbDeserializer` which pass a parameter.

The use-case is looking up an annotation on a element which could provide additional information for serialization and deserialization. For example being able to look up the `@JsonbDateFormat` when you have a custom serializer for some kind of date object.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the JsonbSerializer, JsonbDeserializer, SerializationContext, and DeserializationContext APIs mentioned in the issue. Compare whether the current AnnotatedElement should be exposed through the contexts or serializer and deserializer methods; the work is done when a custom date serializer or deserializer can use that element to look up annotations such as @JsonbDateFormat.

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
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.