forked from loafle/openapi-generator-original
Merge pull request #3487 from szantopeter/master
fixing bug of rendering an extra spaces into @FeignClient annotation
This commit is contained in:
commit
1886abb9f9
@ -3,6 +3,8 @@ package {{package}};
|
||||
import org.springframework.cloud.netflix.feign.FeignClient;
|
||||
import {{configPackage}}.ClientConfiguration;
|
||||
|
||||
@FeignClient(name="${ {{{title}}}.name:{{{title}}}}", url="${ {{{title}}}.url:{{{basePath}}}}", configuration = ClientConfiguration.class)
|
||||
{{=<% %>=}}
|
||||
@FeignClient(name="${<%title%>.name:<%title%>}", url="${<%title%>.url:<%basePath%>}", configuration = ClientConfiguration.class)
|
||||
<%={{ }}=%>
|
||||
public interface {{classname}}Client extends {{classname}} {
|
||||
}
|
@ -1,5 +1,14 @@
|
||||
# swagger-petstore-spring-cloud
|
||||
|
||||
Spring cloud (Feign) client can be generated using the below command :
|
||||
```shell
|
||||
swagger-codegen-cli generate \
|
||||
-l spring \
|
||||
-i http://petstore.swagger.io/v2/swagger.json \
|
||||
-DhideGenerationTimestamp=true
|
||||
```
|
||||
example is [here](https://github.com/swagger-api/swagger-codegen/blob/master/bin/spring-cloud-feign-petstore.sh)
|
||||
|
||||
## Requirements
|
||||
|
||||
Building the API client library requires [Maven](https://maven.apache.org/) to be installed.
|
||||
|
@ -3,6 +3,6 @@ package io.swagger.api;
|
||||
import org.springframework.cloud.netflix.feign.FeignClient;
|
||||
import io.swagger.configuration.ClientConfiguration;
|
||||
|
||||
@FeignClient(name="${ swaggerPetstore.name:swaggerPetstore}", url="${ swaggerPetstore.url:http://petstore.swagger.io/v2}", configuration = ClientConfiguration.class)
|
||||
@FeignClient(name="${swaggerPetstore.name:swaggerPetstore}", url="${swaggerPetstore.url:http://petstore.swagger.io/v2}", configuration = ClientConfiguration.class)
|
||||
public interface PetApiClient extends PetApi {
|
||||
}
|
@ -3,6 +3,6 @@ package io.swagger.api;
|
||||
import org.springframework.cloud.netflix.feign.FeignClient;
|
||||
import io.swagger.configuration.ClientConfiguration;
|
||||
|
||||
@FeignClient(name="${ swaggerPetstore.name:swaggerPetstore}", url="${ swaggerPetstore.url:http://petstore.swagger.io/v2}", configuration = ClientConfiguration.class)
|
||||
@FeignClient(name="${swaggerPetstore.name:swaggerPetstore}", url="${swaggerPetstore.url:http://petstore.swagger.io/v2}", configuration = ClientConfiguration.class)
|
||||
public interface StoreApiClient extends StoreApi {
|
||||
}
|
@ -3,6 +3,6 @@ package io.swagger.api;
|
||||
import org.springframework.cloud.netflix.feign.FeignClient;
|
||||
import io.swagger.configuration.ClientConfiguration;
|
||||
|
||||
@FeignClient(name="${ swaggerPetstore.name:swaggerPetstore}", url="${ swaggerPetstore.url:http://petstore.swagger.io/v2}", configuration = ClientConfiguration.class)
|
||||
@FeignClient(name="${swaggerPetstore.name:swaggerPetstore}", url="${swaggerPetstore.url:http://petstore.swagger.io/v2}", configuration = ClientConfiguration.class)
|
||||
public interface UserApiClient extends UserApi {
|
||||
}
|
@ -1,6 +1,15 @@
|
||||
|
||||
# Swagger generated API stub
|
||||
|
||||
Spring stub can be generated using the below command :
|
||||
```shell
|
||||
swagger-codegen-cli generate \
|
||||
-l spring \
|
||||
-i http://petstore.swagger.io/v2/swagger.json \
|
||||
-DinterfaceOnly=true,singleContentTypes=true,hideGenerationTimestamp=true
|
||||
```
|
||||
example is [here](https://github.com/swagger-api/swagger-codegen/blob/master/bin/spring-stubs.sh)
|
||||
|
||||
|
||||
Spring Framework stub
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user