-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.yaml
More file actions
170 lines (161 loc) · 4.22 KB
/
openapi.yaml
File metadata and controls
170 lines (161 loc) · 4.22 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
openapi: 3.0.3
info:
title: Users API
description: |
Minimal "users" CRUD API used as a SpecShield test fixture.
This is the **v1** (baseline) spec. Identical to the Node test
project's openapi.yaml — by design — so test scenario P9.1
(multi-language consistency) can verify the diff output is
byte-identical across project types.
version: 1.0.0
contact:
name: SpecShield Test Fixture
email: test@specshield.io
servers:
- url: https://api.example.com/v1
description: Production
- url: http://localhost:8080
description: Local dev
tags:
- name: users
description: User account operations
paths:
/users:
get:
tags: [users]
operationId: listUsers
summary: List all users
parameters:
- in: query
name: limit
schema:
type: integer
default: 20
minimum: 1
maximum: 100
- in: query
name: offset
schema:
type: integer
default: 0
minimum: 0
responses:
'200':
description: Paginated list of users
content:
application/json:
schema:
type: object
required: [data, total]
properties:
data:
type: array
items:
$ref: '#/components/schemas/User'
total:
type: integer
description: Total number of users matching the query
post:
tags: [users]
operationId: createUser
summary: Create a new user
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [name]
properties:
name:
type: string
minLength: 1
maxLength: 100
email:
type: string
format: email
description: Optional in v1; required in v2 (breaking change).
responses:
'201':
description: User created
content:
application/json:
schema:
$ref: '#/components/schemas/User'
/users/{id}:
parameters:
- in: path
name: id
required: true
schema:
type: string
format: uuid
get:
tags: [users]
operationId: getUser
summary: Get a single user
responses:
'200':
description: User found
content:
application/json:
schema:
$ref: '#/components/schemas/User'
'404':
description: User not found
patch:
tags: [users]
operationId: updateUser
summary: Update a user's mutable fields
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
name:
type: string
email:
type: string
format: email
responses:
'200':
description: Updated user
content:
application/json:
schema:
$ref: '#/components/schemas/User'
delete:
tags: [users]
operationId: deleteUser
summary: Delete a user
description: |
Removed entirely in v2 — this is a breaking change. Any consumer
still calling DELETE /users/{id} will get a 404 against the v2 API.
responses:
'204':
description: User deleted
components:
schemas:
User:
type: object
required: [id, name, created_at]
properties:
id:
type: string
format: uuid
name:
type: string
email:
type: string
format: email
nullable: true
legacy_id:
type: integer
description: |
Pre-UUID numeric ID for compatibility with the old system.
Removed in v2 — clients that read this field will break.
created_at:
type: string
format: date-time