Skip to content

Latest commit

 

History

History
24 lines (20 loc) · 1.61 KB

README.md

File metadata and controls

24 lines (20 loc) · 1.61 KB

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
  • Endpoints of services are localhost:8080
  • Server is tested in a temurin java jre container

Useful links