Skip to content

Commit e5fd30f

Browse files
committed
chore: change tests to match new error string
1 parent d305a84 commit e5fd30f

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

openapi3/issue657_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ components:
5353
name: "no valid value",
5454
value: "ABCDE",
5555
checkErr: func(t require.TestingT, err error, i ...any) {
56-
require.ErrorContains(t, err, "doesn't match schema due to: minimum string length is 10")
56+
require.ErrorContains(t, err, "minimum string length is 10")
5757

5858
wErr := &openapi3.MultiError{}
5959
require.ErrorAs(t, err, wErr)

openapi3/schema_issue940_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ func TestOneOfErrorPreserved(t *testing.T) {
6262

6363
require.Equal(t, "oneOf", schemaErr.SchemaField)
6464
require.Equal(t, `value doesn't match any schema from "oneOf"`, schemaErr.Reason)
65-
require.Equal(t, `Error at "/foo": doesn't match schema due to: value must be a number Or value must be a string`, schemaErr.Error())
65+
require.Equal(t, `Error at "/foo": value must be a number Or value must be a string`, schemaErr.Error())
6666

6767
var me multiErrorForOneOf
6868
ok = errors.As(err, &me)
6969
require.True(t, ok)
70-
require.Equal(t, `Error at "/foo": value must be a number`, me[0].Error())
71-
require.Equal(t, `Error at "/foo": value must be a string`, me[1].Error())
70+
require.Equal(t, `value must be a number`, me[0].Error())
71+
require.Equal(t, `value must be a string`, me[1].Error())
7272
}

openapi3/schema_oneOf_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,15 +140,15 @@ func TestVisitJSON_OneOf_MissingField(t *testing.T) {
140140
"name": "snoopy",
141141
"$type": "dog",
142142
})
143-
require.ErrorContains(t, err, `doesn't match schema due to: Error at "/barks": property "barks" is missing`)
143+
require.ErrorContains(t, err, `Error at "/barks": property "barks" is missing`)
144144
}
145145

146146
func TestVisitJSON_OneOf_NoDescriptor_MissingField(t *testing.T) {
147147
doc := oneofNoDiscriminatorSpec(t)
148148
err := doc.Components.Schemas["Animal"].Value.VisitJSON(map[string]any{
149149
"name": "snoopy",
150150
})
151-
require.ErrorContains(t, err, `doesn't match schema due to: Error at "/scratches": property "scratches" is missing`)
151+
require.ErrorContains(t, err, `Error at "/scratches": property "scratches" is missing`)
152152
}
153153

154154
func TestVisitJSON_OneOf_BadDiscriminatorType(t *testing.T) {

openapi3filter/issue789_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ paths:
8080
name: "failed oneof string pattern match",
8181
spec: oneOfArraySpec,
8282
req: `/items?test=def`,
83-
errStr: `parameter "test" in query has an error: doesn't match schema due to: string doesn't match the regular expression`,
83+
errStr: `parameter "test" in query has an error: string doesn't match the regular expression`,
8484
},
8585
{
8686
name: "failed oneof string pattern match",

0 commit comments

Comments
 (0)