Merge pull request #3487 from szantopeter/master

fixing bug of rendering an extra spaces into @FeignClient annotation
This commit is contained in:
wing328 2016-08-01 23:12:39 +08:00 committed by GitHub
commit 1886abb9f9
6 changed files with 25 additions and 5 deletions

View File

@ -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}} {
}

View File

@ -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.

View File

@ -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 {
}

View File

@ -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 {
}

View File

@ -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 {
}

View File

@ -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