-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathswagger.yml
More file actions
108 lines (101 loc) · 2.46 KB
/
swagger.yml
File metadata and controls
108 lines (101 loc) · 2.46 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
info:
title: API Template
description: API Template description
contact:
name: API Support
url: http://www.domain.com/support
email: support@domain.com
version: 1.0.0
servers:
- url: "http://{domain}:{port}"
description: Production server
variables:
domain:
default: localhost
port:
default: "9000"
version:
default: "v1"
tags:
- name: System
description: Operations about system
paths:
/ping:
get:
tags:
- System
operationId: ping
summary: Ping the server
description: Ping the server
responses:
200:
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/SuccessResponse"
401:
description: Unauthorized
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
500:
description: Internal Server Error
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
components:
schemas:
Meta:
type: object
properties:
timestamp:
type: string
format: date-time
description: UTC timestamp of the response
example:
timestamp: "2026-01-01T00:00:00Z"
SuccessResponse:
type: object
properties:
data:
description: Response payload (type varies per endpoint)
meta:
$ref: "#/components/schemas/Meta"
example:
data:
ping: "pong"
meta:
timestamp: "2026-01-01T00:00:00Z"
ErrorDetail:
type: object
properties:
code:
type: string
enum:
- UNAUTHORIZED
- FORBIDDEN
- NOT_FOUND
- BAD_REQUEST
- VALIDATION_ERROR
- CONFLICT
- INTERNAL_ERROR
- SERVICE_UNAVAILABLE
description: Machine-readable error code
message:
type: string
description: Human-readable error message
example:
code: "INTERNAL_ERROR"
message: "An unexpected error occurred"
ErrorResponse:
type: object
properties:
error:
$ref: "#/components/schemas/ErrorDetail"
example:
error:
code: "UNAUTHORIZED"
message: "Invalid or missing auth token"