Class AsyncApiController

java.lang.Object
be.appify.prefab.asyncapi.AsyncApiController

@RestController @RequestMapping("/async-api") public class AsyncApiController extends Object
REST controller that exposes AsyncAPI documentation endpoints.
  • GET /async-api/asyncapi.json — the machine-readable AsyncAPI 2.6.0 document
  • GET /async-api — a human-readable HTML viewer backed by AsyncAPI Studio

The JSON document is generated at compile time by the Prefab annotation processor and embedded in the application JAR at META-INF/async-api/asyncapi.json.

  • Constructor Details

    • AsyncApiController

      public AsyncApiController()
      Constructs a new AsyncApiController.
  • Method Details

    • asyncApiJson

      @GetMapping(value="/asyncapi.json", produces="application/json") public org.springframework.http.ResponseEntity<String> asyncApiJson() throws IOException
      Returns the machine-readable AsyncAPI 2.6.0 JSON document.
      Returns:
      the AsyncAPI JSON document
      Throws:
      IOException - if the document cannot be read from the classpath