Backend REST API Documentation
Frontend and backend of Educama communicate with each other using RESTful interfaces: The frontend calls the backend REST API.
Current Documentation
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:
- Add a new example to RestApiDocumentation.java by adding a new method.
- Update the template rest-api.adoc to reference snippets generated after execution of the tests.
- Build and run the backend application:
mvn clean install && mvn spring-boot:run
- Call http://http//localhost:8081/docs/rest-api.html
The generation of the documentation will be aborted if tests (example requests) fail.