Skip to content

Commit 283766c

Browse files
committed
openapi: add classes
1 parent adc798d commit 283766c

File tree

5 files changed

+57
-1
lines changed

5 files changed

+57
-1
lines changed

astro.config.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,10 @@ export default defineConfig({
162162
label: "[GET] List Homeworks",
163163
link: "/client-api/operations/list-homeworks",
164164
},
165+
{
166+
label: "[GET] List Classes",
167+
link: "/client-api/operations/list-classes",
168+
},
165169
{
166170
label: "[GET] List Lessons",
167171
link: "/client-api/operations/list-lessons",

openapi/clientapi.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,31 @@ paths:
133133
schema:
134134
$ref: "./schemas/_common/error_response.yaml"
135135

136+
/classes/{studentId}:
137+
get:
138+
operationId: list-classes
139+
summary: List Classes
140+
description: Lists the student's classes
141+
parameters:
142+
- name: studentId
143+
in: path
144+
required: true
145+
schema:
146+
type: integer
147+
responses:
148+
"200":
149+
description: Array of lessons
150+
content:
151+
application/json:
152+
schema:
153+
$ref: "./schemas/class/list_response.yaml"
154+
"401":
155+
description: Unauthorized
156+
content:
157+
application/json:
158+
schema:
159+
$ref: "./schemas/_common/error_response.yaml"
160+
136161
/timetable/{studentId}:
137162
get:
138163
operationId: list-lessons

openapi/schemas/class/class.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
type: object
2+
properties:
3+
id:
4+
type: integer
5+
name:
6+
type: string
7+
room:
8+
type: string
9+
subject:
10+
type: string
11+
teacher:
12+
type: string
13+
teachers:
14+
type: array
15+
items:
16+
type: string
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
type: object
2+
properties:
3+
data:
4+
type: array
5+
items:
6+
$ref: "./class.yaml"
7+
meta:
8+
type: array
9+
items: {}
10+
success:
11+
type: integer

src/content/docs/coverage.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ description: Track our progress of documentating the ClassCharts API
55

66
Track our progress of documentating the ClassCharts API.
77

8-
- [ ] Classes
98
- [ ] Wellbeing
109
- [ ] Report concern
1110
- [ ] Report absence
@@ -25,6 +24,7 @@ Track our progress of documentating the ClassCharts API.
2524
- [x] List Homeworks
2625
- [x] Mark as complete
2726
- [ ] Mark as seen
27+
- [x] Classes
2828
- [x] Activity
2929
- [x] Behaviour
3030
- [x] Parent Behaviour

0 commit comments

Comments
 (0)