Implementing reactive APIs for our e-commerce app
Now that you have an idea of how Reactive Streams works, 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 to generate the API interface/contract that creates 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 a few OpenAPI Codegen configurations to generate Spring WebFlux-compliant Java interfaces, as shown next:
{ "library": "spring-boot", "dateLibrary": "java8", "hideGenerationTimestamp": true, ...