一、通过Swagger生成客户端代码
下载:https://github.com/swagger-api/swagger-codegen
#编译打包
cd E:\软件空间\代码生成\swagger-codegen-3.0.64
mvn clean package
#指定swagger地址生成客户端代码
cd E:\软件空间\代码生成\swagger-codegen-3.0.64\modules\swagger-codegen-cli\target
java -jar swagger-codegen-cli.jar generate -i http://localhost:5252/swagger/v1/swagger.json -l csharp-dotnet2 -o E:\软件空间\代码生成\swagger-codegen-3.0.64\csharp_api_client
生成代码:
支持生成的客户端语言:
aspnetcore
csharp
csharp-dotnet2
go
go-server
dynamic-html
html
html2
java
jaxrs-cxf-client
jaxrs-cxf
inflector
jaxrs-cxf-cdi
jaxrs-spec
jaxrs-jersey
jaxrs-di
jaxrs-resteasy-eap
jaxrs-resteasy
java-vertx
micronaut
spring
nodejs-server
openapi
openapi-yaml
kotlin-client
kotlin-server
php
python
python-flask
r
ruby
scala
scala-akka-http-server
swift3
swift4
swift5
typescript-angular
typescript-axios
typescript-fetch
javascript