Skip to content

Commit

Permalink
fix string quotation
Browse files Browse the repository at this point in the history
  • Loading branch information
AnatolyRugalev committed Jul 3, 2024
1 parent 4710189 commit 774b7f2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion openapi3/schema_formats.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ type stringRegexpFormatValidator struct {

func (s stringRegexpFormatValidator) Validate(value string) error {
if !s.re.MatchString(value) {
return fmt.Errorf("string doesn't match pattern %q", s.re.String())
return fmt.Errorf(`string doesn't match pattern "%s"`, s.re.String())
}
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion openapi3/schema_issue492_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ info:
"name": "kin-openapi",
"time": "2001-02-03T04:05:06:789Z",
})
require.ErrorContains(t, err, `Error at "/time": string doesn't match the format "date-time": string doesn't match pattern "^[0-9]{4}-(0[0-9]|10|11|12)-([0-2][0-9]|30|31)T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?(Z|(\\+|-)[0-9]{2}:[0-9]{2})?$"`)
require.ErrorContains(t, err, `Error at "/time": string doesn't match the format "date-time": string doesn't match pattern "^[0-9]{4}-(0[0-9]|10|11|12)-([0-2][0-9]|30|31)T[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]+)?(Z|(\+|-)[0-9]{2}:[0-9]{2})?$"`)
}

0 comments on commit 774b7f2

Please sign in to comment.