Skip to content

Feature/enum key prefix name#191

Open
alkalinecoffee wants to merge 2 commits intonextfrom
feature/key-name-prefix
Open

Feature/enum key prefix name#191
alkalinecoffee wants to merge 2 commits intonextfrom
feature/key-name-prefix

Conversation

@alkalinecoffee
Copy link
Copy Markdown
Contributor

@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