-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi.yaml
More file actions
102 lines (98 loc) · 2.47 KB
/
Copy pathapi.yaml
File metadata and controls
102 lines (98 loc) · 2.47 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
openapi: 3.1.0
info:
title: User Management API
description: A simple API for managing users with OpenAPI validation
version: '1.0.0'
components:
schemas:
User:
type: object
properties:
id:
type: integer
description: Unique identifier for the user
example: 1
name:
type: string
description: Full name of the user
minLength: 1
maxLength: 100
example: "John Doe"
email:
type: string
format: email
description: Email address of the user
example: "john.doe@example.com"
age:
type: integer
description: Age of the user
minimum: 0
maximum: 150
example: 25
required:
- name
- email
- age
paths:
/health:
get:
summary: Health check endpoint
description: Returns the health status of the service
responses:
'200':
description: Service is healthy
content:
text/plain:
schema:
type: string
example: "Service is running"
/users:
get:
summary: Get list of users
description: Retrieve a paginated list of users
parameters:
- name: page
in: query
description: Page number for pagination
schema:
type: integer
minimum: 1
default: 1
- name: limit
in: query
description: Number of users per page
schema:
type: integer
minimum: 1
maximum: 100
default: 10
required:
- page
- limit
responses:
'200':
description: List of users retrieved successfully
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/User'
post:
summary: Create a new user
description: Create a new user with the provided information
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/User'
responses:
'200':
description: User created successfully
content:
application/json:
schema:
$ref: '#/components/schemas/User'
'400':
description: Invalid input data