Skip to content

Spring WebFlux ​

EasyApi supports Spring WebFlux reactive endpoints.

Supported Annotations ​

AnnotationDescription
@RestControllerMarks a class as a REST controller
@RequestMappingMaps a request path
@GetMappingMaps a GET request
@PostMappingMaps a POST request
@PutMappingMaps a PUT request
@DeleteMappingMaps a DELETE request
@PatchMappingMaps a PATCH request

Reactive Type Resolution ​

EasyApi automatically resolves reactive wrapper types:

java
@GetMapping("/users/{id}")
public Mono<User> getUser(@PathVariable Long id) {
    // Mono<User> is resolved to User in the documentation
}

@GetMapping("/users")
public Flux<User> listUsers() {
    // Flux<User> is resolved to List<User> in the documentation
}

@GetMapping("/events")
public Publisher<Event> streamEvents() {
    // Publisher<Event> is resolved to Event in the documentation
}

Built-in Resolution Rules ​

properties
###set resolveProperty = false
json.rule.convert[#regex:reactor.core.publisher.Mono<(.*?)>]=${1}
json.rule.convert[reactor.core.publisher.Mono]=java.lang.Object
json.rule.convert[#regex:reactor.core.publisher.Flux<(.*?)>]=java.util.List<${1}>
json.rule.convert[reactor.core.publisher.Flux]=java.util.List<java.lang.Object>
json.rule.convert[#regex:org.reactivestreams.Publisher<(.*?)>]=${1}
json.rule.convert[org.reactivestreams.Publisher]=java.lang.Object
###set resolveProperty = true
TypeResolution
Mono<T>Resolved to T
Mono (no generic)Resolved to Object
Flux<T>Resolved to List<T>
Flux (no generic)Resolved to List<Object>
Publisher<T>Resolved to T
Publisher (no generic)Resolved to Object

ServerWebExchange Handling ​

ServerWebExchange parameters are automatically ignored in the generated documentation, as they represent the HTTP exchange context rather than API input.

Released under the Apache-2.0 License.