Skip to content

Commit 922e39c

Browse files
github-actions[bot]lordvladhbelmiro
authored
Change api template to return Response instead of void (#391)
* Return `Response` instead of `void` (#386) Imagine POSTing to a resource that creates something and returns no payload but a 201 with a Location header. Right now, there is no way to get that url. After this commit, it will be possible * Replaced jakarta with javax * Replaced jakarta with javax --------- Co-authored-by: Waldemar Reusch <[email protected]> Co-authored-by: Helber Belmiro <[email protected]>
1 parent 4e2e395 commit 922e39c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,9 @@ When using RESTEasy Reactive:
153153

154154
## Returning `Response` objects
155155

156-
By default, this extension generates the methods according to their returning models based on the [OpenAPI specification Schema Object](https://spec.openapis.org/oas/v3.1.0#schema-object). If you want to return `javax.ws.rs.core.Response` instead, you can set the `return-response` property to `true`.
156+
By default, this extension generates the methods according to their returning models based on the [OpenAPI specification Schema Object](https://spec.openapis.org/oas/v3.1.0#schema-object). If no response model is defined, `javax.ws.rs.core.Response` is returned.
157+
158+
If you want to return `javax.ws.rs.core.Response` in _all_ cases instead, you can set the `return-response` property to `true`.
157159

158160
### Example
159161

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public interface {classname} {
8686
{#if return-response}
8787
public javax.ws.rs.core.Response {op.nickname}(
8888
{#else}
89-
public {#if op.returnType}{op.returnType}{#else}void{/if} {op.nickname}(
89+
public {#if op.returnType}{op.returnType}{#else}javax.ws.rs.core.Response{/if} {op.nickname}(
9090
{/if}
9191
{#if op.hasFormParams}
9292
{#if is-resteasy-reactive}

0 commit comments

Comments
 (0)