Skip to content

Commit 6bf90bb

Browse files
jacobm-splunkdaveshanley
authored andcommitted
Refined test case to be more strict in terms of expected validation (rather than just an object)
1 parent 86bae22 commit 6bf90bb

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

parameters/path_parameters_test.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1416,12 +1416,8 @@ paths:
14161416
- name: burger
14171417
in: path
14181418
schema:
1419-
type: object
1420-
properties:
1421-
id:
1422-
type: integer
1423-
vegetarian:
1424-
type: boolean
1419+
type: string
1420+
format: uuid
14251421
get:
14261422
operationId: locateBurger`
14271423

@@ -1431,7 +1427,7 @@ paths:
14311427

14321428
v := NewParameterValidator(&m.Model)
14331429

1434-
request, _ := http.NewRequest(http.MethodGet, "https://things.com/lorem/ipsum/burgers/id,1234,vegetarian,true/locate", nil)
1430+
request, _ := http.NewRequest(http.MethodGet, "https://things.com/lorem/ipsum/burgers/d6d8d513-686c-466f-9f5a-1c051b6b4f3f/locate", nil)
14351431
valid, errors := v.ValidatePathParams(request)
14361432

14371433
assert.True(t, valid)

0 commit comments

Comments
 (0)