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

Add more description to failed validation messages #27

Open
its02003 opened this issue Jun 7, 2021 · 3 comments
Open

Add more description to failed validation messages #27

its02003 opened this issue Jun 7, 2021 · 3 comments
Labels
enhancement New feature or request good first issue Good for newcomers
Milestone

Comments

@its02003
Copy link

its02003 commented Jun 7, 2021

While the doc and example depths are still being built out, it would be helpful to return as much information in error messages as possible, for instance:

In the oslo spec project there isn't much depth around what options there are for fields like the SLO.Spec.TimeWindows[].Unit field, though the validator code does a nice job of validating those items here.

It would be useful in this area and others to return useful information like what options must be specified in the error messages, so that sorry suckers like yours truly don't have to slap on the diving equipment and find the answer for ourselves :)

Current behavior: Error: Key: 'SLO.Spec.TimeWindows[0].Unit' Error:Field validation for 'Unit' failed on the 'oneof' tag
Expected behavior: Error: Key: 'SLO.Spec.TimeWindows[0].Unit' Error:Field validation for 'Unit' failed on the 'oneof' tag [Second Quarter Month Week Day]

@ian-bartholomew ian-bartholomew added enhancement New feature or request good first issue Good for newcomers labels Jun 8, 2021
@its02003
Copy link
Author

its02003 commented Jun 8, 2021

I am going to open an issue on the validator project for this

@its02003
Copy link
Author

its02003 commented Jun 9, 2021

@ian-bartholomew I have a PR I am finalizing for the validator project to hopefully fix this

@ian-bartholomew
Copy link
Contributor

@its02003 amazing, thank you!

@ian-bartholomew ian-bartholomew added this to the v1.0.0 milestone Jul 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants