File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -91,13 +91,18 @@ client.request(app.op['addPet'](body=pet_Tom))
9191
9292# - access an Operation object via App.op when operationId is defined
9393# - a request to get the pet back
94- pet = client.request(app.op[' getPetById' ](petId = 1 )).data
94+ req, resp = app.op[' getPetById' ](petId = 1 )
95+ # prefer json as response
96+ req.produce(' application/json' )
97+ pet = client.request((req, resp)).data
9598assert pet.id == 1
9699assert pet.name == ' Tom'
97100
98101# new ways to get Operation object corresponding to 'getPetById'.
99102# 'jp_compose' stands for JSON-Pointer composition
100- pet = client.request(app.resolve(jp_compose(' /pet/{petId} ' , base = ' #/paths' )).get(petId = 1 )).data
103+ req, resp = app.resolve(jp_compose(' /pet/{petId} ' , base = ' #/paths' )).get(petId = 1 )
104+ req.produce(' application/json' )
105+ pet = client.request((req, resp)).data
101106assert pet.id == 1
102107```
103108
@@ -170,7 +175,6 @@ logger.setLevel(logging.DEBUG)
170175- describe expected behavior, or more specific, the input/output
171176
172177#### submit a PR
173- ```
174178- test included
175179- only PR to ` develop ` would be accepted
176180
You can’t perform that action at this time.
0 commit comments