-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi-3.0.yaml
More file actions
104 lines (104 loc) · 2.61 KB
/
Copy pathopenapi-3.0.yaml
File metadata and controls
104 lines (104 loc) · 2.61 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
openapi: 3.0.3
info:
title: Sample API (OpenAPI 3.0, YAML)
description: >-
The same Users API as openapi-3.0.json, written in YAML to show that
Swagger UI loads YAML specs directly (it parses the body, not the file
extension or content-type).
version: 1.0.0
contact:
name: API Support
email: support@example.com
servers:
- url: https://api.example.com/v1
description: Production server
- url: https://staging-api.example.com/v1
description: Staging server
tags:
- name: Users
description: User management
paths:
/users:
get:
summary: Get user list
description: Returns a list of all users
tags: [Users]
responses:
'200':
description: Successfully returned user list
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/User'
post:
summary: Create new user
description: Create a new user account
tags: [Users]
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/NewUser'
responses:
'201':
description: User created successfully
content:
application/json:
schema:
$ref: '#/components/schemas/User'
'400':
description: Invalid request parameters
/users/{userId}:
get:
summary: Get specific user
description: Get detailed user information by ID
tags: [Users]
parameters:
- name: userId
in: path
required: true
description: User ID
schema:
type: integer
responses:
'200':
description: Successfully returned user information
content:
application/json:
schema:
$ref: '#/components/schemas/User'
'404':
description: User not found
components:
schemas:
User:
type: object
properties:
id:
type: integer
example: 1
name:
type: string
example: John Doe
email:
type: string
format: email
example: john@example.com
createdAt:
type: string
format: date-time
example: '2025-11-04T10:00:00Z'
NewUser:
type: object
required: [name, email]
properties:
name:
type: string
example: Jane Smith
email:
type: string
format: email
example: jane@example.com