Skip to content

Commit dc90af7

Browse files
author
Cecilia Wong
committed
Update API documentation.
1 parent 1d9d7d8 commit dc90af7

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

App.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99

1010
application = create_app()
11-
flask_api_doc(application, config_path='./api/doc/swagger.yaml', url_prefix='/api/doc', title='python-webservice-demo | API doc')
11+
flask_api_doc(application, config_path='./api/doc/swagger.yaml', url_prefix='/api/doc', title='Python Web Service Demo | API doc')
1212

1313
@application.route('/')
1414
def hello_world():

api/doc/swagger.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,21 @@ info:
33
title: Python Web Service Demo
44
description: A simple demonstration web service app with Python and Flask.
55
version: 1.2.0
6+
tags:
7+
- name: "SimpleText"
8+
description: "Operations that return a simple text message."
9+
- name: "Calculation"
10+
description: "Operations that perform calculations on values."
11+
- name: "GetData"
12+
description: "Operations that lookup/populate a set of data."
13+
schemes:
14+
- "https"
15+
- "http"
616
paths:
717
/:
818
get:
19+
tags:
20+
- "SimpleText"
921
description: Prints a simple "Hello World" message.
1022
responses:
1123
200:
@@ -17,6 +29,8 @@ paths:
1729
example: <h1>Hello World!</h1>
1830
/{name}:
1931
get:
32+
tags:
33+
- "SimpleText"
2034
description: Prints a personalized greeting with the name provided by <name>.
2135
parameters:
2236
- name: name
@@ -35,6 +49,8 @@ paths:
3549
example: Hello, Lulu!
3650
/getWorkers:
3751
post:
52+
tags:
53+
- "GetData"
3854
description: |
3955
Returns the list of workers configured in `data/worker_list.json`. \
4056
\
@@ -119,6 +135,8 @@ paths:
119135
The request parameter `work_days` includes an invalid value.
120136
/timestwo:
121137
post:
138+
tags:
139+
- "Calculation"
122140
description: Multiplies a given number by 2.
123141
requestBody:
124142
required: true
@@ -152,6 +170,8 @@ paths:
152170
The response body will be the error message.
153171
/calculateDate:
154172
post:
173+
tags:
174+
- "Calculation"
155175
description: Calculates a specific number of weeks before/after a given date.
156176
requestBody:
157177
required: true
@@ -204,6 +224,8 @@ paths:
204224
See the message in the response data for details.
205225
/getSumoHonbashoSchedule:
206226
get:
227+
tags:
228+
- "GetData"
207229
description: |
208230
Determines the schedule of the Ozumo Honbasho (Grand Sumo Tournament)
209231
for a given year. \

0 commit comments

Comments
 (0)