zemzale

Results 59 comments of zemzale

I don't think this is supported right now with struct tags. You can get this however by creating your own custom validator function. See https://pkg.go.dev/github.com/go-playground/validator/v10#hdr-Custom_Validation_Functions Probably can be marked as...

Hey @kke. This can be easily be achieved by this library using struct tags. In your case this would ```go type Config struct { Attrs *Attributes } type Attributes struct...

I misunderstood the main question then. It's not possible to do with this library, and AFAIK is not in the scope of the library. The exact behavior you are asking...

If you want to validate that the value is present you will have to use a pointer there. So for the example given, the change should be something like this....

Hey @f4haofeng. The current implementation of `ValidateMap` doesn't support `gtefield` and other cross-field comparisons. It might be worth looking into, but I don't how feasible it would be. Please correct...

Hey @linsijia1002. This package only does validation. Setting default value is not part of the library, but you can try out something like this. https://github.com/gin-gonic/gin/issues/1052#issuecomment-515966643

This seems to be fixed with 9dedb06 so it's safe to close this. I can also open a PR for adding a test case for such a case, but it's...

Currently, there is nothing that would do this, except the painful way of using the `Var` function. Maybe it's worth exploring a path, where we can pass in validation rules...

@erikvega You could also use https://pkg.go.dev/github.com/go-playground/validator/v10#Validate.StructExcept and not validate the field if not needed. If that is not a valid workaround you can always register your own validator and use...

@deankarn I don't have the right to merge/approve. Could you do it?