Skip to content

Commit b3431da

Browse files
authored
Merge pull request #7939 from jmini/issue52_b
[3.0.0] Update 'java' examples (2)
2 parents f1eb163 + c094b01 commit b3431da

File tree

288 files changed

+7654
-7282
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

288 files changed

+7654
-7282
lines changed

bin/java-petstore-jersey2-java6.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,4 @@ ags="$@ generate --artifact-id swagger-petstore-jersey2-java6 -i modules/swagger
3131
echo "Removing files and folders under samples/client/petstore/java/jersey2/src/main"
3232
rm -rf samples/client/petstore/java/jersey2-java6/src/main
3333
find samples/client/petstore/java/jersey2-java6 -maxdepth 1 -type f ! -name "README.md" -exec rm {} +
34-
# TODO: uncomment the java commmand when the issue with this script is fixed, see https://github.com/swagger-api/swagger-codegen-generators/issues/52
35-
# java $JAVA_OPTS -jar $executable $ags
34+
java $JAVA_OPTS -jar $executable $ags

bin/java-petstore-okhttp-gson-parcelable.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,4 @@ ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore-with
3030

3131
rm -rf samples/client/petstore/java/okhttp-gson-parcelableModel/src/main
3232
find samples/client/petstore/java/okhttp-gson-parcelableModel -maxdepth 1 -type f ! -name "README.md" -exec rm {} +
33-
# TODO: uncomment the java commmand when the issue with this script is fixed, see https://github.com/swagger-api/swagger-codegen-generators/issues/52
34-
# java $JAVA_OPTS -jar $executable $ags
33+
java $JAVA_OPTS -jar $executable $ags

bin/java-petstore-okhttp-gson.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,4 @@ ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore-with
3030

3131
rm -rf samples/client/petstore/java/okhttp-gson/src/main
3232
find samples/client/petstore/java/okhttp-gson -maxdepth 1 -type f ! -name "README.md" -exec rm {} +
33-
# TODO: uncomment the java commmand when the issue with this script is fixed, see https://github.com/swagger-api/swagger-codegen-generators/issues/52
34-
# java $JAVA_OPTS -jar $executable $ags
33+
java $JAVA_OPTS -jar $executable $ags
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.3.1-SNAPSHOT
1+
3.0.0-SNAPSHOT

