Jelajahi Sumber

Create docs for password reset route

Lee Morgan 2 bulan lalu
induk
melakukan
df11387369
2 mengubah file dengan 55 tambahan dan 0 penghapusan
  1. 3 0
      docs/openapi.yaml
  2. 52 0
      docs/paths/user/reset_password.yaml

+ 3 - 0
docs/openapi.yaml

@@ -48,6 +48,9 @@ paths:
   /user/logout:
     post:
       $ref: "./paths/user/logout.yaml"
+  /user/password/reset:
+    patch:
+      $ref: "./paths/user/reset_password.yaml"
 
   #Homes
   /home:

+ 52 - 0
docs/paths/user/reset_password.yaml

@@ -0,0 +1,52 @@
+operationId: userResetPassword
+summary: Reset Password
+security:
+  - UserAuth: []
+description: Reset the user password
+tags: [User]
+requestBody:
+  content:
+    application/json:
+      schema:
+        type: object
+        required:
+          - user_id
+          - token
+          - password
+          - confirm_password
+        properties:
+          user_id:
+            type: string
+            format: uuid
+            description: User ID, provided in URL
+            example: 019e27f6-8898-7e4d-9dd7-93ce0e00cae0
+          token:
+            type: string
+            format: uuid
+            description: Unique user token, provided in URL
+            example: 081e4b9b-37f4-46d8-97e3-303817399fea
+          password:
+            type: string
+            description: New user password
+            example: password123
+          confirm_password:
+            type: string
+            description: Confirmation password
+            example: password123
+
+responses:
+  "200":
+    description: "Password reset (always returns '{success: true}')"
+    content:
+      application/json:
+        schema:
+          type: object
+          properties:
+            success:
+              type: boolean
+  "401":
+    $ref: "#/components/responses/401"
+  "403":
+    $ref: "#/components/responses/403"
+  "500":
+    $ref: "#/components/responses/500"