Prechádzať zdrojové kódy

Create docs for login route.

Lee Morgan 2 mesiacov pred
rodič
commit
ef35fa95e3
2 zmenil súbory, kde vykonal 43 pridanie a 0 odobranie
  1. 3 0
      docs/openapi.yaml
  2. 40 0
      docs/paths/user/login.yaml

+ 3 - 0
docs/openapi.yaml

@@ -36,3 +36,6 @@ paths:
   /user:
     post:
       $ref: "./paths/user/create.yaml"
+  /user/login:
+    post:
+      $ref: "./paths/user/login.yaml"

+ 40 - 0
docs/paths/user/login.yaml

@@ -0,0 +1,40 @@
+operationId: userLogin
+summary: Login
+security: []
+description: User login
+tags: [User]
+requestBody:
+  content:
+    application/json:
+      schema:
+        type: object
+        required:
+          - email
+          - password
+        properties:
+          email:
+            type: string
+            format: email
+            description: User email address
+            example: john.smith@mail.com
+          password:
+            type: string
+            description: User password
+            example: password123
+
+responses:
+  "200":
+    description: "User logged in (always returns '{success: true}')"
+    content:
+      application/json:
+        schema:
+          type: object
+          properties:
+            success:
+              type: boolean
+  "400":
+    $ref: "#/components/responses/400"
+  "401":
+    $ref: "#/components/responses/401"
+  "500":
+    $ref: "#/components/responses/500"