on master help sign in
Update sample servant-docs output in tutorial
02821e3Ivan Lazar Miljenovic
doc/tutorial/Docs.lhs+25−27
@@ -110,12 +110,6 @@ markdown :: API -> String
110That lets us see what our API docs look down in markdown, by looking at `markdown apiDocs`.
110That lets us see what our API docs look down in markdown, by looking at `markdown apiDocs`.
111
111
112````````` text
112````````` text
113−## Welcome
114−
115−This is our super webservice's API.
116−
117−Enjoy!
118−
119## GET /hello
113## GET /hello
120
114
121#### GET Parameters:
115#### GET Parameters:
@@ -132,19 +126,20 @@ Enjoy!
132
126
133- Supported content types are:
127- Supported content types are:
134
128
129+ - `application/json;charset=utf-8`
135 - `application/json`
130 - `application/json`
136
131
137−- When a value is provided for 'name'
132+- When a value is provided for 'name' (`application/json;charset=utf-8`, `application/json`):
138
133
139− ```javascript
134+ ```javascript
140− {"msg":"Hello, Alp"}
135+{"msg":"Hello, Alp"}
141− ```
136+ ```
142
137
143−- When 'name' is not specified
138+- When 'name' is not specified (`application/json;charset=utf-8`, `application/json`):
144
139
145− ```javascript
140+ ```javascript
146− {"msg":"Hello, anonymous coward"}
141+{"msg":"Hello, anonymous coward"}
147− ```
142+ ```
148
143
149## POST /marketing
144## POST /marketing
150
145
@@ -152,28 +147,30 @@ Enjoy!
152
147
153- Supported content types are:
148- Supported content types are:
154
149
150+ - `application/json;charset=utf-8`
155 - `application/json`
151 - `application/json`
156
152
157−- Example: `application/json`
153+- Example (`application/json;charset=utf-8`, `application/json`):
158
154
159− ```javascript
155+ ```javascript
160− {"email":"alp@foo.com","interested_in":["haskell","mathematics"],"age":26,"name":"Alp"}
156+{"clientAge":26,"clientEmail":"alp@foo.com","clientName":"Alp","clientInterestedIn":["haskell","mathematics"]}
161− ```
157+ ```
162
158
163#### Response:
159#### Response:
164
160
165−- Status code 201
161+- Status code 200
166- Headers: []
162- Headers: []
167
163
168- Supported content types are:
164- Supported content types are:
169
165
166+ - `application/json;charset=utf-8`
170 - `application/json`
167 - `application/json`
171
168
172−- Response body as below.
169+- Example (`application/json;charset=utf-8`, `application/json`):
173
170
174− ```javascript
171+ ```javascript
175− {"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"}
172+{"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"}
176− ```
173+ ```
177
174
178## GET /position/:x/:y
175## GET /position/:x/:y
179
176
@@ -189,13 +186,14 @@ Enjoy!
189
186
190- Supported content types are:
187- Supported content types are:
191
188
189+ - `application/json;charset=utf-8`
192 - `application/json`
190 - `application/json`
193
191
194−- Response body as below.
192+- Example (`application/json;charset=utf-8`, `application/json`):
195
193
196− ```javascript
194+ ```javascript
197− {"x":3,"y":14}
195+{"yCoord":14,"xCoord":3}
198− ```
196+ ````
199
197
200`````````
198`````````
201
199