Skip to content

Commit cf30364

Browse files
authored
Merge pull request #151 from mission-liao/feature/update-document
Fix document error
2 parents 1d65d6a + 4549d3c commit cf30364

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff 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
9598
assert pet.id == 1
9699
assert 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
101106
assert 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

0 commit comments

Comments
 (0)