https://github.com/murilobeltrame/java-api-playground
Java Spring Api Playground
https://github.com/murilobeltrame/java-api-playground
java jersey open-api spring-boot
Last synced: 3 months ago
JSON representation
Java Spring Api Playground
- Host: GitHub
- URL: https://github.com/murilobeltrame/java-api-playground
- Owner: murilobeltrame
- License: gpl-3.0
- Created: 2023-09-10T13:08:36.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-11T03:25:19.000Z (about 2 years ago)
- Last Synced: 2025-01-27T10:29:40.907Z (9 months ago)
- Topics: java, jersey, open-api, spring-boot
- Language: Java
- Homepage:
- Size: 84 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Spring API playground
This repo shows of how to create super simple JAVA API using Spring Boot (Company API) or Jersey (Vehicle API).
It also explore how to do it by older version of JAVA (1.8, sorry =P).
Main objective is generate Open API style documentation for both APIs and them merge it in one single file.
To do so:- Get _Open Api_ specification from `company-api`:
- Navigate to `src/company-api`
- Run `./mvnw spring-boot:run -Dmaven.test.skip=true`
- Grab the spec from `http://localhost:9998/api-docs` and save it
- Get _Open Api_ specification from `vehicle-api`:
- Navigate to `src/vehicle-api`
- Run `./mvnw spring-boot:run -Dmaven.test.skip=true`
- Grab the spec from `http://localhost:9999/api-docs` and save it
- Run merger
- Update `src/index.json` to fix file paths.
- Run `npx swagger-merger --input index.json`## Dependencies
- [Java 8](https://docs.aws.amazon.com/corretto/latest/corretto-8-ug/downloads-list.html)
- [Node JS](https://nodejs.org/it)## Refs
- https://holon-platform.com/blog/spring-boot-jersey-and-swagger-always-happy-together/
- https://ruuben.medium.com/documenting-spring-boot-2-5-x-apis-using-openapi-3-0-6334984c6744
- https://github.com/WindomZ/swagger-merger