We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi,
I have a field that is only present if another field has a certain value.
type A struct { Type string `validate:"in:B,C"` B C } type B struct { ID string `validate:"required_if:A.Type,B|uuid4" }
So B's ID must be a UUID, but only if A's type is B.
So this is allowed:
A{ Type: "B", B: { ID: "94e48bd3-e990-405e-bd10-304e767cd3fd" }, }
But this is not allowed:
A{ Type: "C", B: { ID: "94e48bd3-e990-405e-bd10-304e767cd3fd" }, }
And this is not allowed:
A{ Type: "B", B: { ID: "" }, }
Do you know how I would achieve this with your library? Thank you!
The text was updated successfully, but these errors were encountered:
inhere
No branches or pull requests
Hi,
I have a field that is only present if another field has a certain value.
So B's ID must be a UUID, but only if A's type is B.
So this is allowed:
But this is not allowed:
And this is not allowed:
Do you know how I would achieve this with your library? Thank you!
The text was updated successfully, but these errors were encountered: