forked from membrane/api-gateway
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrequests.http
More file actions
116 lines (89 loc) · 2.77 KB
/
requests.http
File metadata and controls
116 lines (89 loc) · 2.77 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#
# Request samples can be executed:
#
# a.) In Visual Studio Code with the HTTP Client Plugin
# See: https://marketplace.visualstudio.com/items?itemName=mkloubert.vscode-http-client
#
# b.) In IntelliJ with the HTTP Client Plugin
# See: https://www.jetbrains.com/help/idea/http-client-in-product-code-editor.html
#
### Valid request, should work => 200 Ok
GET http://localhost:2000/demo-api/v2/persons?limit=10
### Wrong path => 404 Not Found
GET http://localhost:2000/demo-api/v2/wrong
### Limit greater than 100 => 400 Bad Request
GET http://localhost:2000/demo-api/v2/persons?limit=200
### Valid => 201 Ok
PUT http://localhost:2000/demo-api/v2/persons/4077C19D-2C1D-427B-B2DD-FC3112CE89D1
Content-Type: application/json
{
"name": "Jan Vermeer"
}
### Invalid UUID, email and enum => 400 Bad Request
PUT http://localhost:2000/demo-api/v2/persons/4077C19D-2C1D-427B-B2+DDFC3112CE89D1
Content-Type: application/json
{
"name": "Jan Vermeer",
"email": "jan(at)schilderei.nl",
"type": "ARTIST"
}
### Wrong Content-Type => 415 Unsupported Mediatype
PUT http://localhost:2000/demo-api/v2/persons/4077C19D-2C1D-427B-B2DD-FC3112CE89D1
Content-Type: application/xml
<name>Jan</name>
### Required property is missing => 400 Bad Request
PUT http://localhost:2000/demo-api/v2/persons/4077C19D-2C1D-427B-B2DD-FC3112CE89D1
Content-Type: application/json
{
"email": "jan@predic8.de"
}
### Additional property role => 400 Bad Request
PUT http://localhost:2000/demo-api/v2/persons/4077C19D-2C1D-427B-B2DD-FC3112CE89D1
Content-Type: application/json
{
"name": "Jan Vermeer",
"role": "admin"
}
### Wrong regex pattern => 400 Bad Request
PUT http://localhost:2000/demo-api/v2/persons/4077C19D-2C1D-427B-B2DD-FC3112CE89D1
Content-Type: application/json
{
"name": "Jan Vermeer",
"countryCode": "Germany"
}
### Nested Object => 201 Created
PUT http://localhost:2000/demo-api/v2/persons/4077C19D-2C1D-427B-B2DD-FC3112CE89D1
Content-Type: application/json
{
"name": "Jan Vermeer",
"countryCode": "DE",
"address": {
"city": "Bonn",
"street": "Koblenzer Straße 65",
"zip": "D-53173"
}
}
### OneOf with wrong string pattern => 400 Bad Request
PUT http://localhost:2000/demo-api/v2/persons/4077C19D-2C1D-427B-B2DD-FC3112CE89D1
Content-Type: application/json
{
"name": "Jan Vermeer",
"countryCode": "DE",
"address": {
"city": "Bonn",
"street": "Koblenzer Straße 65",
"zip": "D-5317"
}
}
### OneOf with right integer => 201 Created
PUT http://localhost:2000/demo-api/v2/persons/4077C19D-2C1D-427B-B2DD-FC3112CE89D1
Content-Type: application/json
{
"name": "Jan Vermeer",
"countryCode": "DE",
"address": {
"city": "Bonn",
"street": "Koblenzer Straße 65",
"zip": 53173
}
}