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

Allow enums with only one item #77

Merged
merged 5 commits into from
Feb 22, 2023
Merged

Conversation

spinillos
Copy link
Member

Fixes: https://github.com/grafana/schematization-and-as-code-project/issues/74

We were forcing to have at least two elements.

Copy link
Contributor

@sdboyer sdboyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just some small things.

it might be nice to have some more tests that explore expected failure cases here, especially with removing the cue.OrOp check - but only if it's easy, as it's hard to picture anything but intentional misuse there.

generator.go Outdated Show resolved Hide resolved
generator.go Outdated Show resolved Hide resolved
@spinillos
Copy link
Member Author

If you use something different than cue.OrOp, it fails with different error.

@sdboyer sdboyer merged commit 19e8bc6 into main Feb 22, 2023
@sdboyer sdboyer deleted the allow-enums-with-one-element branch February 22, 2023 04:36
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.

None yet

3 participants