Skip to content

Commit 6a4c99f

Browse files
mzellhohbelmiro
andauthored
Response for individual operations (#426)
* Improved return-response tests Signed-off-by: Helber Belmiro <[email protected]> * Return `Response` instead of `void` (#386) * Apply suggestions from code review * Apply suggestions from code review --------- Signed-off-by: Helber Belmiro <[email protected]> Co-authored-by: Helber Belmiro <[email protected]>
1 parent 7e7ef61 commit 6a4c99f

11 files changed

+1719
-12
lines changed

deployment/src/main/resources/templates/api.qute

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public interface {classname} {
7676
public io.smallrye.mutiny.Uni<jakarta.ws.rs.core.Response> {op.nickname}(
7777
{#else}
7878
{#if op.returnType == "void"}
79-
public {#if op.returnType}io.smallrye.mutiny.Uni<Void>{#else}io.smallrye.mutiny.Uni<jakarta.ws.rs.core.Response>{/if} {op.nickname}(
79+
public io.smallrye.mutiny.Uni<jakarta.ws.rs.core.Response> {op.nickname}(
8080
{#else}
8181
public {#if op.returnType}io.smallrye.mutiny.Uni<{op.returnType}>{#else}io.smallrye.mutiny.Uni<jakarta.ws.rs.core.Response>{/if} {op.nickname}(
8282
{/if}
@@ -85,7 +85,11 @@ public interface {classname} {
8585
{#if return-response}
8686
public jakarta.ws.rs.core.Response {op.nickname}(
8787
{#else}
88+
{#if op.returnType == "void"}
89+
public jakarta.ws.rs.core.Response {op.nickname}(
90+
{#else}
8891
public {#if op.returnType}{op.returnType}{#else}jakarta.ws.rs.core.Response{/if} {op.nickname}(
92+
{/if}
8993
{/if}
9094
{/if}
9195
{#if op.hasFormParams}
Lines changed: 274 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,274 @@
1+
---
2+
openapi: 3.0.3
3+
info:
4+
title: greeting-flow API
5+
version: "1.0"
6+
paths:
7+
/:
8+
post:
9+
requestBody:
10+
content:
11+
'*/*':
12+
schema:
13+
$ref: '#/components/schemas/CloudEvent'
14+
responses:
15+
"200":
16+
description: OK
17+
content:
18+
application/json:
19+
schema:
20+
$ref: '#/components/schemas/Response'
21+
/hello:
22+
get:
23+
tags:
24+
- MutinyReturnResponseFalseString
25+
operationId: hello
26+
responses:
27+
"200":
28+
description: OK
29+
content:
30+
text/plain:
31+
schema:
32+
type: string
33+
/messaging/topics:
34+
get:
35+
tags:
36+
- Quarkus Topics Information Resource
37+
responses:
38+
"200":
39+
description: OK
40+
components:
41+
schemas:
42+
CloudEvent:
43+
type: object
44+
properties:
45+
specVersion:
46+
$ref: '#/components/schemas/SpecVersion'
47+
id:
48+
type: string
49+
type:
50+
type: string
51+
source:
52+
format: uri
53+
type: string
54+
dataContentType:
55+
type: string
56+
dataSchema:
57+
format: uri
58+
type: string
59+
subject:
60+
type: string
61+
time:
62+
format: date-time
63+
type: string
64+
attributeNames:
65+
uniqueItems: true
66+
type: array
67+
items:
68+
type: string
69+
extensionNames:
70+
uniqueItems: true
71+
type: array
72+
items:
73+
type: string
74+
data:
75+
$ref: '#/components/schemas/CloudEventData'
76+
CloudEventData:
77+
type: object
78+
EntityTag:
79+
type: object
80+
properties:
81+
value:
82+
type: string
83+
weak:
84+
type: boolean
85+
Family:
86+
enum:
87+
- INFORMATIONAL
88+
- SUCCESSFUL
89+
- REDIRECTION
90+
- CLIENT_ERROR
91+
- SERVER_ERROR
92+
- OTHER
93+
type: string
94+
Link:
95+
type: object
96+
properties:
97+
uri:
98+
format: uri
99+
type: string
100+
uriBuilder:
101+
$ref: '#/components/schemas/UriBuilder'
102+
rel:
103+
type: string
104+
rels:
105+
type: array
106+
items:
107+
type: string
108+
title:
109+
type: string
110+
type:
111+
type: string
112+
params:
113+
type: object
114+
additionalProperties:
115+
type: string
116+
Locale:
117+
type: object
118+
properties:
119+
language:
120+
type: string
121+
script:
122+
type: string
123+
country:
124+
type: string
125+
variant:
126+
type: string
127+
extensionKeys:
128+
uniqueItems: true
129+
type: array
130+
items:
131+
format: byte
132+
type: string
133+
unicodeLocaleAttributes:
134+
uniqueItems: true
135+
type: array
136+
items:
137+
type: string
138+
unicodeLocaleKeys:
139+
uniqueItems: true
140+
type: array
141+
items:
142+
type: string
143+
iSO3Language:
144+
type: string
145+
iSO3Country:
146+
type: string
147+
displayLanguage:
148+
type: string
149+
displayScript:
150+
type: string
151+
displayCountry:
152+
type: string
153+
displayVariant:
154+
type: string
155+
displayName:
156+
type: string
157+
MediaType:
158+
type: object
159+
properties:
160+
type:
161+
type: string
162+
subtype:
163+
type: string
164+
parameters:
165+
type: object
166+
additionalProperties:
167+
type: string
168+
wildcardType:
169+
type: boolean
170+
wildcardSubtype:
171+
type: boolean
172+
MultivaluedMapStringObject:
173+
type: object
174+
additionalProperties:
175+
type: array
176+
items:
177+
type: object
178+
MultivaluedMapStringString:
179+
type: object
180+
additionalProperties:
181+
type: array
182+
items:
183+
type: string
184+
NewCookie:
185+
type: object
186+
properties:
187+
name:
188+
type: string
189+
value:
190+
type: string
191+
version:
192+
format: int32
193+
type: integer
194+
path:
195+
type: string
196+
domain:
197+
type: string
198+
comment:
199+
type: string
200+
maxAge:
201+
format: int32
202+
type: integer
203+
expiry:
204+
format: date
205+
type: string
206+
secure:
207+
type: boolean
208+
httpOnly:
209+
type: boolean
210+
Response:
211+
type: object
212+
properties:
213+
status:
214+
format: int32
215+
type: integer
216+
statusInfo:
217+
$ref: '#/components/schemas/StatusType'
218+
entity:
219+
type: object
220+
mediaType:
221+
$ref: '#/components/schemas/MediaType'
222+
language:
223+
$ref: '#/components/schemas/Locale'
224+
length:
225+
format: int32
226+
type: integer
227+
allowedMethods:
228+
uniqueItems: true
229+
type: array
230+
items:
231+
type: string
232+
cookies:
233+
type: object
234+
additionalProperties:
235+
$ref: '#/components/schemas/NewCookie'
236+
entityTag:
237+
$ref: '#/components/schemas/EntityTag'
238+
date:
239+
format: date
240+
type: string
241+
lastModified:
242+
format: date
243+
type: string
244+
location:
245+
format: uri
246+
type: string
247+
links:
248+
uniqueItems: true
249+
type: array
250+
items:
251+
$ref: '#/components/schemas/Link'
252+
metadata:
253+
$ref: '#/components/schemas/MultivaluedMapStringObject'
254+
headers:
255+
$ref: '#/components/schemas/MultivaluedMapStringObject'
256+
stringHeaders:
257+
$ref: '#/components/schemas/MultivaluedMapStringString'
258+
SpecVersion:
259+
enum:
260+
- V03
261+
- V1
262+
type: string
263+
StatusType:
264+
type: object
265+
properties:
266+
statusCode:
267+
format: int32
268+
type: integer
269+
family:
270+
$ref: '#/components/schemas/Family'
271+
reasonPhrase:
272+
type: string
273+
UriBuilder:
274+
type: object

0 commit comments

Comments
 (0)