Skip to content

Improve documentation on reactive types for ResponseEntity [SPR-17400] #21933

Closed
@spring-projects-issues

Description

@spring-projects-issues

Ankur Pathak opened SPR-17400 and commented

The documentation of Spring WebFlux Contoller Style is not proper and in general give three

example of using it:

  1. Mono<Pojo> sayHello(){}
  2. Flux<Pojo> sayHello(){}
  3. ResponeEntity<?> sayHello(){}

But what if I have Flux and Mono and I have custom headers to set, then what I have to do

no comment on that. I have seen many example on internet no one sure on that abd doing

the things as per their wish for example:

  1. ResponseEntity<Flux<Pojo>> sayHello() {}
  2. ResponseEntity<Mono<Pojo>> sayHello() {}
  3. Mono<ResponseEntity<Pojo>> sayHello() {} : May be blocking
  4. Mono<ResponseEntity<List<Pojo>> sayHello() {} Its Blocking

What is the correct way of doing it?? Please improve the documentation to cover these cases.

Or Provide the Support for Mono And Flux in ResponseEntity itself like:

  1. ResponseEntity.publisher(someMono).ok;
  2. ResponseEntity.publisher(someFlux).noResponse();

Its a blocker in migrating projects in Spring MVC to Spring Flux. Till the time documentation

or support improvement is done, Please provide the correct solution in current situation.

 

All these cases are properly covered for functional style and should be properly covered for

controller style as well.

 


Affects: 5.0.10, 5.1.1

Referenced from: commits 2eae37d, d492d7b

Backported to: 5.0.11

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)status: backportedAn issue that has been backported to maintenance branchestype: documentationA documentation task

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions