Skip to content

Document choices for async ResponseEntity return values #22614

@patpatpat123

Description

@patpatpat123

Hello Spring Framework team,

Thank you for this amazing project, especially Spring Webflux.
I have a question to the community, could you please tell me what is the difference between ResponseEntity<Mono<Foo>> versus Mono<ResponseEntity<Foo>> as a return type of a rest controller?
When is the most appropriate to what?
Following up on this question, let's say I need to return a list, or let's say several elements of Foo, there are many examples of returning Flux<Foo>.
Would it make sense to return ResponseEntity<Flux<Foo>> or Flux<ResponseEntity<Foo>>?

Thank you a lot for your help.
I am not trying to spam, just to learn something new, please don't "just close" this.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions