Readhub - 技术资讯 ( ) • 2021-06-23 07:34
In this Post, I’ll cover how to use OpenAPI to generate REST API documentation and Java clients for a Spring Boot Project ... The other services can simply use the API client once generated, instead of writing their own client, to interact with API ... Can be accessed at http://localhost:8080/V3/api-Docs inputSpec.set("$rootDir/api-Docs.json") // The output Target directory into which code will be generated outputDir.set("$rootDir/thinclient") groupId.set("com.xyz.openapi") id.set("openapi-thinclient") version.set("0.0.1-SNAPSHOT") // Package for generated API classes apiPackage.set("com.xyz.openapi.thinclient.api") // Root package for generated code invokerPackage.set("com.xyz.openapi.thinclient.invoker") // All the model classes being used in API will be in this package modelPackage.set("com.xyz.openapi.thinclient.model") // Language in which client has to be generated.