diff --git a/src/main/resources/Java/JsonUtil.mustache b/src/main/resources/Java/JsonUtil.mustache new file mode 100644 index 00000000000..7be6b3c3ca9 --- /dev/null +++ b/src/main/resources/Java/JsonUtil.mustache @@ -0,0 +1,20 @@ +package {{invokerPackage}}; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.*; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.core.JsonGenerator.Feature; + +public class JsonUtil { + public static ObjectMapper mapper; + + static { + mapper = new ObjectMapper(); + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); + } + + public static ObjectMapper getJsonMapper() { + return mapper; + } +} diff --git a/src/main/resources/Java/apiInvoker.mustache b/src/main/resources/Java/apiInvoker.mustache index 781516eb56a..5267e0df0c4 100644 --- a/src/main/resources/Java/apiInvoker.mustache +++ b/src/main/resources/Java/apiInvoker.mustache @@ -1,7 +1,5 @@ package {{invokerPackage}}; -import com.wordnik.swagger.core.util.JsonUtil; - import com.fasterxml.jackson.core.JsonGenerator.Feature; import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.annotation.*; diff --git a/src/main/resources/Java/pom.mustache b/src/main/resources/Java/pom.mustache index 907976e6a42..b029cda8157 100644 --- a/src/main/resources/Java/pom.mustache +++ b/src/main/resources/Java/pom.mustache @@ -1,224 +1,234 @@ - 4.0.0 - com.wordnik - swagger-client - jar - swagger-client - 1.0 - - scm:git:git@github.com:wordnik/swagger-mustache.git - scm:git:git@github.com:wordnik/swagger-mustache.git - https://github.com/wordnik/swagger-mustache - - - 2.2.0 - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + 4.0.0 + com.wordnik + swagger-client + jar + swagger-client + 1.0 + + scm:git:git@github.com:wordnik/swagger-mustache.git + scm:git:git@github.com:wordnik/swagger-mustache.git + https://github.com/wordnik/swagger-mustache + + + 2.2.0 + - - - scala-tools.org - Scala-Tools Maven2 Repository - http://scala-tools.org/repo-releases - - - maven-mongodb-plugin-repo - maven mongodb plugin repository - http://maven-mongodb-plugin.googlecode.com/svn/maven/repo - default - - + + + scala-tools.org + Scala-Tools Maven2 Repository + http://scala-tools.org/repo-releases + + + maven-mongodb-plugin-repo + maven mongodb plugin repository + http://maven-mongodb-plugin.googlecode.com/svn/maven/repo + default + + - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.12 - - - - loggerPath - conf/log4j.properties - - - -Xms512m -Xmx1500m - methods - pertest - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory}/lib - - - - + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + pertest + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + - - - org.apache.maven.plugins - maven-jar-plugin - 2.2 - - - - jar - test-jar - - - - - - + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + jar + test-jar + + + + + + - - org.codehaus.mojo - build-helper-maven-plugin - - - add_sources - generate-sources - - add-source - - - - src/main/java - - - - - add_test_sources - generate-test-sources - - add-test-source - - - - src/test/java - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 2.3.2 - - 1.6 - 1.6 - - - - org.scala-tools - maven-scala-plugin - 2.15.2 - - - scala-compile-first - process-resources - - add-source - compile - - - - scala-test-compile - process-test-resources - - testCompile - - - - - - -Xms128m - -Xmx1500m - - - - - - - - - org.scala-tools - maven-scala-plugin - - ${scala-version} - - - - - + + org.codehaus.mojo + build-helper-maven-plugin + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 2.3.2 + + 1.6 + 1.6 + + + + org.scala-tools + maven-scala-plugin + 2.15.2 + + + scala-compile-first + process-resources + + add-source + compile + + + + scala-test-compile + process-test-resources + + testCompile + + + + + + -Xms128m + -Xmx1500m + + + + + + + + + org.scala-tools + maven-scala-plugin + + ${scala-version} + + + + + com.sun.jersey jersey-client ${jersey-version} compile - - org.scala-lang - scala-library - ${scala-version} - compile - - - com.wordnik - swagger-core_2.9.1 - ${swagger-core-version} - compile - - - org.scalatest - scalatest_2.9.1 - ${scala-test-version} - test - - - junit - junit - ${junit-version} - test - - - - - scala-tools.org - Scala-Tools Maven2 Repository - http://scala-tools.org/repo-releases - - - wordnik-ci-aws - https://ci.aws.wordnik.com/artifactory/libs-snapshots/ - - - wordnik-ci-aws-maven - https://ci.aws.wordnik.com/artifactory/m2-snapshots/ - - - wordnik-ci-aws-remote - https://ci.aws.wordnik.com/artifactory/remote-repos/ - - + + org.scala-lang + scala-library + ${scala-version} + + + org.scalatest + scalatest_2.9.1 + ${scala-test-version} + test + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson-version} + compile + + + com.fasterxml.jackson.core + jackson-core + ${jackson-version} + compile + + + com.fasterxml.jackson.core + jackson-databind + ${jackson-version} + compile + + + junit + junit + ${junit-version} + test + + + + + scala-tools.org + Scala-Tools Maven2 Repository + http://scala-tools.org/repo-releases + + + wordnik-ci-aws + https://ci.aws.wordnik.com/artifactory/libs-snapshots/ + + + wordnik-ci-aws-maven + https://ci.aws.wordnik.com/artifactory/m2-snapshots/ + + + wordnik-ci-aws-remote + https://ci.aws.wordnik.com/artifactory/remote-repos/ + + - + 1.7 - 1.1.0 - 2.9.1-1 - 4.8.1 - 1.0.0 - 1.6.1 - 4.8.1 - 1.6.1 - + 2.9.1-1 + 4.8.1 + 2.0.4 + 1.0.0 + 1.6.1 + +