Skip to content
This repository was archived by the owner on Dec 4, 2023. It is now read-only.

Commit f258594

Browse files
committed
add openapi documentation
1 parent d67b3a8 commit f258594

File tree

1 file changed

+180
-0
lines changed

1 file changed

+180
-0
lines changed

openapi.yaml

Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
openapi: 3.0.0
2+
info:
3+
title: Swagger php digest
4+
version: 1.0.1
5+
servers:
6+
- url: https://127.0.0.1
7+
description: Local server
8+
tags:
9+
- name: link
10+
description: Operations about links
11+
- name: user
12+
description: Operations about user
13+
paths:
14+
/api/link:
15+
get:
16+
tags:
17+
- link
18+
summary: Get link
19+
parameters:
20+
- name: url
21+
in: query
22+
required: true
23+
style: form
24+
explode: true
25+
schema:
26+
type: string
27+
example: domain.com/bla-bla
28+
responses:
29+
"200":
30+
description: successful operation
31+
content:
32+
application/json:
33+
schema:
34+
$ref: '#/components/schemas/inline_response_200'
35+
security:
36+
- ApiKeyAuth: []
37+
post:
38+
tags:
39+
- link
40+
summary: Add a new link
41+
requestBody:
42+
content:
43+
application/json:
44+
schema:
45+
$ref: '#/components/schemas/body'
46+
responses:
47+
"200":
48+
description: successful operation
49+
content:
50+
application/json:
51+
schema:
52+
$ref: '#/components/schemas/inline_response_200_1'
53+
security:
54+
- ApiKeyAuth: []
55+
delete:
56+
tags:
57+
- link
58+
summary: Delete link
59+
parameters:
60+
- name: url
61+
in: query
62+
required: true
63+
style: form
64+
explode: true
65+
schema:
66+
type: string
67+
example: domain.com/bla-bla
68+
responses:
69+
"200":
70+
description: successful operation
71+
content:
72+
application/json:
73+
schema:
74+
$ref: '#/components/schemas/inline_response_200_1'
75+
security:
76+
- ApiKeyAuth: []
77+
/api/user:
78+
get:
79+
tags:
80+
- user
81+
summary: Get current user info
82+
responses:
83+
"200":
84+
description: successful operation
85+
content:
86+
application/json:
87+
schema:
88+
$ref: '#/components/schemas/inline_response_200_2'
89+
security:
90+
- ApiKeyAuth: []
91+
post:
92+
tags:
93+
- user
94+
summary: Create user
95+
responses:
96+
"200":
97+
description: successful operation
98+
content:
99+
application/json:
100+
schema:
101+
$ref: '#/components/schemas/inline_response_200_3'
102+
components:
103+
schemas:
104+
SuccessResponse:
105+
type: object
106+
properties:
107+
success:
108+
type: boolean
109+
example: true
110+
status:
111+
type: integer
112+
example: 200
113+
code:
114+
type: integer
115+
nullable: true
116+
message:
117+
type: string
118+
nullable: true
119+
inline_response_200:
120+
allOf:
121+
- $ref: '#/components/schemas/SuccessResponse'
122+
- type: object
123+
properties:
124+
data:
125+
$ref: '#/components/schemas/inline_response_200_data'
126+
body:
127+
type: object
128+
properties:
129+
url:
130+
type: string
131+
example: domain.com/bla-bla
132+
description:
133+
type: string
134+
nullable: true
135+
example: description text
136+
inline_response_200_1:
137+
allOf:
138+
- $ref: '#/components/schemas/SuccessResponse'
139+
- type: object
140+
properties:
141+
data:
142+
type: object
143+
nullable: true
144+
inline_response_200_2:
145+
allOf:
146+
- $ref: '#/components/schemas/SuccessResponse'
147+
- type: object
148+
properties:
149+
data:
150+
$ref: '#/components/schemas/inline_response_200_2_data'
151+
inline_response_200_3:
152+
allOf:
153+
- $ref: '#/components/schemas/SuccessResponse'
154+
- type: object
155+
properties:
156+
data:
157+
$ref: '#/components/schemas/inline_response_200_3_data'
158+
inline_response_200_data:
159+
type: object
160+
properties:
161+
url:
162+
type: string
163+
example: domain.com/bla-bla
164+
inline_response_200_2_data:
165+
type: object
166+
properties:
167+
id:
168+
type: integer
169+
example: 100
170+
inline_response_200_3_data:
171+
type: object
172+
properties:
173+
token:
174+
type: string
175+
example: wkkacipforbqgccdqwlhpcexlelrxjmo
176+
securitySchemes:
177+
ApiKeyAuth:
178+
type: apiKey
179+
name: Authorization
180+
in: header

0 commit comments

Comments
 (0)