Closed MantasSilanskas closed 3 months ago
Should have used struct name instead of json name aka -
// JSONInputContractUpdate holds information used for contract update.
type JSONInputContractUpdate struct {
ExpiresAt time.Time `json:"expiresAt" validate:"required_unless=NonExpiring true"`
....
NonExpiring bool `json:"nonExpiring" validate:"omitempty"```
Package version eg. v9, v10:
v10
Issue, Question or Enhancement:
required_if && required_unless not working as expected. I expect when nonExpiring is true that expiresAt field would be not required.
Code sample, to showcase or reproduce:
When I send
Everything is fine but when I do
I get error - "Key: 'JSONInputContractCreate.ExpiresAt' Error:Field validation for 'ExpiresAt' failed on the 'required_unless' tag"