Implementing Reactive APIs for our e-commerce app
Now that you have an idea of how Reactive streams work, we can go ahead and implement REST APIs that are asynchronous and non-blocking.
You'll recall that we are following the design-first approach, so we need the API design specification first. However, we can reuse the e-commerce API specification we created previously in Chapter 3, API Specifications and Implementation.
OpenAPI Codegen is used for generating the API interface/contract that generates the Spring MVC-compliant API Java interfaces. Let's see what changes we need to do to generate the Reactive API interfaces.
Changing OpenAPI Codegen for Reactive APIs
You need to tweak few OpenAPI Codegen configurations to generate Spring WebFlux-compliant Java interfaces, as shown next:
{ Â Â "library": "spring-boot", Â Â "dateLibrary": "java8", Â Â "hideGenerationTimestamp": true, Â ...