Skip to content

Commit d557bff

Browse files
committed
docs: add id property on section entity
1 parent d62f35c commit d557bff

File tree

1 file changed

+50
-29
lines changed

1 file changed

+50
-29
lines changed

src/resources/openapi.yml

+50-29
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ paths:
225225
content:
226226
application/json:
227227
schema:
228-
$ref: "#/components/schemas/CourseBase"
228+
$ref: "#/components/schemas/CourseUpdateBody"
229229
responses:
230230
"200":
231231
description: "Returns the updated course"
@@ -355,6 +355,42 @@ paths:
355355
$ref: "#/components/responses/InternalServerError"
356356
components:
357357
schemas:
358+
SectionBase:
359+
type: object
360+
properties:
361+
title:
362+
type: string
363+
description: Can be empty
364+
elements:
365+
type: array
366+
items:
367+
type: object
368+
properties:
369+
type:
370+
type: string
371+
enum:
372+
- VIDEO
373+
- QUIZ
374+
- PAGE
375+
# - ATTACHMENT # TODO
376+
id:
377+
type: string
378+
order:
379+
type: integer
380+
required:
381+
- type
382+
- id
383+
- order
384+
required:
385+
- title
386+
- elements
387+
Section:
388+
allOf:
389+
- $ref: "#/components/schemas/SectionBase"
390+
- properties:
391+
id:
392+
type: string
393+
description: The id is only required if the section is updated
358394
CourseBase:
359395
type: object
360396
properties:
@@ -371,34 +407,7 @@ components:
371407
sections:
372408
type: array
373409
items:
374-
type: object
375-
properties:
376-
title:
377-
type: string
378-
description: Can be empty
379-
elements:
380-
type: array
381-
items:
382-
type: object
383-
properties:
384-
type:
385-
type: string
386-
enum:
387-
- VIDEO
388-
- QUIZ
389-
- PAGE
390-
# - ATTACHMENT # TODO
391-
id:
392-
type: string
393-
order:
394-
type: integer
395-
required:
396-
- type
397-
- id
398-
- order
399-
required:
400-
- title
401-
- elements
410+
$ref: "#/components/schemas/SectionBase"
402411
required:
403412
- title
404413
- description
@@ -408,6 +417,10 @@ components:
408417
allOf:
409418
- $ref: "#/components/schemas/CourseBase"
410419
- properties:
420+
sections:
421+
type: array
422+
items:
423+
$ref: "#/components/schemas/Section"
411424
id:
412425
type: string
413426
userId:
@@ -424,6 +437,14 @@ components:
424437
- userId
425438
- createdAt
426439
- updatedAt
440+
CourseUpdateBody:
441+
allOf:
442+
- $ref: "#/components/schemas/CourseBase"
443+
- properties:
444+
sections:
445+
type: array
446+
items:
447+
$ref: "#/components/schemas/Section"
427448
PageBase:
428449
type: object
429450
properties:

0 commit comments

Comments
 (0)