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

Feature/enum key prefix name #191

Open
wants to merge 2 commits into
base: next
Choose a base branch
from
Open

Conversation

alkalinecoffee
Copy link

@alkalinecoffee alkalinecoffee commented Jun 7, 2024

Adds a new enumKeyPrefix value to include in our schema, allowing the developer to specify a custom prefix for enum keys.

For instance, an enum value 1080p60 would typically produce a key like 1080P_60, but this would be disallowed as it starts with a number.

By specifying the enumKeyPrefix, we can still use a mix of string and numerical values but can reference them with a valid stringified key.

"VideoMode": {
  "enumKeyPrefix": "mode",
  "enum": [
    "1080p50",
    "1080p60",
    "unknown"
  ]

The above would produce enums such as:

MODE_1080P_50 = "1080p50"
MODE_1080P_60 = "1080p60"
MODE_UNKNOWN = "unknown

@alkalinecoffee alkalinecoffee force-pushed the feature/key-name-prefix branch from 17b7a31 to 97d217b Compare June 7, 2024 20:29
@alkalinecoffee alkalinecoffee changed the title Feature/key name prefix Feature/enum key prefix name Jul 19, 2024
@alkalinecoffee alkalinecoffee force-pushed the feature/key-name-prefix branch from 5a2ee3a to 5d458b6 Compare October 1, 2024 15:34
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

Successfully merging this pull request may close these issues.

1 participant