Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/javiertuya/samples-openapi
Samples of generation of rest server and client api components with OpenApi and Swagger
https://github.com/javiertuya/samples-openapi
api openapi rest swagger
Last synced: about 2 months ago
JSON representation
Samples of generation of rest server and client api components with OpenApi and Swagger
- Host: GitHub
- URL: https://github.com/javiertuya/samples-openapi
- Owner: javiertuya
- License: mit
- Created: 2022-03-29T16:49:27.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-10-20T18:28:09.000Z (3 months ago)
- Last Synced: 2024-10-20T22:17:28.091Z (3 months ago)
- Topics: api, openapi, rest, swagger
- Language: Java
- Homepage:
- Size: 187 KB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Samples of generation of rest server and client api components with OpenApi
This is a multimodule maven project that includes samples to generate rest services
based on a OpenApi V3 specification:- *server-spring*: Rest server (Spring Boot 3, Java 17)
- *client-resttemplate*: Java client api (Spring 6 and Fasterxml, Java 17)
- *client-httpclient*: Java client api (Apache Httpclient 5 and Fasterxml, Java 8)
- *client-netcore*: .NET Core client api (RestSharp and Newtonsosft.Json, net 6.0)## Notes
- To generate the api for all modules (including .NET Core) run `mvn generate-sources` from the project root
- The server is located in *server-spring* module at `giis.samples.openapi.invoker.OpenAPI2SpringBoot` or in an executable jar (if generated with `mvn package`)
- To run from Eclipse, ensure that the generated sources (`target/generated-sources/copenapi/src/main/java`) are included in the build path
- The .NET Core client can be run from Visual Studio at `client-netcore/client-netcore.sln` (project is linked with the generated api code)
- The OpenApi schema is common for all modules, located at [schema/api.yml](schema/api.yml)
- Endpoints of services are `localhost:8080`
- Server is tested in a temurin java jre container## Useful links
- [OpenApi overview](https://swagger.io/docs/specification/about/)
- [OpenApi generator](https://github.com/OpenAPITools/openapi-generator)
- [OpenApi generator maven plugin](https://github.com/OpenAPITools/openapi-generator/tree/master/modules/openapi-generator-maven-plugin)
- [Generators list and platform specific configuration](https://openapi-generator.tech/docs/generators/)