forked from loafle/openapi-generator-original
Update spring-cloud generator to use openfeign (#1191)
This commit is contained in:
parent
9c736731f2
commit
34409bc0d8
@ -1,6 +1,6 @@
|
|||||||
package {{package}};
|
package {{package}};
|
||||||
|
|
||||||
import org.springframework.cloud.netflix.feign.FeignClient;
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
import {{configPackage}}.ClientConfiguration;
|
import {{configPackage}}.ClientConfiguration;
|
||||||
|
|
||||||
{{=<% %>=}}
|
{{=<% %>=}}
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-parent</artifactId>
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
<version>1.5.4.RELEASE</version>
|
<version>2.0.5.RELEASE</version>
|
||||||
</parent>
|
</parent>
|
||||||
{{/parentOverridden}}
|
{{/parentOverridden}}
|
||||||
<build>
|
<build>
|
||||||
@ -34,7 +34,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.cloud</groupId>
|
<groupId>org.springframework.cloud</groupId>
|
||||||
<artifactId>spring-cloud-starter-parent</artifactId>
|
<artifactId>spring-cloud-starter-parent</artifactId>
|
||||||
<version>Dalston.SR1</version>
|
<version>Finchley.SR1</version>
|
||||||
<type>pom</type>
|
<type>pom</type>
|
||||||
<scope>import</scope>
|
<scope>import</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
@ -49,56 +49,38 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.cloud</groupId>
|
<groupId>org.springframework.cloud</groupId>
|
||||||
<artifactId>spring-cloud-starter-feign</artifactId>
|
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.cloud</groupId>
|
<groupId>org.springframework.cloud</groupId>
|
||||||
<artifactId>spring-cloud-security</artifactId>
|
<artifactId>spring-cloud-starter-oauth2</artifactId>
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.security.oauth</groupId>
|
|
||||||
<artifactId>spring-security-oauth2</artifactId>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
{{#withXml}}
|
{{#withXml}}
|
||||||
|
|
||||||
<!-- XML processing: Jackson -->
|
<!-- XML processing: Jackson -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.fasterxml.jackson.dataformat</groupId>
|
<groupId>com.fasterxml.jackson.dataformat</groupId>
|
||||||
<artifactId>jackson-dataformat-xml</artifactId>
|
<artifactId>jackson-dataformat-xml</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
{{/withXml}}
|
{{/withXml}}
|
||||||
{{#java8}}
|
{{#java8}}
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.fasterxml.jackson.datatype</groupId>
|
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||||||
<artifactId>jackson-datatype-jsr310</artifactId>
|
<artifactId>jackson-datatype-jsr310</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
{{/java8}}
|
{{/java8}}
|
||||||
{{#joda}}
|
{{#joda}}
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.fasterxml.jackson.datatype</groupId>
|
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||||||
<artifactId>jackson-datatype-joda</artifactId>
|
<artifactId>jackson-datatype-joda</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
{{/joda}}
|
{{/joda}}
|
||||||
{{#threetenbp}}
|
{{#threetenbp}}
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.joschi.jackson</groupId>
|
<groupId>com.github.joschi.jackson</groupId>
|
||||||
<artifactId>jackson-datatype-threetenbp</artifactId>
|
<artifactId>jackson-datatype-threetenbp</artifactId>
|
||||||
<version>2.6.4</version>
|
<version>2.6.4</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
{{/threetenbp}}
|
{{/threetenbp}}
|
||||||
{{#useBeanValidation}}
|
|
||||||
<!-- Bean Validation API support -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>javax.validation</groupId>
|
|
||||||
<artifactId>validation-api</artifactId>
|
|
||||||
<version>1.1.0.Final</version>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
{{/useBeanValidation}}
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-test</artifactId>
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-parent</artifactId>
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
<version>1.5.4.RELEASE</version>
|
<version>2.0.5.RELEASE</version>
|
||||||
</parent>
|
</parent>
|
||||||
<build>
|
<build>
|
||||||
<sourceDirectory>src/main/java</sourceDirectory>
|
<sourceDirectory>src/main/java</sourceDirectory>
|
||||||
@ -25,7 +25,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.cloud</groupId>
|
<groupId>org.springframework.cloud</groupId>
|
||||||
<artifactId>spring-cloud-starter-parent</artifactId>
|
<artifactId>spring-cloud-starter-parent</artifactId>
|
||||||
<version>Dalston.SR1</version>
|
<version>Finchley.SR1</version>
|
||||||
<type>pom</type>
|
<type>pom</type>
|
||||||
<scope>import</scope>
|
<scope>import</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
@ -40,28 +40,16 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.cloud</groupId>
|
<groupId>org.springframework.cloud</groupId>
|
||||||
<artifactId>spring-cloud-starter-feign</artifactId>
|
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.cloud</groupId>
|
<groupId>org.springframework.cloud</groupId>
|
||||||
<artifactId>spring-cloud-security</artifactId>
|
<artifactId>spring-cloud-starter-oauth2</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.security.oauth</groupId>
|
|
||||||
<artifactId>spring-security-oauth2</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.fasterxml.jackson.datatype</groupId>
|
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||||||
<artifactId>jackson-datatype-jsr310</artifactId>
|
<artifactId>jackson-datatype-jsr310</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- Bean Validation API support -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>javax.validation</groupId>
|
|
||||||
<artifactId>validation-api</artifactId>
|
|
||||||
<version>1.1.0.Final</version>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-test</artifactId>
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package org.openapitools.api;
|
package org.openapitools.api;
|
||||||
|
|
||||||
import org.springframework.cloud.netflix.feign.FeignClient;
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
import org.openapitools.configuration.ClientConfiguration;
|
import org.openapitools.configuration.ClientConfiguration;
|
||||||
|
|
||||||
@FeignClient(name="${openAPIPetstore.name:openAPIPetstore}", url="${openAPIPetstore.url:http://petstore.swagger.io/v2}", configuration = ClientConfiguration.class)
|
@FeignClient(name="${openAPIPetstore.name:openAPIPetstore}", url="${openAPIPetstore.url:http://petstore.swagger.io/v2}", configuration = ClientConfiguration.class)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package org.openapitools.api;
|
package org.openapitools.api;
|
||||||
|
|
||||||
import org.springframework.cloud.netflix.feign.FeignClient;
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
import org.openapitools.configuration.ClientConfiguration;
|
import org.openapitools.configuration.ClientConfiguration;
|
||||||
|
|
||||||
@FeignClient(name="${openAPIPetstore.name:openAPIPetstore}", url="${openAPIPetstore.url:http://petstore.swagger.io/v2}", configuration = ClientConfiguration.class)
|
@FeignClient(name="${openAPIPetstore.name:openAPIPetstore}", url="${openAPIPetstore.url:http://petstore.swagger.io/v2}", configuration = ClientConfiguration.class)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package org.openapitools.api;
|
package org.openapitools.api;
|
||||||
|
|
||||||
import org.springframework.cloud.netflix.feign.FeignClient;
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
import org.openapitools.configuration.ClientConfiguration;
|
import org.openapitools.configuration.ClientConfiguration;
|
||||||
|
|
||||||
@FeignClient(name="${openAPIPetstore.name:openAPIPetstore}", url="${openAPIPetstore.url:http://petstore.swagger.io/v2}", configuration = ClientConfiguration.class)
|
@FeignClient(name="${openAPIPetstore.name:openAPIPetstore}", url="${openAPIPetstore.url:http://petstore.swagger.io/v2}", configuration = ClientConfiguration.class)
|
||||||
|
@ -3,7 +3,7 @@ package org.openapitools;
|
|||||||
import feign.Logger;
|
import feign.Logger;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||||
import org.springframework.cloud.netflix.feign.EnableFeignClients;
|
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
|
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
|
Loading…
x
Reference in New Issue
Block a user