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

Is x-enumNames not supported? #285

Open
wolru opened this issue Jan 3, 2025 · 0 comments
Open

Is x-enumNames not supported? #285

wolru opened this issue Jan 3, 2025 · 0 comments

Comments

@wolru
Copy link

wolru commented Jan 3, 2025

Use case

@JsonEnum()
enum SellingStatus {
@JsonValue(1)
value1(1),
@JsonValue(11)
value11(11),
@JsonValue(21)
value21(21),
@JsonValue(31)
value31(31),
/// Default value for all unparsed values, allows backward compatibility when adding new values on the backend.
$unknown(null);

Proposal

I would like the field names to be applied like this according to x-enumNames.

"SellingStatus": {"enum": [1, 11, 21, 31], "title": "SellingStatus", "type": "integer", "x-enumNames": ["not_listed", "selling", "sold_out", "closed"]}

@JsonEnum()
enum SellingStatus {
@JsonValue(1)
�not_listed(1),
@JsonValue(11)
selling(11),
@JsonValue(21)
soldOut(21),
@JsonValue(31)
closed(31),
/// Default value for all unparsed values, allows backward compatibility when adding new values on the backend.
$unknown(null);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant