How to make field excluded(so that validation does not pass if that field exist) #1198
Unanswered
valerii15298
asked this question in
Q&A
Replies: 1 comment
-
@valerii15298 you could use |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am using general struct, user, and do not wanna duplicate it.
I use it with gorm.
Field uuid is generate by database, so in request json payload I do not wanna allow it. Can I exclude it forever so that if that field is provided the validator should return error?
There is excluded_if https://pkg.go.dev/github.com/go-playground/validator/v10#hdr-Excluded_If
But I need field to be always excluded, not by condition
Beta Was this translation helpful? Give feedback.
All reactions