-
Notifications
You must be signed in to change notification settings - Fork 9
/
extended-petstore.yaml
38 lines (35 loc) · 1.05 KB
/
extended-petstore.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Extension syntax example
# got-swag examples/extended-petstore.yaml
# import an existing swagger file into root
'#/':
$ref: http://petstore.swagger.io/v2/swagger.json
# set a new variable
'#/x-vars/george':
id: 73
age: 6y
name: George
# append spaces to have multiple actions on the same path
'#/x-vars/george ':
# $assign extends the original object (shallow)
$assign:
cool: true
# slahes must be written as double underscores!
'#/paths/__pet__findByStatus/get/x-tests':
- description: Should find pets
steps:
- get( '/v2/pet/findByStatus?status=available' )
- log( res.json[ 0 ] )
- equal( res.statusCode, 200 )
- ok( res.json.length > 0 )
- equal( typeof res.json[ 0 ].name, 'string' )
- validate()
- description: Should not find evil pets
steps:
- get( '/v2/pet/findByStatus?status=evil' )
- deepEqual( res.json, [] )
- validate()
# special actions:
# $assign will do a shallow extend
# $merge will do a deep extend
# $push will append to an array
# $unshift will prepend to an array