Эх сурвалжийг харах

feat: All endpoints return an object

Close #16
Sean Blackburn 1 жил өмнө
parent
commit
013818e871

+ 7 - 6
src/components/examples/api/lecturers/index.yaml

@@ -1,6 +1,7 @@
-- short: rabh
-  surname: Racquel
-  first_name: Bharath
-- short: rudu
-  surname: Ruuben
-  first_name: Dunyasha
+data:
+  - short: rabh
+    surname: Racquel
+    first_name: Bharath
+  - short: rudu
+    surname: Ruuben
+    first_name: Dunyasha

+ 37 - 36
src/components/examples/api/modules/index.yaml

@@ -1,37 +1,38 @@
-- pk: 1
-  short: aet1
-  name: "Allgemeine Elektrotechnik 1 "
-  courses:
-    - 1
-    - 2
-  internal_module_pk: 6007771
-  module_related_pk:
-    - 6
-  ects: 3
-  marks:
-    - overall_grade
-    - final_exam
-    - midterm_exams
-  cat: Fachausbildung
-  sub_cat: Fachgrundlagen
-  dependencies:
-    de:
-      - 5
-    en: []
-  enabling_modules:
-    de:
-      - 6
+data:
+  - pk: 1
+    short: aet1
+    name: "Allgemeine Elektrotechnik 1 "
+    courses:
+      - 1
       - 2
-    en: []
-- pk: 2
-  short: ast1
-  name: "Analoge Schaltungstechnik 1 "
-  courses: []
-  internal_module_pk: null
-  module_related_pk: []
-  ects: null
-  marks: []
-  cat: null
-  sub_cat: null
-  dependencies: {}
-  enabling_modules: {}
+    internal_module_pk: 6007771
+    module_related_pk:
+      - 6
+    ects: 3
+    marks:
+      - overall_grade
+      - final_exam
+      - midterm_exams
+    cat: Fachausbildung
+    sub_cat: Fachgrundlagen
+    dependencies:
+      de:
+        - 5
+      en: []
+    enabling_modules:
+      de:
+        - 6
+        - 2
+      en: []
+  - pk: 2
+    short: ast1
+    name: "Analoge Schaltungstechnik 1 "
+    courses: []
+    internal_module_pk: null
+    module_related_pk: []
+    ects: null
+    marks: []
+    cat: null
+    sub_cat: null
+    dependencies: {}
+    enabling_modules: {}

+ 35 - 34
src/components/examples/api/modules/{module}/history.yaml

@@ -1,34 +1,35 @@
-- pk: 5
-  name: oop1
-  revision_pk: 15
-  weekday: 1
-  class: 1Ia
-  starts: 45900
-  ends: 54600
-  lecturers:
-    - 12
-  lecture_type: on_site
-  rooms:
-    - "4.417"
-  pages:
-    - 3
-  dates: []
-  course_pk: 1
-  module_execution_method: term_weekly
-- pk: 651
-  name: oop1
-  revision_pk: 16
-  weekday: 1
-  class: 1Ib
-  starts: 33000
-  ends: 42300
-  lecturers:
-    - 12
-  lecture_type: on_site
-  rooms:
-    - "4.427"
-  pages:
-    - 4
-  dates: []
-  course_pk: 1
-  module_execution_method: term_weekly
+data:
+  - pk: 5
+    name: oop1
+    revision_pk: 15
+    weekday: 1
+    class: 1Ia
+    starts: 45900
+    ends: 54600
+    lecturers:
+      - 12
+    lecture_type: on_site
+    rooms:
+      - "4.417"
+    pages:
+      - 3
+    dates: []
+    course_pk: 1
+    module_execution_method: term_weekly
+  - pk: 651
+    name: oop1
+    revision_pk: 16
+    weekday: 1
+    class: 1Ib
+    starts: 33000
+    ends: 42300
+    lecturers:
+      - 12
+    lecture_type: on_site
+    rooms:
+      - "4.427"
+    pages:
+      - 4
+    dates: []
+    course_pk: 1
+    module_execution_method: term_weekly

+ 7 - 6
src/components/examples/api/terms/index.yaml

@@ -1,6 +1,7 @@
-- term: 24HS
-  start_date: 1728175749
-  end_date: 1728375749
-- term: 24FS
-  start_date: 1728375750
-  end_date: 1728575749
+data:
+  - term: 24HS
+    start_date: 1728175749
+    end_date: 1728375749
+  - term: 24FS
+    start_date: 1728375750
+    end_date: 1728575749

+ 33 - 32
src/components/examples/api/terms/{term}/revisions/index.yaml

@@ -1,34 +1,35 @@
-- name: prov_5
-  changes: <p>Initialversion</p>
-- name: einschr_1
-  changes: >-
-    <p>Seit der letzten Version hat's neben diversen Raum- und
-    Dozierenden-Änderungen folgende Anpassungen gegeben:</p>
+data:
+  - name: prov_5
+    changes: <p>Initialversion</p>
+  - name: einschr_1
+    changes: >-
+      <p>Seit der letzten Version hat's neben diversen Raum- und
+      Dozierenden-Änderungen folgende Anpassungen gegeben:</p>
 
