Browse Source

Create docs for character creation route

Lee Morgan 1 tháng trước cách đây
mục cha
commit
5fbf55084c
3 tập tin đã thay đổi với 57 bổ sung0 xóa
  1. 4 0
      docs/openapi.yaml
  2. 50 0
      docs/paths/game/character/create.yaml
  3. 3 0
      docs/redoc-static.html

+ 4 - 0
docs/openapi.yaml

@@ -11,6 +11,7 @@ servers:
 tags:
    - name: User
    - name: Game
+   - name: Character
 
 components:
   schemas:
@@ -59,3 +60,6 @@ paths:
   /game:
     post:
       $ref: "./paths/game/create.yaml"
+  /game/{game_id}/character:
+    post:
+      $ref: "./paths/game/character/create.yaml"

+ 50 - 0
docs/paths/game/character/create.yaml

@@ -0,0 +1,50 @@
+operationId: characterCreate
+summary: Create
+security:
+  - UserAuth: [tokens]
+description: Create playable character for a game
+tags: [Character]
+parameters:
+  - name: game_id
+    in: path
+    description: Game ID
+    required: true
+    schema:
+      type: string
+      format: uuid
+      example: 019eb861-4cca-7721-8eb6-524f9edc6d17
+requestBody:
+  content:
+    application/json:
+      schema:
+        type: object
+        required:
+          - name
+          - description
+        properties:
+          name:
+            type: string
+            description: User chosen name of the character
+            example: Sweeney Todd
+          description:
+            type: string
+            description: User provided details/description of their character
+            example: Lorem Ipsum, etc...
+
+responses:
+  "200":
+    description: Character created
+    content:
+      application/json:
+        schema:
+          $ref: "#/components/schemas/Character"
+  "400":
+    $ref: "#/components/responses/400"
+  "401":
+    $ref: "#/components/responses/401"
+  "403":
+    $ref: "#/components/responses/403"
+  "404":
+    $ref: "#/components/responses/404"
+  "500":
+    $ref: "#/components/responses/500"

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 3 - 0
docs/redoc-static.html


Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác