-
Notifications
You must be signed in to change notification settings - Fork 59
Expand file tree
/
Copy pathopenapi-components-parameters.yaml
More file actions
128 lines (120 loc) · 3.01 KB
/
openapi-components-parameters.yaml
File metadata and controls
128 lines (120 loc) · 3.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
openapi: 3.0.3
servers:
- url: http://localhost:3000/v1
description: 开发环境
security:
- BearerAuth: []
paths:
/products:
get:
tags:
- Products
summary: Get product list
description: Get paginated product list with search, filter, and sort support
parameters:
- $ref: '#/components/parameters/PageParam'
- $ref: '#/components/parameters/PageSizeParam'
- $ref: '#/components/parameters/KeywordParam'
- name: categoryId
in: query
description: Product category ID
schema:
type: string
example: cat_001
responses:
'200':
description: Get successful
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/BaseResponse'
- type: object
properties:
data:
$ref: '#/components/schemas/ProductListResponse'
components:
schemas:
# Base response format
BaseResponse:
type: object
properties:
code:
type: integer
description: Response status code
example: 200
message:
type: string
description: Response message
example: Operation successful
data:
type: object
description: Response data
ProductListResponse:
allOf:
- $ref: '#/components/schemas/PaginatedResponse'
- type: object
properties:
list:
type: array
items:
$ref: '#/components/schemas/Product'
PaginatedResponse:
type: object
properties:
list:
type: array
description: Data list
items:
type: object
total:
type: integer
description: Total records
example: 100
page:
type: integer
description: Current page
example: 1
Product:
type: object
properties:
productId:
type: string
description: Product ID
example: prod_001
name:
type: string
description: Product name
example: Classic Pearl Milk Tea
description:
type: string
description: Product description
example: 'Rich milk tea with chewy pearls, a classic that never goes out of style'
parameters:
# Pagination parameters
PageParam:
name: page
in: query
description: Page number
schema:
type: integer
minimum: 1
default: 1
example: 1
PageSizeParam:
name: pageSize
in: query
description: Page size
schema:
type: integer
minimum: 1
maximum: 100
default: 10
example: 10
KeywordParam:
name: keyword
in: query
description: Search keyword
schema:
type: string
example: Pearl Milk Tea