moved to client dir

This commit is contained in:
Tony Tam 2012-09-23 16:34:59 -07:00
parent 1e8c4668b7
commit 611cc6075b
12 changed files with 11 additions and 8 deletions

View File

@ -11,7 +11,7 @@ object JavaPetstoreCodegen extends BasicJavaGenerator {
override def templateDir = "Java"
// where to write generated code
override def destinationDir = "samples/petstore/java/src/main/java"
override def destinationDir = "samples/client/petstore/java/src/main/java"
// package for models
override def modelPackage = Some("com.wordnik.petstore.model")
@ -22,7 +22,7 @@ object JavaPetstoreCodegen extends BasicJavaGenerator {
// supporting classes
override def supportingFiles =
List(
("apiInvoker.mustache", "samples/petstore/java/src/main/java/com/wordnik/client", "ApiInvoker.java"),
("apiException.mustache", "samples/petstore/java/src/main/java/com/wordnik/client", "ApiException.java"),
("pom.mustache", "samples/petstore/java", "pom.xml"))
("apiInvoker.mustache", "samples/client/petstore/java/src/main/java/com/wordnik/client", "ApiInvoker.java"),
("apiException.mustache", "samples/client/petstore/java/src/main/java/com/wordnik/client", "ApiException.java"),
("pom.mustache", "samples/client/petstore/java", "pom.xml"))
}

View File

@ -213,7 +213,7 @@
<properties>
<jersey-version>1.7</jersey-version>
<swagger-core-version>1.02-SNAPSHOT</swagger-core-version>
<swagger-core-version>1.1.0</swagger-core-version>
<scala-version>2.9.1-1</scala-version>
<junit-version>4.8.1</junit-version>
<maven-plugin.version>1.0.0</maven-plugin.version>

View File

@ -2,7 +2,10 @@ package com.wordnik.client;
import com.wordnik.swagger.core.util.JsonUtil;
import org.codehaus.jackson.type.JavaType;
import com.fasterxml.jackson.core.JsonGenerator.Feature;
import com.fasterxml.jackson.databind.*;
import com.fasterxml.jackson.annotation.*;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.sun.jersey.api.client.Client;
import com.sun.jersey.api.client.ClientResponse;
@ -38,7 +41,7 @@ public class ApiInvoker {
public static Object deserialize(String json, String containerType, Class cls) throws ApiException {
try{
if("List".equals(containerType)) {
JavaType typeInfo = org.codehaus.jackson.map.type.TypeFactory.collectionType(List.class, cls);
JavaType typeInfo = JsonUtil.getJsonMapper().getTypeFactory().constructCollectionType(List.class, cls);
List response = (List<?>) JsonUtil.getJsonMapper().readValue(json, typeInfo);
return response;
}
@ -128,4 +131,4 @@ public class ApiInvoker {
}
return hostMap.get(host);
}
}
}