You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Try each of the API files and see what difference they make to your testing e.g. the Permissive files does not have validation on the input parameters so you can explore more conditions.
98
+
- OpenAPI files are designed for usage, not for testing, you should not rely on a Swagger UI for testing purposes.
99
+
100
+
### Exercise - Explore the `/items` endpoint
101
+
102
+
- The main endpoints `/items` will list all of the items in the system and allow creation of a new item
103
+
- Explore these with `GET`, `OPTIONS`, `HEAD`
104
+
- Try to create an item using `POST` on `/items`
105
+
- if you don't know the format of the payload then copy one of hte item objects listed in the response of `GET /items`
106
+
- you should not include an `id` in the `POST` request
107
+
- the `isbn` field will need to be unique, you can generate a random `isbn` on this page or the [About](/practice-modes/simpleapi) page
108
+
109
+
110
+
### Exercise - Explore the `/items/{id}` endpoint
111
+
112
+
- The individual endpoint `/item/{id}` will allow you to work with a single item using its id
113
+
- Try to amend an item with `POST` on `/items/{id}` for an item that exists
114
+
- Try to amend an item with `PUT` on `/items/{id}` for an item that exists
115
+
- Try to delete an item with `DELETE` on `/items/{id}` for an item that exists
116
+
- Check that the API responds with `404` when the item id does not exist
117
+
118
+
### Exercise - Explore the endpoints with all verbs
119
+
120
+
- CRUD operations are based around the `GET`, `PUT`, `POST` and `DELETE` verbs
121
+
- Make sure you call the endpoints with other HTTP verbs e.g. `PATCH` and `TRACE`
122
+
123
+
### Exercise - Explore the `/items/{id}` field validations
124
+
125
+
- When you create or amend an item, check that the system enforces the validations for the fields listed in the documentation and the Open API spec
126
+
- The ISBN must be unique in the system
127
+
- The ISBN must match a specific format, try the different variations of the format
128
+
- e.g. `384252925993-2`, `618-3051270614`, `9114-91-557340-1`, `2799488037490`
129
+
- find more matching variations than the examples above
130
+
- an easy only tool for generating values from Regex can be found [here](https://onlinetools.com/random/generate-random-data-from-regexp)
131
+
- Check the field validations of the other fields as well
132
+
133
+
### Exercise - Explore the system data population validations
134
+
135
+
- The documentation says that there can be only 100 items, is that true?
136
+
- What is the minimum number of items that can be in the system? Can it be brought down to 0, 1, 2, 3, ...?
137
+
138
+
### Exercise - Explore the random ISBN endpoint
139
+
140
+
- There is an endpoint for generating random ISBNs `GET /simpleapi/randomisbn`
141
+
- Does it work they way you would expect?
142
+
143
+
### Exercise - Explore the `accept` header
144
+
145
+
- The Simple API supports both `JSON` and `XML`
146
+
- You should be able to request `XML` as the response payload by using an `accept` header with the value `application/xml`
147
+
- Do all endpoints and calls support this?
148
+
149
+
### Exercise - Explore the `content-type` header
150
+
151
+
- The Simple API supports both `JSON` and `XML`
152
+
- You should be able to send request payloads as `XML` by using a `content-type` header with the value `application/xml`
153
+
- Do all endpoints and calls support this?
154
+
- Do you think you could mix and match `content-type` and `accept` so that you can send `JSON` and receive `XML`?
0 commit comments