Skip to content

Commit

Permalink
Regenerate samples
Browse files Browse the repository at this point in the history
  • Loading branch information
Philzen committed Jun 2, 2024
1 parent de860f2 commit 5df41f4
Show file tree
Hide file tree
Showing 13 changed files with 16 additions and 50 deletions.
7 changes: 0 additions & 7 deletions samples/client/echo_api/java/feign-gson/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,6 @@ test {

ext {
swagger_annotations_version = "1.6.11"
jackson_version = "2.17.1"
jackson_databind_version = "2.17.1"
jackson_databind_nullable_version = "0.2.6"
jakarta_annotation_version = "1.3.5"
feign_version = "10.12"
Expand All @@ -116,15 +114,10 @@ dependencies {
implementation "io.swagger:swagger-annotations:$swagger_annotations_version"
implementation "com.google.code.findbugs:jsr305:3.0.2"
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:feign-okhttp:$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_databind_version"
implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version"
implementation "com.brsanthu:migbase64:2.2"
implementation "com.github.scribejava:scribejava-core:$scribejava_version"
implementation "com.brsanthu:migbase64:2.2"
Expand Down
6 changes: 0 additions & 6 deletions samples/client/echo_api/java/feign-gson/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,9 @@ lazy val root = (project in file(".")).
"io.swagger" % "swagger-annotations" % "1.6.11" % "compile",
"com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile",
"io.github.openfeign" % "feign-core" % "10.12" % "compile",
"io.github.openfeign" % "feign-jackson" % "10.12" % "compile",
"io.github.openfeign" % "feign-slf4j" % "10.12" % "compile",
"io.github.openfeign.form" % "feign-form" % "3.8.0" % "compile",
"io.github.openfeign" % "feign-okhttp" % "10.12" % "compile",
"com.fasterxml.jackson.core" % "jackson-core" % "2.17.1" % "compile",
"com.fasterxml.jackson.core" % "jackson-annotations" % "2.17.1" % "compile",
"com.fasterxml.jackson.core" % "jackson-databind" % "2.17.1" % "compile",
"com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.17.1" % "compile",
"com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.15.2" % "compile",
"com.github.scribejava" % "scribejava-core" % "8.0.0" % "compile",
"com.brsanthu" % "migbase64" % "2.2" % "compile",
"jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile",
Expand Down
1 change: 0 additions & 1 deletion samples/client/echo_api/java/feign-gson/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,6 @@
<feign-form-version>3.8.0</feign-form-version>
<gson-version>2.10.1</gson-version>
<jackson-databind-nullable-version>0.2.6</jackson-databind-nullable-version>
<jackson-databind-version>2.17.1</jackson-databind-version>
<jakarta-annotation-version>1.3.5</jakarta-annotation-version>
<junit-version>5.10.0</junit-version>
<maven-plugin-version>1.0.0</maven-plugin-version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@

package org.openapitools.client;

import com.fasterxml.jackson.databind.util.StdDateFormat;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapter;
import com.google.gson.internal.bind.util.ISO8601Utils;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import com.google.gson.JsonElement;
Expand All @@ -31,16 +31,14 @@
import java.lang.reflect.Type;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.ParsePosition;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.time.ZoneId;
import java.time.ZoneOffset;
import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.Locale;
import java.util.Map;
import java.util.HashMap;
import java.util.TimeZone;

/*
* A JSON utility class
Expand All @@ -57,11 +55,6 @@ public class JSON {
private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter();
private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter();

private static final StdDateFormat sdf = new StdDateFormat()
.withTimeZone(TimeZone.getTimeZone(ZoneId.systemDefault()))
.withColonInTimeZone(true);
private static final DateTimeFormatter dtf = DateTimeFormatter.ISO_OFFSET_DATE_TIME;

@SuppressWarnings("unchecked")
public static GsonBuilder createGson() {
GsonFireBuilder fireBuilder = new GsonFireBuilder()
Expand Down Expand Up @@ -338,7 +331,7 @@ public java.sql.Date read(JsonReader in) throws IOException {
if (dateFormat != null) {
return new java.sql.Date(dateFormat.parse(date).getTime());
}
return new java.sql.Date(sdf.parse(date).getTime());
return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime());
} catch (ParseException e) {
throw new JsonParseException(e);
}
Expand All @@ -348,7 +341,7 @@ public java.sql.Date read(JsonReader in) throws IOException {

/**
* Gson TypeAdapter for java.util.Date type
* If the dateFormat is null, DateTimeFormatter will be used.
* If the dateFormat is null, ISO8601Utils will be used.
*/
public static class DateTypeAdapter extends TypeAdapter<Date> {

Expand All @@ -373,7 +366,7 @@ public void write(JsonWriter out, Date date) throws IOException {
if (dateFormat != null) {
value = dateFormat.format(date);
} else {
value = date.toInstant().atOffset(ZoneOffset.UTC).format(dtf);
value = ISO8601Utils.format(date, true);
}
out.value(value);
}
Expand All @@ -392,7 +385,7 @@ public Date read(JsonReader in) throws IOException {
if (dateFormat != null) {
return dateFormat.parse(date);
}
return sdf.parse(date);
return ISO8601Utils.parse(date, new ParsePosition(0));
} catch (ParseException e) {
throw new JsonParseException(e);
}
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/java/feign/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ dependencies {
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_databind_version"
implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version"
implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version"
implementation "com.brsanthu:migbase64:2.2"
implementation "com.github.scribejava:scribejava-core:$scribejava_version"
implementation "com.brsanthu:migbase64:2.2"
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/java/feign/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,8 @@
<feign-version>13.2.1</feign-version>
<feign-form-version>3.8.0</feign-form-version>
<jackson-version>2.17.1</jackson-version>
<jackson-databind-nullable-version>0.2.6</jackson-databind-nullable-version>
<jackson-databind-version>2.17.1</jackson-databind-version>
<jackson-databind-nullable-version>0.2.6</jackson-databind-nullable-version>
<jakarta-annotation-version>1.3.5</jakarta-annotation-version>
<junit-version>5.10.0</junit-version>
<maven-plugin-version>1.0.0</maven-plugin-version>
Expand Down
6 changes: 0 additions & 6 deletions samples/client/petstore/java/rest-assured/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,6 @@
<artifactId>gson-fire</artifactId>
<version>${gson-fire-version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson-databind-version}</version>
</dependency>
<dependency>
<groupId>com.squareup.okio</groupId>
<artifactId>okio</artifactId>
Expand Down Expand Up @@ -262,7 +257,6 @@
<rest-assured.version>5.3.2</rest-assured.version>
<gson-version>2.10.1</gson-version>
<gson-fire-version>1.9.0</gson-fire-version>
<jackson-databind-version>2.17.1</jackson-databind-version>
<jakarta-annotation-version>1.3.5</jakarta-annotation-version>
<beanvalidation-version>3.0.2</beanvalidation-version>
<okio-version>3.6.0</okio-version>
Expand Down
4 changes: 2 additions & 2 deletions samples/client/petstore/java/retrofit2-play26/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ if(hasProperty('target') && target == 'android') {
ext {
oltu_version = "1.0.1"
retrofit_version = "2.3.0"
jackson_databind_version = "2.17.1"
jackson_version = "2.17.1"
jackson_databind_version = "2.17.1"
javax_ws_rs_api_version = "2.1.1"
jackson_databind_nullable_version = "0.2.6"
play_version = "2.6.7"
Expand All @@ -125,10 +125,10 @@ dependencies {
implementation "com.squareup.retrofit2:converter-jackson:$retrofit_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_databind_version"
implementation "javax.ws.rs:javax.ws.rs-api:$javax_ws_rs_api_version"
implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version"
implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version"
implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version"
testImplementation "junit:junit:$junit_version"
}
7 changes: 6 additions & 1 deletion samples/client/petstore/java/retrofit2-play26/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,11 @@
<artifactId>play-ahc-ws_2.12</artifactId>
<version>${play-version}</version>
</dependency>
<dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
<version>${beanvalidation-version}</version>
</dependency>
<dependency>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
Expand All @@ -297,8 +302,8 @@
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<swagger-annotations-version>1.6.3</swagger-annotations-version>
<jackson-version>2.17.1</jackson-version>
<jackson-databind-version>2.17.1</jackson-databind-version>
<jackson-version>2.17.1</jackson-version>
<jackson-databind-nullable-version>0.2.6</jackson-databind-nullable-version>
<javax.ws.rs-api-version>2.1.1</javax.ws.rs-api-version>
<play-version>2.6.7</play-version>
Expand Down
2 changes: 0 additions & 2 deletions samples/client/petstore/java/retrofit2/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ if(hasProperty('target') && target == 'android') {
ext {
oltu_version = "1.0.1"
retrofit_version = "2.3.0"
jackson_databind_version = "2.17.1"
jakarta_annotation_version = "1.3.5"
swagger_annotations_version = "1.5.22"
junit_version = "4.13.2"
Expand All @@ -116,7 +115,6 @@ dependencies {
exclude group:'org.apache.oltu.oauth2' , module: 'org.apache.oltu.oauth2.common'
}
implementation "io.gsonfire:gson-fire:$json_fire_version"
implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version"
implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version"
testImplementation "junit:junit:$junit_version"
}
6 changes: 0 additions & 6 deletions samples/client/petstore/java/retrofit2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,6 @@
<artifactId>swagger-annotations</artifactId>
<version>${swagger-annotations-version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson-databind-version}</version>
</dependency>
<!-- @Nullable annotation -->
<dependency>
<groupId>com.google.code.findbugs</groupId>
Expand Down Expand Up @@ -267,7 +262,6 @@
<maven.compiler.target>${java.version}</maven.compiler.target>
<gson-fire-version>1.9.0</gson-fire-version>
<swagger-annotations-version>1.6.3</swagger-annotations-version>
<jackson-databind-version>2.17.1</jackson-databind-version>
<retrofit-version>2.5.0</retrofit-version>
<jakarta-annotation-version>1.3.5</jakarta-annotation-version>
<oltu-version>1.0.1</oltu-version>
Expand Down
2 changes: 0 additions & 2 deletions samples/client/petstore/java/retrofit2rx2/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ if(hasProperty('target') && target == 'android') {
ext {
oltu_version = "1.0.1"
retrofit_version = "2.3.0"
jackson_databind_version = "2.17.1"
jakarta_annotation_version = "1.3.5"
swagger_annotations_version = "1.5.22"
junit_version = "4.13.2"
Expand All @@ -119,7 +118,6 @@ dependencies {
exclude group:'org.apache.oltu.oauth2' , module: 'org.apache.oltu.oauth2.common'
}
implementation "io.gsonfire:gson-fire:$json_fire_version"
implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version"
implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version"
testImplementation "junit:junit:$junit_version"
}
2 changes: 0 additions & 2 deletions samples/client/petstore/java/retrofit2rx3/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ if(hasProperty('target') && target == 'android') {
ext {
oltu_version = "1.0.1"
retrofit_version = "2.3.0"
jackson_databind_version = "2.17.1"
jakarta_annotation_version = "1.3.5"
swagger_annotations_version = "1.5.22"
junit_version = "4.13.2"
Expand All @@ -119,7 +118,6 @@ dependencies {
exclude group:'org.apache.oltu.oauth2' , module: 'org.apache.oltu.oauth2.common'
}
implementation "io.gsonfire:gson-fire:$json_fire_version"
implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version"
implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version"
testImplementation "junit:junit:$junit_version"
}

0 comments on commit 5df41f4

Please sign in to comment.