Backend REST API Documentation

Frontend and backend of Educama communicate with each other using RESTful interfaces: The frontend calls the backend REST API.


The documentation is created using Spring REST Docs and served at http://http//localhost:8081/docs/rest-api.html when running the application locally.


The documentation is created by using the template backend/src/main/asciidoc/rest-api.adoc which includes snippets which are created based on example requests defined in backend/src/test/java/org/educama/RestApiDocumentation.java.


To add a new request:

  1. Add a new example to RestApiDocumentation.java by adding a new method.
  2. Update the template rest-api.adoc to reference snippets generated after execution of the tests.
  3. Build and run the backend application: mvn clean install && mvn spring-boot:run
  4. Call http://http//localhost:8081/docs/rest-api.html

The generation of the documentation will be aborted if tests (example requests) fail.