Skip to content

@Status annotation is ignored when an empty publisher is returned #11827

Open
@colesnodgrass

Description

@colesnodgrass

Expected Behavior

given:

@Controller("/")
class Controller { 
  @Get("/502")
  @Status(HttpStatus.BAD_GATEWAY)
  fun badGateway(): Publisher<String> = Mono.empty()
}

/502 should return a 502 status code. This works as expected if Mono.just("") is returned instead.

Actual Behaviour

The status code 404 is returned.

Steps To Reproduce

No response

Environment Information

Java 17
Kotlin 2.1.20

Example Application

No response

Version

4.8.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions