Prechádzať zdrojové kódy

Create responses docs

Lee Morgan 2 mesiacov pred
rodič
commit
44fe5a1d32

+ 14 - 0
docs/components/responses/400.yaml

@@ -0,0 +1,14 @@
+description: Bad Request
+content:
+  application/json:
+    schema:
+      type: object
+      properties:
+        code:
+          type: number
+          description: HTTP response code
+          example: 400
+        message:
+          type: string
+          description: Message describing the error
+          example: "Json deserialize error: invalid type: map, expected a string at line 3 column 13"

+ 14 - 0
docs/components/responses/401.yaml

@@ -0,0 +1,14 @@
+description: Unauthorized
+content:
+  application/json:
+    schema:
+      type: object
+      properties:
+        code:
+          type: number
+          description: HTTP response code
+          example: 401
+        message:
+          type: string
+          description: Message describing the error
+          example: Unauthorized user

+ 14 - 0
docs/components/responses/403.yaml

@@ -0,0 +1,14 @@
+description: Forbidden
+content:
+  application/json:
+    schema:
+      type: object
+      properties:
+        code:
+          type: number
+          description: HTTP response code
+          example: 403
+        message:
+          type: string
+          description: Message describing the error
+          example: Unauthorized access

+ 14 - 0
docs/components/responses/404.yaml

@@ -0,0 +1,14 @@
+description: Not Found
+content:
+  application/json:
+    schema:
+      type: object
+      properties:
+        code:
+          type: number
+          description: HTTP response code
+          example: 404
+        message:
+          type: string
+          description: Message describing the error
+          example: User with this ID not found

+ 14 - 0
docs/components/responses/500.yaml

@@ -0,0 +1,14 @@
+description: Internal Server Error
+content:
+  application/json:
+    schema:
+      type: object
+      properties:
+        code:
+          type: number
+          description: HTTP response code
+          example: 500
+        message:
+          type: string
+          description: Message describing the error
+          example: Internal server error