Skip to content

Commit b4d3611

Browse files
committed
Merge pull request #247 from xoom/issues/java_pom
Issues/java pom - remove scala dependencies from Java pom files
2 parents 8e7571c + fc77521 commit b4d3611

File tree

10 files changed

+182
-430
lines changed

10 files changed

+182
-430
lines changed

samples/client/petstore/android-java/pom.xml

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -104,55 +104,8 @@
104104
<target>1.6</target>
105105
</configuration>
106106
</plugin>
107-
<plugin>
108-
<groupId>net.alchim31.maven</groupId>
109-
<artifactId>scala-maven-plugin</artifactId>
110-
<version>${scala-maven-plugin-version}</version>
111-
<executions>
112-
<execution>
113-
<goals>
114-
<goal>compile</goal>
115-
<goal>testCompile</goal>
116-
</goals>
117-
</execution>
118-
</executions>
119-
<configuration>
120-
<configuration>
121-
<recompileMode>incremental</recompileMode>
122-
</configuration>
123-
<jvmArgs>
124-
<jvmArg>-Xmx384m</jvmArg>
125-
</jvmArgs>
126-
<args>
127-
<arg>-target:jvm-1.5</arg>
128-
<arg>-deprecation</arg>
129-
</args>
130-
<launchers>
131-
<launcher>
132-
<id>run-scalatest</id>
133-
<mainClass>org.scalatest.tools.Runner</mainClass>
134-
<args>
135-
<arg>-p</arg>
136-
<arg>${project.build.testOutputDirectory}</arg>
137-
</args>
138-
<jvmArgs>
139-
<jvmArg>-Xmx512m</jvmArg>
140-
</jvmArgs>
141-
</launcher>
142-
</launchers>
143-
</configuration>
144-
</plugin>
145107
</plugins>
146108
</build>
147-
<reporting>
148-
<plugins>
149-
<plugin>
150-
<groupId>net.alchim31.maven</groupId>
151-
<artifactId>scala-maven-plugin</artifactId>
152-
<version>${scala-maven-plugin-version}</version>
153-
</plugin>
154-
</plugins>
155-
</reporting>
156109
<dependencies>
157110
<dependency>
158111
<groupId>com.fasterxml.jackson.core</groupId>
@@ -180,18 +133,6 @@
180133
</dependency>
181134

182135
<!-- test dependencies -->
183-
<dependency>
184-
<groupId>org.scala-lang</groupId>
185-
<artifactId>scala-library</artifactId>
186-
<version>${scala-version}</version>
187-
<scope>test</scope>
188-
</dependency>
189-
<dependency>
190-
<groupId>org.scalatest</groupId>
191-
<artifactId>scalatest_2.9.1</artifactId>
192-
<version>${scala-test-version}</version>
193-
<scope>test</scope>
194-
</dependency>
195136
<dependency>
196137
<groupId>junit</groupId>
197138
<artifactId>junit</artifactId>
@@ -202,13 +143,10 @@
202143

203144
<properties>
204145
<jackson-version>2.1.4</jackson-version>
205-
<scala-version>2.9.1-1</scala-version>
206146
<junit-version>4.8.1</junit-version>
207147
<maven-plugin-version>1.0.0</maven-plugin-version>
208148
<junit-version>4.8.1</junit-version>
209-
<scala-test-version>1.6.1</scala-test-version>
210149
<httpclient-version>4.0</httpclient-version>
211-
<scala-maven-plugin-version>3.1.5</scala-maven-plugin-version>
212150
</properties>
213151
</project>
214152

samples/client/petstore/android-java/src/main/java/com/wordnik/petstore/api/PetApi.java

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ public Pet getPetById (Long petId) throws ApiException {
5959
}
6060
}
6161
}
62-
//error info- code: 400 reason: "Invalid pet value" model: <none>
63-
public void deletePet (String petId) throws ApiException {
62+
//error info- code: 405 reason: "Invalid input" model: <none>
63+
public void updatePetWithForm (String petId, String name, String status) throws ApiException {
6464
// verify required params are set
6565
if(petId == null ) {
6666
throw new ApiException(400, "missing required params");
@@ -75,7 +75,7 @@ public void deletePet (String petId) throws ApiException {
7575
String contentType = "application/json";
7676

7777
try {
78-
String response = apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, null, headerParams, contentType);
78+
String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, null, headerParams, contentType);
7979
if(response != null){
8080
return ;
8181
}
@@ -91,40 +91,8 @@ public void deletePet (String petId) throws ApiException {
9191
}
9292
}
9393
}
94-
//error info- code: 400 reason: "Invalid tag value" model: <none>
95-
public List<Pet> partialUpdate (String petId, Pet body) throws ApiException {
96-
// verify required params are set
97-
if(petId == null || body == null ) {
98-
throw new ApiException(400, "missing required params");
99-
}
100-
// create path and map variables
101-
String path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString()));
102-
103-
// query params
104-
Map<String, String> queryParams = new HashMap<String, String>();
105-
Map<String, String> headerParams = new HashMap<String, String>();
106-
107-
String contentType = "application/json";
108-
109-
try {
110-
String response = apiInvoker.invokeAPI(basePath, path, "PATCH", queryParams, body, headerParams, contentType);
111-
if(response != null){
112-
return (List<Pet>) ApiInvoker.deserialize(response, "Array", Pet.class);
113-
}
114-
else {
115-
return null;
116-
}
117-
} catch (ApiException ex) {
118-
if(ex.getCode() == 404) {
119-
return null;
120-
}
121-
else {
122-
throw ex;
123-
}
124-
}
125-
}
126-
//error info- code: 405 reason: "Invalid input" model: <none>
127-
public void updatePetWithForm (String petId, String name, String status) throws ApiException {
94+
//error info- code: 400 reason: "Invalid pet value" model: <none>
95+
public void deletePet (String petId) throws ApiException {
12896
// verify required params are set
12997
if(petId == null ) {
13098
throw new ApiException(400, "missing required params");
@@ -139,7 +107,7 @@ public void updatePetWithForm (String petId, String name, String status) throws
139107
String contentType = "application/json";
140108

141109
try {
142-
String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, null, headerParams, contentType);
110+
String response = apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, null, headerParams, contentType);
143111
if(response != null){
144112
return ;
145113
}
@@ -155,9 +123,14 @@ public void updatePetWithForm (String petId, String name, String status) throws
155123
}
156124
}
157125
}
158-
public void uploadFile (String additionalMetadata, File body) throws ApiException {
126+
//error info- code: 400 reason: "Invalid tag value" model: <none>
127+
public List<Pet> partialUpdate (String petId, Pet body) throws ApiException {
128+
// verify required params are set
129+
if(petId == null || body == null ) {
130+
throw new ApiException(400, "missing required params");
131+
}
159132
// create path and map variables
160-
String path = "/pet/uploadImage".replaceAll("\\{format\\}","json");
133+
String path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString()));
161134

162135
// query params
163136
Map<String, String> queryParams = new HashMap<String, String>();
@@ -166,16 +139,16 @@ public void uploadFile (String additionalMetadata, File body) throws ApiExceptio
166139
String contentType = "application/json";
167140

168141
try {
169-
String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, body, headerParams, contentType);
142+
String response = apiInvoker.invokeAPI(basePath, path, "PATCH", queryParams, body, headerParams, contentType);
170143
if(response != null){
171-
return ;
144+
return (List<Pet>) ApiInvoker.deserialize(response, "List", Pet.class);
172145
}
173146
else {
174-
return ;
147+
return null;
175148
}
176149
} catch (ApiException ex) {
177150
if(ex.getCode() == 404) {
178-
return ;
151+
return null;
179152
}
180153
else {
181154
throw ex;
@@ -268,7 +241,7 @@ public List<Pet> findPetsByStatus (String status) throws ApiException {
268241
try {
269242
String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, null, headerParams, contentType);
270243
if(response != null){
271-
return (List<Pet>) ApiInvoker.deserialize(response, "Array", Pet.class);
244+
return (List<Pet>) ApiInvoker.deserialize(response, "List", Pet.class);
272245
}
273246
else {
274247
return null;
@@ -302,7 +275,7 @@ public List<Pet> findPetsByTags (String tags) throws ApiException {
302275
try {
303276
String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, null, headerParams, contentType);
304277
if(response != null){
305-
return (List<Pet>) ApiInvoker.deserialize(response, "Array", Pet.class);
278+
return (List<Pet>) ApiInvoker.deserialize(response, "List", Pet.class);
306279
}
307280
else {
308281
return null;
@@ -316,5 +289,32 @@ public List<Pet> findPetsByTags (String tags) throws ApiException {
316289
}
317290
}
318291
}
292+
public void uploadFile (String additionalMetadata, File file) throws ApiException {
293+
// create path and map variables
294+
String path = "/pet/uploadImage".replaceAll("\\{format\\}","json");
295+
296+
// query params
297+
Map<String, String> queryParams = new HashMap<String, String>();
298+
Map<String, String> headerParams = new HashMap<String, String>();
299+
300+
String contentType = "application/json";
301+
302+
try {
303+
String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, null, headerParams, contentType);
304+
if(response != null){
305+
return ;
306+
}
307+
else {
308+
return ;
309+
}
310+
} catch (ApiException ex) {
311+
if(ex.getCode() == 404) {
312+
return ;
313+
}
314+
else {
315+
throw ex;
316+
}
317+
}
318+
}
319319
}
320320

samples/client/petstore/android-java/src/main/java/com/wordnik/petstore/api/StoreApi.java

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,14 @@ public String getBasePath() {
2626
return basePath;
2727
}
2828

29-
//error info- code: 400 reason: "Invalid ID supplied" model: <none>
30-
//error info- code: 404 reason: "Order not found" model: <none>
31-
public Order getOrderById (String orderId) throws ApiException {
29+
//error info- code: 400 reason: "Invalid order" model: <none>
30+
public void placeOrder (Order body) throws ApiException {
3231
// verify required params are set
33-
if(orderId == null ) {
32+
if(body == null ) {
3433
throw new ApiException(400, "missing required params");
3534
}
3635
// create path and map variables
37-
String path = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId.toString()));
36+
String path = "/store/order".replaceAll("\\{format\\}","json");
3837

3938
// query params
4039
Map<String, String> queryParams = new HashMap<String, String>();
@@ -43,16 +42,16 @@ public Order getOrderById (String orderId) throws ApiException {
4342
String contentType = "application/json";
4443

4544
try {
46-
String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, null, headerParams, contentType);
45+
String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, body, headerParams, contentType);
4746
if(response != null){
48-
return (Order) ApiInvoker.deserialize(response, "", Order.class);
47+
return ;
4948
}
5049
else {
51-
return null;
50+
return ;
5251
}
5352
} catch (ApiException ex) {
5453
if(ex.getCode() == 404) {
55-
return null;
54+
return ;
5655
}
5756
else {
5857
throw ex;
@@ -92,14 +91,15 @@ public void deleteOrder (String orderId) throws ApiException {
9291
}
9392
}
9493
}
95-
//error info- code: 400 reason: "Invalid order" model: <none>
96-
public void placeOrder (Order body) throws ApiException {
94+
//error info- code: 400 reason: "Invalid ID supplied" model: <none>
95+
//error info- code: 404 reason: "Order not found" model: <none>
96+
public Order getOrderById (String orderId) throws ApiException {
9797
// verify required params are set
98-
if(body == null ) {
98+
if(orderId == null ) {
9999
throw new ApiException(400, "missing required params");
100100
}
101101
// create path and map variables
102-
String path = "/store/order".replaceAll("\\{format\\}","json");
102+
String path = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId.toString()));
103103

104104
// query params
105105
Map<String, String> queryParams = new HashMap<String, String>();
@@ -108,16 +108,16 @@ public void placeOrder (Order body) throws ApiException {
108108
String contentType = "application/json";
109109

110110
try {
111-
String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, body, headerParams, contentType);
111+
String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, null, headerParams, contentType);
112112
if(response != null){
113-
return ;
113+
return (Order) ApiInvoker.deserialize(response, "", Order.class);
114114
}
115115
else {
116-
return ;
116+
return null;
117117
}
118118
} catch (ApiException ex) {
119119
if(ex.getCode() == 404) {
120-
return ;
120+
return null;
121121
}
122122
else {
123123
throw ex;

samples/client/petstore/android-java/src/main/java/com/wordnik/petstore/api/UserApi.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,13 +188,13 @@ public void logoutUser () throws ApiException {
188188
}
189189
}
190190
}
191-
public void createUser (User body) throws ApiException {
191+
public void createUsersWithArrayInput (List<User> body) throws ApiException {
192192
// verify required params are set
193193
if(body == null ) {
194194
throw new ApiException(400, "missing required params");
195195
}
196196
// create path and map variables
197-
String path = "/user".replaceAll("\\{format\\}","json");
197+
String path = "/user/createWithArray".replaceAll("\\{format\\}","json");
198198

199199
// query params
200200
Map<String, String> queryParams = new HashMap<String, String>();
@@ -219,13 +219,13 @@ public void createUser (User body) throws ApiException {
219219
}
220220
}
221221
}
222-
public void createUsersWithArrayInput (List<User> body) throws ApiException {
222+
public void createUsersWithListInput (List<User> body) throws ApiException {
223223
// verify required params are set
224224
if(body == null ) {
225225
throw new ApiException(400, "missing required params");
226226
}
227227
// create path and map variables
228-
String path = "/user/createWithArray".replaceAll("\\{format\\}","json");
228+
String path = "/user/createWithList".replaceAll("\\{format\\}","json");
229229

230230
// query params
231231
Map<String, String> queryParams = new HashMap<String, String>();
@@ -250,13 +250,13 @@ public void createUsersWithArrayInput (List<User> body) throws ApiException {
250250
}
251251
}
252252
}
253-
public void createUsersWithListInput (List<User> body) throws ApiException {
253+
public void createUser (User body) throws ApiException {
254254
// verify required params are set
255255
if(body == null ) {
256256
throw new ApiException(400, "missing required params");
257257
}
258258
// create path and map variables
259-
String path = "/user/createWithList".replaceAll("\\{format\\}","json");
259+
String path = "/user".replaceAll("\\{format\\}","json");
260260

261261
// query params
262262
Map<String, String> queryParams = new HashMap<String, String>();

0 commit comments

Comments
 (0)