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/key name prefix #189

Closed

Conversation

alkalinecoffee
Copy link

@alkalinecoffee alkalinecoffee commented Jun 3, 2024

Adds a new keyNamePrefix 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 keyNamePrefix, 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
Copy link
Author

switching to repo-local branch instead of personal branch

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