This project tries to provide a modern approach to manage APIs combining Protobuf and OpenAPI specification.
The project tries to address the following challenges:
- Contract definitions
- Contract compatibility enforcement
- Contract versioning
- OpenAPI definition generation
- Stub generation to different languages
- Client SDK generation to different languages
- Swagger-UI to display the HTTP API
- API management guideline
- ETC
I am the author of the Advanced Java for adults course. This course contains advanced and not conventional lessons. In this course, you will learn to think differently from those who have a limited view of software development. I will provoke you to reflect on decisions that you take in your day to day job, which might not be the best ones. This course is for middle to senior developers and we will not teach Java language features but how to lead complex Java projects.
This course's lectures are based on a Trading system, an opensource project hosted on my Github.
make generate
make install
We are sharing a docker image with everything required by this project
docker run -it -v "$(pwd):/workspace" -v "$HOME"/.m2:/root/.m2 -w /workspace apssouza/proto-api-manager
make generate
make install
If you prefer to build a local image docker build . -f assets/Dockerfile -t apssouza/proto-api-manager
Generate stub code to different languages(Javascript, Java, Golang)
./bin/go-gen.sh
./bin/java-gen.sh
./bin/js-gen.sh ./protos 0.0.12
Share the API generated code to different languages(Java, Golang)
./bin/go-deploy.sh
./bin/js-deploy.sh ./protos
./bin/java-package.sh
./bin/java-install.sh
Reads protobuf service definitions and generates service definition files. These files can then be used by the Swagger-UI project to display the API and Swagger-Codegen to generate clients in various languages.
./bin/swagger-gen.sh
./bin/swagger-assets-package.sh
Use the service definition files along with Swagger-Codegen to generate HTTP clients for the service in Java and Golang.
./bin/gen-sdk-clients.sh
Use the service definition files along with Swagger-UI project to display the HTTP API version
- Run the services/swaggerui/main.go
- Access https://localhost:8081/?def-file=./definition/book/v1/books.swagger.json
Guarantee the quality of the API by using the project Buf to ensure that the API follows a code style
This is done using Github actions. Check out the .github/workflows/ci.yml
Guarantee back-compatibility of the API by using the project Buf to ensure that the API changes doesn't break the existing contract.
This is done using Github actions. Check out the .github/workflows/ci.yml
Check out a guideline to help manage the APIs in a microservice environment
Check out 2 microservices examples inside ./services
to get inspired. Book microservice is in Golang and
Shelf microservice is in Java.