This repository shows the working example of how to design and build an API using the API First Design approach. The Design First approach advocates for designing the API's contract first before writing any implementation/code.
Open API spec File 'students-api.yaml' [located under 'src/main/resources']
Any modification to students-api.yaml file, necessitates the build of the project as per below instructions to regenerate the API and Model classes. This is done using the swagger-codegen-maven-plugin. REST Controller 'StudentsApiController' consumes these generated classes.
- v0.1: Initial version with mocked api response
- v1.0: The repository now supports Mongo DB as storage. students-api repository connects to Mongo DB, which is run as a Docker container. Java Logs (students-api-logger.log) are created under project root/logs directory.
- Clone this repository:
git clone https://github.com/sainik73/students-api
- Run Mongo docker instance by following instructions in mongo-data\RunMongo.txt file
- Build the project with Maven:
cd students-api/
mvn clean install