eclipse-ee4j / eclipse-ee4j/yasson

Recognize or honor @JsonbProperty annotation when applied to enumerated types.

Open
#616 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Java
Stars
218
Forks
109
Avg merge
1d 5h
Merged PRs (30d)
9

Description

As mentioned here https://github.com/jakartaee/jsonb-api/issues/255, and likely implemented in Johnzon as of https://issues.apache.org/jira/browse/JOHNZON-321, the @JsonbProperty annotation isn't recognized right now on the enum entries. So one need a custom adapter or serilizer / deserliser.

Is it possible to implement it directly? So one only need to use the annotation inside the enum directly, and nothing more?

I think about something like:
```
public enum Colors {

@JsonbProperty("Red")
RED,
@JsonbProperty("Green")
GREEN
}```

Contributor guide

Open the contributing guide

Research direction

Start by reviewing Jakarta JSON-B issue 255 and JOHNzon issue 321, then use the enum example in this issue as the behavioral entry point. Confirm how @JsonbProperty on enum constants should affect both serialization and deserialization; done means the annotation works directly without a custom adapter or serializer/deserializer.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend-api-design
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.