Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: proceed with RequestFilter and CompletableFuture #11285

Merged
merged 7 commits into from
Oct 30, 2024

Conversation

sdelamo
Copy link
Contributor

@sdelamo sdelamo commented Oct 29, 2024

No description provided.

//tag::methods[]
@RequestFilter
@Nullable
public CompletableFuture<@Nullable HttpResponse<?>> filter(@NonNull HttpRequest<?> request) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please note that if you remove the @Nullable annotation. It does not work. This PR ensures the users finds the correct return type incantation. He needs to use CompletableFuture<@Nullable HttpResponse<?>> not CompletableFuture<HttpResponse<?>>.

Suggested change
public CompletableFuture<@Nullable HttpResponse<?>> filter(@NonNull HttpRequest<?> request) {
public CompletableFuture<HttpResponse<?>> filter(@NonNull HttpRequest<?> request) {

@sdelamo sdelamo force-pushed the doc-request-filter-completeablefuture-proceed branch from 4ac939d to 5cd988a Compare October 29, 2024 06:29
…ts/filter/RequestFilterCompletableFutureFutureProceedTest.java
@dstepanov
Copy link
Contributor

It should be also possible to use CompletionStage

@sdelamo
Copy link
Contributor Author

sdelamo commented Oct 29, 2024

It should be also possible to use CompletionStage

Documented and I added a test of CompletionStage

…ts/filter/RequestFilterCompletionStageFutureProceedTest.java
Copy link

@sdelamo sdelamo merged commit c233fcb into 4.7.x Oct 30, 2024
21 checks passed
@sdelamo sdelamo deleted the doc-request-filter-completeablefuture-proceed branch October 30, 2024 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants