Skip to content

Commit 9e314d1

Browse files
authored
[Java][Server] remove snapshot dependency (#9997)
1 parent e568376 commit 9e314d1

34 files changed

+96
-98
lines changed

bin/configs/java-resttemplate-withXml.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ outputDir: samples/client/petstore/java/resttemplate-withXml
33
library: resttemplate
44
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
55
additionalProperties:
6+
java8: true
67
withXml: "true"
78
artifactId: petstore-resttemplate-withxml
89
hideGenerationTimestamp: "true"

bin/configs/java-resttemplate.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-e
55
additionalProperties:
66
artifactId: petstore-resttemplate
77
hideGenerationTimestamp: "true"
8+
java8: true

modules/openapi-generator/src/main/resources/java-pkmst/pom.mustache

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<cucumber-java.version>1.2.5</cucumber-java.version>
1717
<cucumber-reporting.version>3.10.0</cucumber-reporting.version>
1818
<javax-annotation-version>1.3.2</javax-annotation-version>
19-
<springfox-swagger2>2.6.1-SNAPSHOT</springfox-swagger2>
19+
<springfox-swagger2>2.6.0</springfox-swagger2>
2020
<springfox-swagger-ui>2.6.0</springfox-swagger-ui>
2121
<slf4j-api>1.7.25</slf4j-api>
2222
<logstash-logback-encoder>4.11</logstash-logback-encoder>
@@ -36,14 +36,6 @@
3636
<!-- lookup parent from repository -->
3737
</parent>
3838
<repositories>
39-
<repository>
40-
<id>oss-snapshots</id>
41-
<name>JFrog OSS Snapshots</name>
42-
<url>https://oss.jfrog.org/simple/oss-snapshot-local/</url>
43-
<snapshots>
44-
<enabled>true</enabled>
45-
</snapshots>
46-
</repository>
4739
<repository>
4840
<id>central</id>
4941
<name>Maven Repository Switchboard</name>

samples/client/petstore/java/resttemplate-withXml/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, mod
1313

1414
Building the API client library requires:
1515

16-
1. Java 1.7+
16+
1. Java 1.8+
1717
2. Maven/Gradle
1818

1919
## Installation

samples/client/petstore/java/resttemplate-withXml/build.gradle

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ if(hasProperty('target') && target == 'android') {
3333
targetSdkVersion 22
3434
}
3535
compileOptions {
36-
sourceCompatibility JavaVersion.VERSION_1_7
37-
targetCompatibility JavaVersion.VERSION_1_7
36+
sourceCompatibility JavaVersion.VERSION_1_8
37+
targetCompatibility JavaVersion.VERSION_1_8
3838
}
3939

4040
// Rename the aar correctly
@@ -79,8 +79,8 @@ if(hasProperty('target') && target == 'android') {
7979
apply plugin: 'java'
8080
apply plugin: 'maven'
8181

82-
sourceCompatibility = JavaVersion.VERSION_1_7
83-
targetCompatibility = JavaVersion.VERSION_1_7
82+
sourceCompatibility = JavaVersion.VERSION_1_8
83+
targetCompatibility = JavaVersion.VERSION_1_8
8484

8585
install {
8686
repositories.mavenInstaller {
@@ -115,6 +115,7 @@ dependencies {
115115
implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version"
116116
implementation "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version"
117117
implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version"
118+
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version"
118119
implementation "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_threeten_version"
119120
implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:$jackson_version"
120121
implementation 'javax.annotation:javax.annotation-api:1.3.2'

samples/client/petstore/java/resttemplate-withXml/pom.xml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@
137137
<artifactId>maven-compiler-plugin</artifactId>
138138
<version>3.6.1</version>
139139
<configuration>
140-
<source>1.7</source>
141-
<target>1.7</target>
140+
<source>1.8</source>
141+
<target>1.8</target>
142142
</configuration>
143143
</plugin>
144144
<plugin>
@@ -257,6 +257,11 @@
257257
<version>${jackson-version}</version>
258258
</dependency>
259259

260+
<dependency>
261+
<groupId>com.fasterxml.jackson.datatype</groupId>
262+
<artifactId>jackson-datatype-jsr310</artifactId>
263+
<version>${jackson-version}</version>
264+
</dependency>
260265
<dependency>
261266
<groupId>com.github.joschi.jackson</groupId>
262267
<artifactId>jackson-datatype-threetenbp</artifactId>

samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ public AdditionalPropertiesClass mapString(Map<String, String> mapString) {
129129

130130
public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) {
131131
if (this.mapString == null) {
132-
this.mapString = new HashMap<String, String>();
132+
this.mapString = new HashMap<>();
133133
}
134134
this.mapString.put(key, mapStringItem);
135135
return this;
@@ -164,7 +164,7 @@ public AdditionalPropertiesClass mapNumber(Map<String, BigDecimal> mapNumber) {
164164

165165
public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) {
166166
if (this.mapNumber == null) {
167-
this.mapNumber = new HashMap<String, BigDecimal>();
167+
this.mapNumber = new HashMap<>();
168168
}
169169
this.mapNumber.put(key, mapNumberItem);
170170
return this;
@@ -199,7 +199,7 @@ public AdditionalPropertiesClass mapInteger(Map<String, Integer> mapInteger) {
199199

200200
public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) {
201201
if (this.mapInteger == null) {
202-
this.mapInteger = new HashMap<String, Integer>();
202+
this.mapInteger = new HashMap<>();
203203
}
204204
this.mapInteger.put(key, mapIntegerItem);
205205
return this;
@@ -234,7 +234,7 @@ public AdditionalPropertiesClass mapBoolean(Map<String, Boolean> mapBoolean) {
234234

235235
public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) {
236236
if (this.mapBoolean == null) {
237-
this.mapBoolean = new HashMap<String, Boolean>();
237+
this.mapBoolean = new HashMap<>();
238238
}
239239
this.mapBoolean.put(key, mapBooleanItem);
240240
return this;
@@ -269,7 +269,7 @@ public AdditionalPropertiesClass mapArrayInteger(Map<String, List<Integer>> mapA
269269

270270
public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List<Integer> mapArrayIntegerItem) {
271271
if (this.mapArrayInteger == null) {
272-
this.mapArrayInteger = new HashMap<String, List<Integer>>();
272+
this.mapArrayInteger = new HashMap<>();
273273
}
274274
this.mapArrayInteger.put(key, mapArrayIntegerItem);
275275
return this;
@@ -304,7 +304,7 @@ public AdditionalPropertiesClass mapArrayAnytype(Map<String, List<Object>> mapAr
304304

305305
public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List<Object> mapArrayAnytypeItem) {
306306
if (this.mapArrayAnytype == null) {
307-
this.mapArrayAnytype = new HashMap<String, List<Object>>();
307+
this.mapArrayAnytype = new HashMap<>();
308308
}
309309
this.mapArrayAnytype.put(key, mapArrayAnytypeItem);
310310
return this;
@@ -339,7 +339,7 @@ public AdditionalPropertiesClass mapMapString(Map<String, Map<String, String>> m
339339

340340
public AdditionalPropertiesClass putMapMapStringItem(String key, Map<String, String> mapMapStringItem) {
341341
if (this.mapMapString == null) {
342-
this.mapMapString = new HashMap<String, Map<String, String>>();
342+
this.mapMapString = new HashMap<>();
343343
}
344344
this.mapMapString.put(key, mapMapStringItem);
345345
return this;
@@ -374,7 +374,7 @@ public AdditionalPropertiesClass mapMapAnytype(Map<String, Map<String, Object>>
374374

375375
public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map<String, Object> mapMapAnytypeItem) {
376376
if (this.mapMapAnytype == null) {
377-
this.mapMapAnytype = new HashMap<String, Map<String, Object>>();
377+
this.mapMapAnytype = new HashMap<>();
378378
}
379379
this.mapMapAnytype.put(key, mapMapAnytypeItem);
380380
return this;

samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public ArrayOfArrayOfNumberOnly arrayArrayNumber(List<List<BigDecimal>> arrayArr
5757

5858
public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List<BigDecimal> arrayArrayNumberItem) {
5959
if (this.arrayArrayNumber == null) {
60-
this.arrayArrayNumber = new ArrayList<List<BigDecimal>>();
60+
this.arrayArrayNumber = new ArrayList<>();
6161
}
6262
this.arrayArrayNumber.add(arrayArrayNumberItem);
6363
return this;

samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public ArrayOfNumberOnly arrayNumber(List<BigDecimal> arrayNumber) {
5757

5858
public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) {
5959
if (this.arrayNumber == null) {
60-
this.arrayNumber = new ArrayList<BigDecimal>();
60+
this.arrayNumber = new ArrayList<>();
6161
}
6262
this.arrayNumber.add(arrayNumberItem);
6363
return this;

samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public ArrayTest arrayOfString(List<String> arrayOfString) {
7373

7474
public ArrayTest addArrayOfStringItem(String arrayOfStringItem) {
7575
if (this.arrayOfString == null) {
76-
this.arrayOfString = new ArrayList<String>();
76+
this.arrayOfString = new ArrayList<>();
7777
}
7878
this.arrayOfString.add(arrayOfStringItem);
7979
return this;
@@ -108,7 +108,7 @@ public ArrayTest arrayArrayOfInteger(List<List<Long>> arrayArrayOfInteger) {
108108

109109
public ArrayTest addArrayArrayOfIntegerItem(List<Long> arrayArrayOfIntegerItem) {
110110
if (this.arrayArrayOfInteger == null) {
111-
this.arrayArrayOfInteger = new ArrayList<List<Long>>();
111+
this.arrayArrayOfInteger = new ArrayList<>();
112112
}
113113
this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem);
114114
return this;
@@ -143,7 +143,7 @@ public ArrayTest arrayArrayOfModel(List<List<ReadOnlyFirst>> arrayArrayOfModel)
143143

144144
public ArrayTest addArrayArrayOfModelItem(List<ReadOnlyFirst> arrayArrayOfModelItem) {
145145
if (this.arrayArrayOfModel == null) {
146-
this.arrayArrayOfModel = new ArrayList<List<ReadOnlyFirst>>();
146+
this.arrayArrayOfModel = new ArrayList<>();
147147
}
148148
this.arrayArrayOfModel.add(arrayArrayOfModelItem);
149149
return this;

samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumArrays.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ public EnumArrays arrayEnum(List<ArrayEnumEnum> arrayEnum) {
168168

169169
public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) {
170170
if (this.arrayEnum == null) {
171-
this.arrayEnum = new ArrayList<ArrayEnumEnum>();
171+
this.arrayEnum = new ArrayList<>();
172172
}
173173
this.arrayEnum.add(arrayEnumItem);
174174
return this;

samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public FileSchemaTestClass files(List<java.io.File> files) {
9090

9191
public FileSchemaTestClass addFilesItem(java.io.File filesItem) {
9292
if (this.files == null) {
93-
this.files = new ArrayList<java.io.File>();
93+
this.files = new ArrayList<>();
9494
}
9595
this.files.add(filesItem);
9696
return this;

samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MapTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public MapTest mapMapOfString(Map<String, Map<String, String>> mapMapOfString) {
120120

121121
public MapTest putMapMapOfStringItem(String key, Map<String, String> mapMapOfStringItem) {
122122
if (this.mapMapOfString == null) {
123-
this.mapMapOfString = new HashMap<String, Map<String, String>>();
123+
this.mapMapOfString = new HashMap<>();
124124
}
125125
this.mapMapOfString.put(key, mapMapOfStringItem);
126126
return this;
@@ -155,7 +155,7 @@ public MapTest mapOfEnumString(Map<String, InnerEnum> mapOfEnumString) {
155155

156156
public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) {
157157
if (this.mapOfEnumString == null) {
158-
this.mapOfEnumString = new HashMap<String, InnerEnum>();
158+
this.mapOfEnumString = new HashMap<>();
159159
}
160160
this.mapOfEnumString.put(key, mapOfEnumStringItem);
161161
return this;
@@ -190,7 +190,7 @@ public MapTest directMap(Map<String, Boolean> directMap) {
190190

191191
public MapTest putDirectMapItem(String key, Boolean directMapItem) {
192192
if (this.directMap == null) {
193-
this.directMap = new HashMap<String, Boolean>();
193+
this.directMap = new HashMap<>();
194194
}
195195
this.directMap.put(key, directMapItem);
196196
return this;
@@ -225,7 +225,7 @@ public MapTest indirectMap(Map<String, Boolean> indirectMap) {
225225

226226
public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) {
227227
if (this.indirectMap == null) {
228-
this.indirectMap = new HashMap<String, Boolean>();
228+
this.indirectMap = new HashMap<>();
229229
}
230230
this.indirectMap.put(key, indirectMapItem);
231231
return this;

samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public MixedPropertiesAndAdditionalPropertiesClass map(Map<String, Animal> map)
128128

129129
public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) {
130130
if (this.map == null) {
131-
this.map = new HashMap<String, Animal>();
131+
this.map = new HashMap<>();
132132
}
133133
this.map.put(key, mapItem);
134134
return this;

samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Pet.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public class Pet {
6767
// items.example= items.type=String
6868
@XmlElement(name = "photoUrls")
6969
@XmlElementWrapper(name = "photoUrl")
70-
private Set<String> photoUrls = new LinkedHashSet<String>();
70+
private Set<String> photoUrls = new LinkedHashSet<>();
7171

7272
public static final String JSON_PROPERTY_TAGS = "tags";
7373
// Is a container wrapped=true
@@ -255,7 +255,7 @@ public Pet tags(List<Tag> tags) {
255255

256256
public Pet addTagsItem(Tag tagsItem) {
257257
if (this.tags == null) {
258-
this.tags = new ArrayList<Tag>();
258+
this.tags = new ArrayList<>();
259259
}
260260
this.tags.add(tagsItem);
261261
return this;

samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderDefault.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public class TypeHolderDefault {
6666
// items.name=arrayItem items.baseName=arrayItem items.xmlName= items.xmlNamespace=
6767
// items.example= items.type=Integer
6868
@XmlElement(name = "arrayItem")
69-
private List<Integer> arrayItem = new ArrayList<Integer>();
69+
private List<Integer> arrayItem = new ArrayList<>();
7070

7171

7272
public TypeHolderDefault stringItem(String stringItem) {

samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderExample.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public class TypeHolderExample {
7171
// items.name=arrayItem items.baseName=arrayItem items.xmlName= items.xmlNamespace=
7272
// items.example= items.type=Integer
7373
@XmlElement(name = "arrayItem")
74-
private List<Integer> arrayItem = new ArrayList<Integer>();
74+
private List<Integer> arrayItem = new ArrayList<>();
7575

7676

7777
public TypeHolderExample stringItem(String stringItem) {

samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/XmlItem.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ public XmlItem wrappedArray(List<Integer> wrappedArray) {
342342

343343
public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) {
344344
if (this.wrappedArray == null) {
345-
this.wrappedArray = new ArrayList<Integer>();
345+
this.wrappedArray = new ArrayList<>();
346346
}
347347
this.wrappedArray.add(wrappedArrayItem);
348348
return this;
@@ -497,7 +497,7 @@ public XmlItem nameArray(List<Integer> nameArray) {
497497

498498
public XmlItem addNameArrayItem(Integer nameArrayItem) {
499499
if (this.nameArray == null) {
500-
this.nameArray = new ArrayList<Integer>();
500+
this.nameArray = new ArrayList<>();
501501
}
502502
this.nameArray.add(nameArrayItem);
503503
return this;
@@ -532,7 +532,7 @@ public XmlItem nameWrappedArray(List<Integer> nameWrappedArray) {
532532

533533
public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) {
534534
if (this.nameWrappedArray == null) {
535-
this.nameWrappedArray = new ArrayList<Integer>();
535+
this.nameWrappedArray = new ArrayList<>();
536536
}
537537
this.nameWrappedArray.add(nameWrappedArrayItem);
538538
return this;
@@ -687,7 +687,7 @@ public XmlItem prefixArray(List<Integer> prefixArray) {
687687

688688
public XmlItem addPrefixArrayItem(Integer prefixArrayItem) {
689689
if (this.prefixArray == null) {
690-
this.prefixArray = new ArrayList<Integer>();
690+
this.prefixArray = new ArrayList<>();
691691
}
692692
this.prefixArray.add(prefixArrayItem);
693693
return this;
@@ -722,7 +722,7 @@ public XmlItem prefixWrappedArray(List<Integer> prefixWrappedArray) {
722722

723723
public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) {
724724
if (this.prefixWrappedArray == null) {
725-
this.prefixWrappedArray = new ArrayList<Integer>();
725+
this.prefixWrappedArray = new ArrayList<>();
726726
}
727727
this.prefixWrappedArray.add(prefixWrappedArrayItem);
728728
return this;
@@ -877,7 +877,7 @@ public XmlItem namespaceArray(List<Integer> namespaceArray) {
877877

878878
public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) {
879879
if (this.namespaceArray == null) {
880-
this.namespaceArray = new ArrayList<Integer>();
880+
this.namespaceArray = new ArrayList<>();
881881
}
882882
this.namespaceArray.add(namespaceArrayItem);
883883
return this;
@@ -912,7 +912,7 @@ public XmlItem namespaceWrappedArray(List<Integer> namespaceWrappedArray) {
912912

913913
public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) {
914914
if (this.namespaceWrappedArray == null) {
915-
this.namespaceWrappedArray = new ArrayList<Integer>();
915+
this.namespaceWrappedArray = new ArrayList<>();
916916
}
917917
this.namespaceWrappedArray.add(namespaceWrappedArrayItem);
918918
return this;
@@ -1067,7 +1067,7 @@ public XmlItem prefixNsArray(List<Integer> prefixNsArray) {
10671067

10681068
public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) {
10691069
if (this.prefixNsArray == null) {
1070-
this.prefixNsArray = new ArrayList<Integer>();
1070+
this.prefixNsArray = new ArrayList<>();
10711071
}
10721072
this.prefixNsArray.add(prefixNsArrayItem);
10731073
return this;
@@ -1102,7 +1102,7 @@ public XmlItem prefixNsWrappedArray(List<Integer> prefixNsWrappedArray) {
11021102

11031103
public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) {
11041104
if (this.prefixNsWrappedArray == null) {
1105-
this.prefixNsWrappedArray = new ArrayList<Integer>();
1105+
this.prefixNsWrappedArray = new ArrayList<>();
11061106
}
11071107
this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem);
11081108
return this;

0 commit comments

Comments
 (0)