Open santhosh77h opened 7 months ago
required_if, required_unless,required_with,required_with_all,required_without,required_without_all,excluded_if,excluded_unless,excluded_with,excluded_with_all,excluded_without,excluded_without_all,skip_unless
if they meet the criteria for skipping, should skip all subsequent validation。
@deankarn Hello, what do you think of this suggestion
Yes that’s the way I expected those tags to work also, but they aren’t documented that way.
gonna have to double check if it ever behaved that way before. Will try to take a look this week, hopefully can find time.
PromotionType string `json:"promotion_type" binding:"required,oneof= a b c"`
ApplicablePhase []ApplicablePhaseItem `json:"applicable_phase" binding:"required_if=PromotionType a,dive,len=4"`
@deankarn In this example, len tag not working when required_if meets condition
PromotionType string `json:"promotion_type" binding:"required,oneof= a b c"` ApplicablePhase []ApplicablePhaseItem `json:"applicable_phase" binding:"required_if=PromotionType a,dive,len=4"`
@deankarn In this example, len tag not working when required_if meets condition
it's not conform to the logic of this issues
Any news?
@deankarn any comments would be welcome. Is it even feasible for this to work the way some of us would like?
Package version eg. v9, v10:
v10
Issue, Question or Enhancement:
Question
Code sample, to showcase or reproduce:
so in the above example for DOB we are getting the error as
Error:Field validation for 'Dob' failed on the 'len' tag
but there should have been no errro, if required_with is already in false state.