소스 검색

:construction: add swagger paths demo

Jeremy Zheng 3 년 전
부모
커밋
039c2256ce

+ 1 - 1
openapi/index.html

@@ -4,7 +4,7 @@
     <meta charset="UTF-8" />
     <link rel="icon" type="image/svg+xml" href="/vite.svg" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-    <title>Vite + React + TS</title>
+    <title>MINT API</title>
   </head>
   <body>
     <div id="root"></div>

+ 10 - 19
openapi/public/assets/protocol/main.yaml

@@ -1,24 +1,15 @@
 openapi: 3.0.0
 info:
-  title: Sample API
-  description: Optional multiline or single-line description in [CommonMark](http://commonmark.org/help/) or HTML.
-  version: 0.1.9
+  title: MINT API
+  description: International Academy Of Pali Tipitaka(国际巴利三藏学院)
+  version: 2022.12.8
 servers:
-  - url: http://api.example.com/v1
-    description: Optional server description, e.g. Main (production) server
-  - url: http://staging-api.example.com
-    description: Optional server description, e.g. Internal staging server for testing
+  - url: https://spring.wikipali.org/api
+    description: Internal staging server for testing
+  - url: https://www.wikipali.org/api
+    description: Main production server
 paths:
   /users:
-    get:
-      summary: Returns a list of users.
-      description: Optional extended description in CommonMark or HTML.
-      responses:
-        "200": # status code
-          description: A JSON array of user names
-          content:
-            application/json:
-              schema:
-                type: array
-                items:
-                  type: string
+    $ref: "./resources/auth/users/index.yaml"
+  /users/sign-in:
+    $ref: "./resources/auth/users/sign-in.yaml"

+ 13 - 0
openapi/public/assets/protocol/resources/auth/users/index.yaml

@@ -0,0 +1,13 @@
+get:
+  summary: Returns a list of users.
+  tags:
+    - auth
+  responses:
+    "200":
+      description: A JSON array of user names
+      content:
+        application/json:
+          schema:
+            type: array
+            items:
+              type: string

+ 13 - 0
openapi/public/assets/protocol/resources/auth/users/sign-in.yaml

@@ -0,0 +1,13 @@
+post:
+  summary: Sign in.
+  tags:
+    - auth
+  responses:
+    "200": # status code
+      description: A JSON array of user names
+      content:
+        application/json:
+          schema:
+            type: array
+            items:
+              type: string