-    <p><strong>Verschiebung / Änderungen:</strong>
-      <ul>
-        <li>wus 1Ea</li>
-        <li>aet1 1Eb</li>
-        <li>glaL1 1Eb</li>
-        <li>oop1 1Eb</li>
-        <li>hfta 5Ea</li>
-        <li>kryg 5Ea</li>
-        <li>edea 5iCbb</li>
-        <li>an1 1Ma</li>
-        <li>lalg1 1Ma</li>
-        <li>an1 1Mb</li>
-        <li>lalg1 1Mb</li>
-        <li>pro4M 5Mbb</li>
-        <li>eltM 3Mb</li>
-        <li>elmag 3Mb</li>
-        <li>dglM 3Mb</li>
-      </ul>
-    </p>
+      <p><strong>Verschiebung / Änderungen:</strong>
+        <ul>
+          <li>wus 1Ea</li>
+          <li>aet1 1Eb</li>
+          <li>glaL1 1Eb</li>
+          <li>oop1 1Eb</li>
+          <li>hfta 5Ea</li>
+          <li>kryg 5Ea</li>
+          <li>edea 5iCbb</li>
+          <li>an1 1Ma</li>
+          <li>lalg1 1Ma</li>
+          <li>an1 1Mb</li>
+          <li>lalg1 1Mb</li>
+          <li>pro4M 5Mbb</li>
+          <li>eltM 3Mb</li>
+          <li>elmag 3Mb</li>
+          <li>dglM 3Mb</li>
+        </ul>
+      </p>
 
-    <p><strong>Streichung von:</strong>
-    <ul><li>mgli 1iCeng</li></ul>
-    </p>
-- name: korr_1
-  changes: <p>Keine Angaben</p>
-- name: korr_2
-  changes: <p>Keine Angaben</p>
+      <p><strong>Streichung von:</strong>
+      <ul><li>mgli 1iCeng</li></ul>
+      </p>
+  - name: korr_1
+    changes: <p>Keine Angaben</p>
+  - name: korr_2
+    changes: <p>Keine Angaben</p>

+ 37 - 36
src/components/examples/api/terms/{term}/revisions/{revision}/lectures/index.yaml

@@ -1,36 +1,37 @@
-- pk: 1
-  revision_pk: 1
-  weekday: 0
-  starts: 29700
-  ends: 64800
-  class: 1Da
-  name: dummy
-  rooms:
-    - 5.3B51
-  lecturers:
-    - 14
-  lecture_type: on_site
-  module_execution_method: term_weekly
-  pages:
-    - 1
-  course_pk: 2
-  part_of_other_classes: []
-  dates: []
-- pk: 2
-  revision_pk: 1
-  weekday: 1
-  starts: 29700
-  ends: 36000
-  class: 1Da
-  name: eda
-  rooms:
-    - 5.3B51
-  lecturers:
-    - 10
-  lecture_type: on_site
-  module_execution_method: term_weekly
-  pages:
-    - 1
-  course_pk: 2
-  part_of_other_classes: []
-  dates: []
+data:
+  - pk: 1
+    revision_pk: 1
+    weekday: 0
+    starts: 29700
+    ends: 64800
+    class: 1Da
+    name: dummy
+    rooms:
+      - 5.3B51
+    lecturers:
+      - 14
+    lecture_type: on_site
+    module_execution_method: term_weekly
+    pages:
+      - 1
+    course_pk: 2
+    part_of_other_classes: []
+    dates: []
+  - pk: 2
+    revision_pk: 1
+    weekday: 1
+    starts: 29700
+    ends: 36000
+    class: 1Da
+    name: eda
+    rooms:
+      - 5.3B51
+    lecturers:
+      - 10
+    lecture_type: on_site
+    module_execution_method: term_weekly
+    pages:
+      - 1
+    course_pk: 2
+    part_of_other_classes: []
+    dates: []

+ 6 - 3
src/components/responses/api/courses/index-get-200.yaml

@@ -2,9 +2,12 @@ description: OK
 content:
   application/json:
     schema:
-      type: array
-      items:
-        $ref: ../../../schemas/api/course.yaml
+      type: object
+      properties:
+        data:
+          type: array
+          items:
+            $ref: ../../../schemas/api/course.yaml
     # TODO
     # example:
     #   $ref: ../../../examples/api/lecturers/index.yaml

+ 6 - 3
src/components/responses/api/lecturers/index-get-200.yaml

@@ -2,8 +2,11 @@ description: OK
 content:
   application/json:
     schema:
-      type: array
-      items:
-        $ref: ../../../schemas/api/lecturer.yaml
+      type: object
+      properties:
+        data:
+          type: array
+          items:
+            $ref: ../../../schemas/api/lecturer.yaml
     example:
       $ref: ../../../examples/api/lecturers/index.yaml

