@@ -12,14 +12,38 @@ components:
1212 schemas :
1313 Feedback :
1414 type : object
15+ description : Feedback submitted by users
1516 properties :
1617 name :
1718 type : string
19+ type :
20+ type : string
21+ example : " bug" # or "feature"
1822 email :
1923 type : string
2024 text :
2125 type : string
2226
27+ ResponseMessage :
28+ type : object
29+ description : Plain response with a message field
30+ properties :
31+ message :
32+ type : string
33+ example : " Feedback submitted successfully"
34+
35+ HealthStatus :
36+ type : object
37+ description : Health status of the service
38+ properties :
39+ status :
40+ type : string
41+ example : " OK"
42+ message :
43+ type : string
44+ example : " Service is healthy"
45+
46+
2347paths :
2448 /feedbacks :
2549 post :
@@ -37,21 +61,26 @@ paths:
3761 content :
3862 application/json :
3963 schema :
40- type : object
41- properties :
42- message :
43- type : string
44- example : " Feedback submitted successfully"
64+ $ref : ' #/components/schemas/ResponseMessage'
4565 ' 400 ' :
4666 description : Bad request
4767 content :
4868 application/json :
4969 schema :
50- type : object
51- properties :
52- error :
53- type : string
54- example : " Invalid input data"
70+ $ref : ' #/components/schemas/ResponseMessage'
71+ ' 422 ' :
72+ description : Unprocessable payload or validation error
73+ content :
74+ application/json :
75+ schema :
76+ $ref : ' #/components/schemas/ResponseMessage'
77+ ' 500 ' :
78+ description : Internal server error
79+ content :
80+ application/json :
81+ schema :
82+ $ref : ' #/components/schemas/ResponseMessage'
83+
5584 get :
5685 summary : Get all feedbacks
5786 operationId : getFeedbacks
@@ -69,11 +98,7 @@ paths:
6998 content :
7099 application/json :
71100 schema :
72- type : object
73- properties :
74- error :
75- type : string
76- example : " Internal server error"
101+ $ref : ' #/components/schemas/ResponseMessage'
77102
78103 /feedbacks/{id} :
79104 get :
@@ -97,11 +122,7 @@ paths:
97122 content :
98123 application/json :
99124 schema :
100- type : object
101- properties :
102- error :
103- type : string
104- example : " Feedback not found"
125+ $ref : ' #/components/schemas/ResponseMessage'
105126
106127
107128 /health :
@@ -114,11 +135,13 @@ paths:
114135 content :
115136 application/json :
116137 schema :
117- type : object
118- properties :
119- status :
120- type : string
121- example : " OK"
138+ $ref : ' #/components/schemas/HealthStatus'
139+ ' 500 ' :
140+ description : Service is unhealthy
141+ content :
142+ application/json :
143+ schema :
144+ $ref : ' #/components/schemas/HealthStatus'
122145
123146
124147
0 commit comments