Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
api-from-the-ion opened this issue Oct 4, 2023 · 0 comments

Comments

@api-from-the-ion
Copy link

As mentioned here jakartaee/jsonb-api#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
}```
api-from-the-ion added a commit to api-from-the-ion/yasson that referenced this issue Oct 8, 2023
…nnotation on enum constants

Signed-off-by: Anton Pinsky <anton.pinsky@ionos.com>
api-from-the-ion added a commit to api-from-the-ion/yasson that referenced this issue Feb 12, 2024
…r and Adapter in tests

Signed-off-by: Anton Pinsky <anton.pinsky@ionos.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant