Skip to content

Commit b418719

Browse files
committed
update sample, update shell script with messages about removing files
1 parent c6cc15f commit b418719

26 files changed

+652
-164
lines changed

bin/java-petstore-jersey2.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ fi
2828
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
2929
ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l java -c bin/java-petstore-jersey2.json -o samples/client/petstore/java/jersey2 -DdateLibrary=joda,hideGenerationTimestamp=true"
3030

31+
echo "Removing files and folders under samples/client/petstore/java/jersey2/src/main"
3132
rm -rf samples/client/petstore/java/jersey2/src/main
3233
find samples/client/petstore/java/jersey2 -maxdepth 1 -type f ! -name "README.md" -exec rm {} +
3334
java $JAVA_OPTS -jar $executable $ags

bin/java-petstore.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ fi
2828
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
2929
ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l java -o samples/client/petstore/java/default -DdateLibrary=joda,hideGenerationTimestamp=true"
3030

31+
echo "Removing files and folders under samples/client/petstore/java/default/src/main"
3132
rm -rf samples/client/petstore/java/default/src/main
3233
find samples/client/petstore/java/default -maxdepth 1 -type f ! -name "README.md" -exec rm {} +
3334
java $JAVA_OPTS -jar $executable $ags

samples/client/petstore/java/default/src/main/java/io/swagger/client/ApiClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ public ApiClient() {
7575

7676
// Setup authentications (key: authentication name, value: authentication).
7777
authentications = new HashMap<String, Authentication>();
78-
authentications.put("petstore_auth", new OAuth());
7978
authentications.put("api_key", new ApiKeyAuth("header", "api_key"));
79+
authentications.put("petstore_auth", new OAuth());
8080
// Prevent the authentications from being modified.
8181
authentications = Collections.unmodifiableMap(authentications);
8282

Lines changed: 95 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,103 @@
1+
/**
2+
* Swagger Petstore
3+
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
4+
*
5+
* OpenAPI spec version: 1.0.0
6+
* Contact: [email protected]
7+
*
8+
* NOTE: This class is auto generated by the swagger code generator program.
9+
* https://github.com/swagger-api/swagger-codegen.git
10+
* Do not edit the class manually.
11+
*
12+
* Licensed under the Apache License, Version 2.0 (the "License");
13+
* you may not use this file except in compliance with the License.
14+
* You may obtain a copy of the License at
15+
*
16+
* http://www.apache.org/licenses/LICENSE-2.0
17+
*
18+
* Unless required by applicable law or agreed to in writing, software
19+
* distributed under the License is distributed on an "AS IS" BASIS,
20+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21+
* See the License for the specific language governing permissions and
22+
* limitations under the License.
23+
*/
24+
25+
126
package io.swagger.client;
227

328
import java.util.Map;
429
import java.util.List;
530

631

732
public class ApiException extends Exception {
8-
private int code = 0;
9-
private Map<String, List<String>> responseHeaders = null;
10-
private String responseBody = null;
11-
12-
public ApiException() {}
13-
14-
public ApiException(Throwable throwable) {
15-
super(throwable);
16-
}
17-
18-
public ApiException(String message) {
19-
super(message);
20-
}
21-
22-
public ApiException(String message, Throwable throwable, int code, Map<String, List<String>> responseHeaders, String responseBody) {
23-
super(message, throwable);
24-
this.code = code;
25-
this.responseHeaders = responseHeaders;
26-
this.responseBody = responseBody;
27-
}
28-
29-
public ApiException(String message, int code, Map<String, List<String>> responseHeaders, String responseBody) {
30-
this(message, (Throwable) null, code, responseHeaders, responseBody);
31-
}
32-
33-
public ApiException(String message, Throwable throwable, int code, Map<String, List<String>> responseHeaders) {
34-
this(message, throwable, code, responseHeaders, null);
35-
}
36-
37-
public ApiException(int code, Map<String, List<String>> responseHeaders, String responseBody) {
38-
this((String) null, (Throwable) null, code, responseHeaders, responseBody);
39-
}
40-
41-
public ApiException(int code, String message) {
42-
super(message);
43-
this.code = code;
44-
}
45-
46-
public ApiException(int code, String message, Map<String, List<String>> responseHeaders, String responseBody) {
47-
this(code, message);
48-
this.responseHeaders = responseHeaders;
49-
this.responseBody = responseBody;
50-
}
51-
52-
public int getCode() {
53-
return code;
54-
}
55-
56-
/**
57-
* Get the HTTP response headers.
58-
*/
59-
public Map<String, List<String>> getResponseHeaders() {
60-
return responseHeaders;
61-
}
62-
63-
/**
64-
* Get the HTTP response body.
65-
*/
66-
public String getResponseBody() {
67-
return responseBody;
68-
}
33+
private int code = 0;
34+
private Map<String, List<String>> responseHeaders = null;
35+
private String responseBody = null;
36+
37+
public ApiException() {}
38+
39+
public ApiException(Throwable throwable) {
40+
super(throwable);
41+
}
42+
43+
public ApiException(String message) {
44+
super(message);
45+
}
46+
47+
public ApiException(String message, Throwable throwable, int code, Map<String, List<String>> responseHeaders, String responseBody) {
48+
super(message, throwable);
49+
this.code = code;
50+
this.responseHeaders = responseHeaders;
51+
this.responseBody = responseBody;
52+
}
53+
54+
public ApiException(String message, int code, Map<String, List<String>> responseHeaders, String responseBody) {
55+
this(message, (Throwable) null, code, responseHeaders, responseBody);
56+
}
57+
58+
public ApiException(String message, Throwable throwable, int code, Map<String, List<String>> responseHeaders) {
59+
this(message, throwable, code, responseHeaders, null);
60+
}
61+
62+
public ApiException(int code, Map<String, List<String>> responseHeaders, String responseBody) {
63+
this((String) null, (Throwable) null, code, responseHeaders, responseBody);
64+
}
65+
66+
public ApiException(int code, String message) {
67+
super(message);
68+
this.code = code;
69+
}
70+
71+
public ApiException(int code, String message, Map<String, List<String>> responseHeaders, String responseBody) {
72+
this(code, message);
73+
this.responseHeaders = responseHeaders;
74+
this.responseBody = responseBody;
75+
}
76+
77+
/**
78+
* Get the HTTP status code.
79+
*
80+
* @return HTTP status code
81+
*/
82+
public int getCode() {
83+
return code;
84+
}
85+
86+
/**
87+
* Get the HTTP response headers.
88+
*
89+
* @return A map of list of string
90+
*/
91+
public Map<String, List<String>> getResponseHeaders() {
92+
return responseHeaders;
93+
}
94+
95+
/**
96+
* Get the HTTP response body.
97+
*
98+
* @return Response body in the form of string
99+
*/
100+
public String getResponseBody() {
101+
return responseBody;
102+
}
69103
}
Lines changed: 44 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,51 @@
1+
/**
2+
* Swagger Petstore
3+
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
4+
*
5+
* OpenAPI spec version: 1.0.0
6+
* Contact: [email protected]
7+
*
8+
* NOTE: This class is auto generated by the swagger code generator program.
9+
* https://github.com/swagger-api/swagger-codegen.git
10+
* Do not edit the class manually.
11+
*
12+
* Licensed under the Apache License, Version 2.0 (the "License");
13+
* you may not use this file except in compliance with the License.
14+
* You may obtain a copy of the License at
15+
*
16+
* http://www.apache.org/licenses/LICENSE-2.0
17+
*
18+
* Unless required by applicable law or agreed to in writing, software
19+
* distributed under the License is distributed on an "AS IS" BASIS,
20+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21+
* See the License for the specific language governing permissions and
22+
* limitations under the License.
23+
*/
24+
25+
126
package io.swagger.client;
227

328

429
public class Configuration {
5-
private static ApiClient defaultApiClient = new ApiClient();
30+
private static ApiClient defaultApiClient = new ApiClient();
631

7-
/**
8-
* Get the default API client, which would be used when creating API
9-
* instances without providing an API client.
10-
*/
11-
public static ApiClient getDefaultApiClient() {
12-
return defaultApiClient;
13-
}
32+
/**
33+
* Get the default API client, which would be used when creating API
34+
* instances without providing an API client.
35+
*
36+
* @return Default API client
37+
*/
38+
public static ApiClient getDefaultApiClient() {
39+
return defaultApiClient;
40+
}
1441

15-
/**
16-
* Set the default API client, which would be used when creating API
17-
* instances without providing an API client.
18-
*/
19-
public static void setDefaultApiClient(ApiClient apiClient) {
20-
defaultApiClient = apiClient;
21-
}
42+
/**
43+
* Set the default API client, which would be used when creating API
44+
* instances without providing an API client.
45+
*
46+
* @param apiClient API client
47+
*/
48+
public static void setDefaultApiClient(ApiClient apiClient) {
49+
defaultApiClient = apiClient;
50+
}
2251
}

samples/client/petstore/java/default/src/main/java/io/swagger/client/Pair.java

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,28 @@
1+
/**
2+
* Swagger Petstore
3+
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
4+
*
5+
* OpenAPI spec version: 1.0.0
6+
* Contact: [email protected]
7+
*
8+
* NOTE: This class is auto generated by the swagger code generator program.
9+
* https://github.com/swagger-api/swagger-codegen.git
10+
* Do not edit the class manually.
11+
*
12+
* Licensed under the Apache License, Version 2.0 (the "License");
13+
* you may not use this file except in compliance with the License.
14+
* You may obtain a copy of the License at
15+
*
16+
* http://www.apache.org/licenses/LICENSE-2.0
17+
*
18+
* Unless required by applicable law or agreed to in writing, software
19+
* distributed under the License is distributed on an "AS IS" BASIS,
20+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21+
* See the License for the specific language governing permissions and
22+
* limitations under the License.
23+
*/
24+
25+
126
package io.swagger.client;
227

328

samples/client/petstore/java/default/src/main/java/io/swagger/client/StringUtil.java

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,28 @@
1+
/**
2+
* Swagger Petstore
3+
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
4+
*
5+
* OpenAPI spec version: 1.0.0
6+
* Contact: [email protected]
7+
*
8+
* NOTE: This class is auto generated by the swagger code generator program.
9+
* https://github.com/swagger-api/swagger-codegen.git
10+
* Do not edit the class manually.
11+
*
12+
* Licensed under the Apache License, Version 2.0 (the "License");
13+
* you may not use this file except in compliance with the License.
14+
* You may obtain a copy of the License at
15+
*
16+
* http://www.apache.org/licenses/LICENSE-2.0
17+
*
18+
* Unless required by applicable law or agreed to in writing, software
19+
* distributed under the License is distributed on an "AS IS" BASIS,
20+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21+
* See the License for the specific language governing permissions and
22+
* limitations under the License.
23+
*/
24+
25+
126
package io.swagger.client;
227

328

samples/client/petstore/java/default/src/main/java/io/swagger/client/api/FakeApi.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
import io.swagger.client.Pair;
1010

1111
import org.joda.time.LocalDate;
12-
import java.math.BigDecimal;
1312
import org.joda.time.DateTime;
13+
import java.math.BigDecimal;
1414

1515

1616
import java.util.ArrayList;

samples/client/petstore/java/default/src/main/java/io/swagger/client/api/PetApi.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
import io.swagger.client.Pair;
1010

1111
import io.swagger.client.model.Pet;
12-
import io.swagger.client.model.ModelApiResponse;
1312
import java.io.File;
13+
import io.swagger.client.model.ModelApiResponse;
1414

1515

1616
import java.util.ArrayList;

samples/client/petstore/java/default/src/main/java/io/swagger/client/auth/ApiKeyAuth.java

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,28 @@
1+
/**
2+
* Swagger Petstore
3+
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
4+
*
5+
* OpenAPI spec version: 1.0.0
6+
* Contact: [email protected]
7+
*
8+
* NOTE: This class is auto generated by the swagger code generator program.
9+
* https://github.com/swagger-api/swagger-codegen.git
10+
* Do not edit the class manually.
11+
*
12+
* Licensed under the Apache License, Version 2.0 (the "License");
13+
* you may not use this file except in compliance with the License.
14+
* You may obtain a copy of the License at
15+
*
16+
* http://www.apache.org/licenses/LICENSE-2.0
17+
*
18+
* Unless required by applicable law or agreed to in writing, software
19+
* distributed under the License is distributed on an "AS IS" BASIS,
20+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21+
* See the License for the specific language governing permissions and
22+
* limitations under the License.
23+
*/
24+
25+
126
package io.swagger.client.auth;
227

328
import io.swagger.client.Pair;

0 commit comments

Comments
 (0)