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

Enhance enumeration support #308

Closed
mwadams opened this issue Mar 13, 2024 · 0 comments
Closed

Enhance enumeration support #308

mwadams opened this issue Mar 13, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@mwadams
Copy link
Contributor

mwadams commented Mar 13, 2024

The enum keyword itself doesn't support documentation.

The recommended method for "documenting" your enum-like values is to use the oneOf keyword:

"oneOf": [
    { "const": "some value", "title": "Some value", "description": "The documentation for some value" },
    { "const": "some other value", "title": "Some other value", "description": "The documentation for some other value" },
]

We do not want to change our implementation of the enum keyword itself as it would be a significant breaking change.

However, we could detect this pattern and emit different code.

For instance

  1. We could conventionally use title as the name of the enum value if present
  2. We could conventionally use description as the summary documentation for the enum value
  3. We could detect "pure integer" enumerations and emit a dotnet enum instead of the static values.
@mwadams mwadams added the enhancement New feature or request label Mar 13, 2024
@mwadams mwadams closed this as not planned Won't fix, can't repro, duplicate, stale Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant