You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a struct with 2 fields: latitude and longitude
Both of them are optional, but if 1 is present the other should be validated as required
I haven't found a combination that would work to validate these 4 cases:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have a struct with 2 fields:
latitude
andlongitude
Both of them are optional, but if 1 is present the other should be validated as required
I haven't found a combination that would work to validate these 4 cases:
I tried different variations of
required_
andexcluded_
andomitempty
but one of the cases always failed so farIt seems that it should be a fairly common case. Your help will be greatly appreciated!
Beta Was this translation helpful? Give feedback.
All reactions