Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Java] [Feign] [3.0] Add support for Feign 13 #12526

Open
wants to merge 2 commits into
base: 3.0.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1201,7 +1201,7 @@
</repositories>
<properties>
<maven.compiler.release>8</maven.compiler.release>
<swagger-codegen-generators-version>1.0.56</swagger-codegen-generators-version>
<swagger-codegen-generators-version>1.0.57-SNAPSHOT</swagger-codegen-generators-version>
<swagger-core-version>2.2.28</swagger-core-version>
<swagger-core-version-v1>1.6.15</swagger-core-version-v1>
<swagger-parser-version>2.1.25</swagger-parser-version>
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.36-SNAPSHOT
3.0.67
43 changes: 23 additions & 20 deletions samples/client/petstore/java/feign/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ version = '1.0.0'

buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.+'
Expand All @@ -15,7 +15,7 @@ buildscript {
}

repositories {
jcenter()
mavenCentral()
}


Expand Down Expand Up @@ -76,14 +76,17 @@ if(hasProperty('target') && target == 'android') {
} else {

apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'maven-publish'

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

install {
repositories.mavenInstaller {
pom.artifactId = 'swagger-petstore-feign'
publishing {
publications {
maven(MavenPublication) {
artifactId = 'swagger-petstore-feign'
from components.java
}
}
}

Expand All @@ -96,26 +99,26 @@ if(hasProperty('target') && target == 'android') {
ext {
swagger_annotations_version = "2.0.0"
jackson_version = "2.10.1"
feign_version = "11.6"
feign_version = "13.5"
feign_form_version = "3.8.0"
junit_version = "4.12"
oltu_version = "1.0.2"
}

dependencies {
compile "io.swagger.core.v3:swagger-annotations:$swagger_annotations_version"
compile "io.github.openfeign:feign-core:$feign_version"
compile "io.github.openfeign:feign-jackson:$feign_version"
compile "io.github.openfeign:feign-slf4j:$feign_version"
compile "io.github.openfeign.form:feign-form:$feign_form_version"
compile "com.fasterxml.jackson.core:jackson-core:$jackson_version"
compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version"
compile "com.fasterxml.jackson.core:jackson-databind:$jackson_version"
compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version"
compile ("org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:$oltu_version") {
implementation "io.swagger.core.v3:swagger-annotations:$swagger_annotations_version"
implementation "io.github.openfeign:feign-core:$feign_version"
implementation "io.github.openfeign:feign-jackson:$feign_version"
implementation "io.github.openfeign:feign-slf4j:$feign_version"
implementation "io.github.openfeign.form:feign-form:$feign_form_version"
implementation "com.fasterxml.jackson.core:jackson-core:$jackson_version"
implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version"
implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_version"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version"
implementation ("org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:$oltu_version") {
exclude group: "org.json", module: "json"
}
compile "org.json:json:20180130"
compile "com.brsanthu:migbase64:2.2"
testCompile "junit:junit:$junit_version"
implementation "org.json:json:20180130"
implementation "com.brsanthu:migbase64:2.2"
testImplementation "junit:junit:$junit_version"
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#Tue May 17 23:08:05 CST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.6-bin.zip
4 changes: 2 additions & 2 deletions samples/client/petstore/java/feign/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,9 @@
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<swagger-core-version>2.0.0</swagger-core-version>
<feign-version>11.6</feign-version>
<feign-version>13.5</feign-version>
<feign-form-version>3.8.0</feign-form-version>
<jackson-version>2.10.1</jackson-version>
<jackson-version>2.15.2</jackson-version>
<junit-version>4.13.1</junit-version>
<maven-plugin-version>1.0.0</maven-plugin-version>
<oltu-version>1.0.2</oltu-version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import io.swagger.client.auth.*;
import io.swagger.client.auth.OAuth.AccessTokenListener;


public class ApiClient {
public interface Api {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

package io.swagger.client;


public class StringUtil {
/**
* Check if the given array contains the given value (with case-insensitive comparison).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import java.util.Map;
import feign.*;


public interface AnimalApi extends ApiClient.Api {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import java.util.Map;
import feign.*;


public interface AnotherFakeApi extends ApiClient.Api {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import java.util.Map;
import feign.*;


public interface DogApi extends ApiClient.Api {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import java.util.Map;
import feign.*;


public interface FakeApi extends ApiClient.Api {

/**
Expand Down Expand Up @@ -86,7 +87,7 @@ public interface FakeApi extends ApiClient.Api {
*/
@RequestLine("POST /fake")
@Headers({
"Content-Type: application/xml; charset&#x3D;utf-8",
"Content-Type: application/xml; charset=utf-8",
"Accept: */*",
})
void testEndpointParameters(FakeBody body);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import java.util.Map;
import feign.*;


public interface FakeClassnameTags123Api extends ApiClient.Api {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import java.util.Map;
import feign.*;


public interface PetApi extends ApiClient.Api {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import java.util.Map;
import feign.*;


public interface StoreApi extends ApiClient.Api {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import java.util.Map;
import feign.*;


public interface UserApi extends ApiClient.Api {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.Map;
import java.util.Map.Entry;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -95,7 +96,7 @@ public synchronized void updateAccessToken(RequestTemplate template) {
try {
accessTokenResponse = oauthClient.accessToken(tokenRequestBuilder.buildBodyMessage());
} catch (Exception e) {
throw new RetryableException(400, e.getMessage(), template.request().httpMethod(), e, null, template.request());
throw new RetryableException(400, e.getMessage(), template.request().httpMethod(), e, (Date) null, template.request());
}
if (accessTokenResponse != null && accessTokenResponse.getAccessToken() != null) {
setAccessToken(accessTokenResponse.getAccessToken(), accessTokenResponse.getExpiresIn());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
*/



public class AdditionalPropertiesClass {
@JsonProperty("map_property")
private Map<String, String> mapProperty = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
*/



public class AllOfSubCategoryCategory extends Category {
@JsonProperty("foo")
private Boolean foo = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
*/



public class AllOfSubCategoryPetsItems extends Pet {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
*/



public class AllPetsResponse extends ArrayList<OneOfAllPetsResponseItems> {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
* Animal
*/


@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true )
@JsonSubTypes({
@JsonSubTypes.Type(value = Dog.class, name = "Dog"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
*/



public class AnimalAnimalIdBody {
@JsonProperty("name")
private String name = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
*/



public class AnimalFarm extends ArrayList<Animal> {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
*/



public class ArrayOfArrayOfNumberOnly {
@JsonProperty("ArrayArrayNumber")
private List<List<BigDecimal>> arrayArrayNumber = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
*/



public class ArrayOfNumberOnly {
@JsonProperty("ArrayNumber")
private List<BigDecimal> arrayNumber = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
*/



public class ArrayTest {
@JsonProperty("array_of_string")
private List<String> arrayOfString = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
*/



public class Capitalization {
@JsonProperty("smallCamel")
private String smallCamel = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
*/



public class Cat extends Animal implements OneOfAllPetsResponseItems, OneOfSinglePetResponsePet {
@JsonProperty("declawed")
private Boolean declawed = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
*/



public class Category {
@JsonProperty("id")
private Long id = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
*/
@Schema(description = "Model for testing model with \"_class\" property")


public class ClassModel {
@JsonProperty("_class")
private String propertyClass = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
*/



public class Client {
@JsonProperty("client")
private String client = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
*/



public class Dog extends Animal implements OneOfAllPetsResponseItems, OneOfSinglePetResponsePet {
@JsonProperty("breed")
private String breed = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
*/



public class DogDogIdBody {
@JsonProperty("name")
private String name = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
*/



public class EnumArrays {
/**
* Gets or Sets justSymbol
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
*/



public class EnumFormBody {
/**
* Gets or Sets enumFormStringArray
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
*/



public class EnumTest {
/**
* Gets or Sets enumString
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
*/



public class FakeBody {
@JsonProperty("integer")
private Integer integer = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
*/



public class FakeBody1 {
@JsonProperty("integer")
private Integer integer = null;
Expand Down
Loading