eclipse-ee4j / eclipse-ee4j/jersey

CompletionStage with null value should always yield 204

Open
#3,901 4 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
730
Forks
382
PR merge metrics
No merged PRs in 30d

Description

Consider the following:

@Path("/null")
@GET
public String getNull() {
return null;
}

@Path("/null-async")
@GET
public CompletionStage getNullAsync() {
return CompletableFuture.completedFuture(null);
}

@Path("/null-async-defer")
@GET
public CompletionStage getNullAsyncDefer() {
final CompletableFuture cf = new CompletableFuture<>();
executor.schedule(() -> cf.complete(null), 1, SECONDS);
return cf;
}

The response statuses for these resources are respectively: `204`, `204`, `200`. The latter should be consistent with the others, i.e. a `204`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.