+ 6 - 3
src/components/responses/api/me/events/index-get-200.yaml

@@ -2,9 +2,12 @@ description: OK
 content:
   application/json:
     schema:
-      type: array
-      items:
-        $ref: ../../../../schemas/api/personal-event.yaml
+      type: object
+      properties:
+        data:
+          type: array
+          items:
+            $ref: ../../../../schemas/api/personal-event.yaml
     # TODO
     # example:
     #   $ref: ../../../../examples/api/me/events.yaml

+ 6 - 3
src/components/responses/api/me/favourites/index-get-200.yaml

@@ -2,9 +2,12 @@ description: OK
 content:
   application/json:
     schema:
-      type: array
-      items:
-        $ref: ../../../../schemas/api/favourite.yaml
+      type: object
+      properties:
+        data:
+          type: array
+          items:
+            $ref: ../../../../schemas/api/favourite.yaml
     # TODO
     # example:
     #   $ref: ../../../../examples/api/me/favourites/index.yaml

+ 1 - 3
src/components/responses/api/me/index-get-200.yaml

@@ -2,9 +2,7 @@ description: OK
 content:
   application/json:
     schema:
-      type: array
-      items:
-        $ref: ../../../schemas/api/me.yaml
+      $ref: ../../../schemas/api/me.yaml
     # TODO
     # example:
     #   $ref: ../../../examples/api/me/index.yaml

+ 6 - 3
src/components/responses/api/me/plans/index-get-200.yaml

@@ -2,9 +2,12 @@ description: OK
 content:
   application/json:
     schema:
-      type: array
-      items:
-        $ref: ../../../../schemas/api/plan.yaml
+      type: object
+      properties:
+        data:
+          type: array
+          items:
+            $ref: ../../../../schemas/api/plan.yaml
     # TODO
     # example:
     #   $ref: ../../../../examples/api/me/plans/index.yaml

+ 6 - 3
src/components/responses/api/modules/index-get-200.yaml

@@ -2,8 +2,11 @@ description: OK
 content:
   application/json:
     schema:
-      type: array
-      items:
-        $ref: ../../../schemas/api/module.yaml
+      type: object
+      properties:
+        data:
+          type: array
+          items:
+            $ref: ../../../schemas/api/module.yaml
     example:
       $ref: ../../../examples/api/modules/index.yaml

+ 6 - 3
src/components/responses/api/modules/{module}/history-get-200.yaml

@@ -2,8 +2,11 @@ description: OK
 content:
   application/json:
     schema:
-      type: array
-      items:
-        $ref: ../../../../schemas/api/lecture-series.yaml
+      type: object
+      properties:
+        data:
+          type: array
+          items:
+            $ref: ../../../../schemas/api/lecture-series.yaml
     example:
       $ref: ../../../../examples/api/modules/{module}/history.yaml

+ 6 - 3
src/components/responses/api/terms/index-get-200.yaml

@@ -2,8 +2,11 @@ description: OK
 content:
   application/json:
     schema:
-      type: array
-      items:
-        $ref: ../../../schemas/api/term-revisions-overview.yaml
+      type: object
+      properties:
+        data:
+          type: array
+          items:
+            $ref: ../../../schemas/api/term-revisions-overview.yaml
     example:
       $ref: ../../../examples/api/terms/index.yaml

+ 6 - 3
src/components/responses/api/terms/{term}/revisions/index-get-200.yaml

@@ -2,8 +2,11 @@ description: OK
 content:
   application/json:
     schema:
-      type: array
-      items:
-        $ref: ../../../../../schemas/api/term-revision.yaml
+      type: object
+      properties:
+        data:
+          type: array
+          items:
+            $ref: ../../../../../schemas/api/term-revision.yaml
     example:
       $ref: ../../../../../examples/api/terms/{term}/revisions/index.yaml

+ 6 - 3
src/components/responses/api/terms/{term}/revisions/{revision}/assets/index-get-200.yaml

@@ -2,9 +2,12 @@ description: OK
 content:
   application/json:
     schema:
-      type: array
-      items:
-        $ref: ../../../../../../../schemas/api/term-revision-asset.yaml
+      type: object
+      properties:
+        data:
+          type: array
+          items:
+            $ref: ../../../../../../../schemas/api/term-revision-asset.yaml
     # TODO
     # example:
     #   $ref: ../../../../../../../../examples/api/terms/{term}/revisions/{revision}/assets/{asset}/index-put.yaml

+ 6 - 3
src/components/responses/api/terms/{term}/revisions/{revision}/lectures/index-get-200.yaml

@@ -2,8 +2,11 @@ description: OK
 content:
   application/json:
     schema:
-      type: array
-      items:
-        $ref: ../../../../../../../schemas/api/lecture-series.yaml
+      type: object
+      properties:
+        data:
+          type: array
+          items:
+            $ref: ../../../../../../../schemas/api/lecture-series.yaml
     example:
       $ref: ../../../../../../../examples/api/terms/{term}/revisions/{revision}/lectures/index.yaml