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

Enums should be treated as an application resource instead of field type. #25694

Open
1 task
mshima opened this issue Apr 1, 2024 · 0 comments
Open
1 task

Comments

@mshima
Copy link
Member

mshima commented Apr 1, 2024

Overview of the feature request

Enums are currently treated as field type inside fieldValues.

{ "fieldName": "myFieldB", "fieldType": "MyEnumB", "fieldValues": "AAA (aaa_aaa),BBB" },

If a Enum in JDL is used twice, the enum specification is duplicated in every field.

A Enum can be treated as an application resource.

writing({ application, enumerations }) {
  for(const enumeration of enumerations) {
    write(enum);
  }
}
Motivation for or Use Case
  • enums can be used outside entities
  • reused enum's fieldValues must match in every declaration to avoid unexpected behavior.
Related issues or PR
  • Checking this box is mandatory (this is just to show you read everything)
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