snowdrop-zen / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
1 stars 0 forks source link

Add the ability to set HTTP headers and Response status when returning Reactive Types from RESTEasy Reactive #426

Closed snowdrop-bot closed 3 years ago

snowdrop-bot commented 3 years ago

Description

Currently when returning a Uni or Multi, there is no easy way to set a response header or a the HTTP status. We should provide and document a way to do this.

Implementation ideas

There are two ways I can think of:

1) We introduce @Header and @Status annotations that can be placed on a resource method and if the method was executed properly, these annotations set the corresponding response properties. 2) We allow the use of RestResponse<Uni<T>> and RestResponse<Multi<T>>. This would allow more control, but might be more cumbersome to use.

WDYT @FroMage @stuartwdouglas ?


https://github.com/quarkusio/quarkus/issues/20100


$upstream:20100$