Update sample servant-docs output in tutorial
Not all of this is due to the changes in multiple content-type handling.
This commit is contained in:
parent
ed3ace3066
commit
02821e326a
1 changed files with 25 additions and 27 deletions
|
@ -110,12 +110,6 @@ markdown :: API -> String
|
||||||
That lets us see what our API docs look down in markdown, by looking at `markdown apiDocs`.
|
That lets us see what our API docs look down in markdown, by looking at `markdown apiDocs`.
|
||||||
|
|
||||||
````````` text
|
````````` text
|
||||||
## Welcome
|
|
||||||
|
|
||||||
This is our super webservice's API.
|
|
||||||
|
|
||||||
Enjoy!
|
|
||||||
|
|
||||||
## GET /hello
|
## GET /hello
|
||||||
|
|
||||||
#### GET Parameters:
|
#### GET Parameters:
|
||||||
|
@ -132,18 +126,19 @@ Enjoy!
|
||||||
|
|
||||||
- Supported content types are:
|
- Supported content types are:
|
||||||
|
|
||||||
|
- `application/json;charset=utf-8`
|
||||||
- `application/json`
|
- `application/json`
|
||||||
|
|
||||||
- When a value is provided for 'name'
|
- When a value is provided for 'name' (`application/json;charset=utf-8`, `application/json`):
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
{"msg":"Hello, Alp"}
|
{"msg":"Hello, Alp"}
|
||||||
```
|
```
|
||||||
|
|
||||||
- When 'name' is not specified
|
- When 'name' is not specified (`application/json;charset=utf-8`, `application/json`):
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
{"msg":"Hello, anonymous coward"}
|
{"msg":"Hello, anonymous coward"}
|
||||||
```
|
```
|
||||||
|
|
||||||
## POST /marketing
|
## POST /marketing
|
||||||
|
@ -152,27 +147,29 @@ Enjoy!
|
||||||
|
|
||||||
- Supported content types are:
|
- Supported content types are:
|
||||||
|
|
||||||
|
- `application/json;charset=utf-8`
|
||||||
- `application/json`
|
- `application/json`
|
||||||
|
|
||||||
- Example: `application/json`
|
- Example (`application/json;charset=utf-8`, `application/json`):
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
{"email":"alp@foo.com","interested_in":["haskell","mathematics"],"age":26,"name":"Alp"}
|
{"clientAge":26,"clientEmail":"alp@foo.com","clientName":"Alp","clientInterestedIn":["haskell","mathematics"]}
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Response:
|
#### Response:
|
||||||
|
|
||||||
- Status code 201
|
- Status code 200
|
||||||
- Headers: []
|
- Headers: []
|
||||||
|
|
||||||
- Supported content types are:
|
- Supported content types are:
|
||||||
|
|
||||||
|
- `application/json;charset=utf-8`
|
||||||
- `application/json`
|
- `application/json`
|
||||||
|
|
||||||
- Response body as below.
|
- Example (`application/json;charset=utf-8`, `application/json`):
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
{"subject":"Hey Alp, we miss you!","body":"Hi Alp,\n\nSince you've recently turned 26, have you checked out our latest haskell, mathematics products? Give us a visit!","to":"alp@foo.com","from":"great@company.com"}
|
{"subject":"Hey Alp, we miss you!","body":"Hi Alp,\n\nSince you've recently turned 26, have you checked out our latest haskell, mathematics products? Give us a visit!","to":"alp@foo.com","from":"great@company.com"}
|
||||||
```
|
```
|
||||||
|
|
||||||
## GET /position/:x/:y
|
## GET /position/:x/:y
|
||||||
|
@ -189,13 +186,14 @@ Enjoy!
|
||||||
|
|
||||||
- Supported content types are:
|
- Supported content types are:
|
||||||
|
|
||||||
|
- `application/json;charset=utf-8`
|
||||||
- `application/json`
|
- `application/json`
|
||||||
|
|
||||||
- Response body as below.
|
- Example (`application/json;charset=utf-8`, `application/json`):
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
{"x":3,"y":14}
|
{"yCoord":14,"xCoord":3}
|
||||||
```
|
````
|
||||||
|
|
||||||
`````````
|
`````````
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue