Improve validation error messages for oneof failures.

Return a clear allowed-values message for oneof tags so issue status updates no longer surface empty field errors.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Yared Yemane 2026-07-30 00:02:17 -07:00
parent 3b08a07c85
commit 2c107cf35a

View File

@ -60,6 +60,8 @@ func errorMsgs(tag string, value string) string {
return "length should be equal to " + value
case "email":
return "must be a valid email address"
case "oneof":
return "must be one of: " + value
}
return ""
return "failed " + tag + " validation"
}