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

Expand skip to have the same other operators as requred and excluded #1245

Open
2 tasks done
deefdragon opened this issue Mar 31, 2024 · 2 comments
Open
2 tasks done

Comments

@deefdragon
Copy link

  • I have looked at the documentation here first?
  • I have looked at the examples provided that may showcase my question here?

Package version eg. v9, v10: v10.19.0

Issue, Question or Enhancement:

I currently have several options that are only relevant under select circumstances, the largest example of which is when certain fields don't matter (and thus their validation can be ignored) unless another field exists and or is set to a specific value.

With excluded_foo I could manage most cases if I could force the values to be empty, but unfortunately that is not something I edit or adjust in several cases. (most of these are dropdowns with non-empty default that are otherwise hidden on the form until some other value is set)

I am currently operating by skipping those validations in tags and writing a custom struct level validator that basically does the same thing. This is quite repetitive however.

It would also just make sense to have required, skip, and exclude all contain the same modifiers.

As an aside, the exclude_foo tags do not currently have docs for the modifiers other than if and unless. Adding these would be a good time to update the docs for the whole lot.

@deefdragon
Copy link
Author

As a side note, I am willing to do the work on this if its considered worth it, I just need to get some approvals at work to contribute, which may take a week or two.

@zemzale
Copy link
Member

zemzale commented Apr 2, 2024

I don't see a problem with this being added so feel free to open a PR. it might take a while for it to be reviewed and such, but it as long as it contains test cases it shouldn't be a problem.

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