Skip to content

Commit a8fe432

Browse files
authored
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
1 parent cbadd86 commit a8fe432

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
@@ -152,7 +152,9 @@ When using RESTEasy Reactive:
152152

153153
## Returning `Response` objects
154154

155-
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 `jakarta.ws.rs.core.Response` instead, you can set the `return-response` property to `true`.
155+
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, `jakarta.ws.rs.core.Response` is returned.
156+
157+
If you want to return `jakarta.ws.rs.core.Response` in _all_ cases instead, you can set the `return-response` property to `true`.
156158

157159
### Example
158160

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 jakarta.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}jakarta.ws.rs.core.Response{/if} {op.nickname}(
9090
{/if}
9191
{#if op.hasFormParams}
9292
{#if is-resteasy-reactive}

0 commit comments

Comments
 (0)