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

Implement SimpleSchema enum support #304

Open
a-hilaly opened this issue Feb 13, 2025 · 2 comments
Open

Implement SimpleSchema enum support #304

a-hilaly opened this issue Feb 13, 2025 · 2 comments

Comments

@a-hilaly
Copy link
Member

Feature Description

Currently the enum marker type is not implemented in SimpleSchema, causing validation errors when users try to use it:

failed to parse field schema for mode: invalid marker key 'enum': unknown marker type: enum

Example usage that fails:

mode: string | enum="debug,info,warn,error" default="info"

The implementation can start here, where the enum marker is defined but not implemented yet:

type MarkerType string
const (
// MarkerTypeRequired represents the `required` marker.
MarkerTypeRequired MarkerType = "required"
// MarkerTypeDefault represents the `default` marker.
MarkerTypeDefault MarkerType = "default"
// MarkerTypeDescription represents the `description` marker.
MarkerTypeDescription MarkerType = "description"
)

@KekmaTime
Copy link

@a-hilaly i would like to work on this issue. can i take it up

@a-hilaly
Copy link
Member Author

@KekmaTime I just assigned it to you, let us know if you run into any issues!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants