(a *AttributeExpr, example any)
| 383 | } |
| 384 | |
| 385 | func checkPattern(a *AttributeExpr, example any) bool { |
| 386 | if !hasPatternValidation(a) { |
| 387 | return true |
| 388 | } |
| 389 | pattern := a.Validation.Pattern |
| 390 | re, err := regexp.Compile(pattern) |
| 391 | if err != nil { |
| 392 | panic("Validation: invalid pattern '" + pattern + "'") |
| 393 | } |
| 394 | if !re.MatchString(fmt.Sprint(example)) { |
| 395 | return false |
| 396 | } |
| 397 | return true |
| 398 | } |
| 399 | |
| 400 | func checkMinMaxValue(a *AttributeExpr, example any) bool { |
| 401 | if !hasMinMaxValidation(a) { |
no test coverage detected