samples/client/petstore/java/jersey2-java6/README.md

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,16 @@ import java.util.*;
6969
public class AnotherFakeApiExample {
7070

7171
public static void main(String[] args) {
72+
ApiClient defaultClient = Configuration.getDefaultApiClient();
7273

74+
75+
7376
AnotherFakeApi apiInstance = new AnotherFakeApi();
74-
Client body = new Client(); // Client | client model
77+
78+
Client client = ; // Client | client model
79+
7580
try {
76-
Client result = apiInstance.testSpecialTags(body);
81+
Client result = apiInstance.testSpecialTags(client);
7782
System.out.println(result);
7883
} catch (ApiException e) {
7984
System.err.println("Exception when calling AnotherFakeApi#testSpecialTags");
@@ -127,14 +132,15 @@ Class | Method | HTTP request | Description
127132

128133
- [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md)
129134
- [Animal](docs/Animal.md)
130-
- [AnimalFarm](docs/AnimalFarm.md)
131135
- [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md)
132136
- [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md)
133137
- [ArrayTest](docs/ArrayTest.md)
134138
- [Capitalization](docs/Capitalization.md)
139+
- [Cat](docs/Cat.md)
135140
- [Category](docs/Category.md)
136141
- [ClassModel](docs/ClassModel.md)
137142
- [Client](docs/Client.md)
143+
- [Dog](docs/Dog.md)
138144
- [EnumArrays](docs/EnumArrays.md)
139145
- [EnumClass](docs/EnumClass.md)
140146
- [EnumTest](docs/EnumTest.md)
@@ -155,8 +161,6 @@ Class | Method | HTTP request | Description
155161
- [SpecialModelName](docs/SpecialModelName.md)
156162
- [Tag](docs/Tag.md)
157163
- [User](docs/User.md)
158-
- [Cat](docs/Cat.md)
159-
- [Dog](docs/Dog.md)
160164

161165

162166
## Documentation for Authorization
@@ -168,24 +172,37 @@ Authentication schemes defined for the API:
168172
- **API key parameter name**: api_key
169173
- **Location**: HTTP header
170174

175+
176+
177+
171178
### api_key_query
172179

173180
- **Type**: API key
174181
- **API key parameter name**: api_key_query
175182
- **Location**: URL query string
176183

184+
185+
186+
177187
### http_basic_test
178188

189+
179190
- **Type**: HTTP basic authentication
180191

192+
193+
181194
### petstore_auth
182195

196+
197+
183198
- **Type**: OAuth
184199
- **Flow**: implicit
185200
- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog
186201
- **Scopes**:
187-
- write:pets: modify pets in your account
188-
- read:pets: read your pets
202+
- :
203+
204+
205+
189206

190207

191208
## Recommendation

samples/client/petstore/java/jersey2-java6/build.gradle

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,11 @@ if(hasProperty('target') && target == 'android') {
3232
targetSdkVersion 25
3333
}
3434
compileOptions {
35+
36+
3537
sourceCompatibility JavaVersion.VERSION_1_7
3638
targetCompatibility JavaVersion.VERSION_1_7
39+
3740
}
3841

3942
// Rename the aar correctly
@@ -77,8 +80,11 @@ if(hasProperty('target') && target == 'android') {
7780

7881
apply plugin: 'java'
7982
apply plugin: 'maven'
83+
84+
8085
sourceCompatibility = JavaVersion.VERSION_1_7
8186
targetCompatibility = JavaVersion.VERSION_1_7
87+
8288

8389
install {
8490
repositories.mavenInstaller {
@@ -95,9 +101,11 @@ if(hasProperty('target') && target == 'android') {
95101
ext {
96102
swagger_annotations_version = "1.5.15"
97103
jackson_version = "2.8.9"
98-
jersey_version = "2.6"
104+
jersey_version = "2.25.1"
105+
99106
commons_io_version=2.5
100107
commons_lang3_version=3.6
108+
101109
junit_version = "4.12"
102110
}
103111

@@ -109,9 +117,17 @@ dependencies {
109117
compile "com.fasterxml.jackson.core:jackson-core:$jackson_version"
110118
compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version"
111119
compile "com.fasterxml.jackson.core:jackson-databind:$jackson_version"
120+
121+
122+
112123
compile "commons-io:commons-io:$commons_io_version"
113124
compile "org.apache.commons:commons-lang3:$commons_lang3_version"
125+
126+
114127
compile "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_version",
128+
129+
115130
compile "com.brsanthu:migbase64:2.2"
131+
116132
testCompile "junit:junit:$junit_version"
117133
}

samples/client/petstore/java/jersey2-java6/build.sbt

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,24 @@ lazy val root = (project in file(".")).
1010
resolvers += Resolver.mavenLocal,
1111
libraryDependencies ++= Seq(
1212
"io.swagger" % "swagger-annotations" % "1.5.15",
13-
"org.glassfish.jersey.core" % "jersey-client" % "2.6",
14-
"org.glassfish.jersey.media" % "jersey-media-multipart" % "2.6",
15-
"org.glassfish.jersey.media" % "jersey-media-json-jackson" % "2.6",
13+
"org.glassfish.jersey.core" % "jersey-client" % "2.25.1",
14+
"org.glassfish.jersey.media" % "jersey-media-multipart" % "2.25.1",
15+
"org.glassfish.jersey.media" % "jersey-media-json-jackson" % "2.25.1",
1616
"com.fasterxml.jackson.core" % "jackson-core" % "2.6.4" % "compile",
1717
"com.fasterxml.jackson.core" % "jackson-annotations" % "2.6.4" % "compile",
1818
"com.fasterxml.jackson.core" % "jackson-databind" % "2.6.4" % "compile",
19+
20+
21+
1922
"com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.6.4" % "compile",
23+
24+
2025
"com.brsanthu" % "migbase64" % "2.2",
26+
27+
2128
"org.apache.commons" % "commons-lang3" % "3.6",
2229
"commons-io" % "commons-io" % "2.5",
30+
2331
"junit" % "junit" % "4.12" % "test",
2432
"com.novocode" % "junit-interface" % "0.10" % "test"
2533
)

samples/client/petstore/java/jersey2-java6/docs/AdditionalPropertiesClass.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ Name | Type | Description | Notes
99

1010

1111

12+

samples/client/petstore/java/jersey2-java6/docs/Animal.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ Name | Type | Description | Notes
99

1010

1111

12+

samples/client/petstore/java/jersey2-java6/docs/AnimalFarm.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)