diff --git a/bin/all-petstore.sh b/bin/all-petstore.sh index 716db5bae15..8b8fd96226f 100755 --- a/bin/all-petstore.sh +++ b/bin/all-petstore.sh @@ -18,20 +18,14 @@ if [ ! -d "${APP_DIR}" ]; then fi cd $APP_DIR -./bin/java-wordnik-api.sh -./bin/php-wordnik-api.sh -./bin/python3-wordnik-api.sh -./bin/objc-wordnik-api.sh -./bin/python-wordnik-api.sh -./bin/scala-wordnik-api.sh - ./bin/android-java-petstore.sh -./bin/csharp-petstore.sh -./bin/flash-petstore.sh +./bin/android-java-wordnik-api.sh +./bin/dynamic-html.sh +./bin/html.sh +./bin/jaxrs-petstore-server.sh +./bin/java-petstore-filemap.sh ./bin/java-petstore.sh +./bin/java-wordnik-api.sh ./bin/objc-petstore.sh -./bin/php-petstore.sh -./bin/python-petstore.sh -./bin/python3-petstore.sh -./bin/ruby-petstore.sh -./bin/scala-petstore.sh +./bin/objc-wordnik-api.sh +./bin/tizen-petstore.sh diff --git a/bin/android-java-petstore.sh b/bin/android-java-petstore.sh index 312953e7d81..5747ff49531 100755 --- a/bin/android-java-petstore.sh +++ b/bin/android-java-petstore.sh @@ -17,11 +17,20 @@ if [ ! -d "${APP_DIR}" ]; then APP_DIR=`cd "${APP_DIR}"; pwd` fi -cd $APP_DIR +root=./modules/swagger-codegen-distribution/pom.xml +# gets version of swagger-codegen +version=$(sed '//,/<\/project>/d;//!d;s/ *<\/\?version> *//g' $root | sed -n '2p' | sed -e 's,.*\([^<]*\).*,\1,g') + +executable="./modules/swagger-codegen-distribution/target/swagger-codegen-distribution-$version.jar" + +if [ ! -f "$executable" ] +then + mvn clean package +fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ com.wordnik.swagger.codegen.Codegen -i src/test/resources/petstore.json -l android -o samples/client/petstore/android-java" +ags="$@ -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l android -o samples/client/petstore/android-java" -java -cp $APP_DIR/target/*:$APP_DIR/target/lib/* $ags +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/android-java-wordnik-api.sh b/bin/android-java-wordnik-api.sh index aba96fb9096..3f2654a1685 100755 --- a/bin/android-java-wordnik-api.sh +++ b/bin/android-java-wordnik-api.sh @@ -1,7 +1,6 @@ #!/bin/sh SCRIPT="$0" -SCALA_RUNNER_VERSION=$(scala ./bin/Version.scala) while [ -h "$SCRIPT" ] ; do ls=`ls -ld "$SCRIPT"` @@ -18,15 +17,20 @@ if [ ! -d "${APP_DIR}" ]; then APP_DIR=`cd "${APP_DIR}"; pwd` fi -cd $APP_DIR +root=./modules/swagger-codegen-distribution/pom.xml +# gets version of swagger-codegen +version=$(sed '//,/<\/project>/d;//!d;s/ *<\/\?version> *//g' $root | sed -n '2p' | sed -e 's,.*\([^<]*\).*,\1,g') + +executable="./modules/swagger-codegen-distribution/target/swagger-codegen-distribution-$version.jar" + +if [ ! -f "$executable" ] +then + mvn clean package +fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ samples/client/petstore/android-java/AndroidJavaPetstoreCodegen.scala http://petstore.swagger.wordnik.com/api/api-docs special-key" +ags="$@ -i modules/swagger-codegen/src/test/resources/2_0/wordnik.json -l android -o samples/client/wordnik/android-java" -if [ -f $APP_DIR/target/scala-$SCALA_RUNNER_VERSION/*assembly*.jar ]; then - scala -cp target/scala-$SCALA_RUNNER_VERSION/*assembly*.jar $ags -else - echo "Please set scalaVersion := \"$SCALA_RUNNER_VERSION\" in build.sbt and run ./sbt assembly" -fi +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/dynamic-html.sh b/bin/dynamic-html.sh index 192cb6f0159..45dcedd5f69 100755 --- a/bin/dynamic-html.sh +++ b/bin/dynamic-html.sh @@ -17,11 +17,20 @@ if [ ! -d "${APP_DIR}" ]; then APP_DIR=`cd "${APP_DIR}"; pwd` fi -cd $APP_DIR +root=./modules/swagger-codegen-distribution/pom.xml +# gets version of swagger-codegen +version=$(sed '//,/<\/project>/d;//!d;s/ *<\/\?version> *//g' $root | sed -n '2p' | sed -e 's,.*\([^<]*\).*,\1,g') + +executable="./modules/swagger-codegen-distribution/target/swagger-codegen-distribution-$version.jar" + +if [ ! -f "$executable" ] +then + mvn clean package +fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ com.wordnik.swagger.codegen.Codegen -i http://petstore.swagger.wordnik.com/v2/swagger.json -l dynamic-html -o samples/swagger-dynamic-html" +ags="$@ -i http://petstore.swagger.wordnik.com/v2/swagger.json -l dynamic-html -o samples/swagger-dynamic-html" -java -cp $APP_DIR/target/*:$APP_DIR/target/lib/* $ags +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/html.sh b/bin/html.sh index d50a5cc7cf0..95c5e01411a 100755 --- a/bin/html.sh +++ b/bin/html.sh @@ -17,11 +17,20 @@ if [ ! -d "${APP_DIR}" ]; then APP_DIR=`cd "${APP_DIR}"; pwd` fi -cd $APP_DIR +root=./modules/swagger-codegen-distribution/pom.xml +# gets version of swagger-codegen +version=$(sed '//,/<\/project>/d;//!d;s/ *<\/\?version> *//g' $root | sed -n '2p' | sed -e 's,.*\([^<]*\).*,\1,g') + +executable="./modules/swagger-codegen-distribution/target/swagger-codegen-distribution-$version.jar" + +if [ ! -f "$executable" ] +then + mvn clean package +fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ com.wordnik.swagger.codegen.Codegen -i http://petstore.swagger.wordnik.com/v2/swagger.json -l html -o samples/swagger-html" +ags="$@ -i http://petstore.swagger.wordnik.com/v2/swagger.json -l html -o samples/swagger-html" -java -cp $APP_DIR/target/*:$APP_DIR/target/lib/* $ags +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/java-petstore-filemap.sh b/bin/java-petstore-filemap.sh index fbe0f86c210..04345b346ab 100755 --- a/bin/java-petstore-filemap.sh +++ b/bin/java-petstore-filemap.sh @@ -17,10 +17,20 @@ if [ ! -d "${APP_DIR}" ]; then APP_DIR=`cd "${APP_DIR}"; pwd` fi -cd $APP_DIR +root=./modules/swagger-codegen-distribution/pom.xml + +# gets version of swagger-codegen +version=$(sed '//,/<\/project>/d;//!d;s/ *<\/\?version> *//g' $root | sed -n '2p' | sed -e 's,.*\([^<]*\).*,\1,g') + +executable="./modules/swagger-codegen-distribution/target/swagger-codegen-distribution-$version.jar" + +if [ ! -f "$executable" ] +then + mvn clean package +fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ com.wordnik.swagger.codegen.Codegen -i src/test/resources/petstore.json -l java -o samples/client/petstore/java" +ags="$@ -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l java -o samples/client/petstore/java" -java -cp $APP_DIR/target/*:$APP_DIR/target/lib/* $ags +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/java-petstore.sh b/bin/java-petstore.sh index 8996c23faea..a3f15898492 100755 --- a/bin/java-petstore.sh +++ b/bin/java-petstore.sh @@ -17,10 +17,20 @@ if [ ! -d "${APP_DIR}" ]; then APP_DIR=`cd "${APP_DIR}"; pwd` fi -cd $APP_DIR +root=./modules/swagger-codegen-distribution/pom.xml + +# gets version of swagger-codegen +version=$(sed '//,/<\/project>/d;//!d;s/ *<\/\?version> *//g' $root | sed -n '2p' | sed -e 's,.*\([^<]*\).*,\1,g') + +executable="./modules/swagger-codegen-distribution/target/swagger-codegen-distribution-$version.jar" + +if [ ! -f "$executable" ] +then + mvn clean package +fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ com.wordnik.swagger.codegen.Codegen -i http://petstore.swagger.wordnik.com/v2/swagger.json -l java -o samples/client/petstore/java" +ags="$@ -i http://petstore.swagger.wordnik.com/v2/swagger.json -l java -o samples/client/petstore/java" -java -cp $APP_DIR/target/*:$APP_DIR/target/lib/* $ags +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/java-wordnik-api.sh b/bin/java-wordnik-api.sh index c1888f07fb0..b4cae8590bc 100755 --- a/bin/java-wordnik-api.sh +++ b/bin/java-wordnik-api.sh @@ -17,10 +17,20 @@ if [ ! -d "${APP_DIR}" ]; then APP_DIR=`cd "${APP_DIR}"; pwd` fi -cd $APP_DIR +root=./modules/swagger-codegen-distribution/pom.xml + +# gets version of swagger-codegen +version=$(sed '//,/<\/project>/d;//!d;s/ *<\/\?version> *//g' $root | sed -n '2p' | sed -e 's,.*\([^<]*\).*,\1,g') + +executable="./modules/swagger-codegen-distribution/target/swagger-codegen-distribution-$version.jar" + +if [ ! -f "$executable" ] +then + mvn clean package +fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ com.wordnik.swagger.codegen.Codegen -i src/test/resources/wordnik.json -l java" +ags="$@ -i modules/swagger-codegen/src/test/resources/2_0/wordnik.json -l java -o samples/client/wordnik/java" -java -cp $APP_DIR/target/*:$APP_DIR/target/lib/* $ags +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/jaxrs-petstore-server.sh b/bin/jaxrs-petstore-server.sh new file mode 100755 index 00000000000..066651aaca0 --- /dev/null +++ b/bin/jaxrs-petstore-server.sh @@ -0,0 +1,36 @@ +#!/bin/sh + +SCRIPT="$0" + +while [ -h "$SCRIPT" ] ; do + ls=`ls -ld "$SCRIPT"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=`dirname "$SCRIPT"`/"$link" + fi +done + +if [ ! -d "${APP_DIR}" ]; then + APP_DIR=`dirname "$SCRIPT"`/.. + APP_DIR=`cd "${APP_DIR}"; pwd` +fi + +root=./modules/swagger-codegen-distribution/pom.xml + +# gets version of swagger-codegen +version=$(sed '//,/<\/project>/d;//!d;s/ *<\/\?version> *//g' $root | sed -n '2p' | sed -e 's,.*\([^<]*\).*,\1,g') + +executable="./modules/swagger-codegen-distribution/target/swagger-codegen-distribution-$version.jar" + +if [ ! -f "$executable" ] +then + mvn clean package +fi + +# if you've executed sbt assembly previously it will use that instead. +export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" +ags="$@ -i http://petstore.swagger.wordnik.com/v2/swagger.json -l jaxrs -o samples/server/petstore/jaxrs -t modules/swagger-codegen/src/main/resources/JavaJaxRS" + +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/objc-petstore.sh b/bin/objc-petstore.sh index 199ef4fb7ad..d01aebcff67 100755 --- a/bin/objc-petstore.sh +++ b/bin/objc-petstore.sh @@ -17,10 +17,20 @@ if [ ! -d "${APP_DIR}" ]; then APP_DIR=`cd "${APP_DIR}"; pwd` fi -cd $APP_DIR +root=./modules/swagger-codegen-distribution/pom.xml + +# gets version of swagger-codegen +version=$(sed '//,/<\/project>/d;//!d;s/ *<\/\?version> *//g' $root | sed -n '2p' | sed -e 's,.*\([^<]*\).*,\1,g') + +executable="./modules/swagger-codegen-distribution/target/swagger-codegen-distribution-$version.jar" + +if [ ! -f "$executable" ] +then + mvn clean package +fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ com.wordnik.swagger.codegen.Codegen -i src/test/resources/petstore.json -l objc -o samples/client/petstore/objc -t src/main/resources/objc" +ags="$@ -i modules/swagger-codegen/src/test/resources/petstore.json -l objc -o samples/client/petstore/objc -t src/main/resources/objc" -java -cp $APP_DIR/target/*:$APP_DIR/target/lib/* $ags +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/objc-wordnik-api.sh b/bin/objc-wordnik-api.sh index cde5fb50fc2..68eb1b8226d 100755 --- a/bin/objc-wordnik-api.sh +++ b/bin/objc-wordnik-api.sh @@ -17,10 +17,20 @@ if [ ! -d "${APP_DIR}" ]; then APP_DIR=`cd "${APP_DIR}"; pwd` fi -cd $APP_DIR +root=./modules/swagger-codegen-distribution/pom.xml + +# gets version of swagger-codegen +version=$(sed '//,/<\/project>/d;//!d;s/ *<\/\?version> *//g' $root | sed -n '2p' | sed -e 's,.*\([^<]*\).*,\1,g') + +executable="./modules/swagger-codegen-distribution/target/swagger-codegen-distribution-$version.jar" + +if [ ! -f "$executable" ] +then + mvn clean package +fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ com.wordnik.swagger.codegen.Codegen -i src/test/resources/wordnik.json -l objc" +ags="$@ -i modules/swagger-codegen/src/test/resources/2_0/wordnik.json -l objc -o samples/client/wordnik/objc" -java -cp $APP_DIR/target/*:$APP_DIR/target/lib/* $ags +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/tizen-petstore.sh b/bin/tizen-petstore.sh index 6026e0ca7b1..97ba32ae721 100755 --- a/bin/tizen-petstore.sh +++ b/bin/tizen-petstore.sh @@ -17,10 +17,20 @@ if [ ! -d "${APP_DIR}" ]; then APP_DIR=`cd "${APP_DIR}"; pwd` fi -cd $APP_DIR +root=./modules/swagger-codegen-distribution/pom.xml + +# gets version of swagger-codegen +version=$(sed '//,/<\/project>/d;//!d;s/ *<\/\?version> *//g' $root | sed -n '2p' | sed -e 's,.*\([^<]*\).*,\1,g') + +executable="./modules/swagger-codegen-distribution/target/swagger-codegen-distribution-$version.jar" + +if [ ! -f "$executable" ] +then + mvn clean package +fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ com.wordnik.swagger.codegen.Codegen -i http://petstore.swagger.wordnik.com/v2/swagger.json -l tizen -o samples/client/petstore/tizen" +ags="$@ -i http://petstore.swagger.wordnik.com/v2/swagger.json -l tizen -o samples/client/petstore/tizen" -java -cp $APP_DIR/target/*:$APP_DIR/target/lib/* $ags +java $JAVA_OPTS -jar $executable $ags diff --git a/modules/swagger-codegen-distribution/pom.xml b/modules/swagger-codegen-distribution/pom.xml new file mode 100644 index 00000000000..a70a79c27e1 --- /dev/null +++ b/modules/swagger-codegen-distribution/pom.xml @@ -0,0 +1,63 @@ + + + com.wordnik + swagger-codegen-project + 2.1.0-SNAPSHOT + ../.. + + 4.0.0 + com.wordnik + swagger-codegen-distribution + jar + swagger-codegen-distribution + 2.1.0-SNAPSHOT + + src/test/scala + target/classes + target/test-classes + install + target + ${project.artifactId}-${project.version} + + + + org.apache.maven.plugins + maven-shade-plugin + 2.3 + + + package + + shade + + + false + true + + ${java.io.tmpdir}/dependency-reduced-pom.xml + + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + com.wordnik.swagger.codegen.Codegen + + + + + + + + + com.wordnik + swagger-codegen + ${project.parent.version} + + + \ No newline at end of file diff --git a/modules/swagger-codegen/pom.xml b/modules/swagger-codegen/pom.xml new file mode 100644 index 00000000000..9ca956c85a2 --- /dev/null +++ b/modules/swagger-codegen/pom.xml @@ -0,0 +1,391 @@ + + + com.wordnik + swagger-codegen-project + 2.1.0-SNAPSHOT + ../.. + + 4.0.0 + com.wordnik + swagger-codegen + jar + swagger-codegen (core library) + 2.1.0-SNAPSHOT + + src/main/java + install + + + org.jvnet.wagon-svn + wagon-svn + 1.8 + + + org.apache.maven.wagon + wagon-ssh-external + 1.0-alpha-6 + + + org.apache.maven.wagon + wagon-webdav + 1.0-beta-1 + + + target + ${project.artifactId}-${project.version} + + + org.codehaus.mojo + exec-maven-plugin + 1.3.2 + + + + java + + + + + com.wordnik.swagger.codegen.Codegen + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + com.wordnik.swagger.codegen.Codegen + + + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + net.alchim31.maven + scala-maven-plugin + + + + add-source + compile + testCompile + + + + + + incremental + + + -Xmx384m + + + -target:jvm-1.6 + -deprecation + + + + run-scalatest + org.scalatest.tools.Runner + + -p + ${project.build.testOutputDirectory} + + + -Xmx512m + + + + + + + org.apache.maven.plugins + maven-source-plugin + 2.1.2 + + + attach-sources + verify + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.7 + + true + 1.6 + UTF-8 + 1g + + http://java.sun.com/javase/6/docs/api/ + + ${javadoc.package.exclude} + + + + attach-javadocs + verify + + jar + + + + + + maven-compiler-plugin + 3.0 + + 1.6 + 1.6 + + + + org.apache.maven.plugins + maven-jar-plugin + 2.4 + + + + development + ${project.url} + ${project.version} + com.wordnik + + + + + + org.apache.maven.plugins + maven-site-plugin + 2.1 + + + org.apache.maven.plugins + maven-release-plugin + 2.1 + + + + + + net.alchim31.maven + scala-maven-plugin + ${scala-maven-plugin-version} + + + org.apache.maven.plugins + maven-gpg-plugin + + release + sign + + + + + + + + release-profile + + true + + + + + net.alchim31.maven + scala-maven-plugin + + + + compile + testCompile + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + add-source + prepare-package + + add-source + + + + src/main/scala + + + + + + + + + + release-sign-artifacts + + + performRelease + true + + + + + + org.apache.maven.plugins + maven-gpg-plugin + + + sign-artifacts + verify + + sign + + + + + + + + + + target/site + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.9 + + true + true + + http://java.sun.com/javaee/5/docs/api + http://java.sun.com/j2se/1.5.0/docs/api + + + + + + net.alchim31.maven + scala-maven-plugin + ${scala-maven-plugin-version} + + + org.apache.maven.plugins + maven-jxr-plugin + 2.3 + + true + + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 2.6 + + + + project-team + + + + + + + + + io.swagger + swagger-parser + ${swagger-parser-version} + + + io.swagger + swagger-legacy-spec-parser + ${swagger-parser-version} + + + ${project.groupId} + swagger-core + ${swagger-core-version} + + + com.samskivert + jmustache + ${jmustache-version} + + + commons-io + commons-io + ${commons-io-version} + + + org.apache.maven + maven-plugin-tools-api + 2.0 + + + org.apache.felix + maven-bundle-plugin + ${felix-version} + + + org.slf4j + slf4j-ext + ${slf4j-version} + + + org.slf4j + slf4j-api + ${slf4j-version} + + + commons-lang + commons-lang + ${commons-lang-version} + + + commons-cli + commons-cli + ${commons-cli-version} + + + org.scalatest + scalatest_2.11 + ${scala-test-version} + test + + + + + sonatype-snapshots + https://oss.sonatype.org/content/repositories/snapshots + + true + + + + diff --git a/src/main/java/com/wordnik/swagger/codegen/ClientOptInput.java b/modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/ClientOptInput.java similarity index 100% rename from src/main/java/com/wordnik/swagger/codegen/ClientOptInput.java rename to modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/ClientOptInput.java diff --git a/src/main/java/com/wordnik/swagger/codegen/ClientOpts.java b/modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/ClientOpts.java similarity index 100% rename from src/main/java/com/wordnik/swagger/codegen/ClientOpts.java rename to modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/ClientOpts.java diff --git a/src/main/java/com/wordnik/swagger/codegen/Codegen.java b/modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/Codegen.java similarity index 100% rename from src/main/java/com/wordnik/swagger/codegen/Codegen.java rename to modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/Codegen.java diff --git a/src/main/java/com/wordnik/swagger/codegen/CodegenConfig.java b/modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/CodegenConfig.java similarity index 100% rename from src/main/java/com/wordnik/swagger/codegen/CodegenConfig.java rename to modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/CodegenConfig.java diff --git a/src/main/java/com/wordnik/swagger/codegen/CodegenModel.java b/modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/CodegenModel.java similarity index 100% rename from src/main/java/com/wordnik/swagger/codegen/CodegenModel.java rename to modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/CodegenModel.java diff --git a/src/main/java/com/wordnik/swagger/codegen/CodegenModelFactory.java b/modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/CodegenModelFactory.java similarity index 100% rename from src/main/java/com/wordnik/swagger/codegen/CodegenModelFactory.java rename to modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/CodegenModelFactory.java diff --git a/src/main/java/com/wordnik/swagger/codegen/CodegenModelType.java b/modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/CodegenModelType.java similarity index 100% rename from src/main/java/com/wordnik/swagger/codegen/CodegenModelType.java rename to modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/CodegenModelType.java diff --git a/src/main/java/com/wordnik/swagger/codegen/CodegenOperation.java b/modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/CodegenOperation.java similarity index 100% rename from src/main/java/com/wordnik/swagger/codegen/CodegenOperation.java rename to modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/CodegenOperation.java diff --git a/src/main/java/com/wordnik/swagger/codegen/CodegenParameter.java b/modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/CodegenParameter.java similarity index 100% rename from src/main/java/com/wordnik/swagger/codegen/CodegenParameter.java rename to modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/CodegenParameter.java diff --git a/src/main/java/com/wordnik/swagger/codegen/CodegenProperty.java b/modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/CodegenProperty.java similarity index 100% rename from src/main/java/com/wordnik/swagger/codegen/CodegenProperty.java rename to modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/CodegenProperty.java diff --git a/src/main/java/com/wordnik/swagger/codegen/CodegenResponse.java b/modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/CodegenResponse.java similarity index 100% rename from src/main/java/com/wordnik/swagger/codegen/CodegenResponse.java rename to modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/CodegenResponse.java diff --git a/src/main/java/com/wordnik/swagger/codegen/DefaultCodegen.java b/modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/DefaultCodegen.java similarity index 97% rename from src/main/java/com/wordnik/swagger/codegen/DefaultCodegen.java rename to modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/DefaultCodegen.java index e89b0f0b26f..92ff8129ef4 100644 --- a/src/main/java/com/wordnik/swagger/codegen/DefaultCodegen.java +++ b/modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/DefaultCodegen.java @@ -7,9 +7,14 @@ import com.wordnik.swagger.util.Json; import org.apache.commons.lang.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.util.*; public class DefaultCodegen { + Logger LOGGER = LoggerFactory.getLogger(DefaultCodegen.class); + protected String outputFolder = ""; protected Set defaultIncludes = new HashSet(); protected Map typeMapping = new HashMap(); @@ -375,7 +380,7 @@ public class DefaultCodegen { Property prop = impl.getProperties().get(key); if(prop == null) { - System.out.println("null property for " + key); + LOGGER.warn("null property for " + key); } else { CodegenProperty cp = fromProperty(key, prop); @@ -422,7 +427,7 @@ public class DefaultCodegen { public CodegenProperty fromProperty(String name, Property p) { if(p == null) { - System.out.println("unexpected missing property for name " + null); + LOGGER.error("unexpected missing property for name " + null); return null; } CodegenProperty property = CodegenModelFactory.newInstance(CodegenModelType.PROPERTY); @@ -481,8 +486,7 @@ public class DefaultCodegen { ArrayProperty ap = (ArrayProperty) p; CodegenProperty cp = fromProperty("inner", ap.getItems()); if(cp == null) { - System.out.println("skipping invalid property:"); - Json.prettyPrint(p); + LOGGER.warn("skipping invalid property " + Json.pretty(p)); } else { property.baseType = getSwaggerType(p); @@ -540,7 +544,7 @@ public class DefaultCodegen { } } operationId = builder.toString(); - System.out.println("generated operationId " + operationId); + LOGGER.warn("generated operationId " + operationId); } op.path = path; op.operationId = operationId; @@ -741,7 +745,7 @@ public class DefaultCodegen { if("array".equals(qp.getType())) { Property inner = qp.getItems(); if(inner == null) { - System.out.println("warning! No inner type supplied for array parameter \"" + qp.getName() + "\", using String"); + LOGGER.warn("warning! No inner type supplied for array parameter \"" + qp.getName() + "\", using String"); inner = new StringProperty().description("//TODO automatically added by swagger-codegen"); } property = new ArrayProperty(inner); @@ -753,7 +757,7 @@ public class DefaultCodegen { else property = PropertyBuilder.build(qp.getType(), qp.getFormat(), null); if(property == null) { - System.out.println("warning! Property type \"" + qp.getType() + "\" not found for parameter \"" + param.getName() + "\", using String"); + LOGGER.warn("warning! Property type \"" + qp.getType() + "\" not found for parameter \"" + param.getName() + "\", using String"); property = new StringProperty().description("//TODO automatically added by swagger-codegen. Type was " + qp.getType() + " but not supported"); } CodegenProperty model = fromProperty(qp.getName(), property); diff --git a/src/main/java/com/wordnik/swagger/codegen/DefaultGenerator.java b/modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/DefaultGenerator.java similarity index 100% rename from src/main/java/com/wordnik/swagger/codegen/DefaultGenerator.java rename to modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/DefaultGenerator.java diff --git a/src/main/java/com/wordnik/swagger/codegen/Generator.java b/modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/Generator.java similarity index 100% rename from src/main/java/com/wordnik/swagger/codegen/Generator.java rename to modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/Generator.java diff --git a/src/main/java/com/wordnik/swagger/codegen/SupportingFile.java b/modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/SupportingFile.java similarity index 100% rename from src/main/java/com/wordnik/swagger/codegen/SupportingFile.java rename to modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/SupportingFile.java diff --git a/src/main/java/com/wordnik/swagger/codegen/auth/AuthMethod.java b/modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/auth/AuthMethod.java similarity index 100% rename from src/main/java/com/wordnik/swagger/codegen/auth/AuthMethod.java rename to modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/auth/AuthMethod.java diff --git a/modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/haproxy.cfg b/modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/haproxy.cfg new file mode 100644 index 00000000000..9fd8d61f2ce --- /dev/null +++ b/modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/haproxy.cfg @@ -0,0 +1,86 @@ +#--------------------------------------------------------------------- +# Global settings +#--------------------------------------------------------------------- +global + log 127.0.0.1 local2 + chroot /var/lib/haproxy + pidfile /var/run/haproxy.pid + maxconn 4000 + user haproxy + group haproxy + daemon + +#--------------------------------------------------------------------- +# common defaults that all the 'listen' and 'backend' sections will +# use if not designated in their block +#--------------------------------------------------------------------- +defaults + mode http + log global + option dontlognull + option httpclose + option httplog + option forwardfor + option redispatch + timeout connect 10000 # default 10 second time out if a backend is not found + timeout client 300000 + timeout server 300000 + maxconn 60000 + retries 3 + +#--------------------------------------------------------------------- +# main frontend which proxys to the backends +#--------------------------------------------------------------------- +frontend main *:80 + default_backend app + + acl is_swagger_online hdr_beg(host) -i online.swagger.io + acl is_swagger_io hdr_beg(host) -i swagger.io + acl is_old hdr_beg(host) -i swagger.wordnik.com + acl is_old_editor hdr_beg(host) -i editor.swagger.wordnik.com + acl is_validator_swagger path_beg /swagger.json + + # online spec validator + reqrep ([^\ ]*)\ /validator/(.*) \1\ /validator/validator/\2 if is_swagger_online + + # something that didn't work + reqrep ([^\ ]*)\ /swagger.json(.*) \1\ /validator/swagger.json if is_validator_swagger + + # swagger schema + reqrep ^([^\ :]*)\ /v2/schema.json(.*) \1\ /swagger-api/swagger-spec/master/schemas/v2.0/schema.json\2 + acl is_swagger_spec path_beg /swagger-api/swagger-spec + + # swagger docs + reqrep ^([^\ :]*)\ /swagger-core/documentation/annotations/apidocs/current(.*) \1\ /swagger-core/apidocs/\2 + acl is_swagger_docs path_beg /swagger-core/apidocs + + use_backend github_swagger_io if is_swagger_docs + use_backend validator if is_swagger_online + use_backend validator if is_validator_swagger + use_backend github_swagger_io if is_swagger_io !is_swagger_spec + use_backend github_swagger_spec if is_swagger_spec + + redirect location http://editor.swagger.io if is_old_editor + redirect location http://swagger.io if is_old + +#--------------------------------------------------------------------- +# round robin balancing between the various backends +#--------------------------------------------------------------------- +backend github_swagger_io + balance roundrobin + server gh1 swagger-api.github.io:80 check + +backend github_swagger_spec + http-request set-header Host raw.githubusercontent.com + rspirep ^Content-type:(.*) Content-Type:\ application/json + rspirep ^Access-Control-Allow-Origin:(.*) Access-Control-Allow-Origin:* + balance roundrobin + server gh2 raw.githubusercontent.com:443 check ssl verify none + +backend validator + balance roundrobin + server app1 127.0.0.1:8000 check + +backend app + balance roundrobin + server app1 127.0.0.1:8000 check diff --git a/src/main/java/com/wordnik/swagger/codegen/languages/AndroidClientCodegen.java b/modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/languages/AndroidClientCodegen.java similarity index 100% rename from src/main/java/com/wordnik/swagger/codegen/languages/AndroidClientCodegen.java rename to modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/languages/AndroidClientCodegen.java diff --git a/src/main/java/com/wordnik/swagger/codegen/languages/JavaClientCodegen.java b/modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/languages/JavaClientCodegen.java similarity index 100% rename from src/main/java/com/wordnik/swagger/codegen/languages/JavaClientCodegen.java rename to modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/languages/JavaClientCodegen.java diff --git a/src/main/java/com/wordnik/swagger/codegen/languages/JaxRSServerCodegen.java b/modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/languages/JaxRSServerCodegen.java similarity index 87% rename from src/main/java/com/wordnik/swagger/codegen/languages/JaxRSServerCodegen.java rename to modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/languages/JaxRSServerCodegen.java index 6c805e993c9..3e6702a8473 100644 --- a/src/main/java/com/wordnik/swagger/codegen/languages/JaxRSServerCodegen.java +++ b/modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/languages/JaxRSServerCodegen.java @@ -10,8 +10,8 @@ import java.util.*; import java.io.File; public class JaxRSServerCodegen extends JavaClientCodegen implements CodegenConfig { - protected String invokerPackage = "com.wordnik.api"; - protected String groupId = "com.wordnik"; + protected String invokerPackage = "io.swagger.api"; + protected String groupId = "io.swagger"; protected String artifactId = "swagger-server"; protected String artifactVersion = "1.0.0"; protected String sourceFolder = "src/main/java"; @@ -31,8 +31,8 @@ public class JaxRSServerCodegen extends JavaClientCodegen implements CodegenConf modelTemplateFiles.put("model.mustache", ".java"); apiTemplateFiles.put("api.mustache", ".java"); templateDir = "JavaJaxRS"; - apiPackage = "com.wordnik.api"; - modelPackage = "com.wordnik.model"; + apiPackage = "io.swagger.api"; + modelPackage = "io.swagger.model"; additionalProperties.put("invokerPackage", invokerPackage); additionalProperties.put("groupId", groupId); @@ -66,6 +66,22 @@ public class JaxRSServerCodegen extends JavaClientCodegen implements CodegenConf ); } + @Override + public String getTypeDeclaration(Property p) { + if(p instanceof ArrayProperty) { + ArrayProperty ap = (ArrayProperty) p; + Property inner = ap.getItems(); + return getSwaggerType(p) + "<" + getTypeDeclaration(inner) + ">"; + } + else if (p instanceof MapProperty) { + MapProperty mp = (MapProperty) p; + Property inner = mp.getAdditionalProperties(); + + return getTypeDeclaration(inner); + } + return super.getTypeDeclaration(p); + } + @Override public void addOperationToGroup(String tag, String resourcePath, Operation operation, CodegenOperation co, Map> operations) { String basePath = resourcePath; diff --git a/src/main/java/com/wordnik/swagger/codegen/languages/NodeJSServerCodegen.java b/modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/languages/NodeJSServerCodegen.java similarity index 100% rename from src/main/java/com/wordnik/swagger/codegen/languages/NodeJSServerCodegen.java rename to modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/languages/NodeJSServerCodegen.java diff --git a/src/main/java/com/wordnik/swagger/codegen/languages/ObjcClientCodegen.java b/modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/languages/ObjcClientCodegen.java similarity index 100% rename from src/main/java/com/wordnik/swagger/codegen/languages/ObjcClientCodegen.java rename to modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/languages/ObjcClientCodegen.java diff --git a/src/main/java/com/wordnik/swagger/codegen/languages/PhpClientCodegen.java b/modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/languages/PhpClientCodegen.java similarity index 100% rename from src/main/java/com/wordnik/swagger/codegen/languages/PhpClientCodegen.java rename to modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/languages/PhpClientCodegen.java diff --git a/src/main/java/com/wordnik/swagger/codegen/languages/PythonClientCodegen.java b/modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/languages/PythonClientCodegen.java similarity index 100% rename from src/main/java/com/wordnik/swagger/codegen/languages/PythonClientCodegen.java rename to modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/languages/PythonClientCodegen.java diff --git a/src/main/java/com/wordnik/swagger/codegen/languages/ScalaClientCodegen.java b/modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/languages/ScalaClientCodegen.java similarity index 100% rename from src/main/java/com/wordnik/swagger/codegen/languages/ScalaClientCodegen.java rename to modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/languages/ScalaClientCodegen.java diff --git a/src/main/java/com/wordnik/swagger/codegen/languages/ScalatraServerCodegen.java b/modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/languages/ScalatraServerCodegen.java similarity index 100% rename from src/main/java/com/wordnik/swagger/codegen/languages/ScalatraServerCodegen.java rename to modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/languages/ScalatraServerCodegen.java diff --git a/src/main/java/com/wordnik/swagger/codegen/languages/StaticDocCodegen.java b/modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/languages/StaticDocCodegen.java similarity index 100% rename from src/main/java/com/wordnik/swagger/codegen/languages/StaticDocCodegen.java rename to modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/languages/StaticDocCodegen.java diff --git a/src/main/java/com/wordnik/swagger/codegen/languages/StaticHtmlGenerator.java b/modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/languages/StaticHtmlGenerator.java similarity index 100% rename from src/main/java/com/wordnik/swagger/codegen/languages/StaticHtmlGenerator.java rename to modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/languages/StaticHtmlGenerator.java diff --git a/src/main/java/com/wordnik/swagger/codegen/languages/SwaggerGenerator.java b/modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/languages/SwaggerGenerator.java similarity index 100% rename from src/main/java/com/wordnik/swagger/codegen/languages/SwaggerGenerator.java rename to modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/languages/SwaggerGenerator.java diff --git a/src/main/java/com/wordnik/swagger/codegen/languages/TizenClientCodegen.java b/modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/languages/TizenClientCodegen.java similarity index 100% rename from src/main/java/com/wordnik/swagger/codegen/languages/TizenClientCodegen.java rename to modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/languages/TizenClientCodegen.java diff --git a/src/main/resources/Groovy/ApiUtils.mustache b/modules/swagger-codegen/src/main/resources/Groovy/ApiUtils.mustache similarity index 100% rename from src/main/resources/Groovy/ApiUtils.mustache rename to modules/swagger-codegen/src/main/resources/Groovy/ApiUtils.mustache diff --git a/src/main/resources/Groovy/api.mustache b/modules/swagger-codegen/src/main/resources/Groovy/api.mustache similarity index 100% rename from src/main/resources/Groovy/api.mustache rename to modules/swagger-codegen/src/main/resources/Groovy/api.mustache diff --git a/src/main/resources/Groovy/build.gradle.mustache b/modules/swagger-codegen/src/main/resources/Groovy/build.gradle.mustache similarity index 100% rename from src/main/resources/Groovy/build.gradle.mustache rename to modules/swagger-codegen/src/main/resources/Groovy/build.gradle.mustache diff --git a/src/main/resources/Groovy/model.mustache b/modules/swagger-codegen/src/main/resources/Groovy/model.mustache similarity index 100% rename from src/main/resources/Groovy/model.mustache rename to modules/swagger-codegen/src/main/resources/Groovy/model.mustache diff --git a/src/main/resources/Java/JsonUtil.mustache b/modules/swagger-codegen/src/main/resources/Java/JsonUtil.mustache similarity index 100% rename from src/main/resources/Java/JsonUtil.mustache rename to modules/swagger-codegen/src/main/resources/Java/JsonUtil.mustache diff --git a/src/main/resources/Java/api.mustache b/modules/swagger-codegen/src/main/resources/Java/api.mustache similarity index 100% rename from src/main/resources/Java/api.mustache rename to modules/swagger-codegen/src/main/resources/Java/api.mustache diff --git a/src/main/resources/Java/apiException.mustache b/modules/swagger-codegen/src/main/resources/Java/apiException.mustache similarity index 100% rename from src/main/resources/Java/apiException.mustache rename to modules/swagger-codegen/src/main/resources/Java/apiException.mustache diff --git a/src/main/resources/Java/apiInvoker.mustache b/modules/swagger-codegen/src/main/resources/Java/apiInvoker.mustache similarity index 100% rename from src/main/resources/Java/apiInvoker.mustache rename to modules/swagger-codegen/src/main/resources/Java/apiInvoker.mustache diff --git a/src/main/resources/Java/model.mustache b/modules/swagger-codegen/src/main/resources/Java/model.mustache similarity index 100% rename from src/main/resources/Java/model.mustache rename to modules/swagger-codegen/src/main/resources/Java/model.mustache diff --git a/src/main/resources/Java/pom.mustache b/modules/swagger-codegen/src/main/resources/Java/pom.mustache similarity index 100% rename from src/main/resources/Java/pom.mustache rename to modules/swagger-codegen/src/main/resources/Java/pom.mustache diff --git a/src/main/resources/JavaJaxRS/ApiException.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/ApiException.mustache similarity index 100% rename from src/main/resources/JavaJaxRS/ApiException.mustache rename to modules/swagger-codegen/src/main/resources/JavaJaxRS/ApiException.mustache diff --git a/src/main/resources/JavaJaxRS/ApiOriginFilter.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/ApiOriginFilter.mustache similarity index 100% rename from src/main/resources/JavaJaxRS/ApiOriginFilter.mustache rename to modules/swagger-codegen/src/main/resources/JavaJaxRS/ApiOriginFilter.mustache diff --git a/src/main/resources/JavaJaxRS/ApiResponseMessage.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/ApiResponseMessage.mustache similarity index 100% rename from src/main/resources/JavaJaxRS/ApiResponseMessage.mustache rename to modules/swagger-codegen/src/main/resources/JavaJaxRS/ApiResponseMessage.mustache diff --git a/src/main/resources/JavaJaxRS/NotFoundException.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/NotFoundException.mustache similarity index 100% rename from src/main/resources/JavaJaxRS/NotFoundException.mustache rename to modules/swagger-codegen/src/main/resources/JavaJaxRS/NotFoundException.mustache diff --git a/src/main/resources/JavaJaxRS/README.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/README.mustache similarity index 100% rename from src/main/resources/JavaJaxRS/README.mustache rename to modules/swagger-codegen/src/main/resources/JavaJaxRS/README.mustache diff --git a/src/main/resources/JavaJaxRS/api.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/api.mustache similarity index 98% rename from src/main/resources/JavaJaxRS/api.mustache rename to modules/swagger-codegen/src/main/resources/JavaJaxRS/api.mustache index fe287c9ddfe..ce99acb1f39 100644 --- a/src/main/resources/JavaJaxRS/api.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/api.mustache @@ -23,6 +23,7 @@ public class {{classname}} { {{#subresourceOperation}}@Path("{{path}}"){{/subresourceOperation}} {{#hasConsumes}}@Consumes({ {{#consumes}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}} {{#hasProduces}}@Produces({ {{#produces}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}} + // {{returnType}} @ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", response = {{{returnType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}) @ApiResponses(value = { {{#responses}} @ApiResponse(code = {{{code}}}, message = "{{{message}}}"){{#hasMore}}, diff --git a/src/main/resources/JavaJaxRS/bodyParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/bodyParams.mustache similarity index 100% rename from src/main/resources/JavaJaxRS/bodyParams.mustache rename to modules/swagger-codegen/src/main/resources/JavaJaxRS/bodyParams.mustache diff --git a/src/main/resources/JavaJaxRS/formParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/formParams.mustache similarity index 100% rename from src/main/resources/JavaJaxRS/formParams.mustache rename to modules/swagger-codegen/src/main/resources/JavaJaxRS/formParams.mustache diff --git a/src/main/resources/JavaJaxRS/headerParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/headerParams.mustache similarity index 100% rename from src/main/resources/JavaJaxRS/headerParams.mustache rename to modules/swagger-codegen/src/main/resources/JavaJaxRS/headerParams.mustache diff --git a/src/main/resources/JavaJaxRS/model.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/model.mustache similarity index 100% rename from src/main/resources/JavaJaxRS/model.mustache rename to modules/swagger-codegen/src/main/resources/JavaJaxRS/model.mustache diff --git a/src/main/resources/JavaJaxRS/pathParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/pathParams.mustache similarity index 100% rename from src/main/resources/JavaJaxRS/pathParams.mustache rename to modules/swagger-codegen/src/main/resources/JavaJaxRS/pathParams.mustache diff --git a/src/main/resources/JavaJaxRS/pom.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/pom.mustache similarity index 94% rename from src/main/resources/JavaJaxRS/pom.mustache rename to modules/swagger-codegen/src/main/resources/JavaJaxRS/pom.mustache index e0782610efd..a33f899e02c 100644 --- a/src/main/resources/JavaJaxRS/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/pom.mustache @@ -123,14 +123,8 @@ ${servlet-api-version} - - - sonatype-snapshots - https://oss.sonatype.org/content/repositories/snapshots - - - 1.5.0-SNAPSHOT + 1.5.0-M1 8.1.11.v20130520 1.13 1.6.3 diff --git a/src/main/resources/JavaJaxRS/project/build.properties b/modules/swagger-codegen/src/main/resources/JavaJaxRS/project/build.properties similarity index 100% rename from src/main/resources/JavaJaxRS/project/build.properties rename to modules/swagger-codegen/src/main/resources/JavaJaxRS/project/build.properties diff --git a/src/main/resources/JavaJaxRS/project/plugins.sbt b/modules/swagger-codegen/src/main/resources/JavaJaxRS/project/plugins.sbt similarity index 100% rename from src/main/resources/JavaJaxRS/project/plugins.sbt rename to modules/swagger-codegen/src/main/resources/JavaJaxRS/project/plugins.sbt diff --git a/src/main/resources/JavaJaxRS/queryParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/queryParams.mustache similarity index 100% rename from src/main/resources/JavaJaxRS/queryParams.mustache rename to modules/swagger-codegen/src/main/resources/JavaJaxRS/queryParams.mustache diff --git a/src/main/resources/JavaJaxRS/web.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/web.mustache similarity index 96% rename from src/main/resources/JavaJaxRS/web.mustache rename to modules/swagger-codegen/src/main/resources/JavaJaxRS/web.mustache index b9cd00b71ce..f6181046dda 100644 --- a/src/main/resources/JavaJaxRS/web.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/web.mustache @@ -45,7 +45,7 @@ ApiOriginFilter - com.wordnik.api.ApiOriginFilter + {{apiPackage}}.ApiOriginFilter ApiOriginFilter diff --git a/src/main/resources/META-INF/services/com.wordnik.swagger.codegen.CodegenConfig b/modules/swagger-codegen/src/main/resources/META-INF/services/com.wordnik.swagger.codegen.CodegenConfig similarity index 100% rename from src/main/resources/META-INF/services/com.wordnik.swagger.codegen.CodegenConfig rename to modules/swagger-codegen/src/main/resources/META-INF/services/com.wordnik.swagger.codegen.CodegenConfig diff --git a/src/main/resources/android-java/api.mustache b/modules/swagger-codegen/src/main/resources/android-java/api.mustache similarity index 100% rename from src/main/resources/android-java/api.mustache rename to modules/swagger-codegen/src/main/resources/android-java/api.mustache diff --git a/src/main/resources/android-java/apiException.mustache b/modules/swagger-codegen/src/main/resources/android-java/apiException.mustache similarity index 100% rename from src/main/resources/android-java/apiException.mustache rename to modules/swagger-codegen/src/main/resources/android-java/apiException.mustache diff --git a/src/main/resources/android-java/apiInvoker.mustache b/modules/swagger-codegen/src/main/resources/android-java/apiInvoker.mustache similarity index 100% rename from src/main/resources/android-java/apiInvoker.mustache rename to modules/swagger-codegen/src/main/resources/android-java/apiInvoker.mustache diff --git a/src/main/resources/android-java/httpPatch.mustache b/modules/swagger-codegen/src/main/resources/android-java/httpPatch.mustache similarity index 100% rename from src/main/resources/android-java/httpPatch.mustache rename to modules/swagger-codegen/src/main/resources/android-java/httpPatch.mustache diff --git a/src/main/resources/android-java/jsonUtil.mustache b/modules/swagger-codegen/src/main/resources/android-java/jsonUtil.mustache similarity index 100% rename from src/main/resources/android-java/jsonUtil.mustache rename to modules/swagger-codegen/src/main/resources/android-java/jsonUtil.mustache diff --git a/src/main/resources/android-java/model.mustache b/modules/swagger-codegen/src/main/resources/android-java/model.mustache similarity index 100% rename from src/main/resources/android-java/model.mustache rename to modules/swagger-codegen/src/main/resources/android-java/model.mustache diff --git a/src/main/resources/android-java/pom.mustache b/modules/swagger-codegen/src/main/resources/android-java/pom.mustache similarity index 100% rename from src/main/resources/android-java/pom.mustache rename to modules/swagger-codegen/src/main/resources/android-java/pom.mustache diff --git a/src/main/resources/asyncscala/api.mustache b/modules/swagger-codegen/src/main/resources/asyncscala/api.mustache similarity index 100% rename from src/main/resources/asyncscala/api.mustache rename to modules/swagger-codegen/src/main/resources/asyncscala/api.mustache diff --git a/src/main/resources/asyncscala/client.mustache b/modules/swagger-codegen/src/main/resources/asyncscala/client.mustache similarity index 100% rename from src/main/resources/asyncscala/client.mustache rename to modules/swagger-codegen/src/main/resources/asyncscala/client.mustache diff --git a/src/main/resources/asyncscala/model.mustache b/modules/swagger-codegen/src/main/resources/asyncscala/model.mustache similarity index 100% rename from src/main/resources/asyncscala/model.mustache rename to modules/swagger-codegen/src/main/resources/asyncscala/model.mustache diff --git a/src/main/resources/asyncscala/sbt.mustache b/modules/swagger-codegen/src/main/resources/asyncscala/sbt.mustache similarity index 100% rename from src/main/resources/asyncscala/sbt.mustache rename to modules/swagger-codegen/src/main/resources/asyncscala/sbt.mustache diff --git a/src/main/resources/csharp/Newtonsoft.Json.dll b/modules/swagger-codegen/src/main/resources/csharp/Newtonsoft.Json.dll similarity index 100% rename from src/main/resources/csharp/Newtonsoft.Json.dll rename to modules/swagger-codegen/src/main/resources/csharp/Newtonsoft.Json.dll diff --git a/src/main/resources/csharp/api.mustache b/modules/swagger-codegen/src/main/resources/csharp/api.mustache similarity index 100% rename from src/main/resources/csharp/api.mustache rename to modules/swagger-codegen/src/main/resources/csharp/api.mustache diff --git a/src/main/resources/csharp/apiException.mustache b/modules/swagger-codegen/src/main/resources/csharp/apiException.mustache similarity index 100% rename from src/main/resources/csharp/apiException.mustache rename to modules/swagger-codegen/src/main/resources/csharp/apiException.mustache diff --git a/src/main/resources/csharp/apiInvoker.mustache b/modules/swagger-codegen/src/main/resources/csharp/apiInvoker.mustache similarity index 100% rename from src/main/resources/csharp/apiInvoker.mustache rename to modules/swagger-codegen/src/main/resources/csharp/apiInvoker.mustache diff --git a/src/main/resources/csharp/compile.mustache b/modules/swagger-codegen/src/main/resources/csharp/compile.mustache similarity index 100% rename from src/main/resources/csharp/compile.mustache rename to modules/swagger-codegen/src/main/resources/csharp/compile.mustache diff --git a/src/main/resources/csharp/model.mustache b/modules/swagger-codegen/src/main/resources/csharp/model.mustache similarity index 100% rename from src/main/resources/csharp/model.mustache rename to modules/swagger-codegen/src/main/resources/csharp/model.mustache diff --git a/src/main/resources/flash/ASAXB-0.1.1.swc b/modules/swagger-codegen/src/main/resources/flash/ASAXB-0.1.1.swc similarity index 100% rename from src/main/resources/flash/ASAXB-0.1.1.swc rename to modules/swagger-codegen/src/main/resources/flash/ASAXB-0.1.1.swc diff --git a/src/main/resources/flash/AirExecutorApp-app.xml b/modules/swagger-codegen/src/main/resources/flash/AirExecutorApp-app.xml similarity index 100% rename from src/main/resources/flash/AirExecutorApp-app.xml rename to modules/swagger-codegen/src/main/resources/flash/AirExecutorApp-app.xml diff --git a/src/main/resources/flash/ApiClientEvent.as b/modules/swagger-codegen/src/main/resources/flash/ApiClientEvent.as similarity index 100% rename from src/main/resources/flash/ApiClientEvent.as rename to modules/swagger-codegen/src/main/resources/flash/ApiClientEvent.as diff --git a/src/main/resources/flash/ApiError.as b/modules/swagger-codegen/src/main/resources/flash/ApiError.as similarity index 100% rename from src/main/resources/flash/ApiError.as rename to modules/swagger-codegen/src/main/resources/flash/ApiError.as diff --git a/src/main/resources/flash/ApiErrorCodes.as b/modules/swagger-codegen/src/main/resources/flash/ApiErrorCodes.as similarity index 100% rename from src/main/resources/flash/ApiErrorCodes.as rename to modules/swagger-codegen/src/main/resources/flash/ApiErrorCodes.as diff --git a/src/main/resources/flash/ApiInvoker.as b/modules/swagger-codegen/src/main/resources/flash/ApiInvoker.as similarity index 100% rename from src/main/resources/flash/ApiInvoker.as rename to modules/swagger-codegen/src/main/resources/flash/ApiInvoker.as diff --git a/src/main/resources/flash/ApiUrlHelper.as b/modules/swagger-codegen/src/main/resources/flash/ApiUrlHelper.as similarity index 100% rename from src/main/resources/flash/ApiUrlHelper.as rename to modules/swagger-codegen/src/main/resources/flash/ApiUrlHelper.as diff --git a/src/main/resources/flash/ApiUserCredentials.as b/modules/swagger-codegen/src/main/resources/flash/ApiUserCredentials.as similarity index 100% rename from src/main/resources/flash/ApiUserCredentials.as rename to modules/swagger-codegen/src/main/resources/flash/ApiUserCredentials.as diff --git a/src/main/resources/flash/ListWrapper.as b/modules/swagger-codegen/src/main/resources/flash/ListWrapper.as similarity index 100% rename from src/main/resources/flash/ListWrapper.as rename to modules/swagger-codegen/src/main/resources/flash/ListWrapper.as diff --git a/src/main/resources/flash/Response.as b/modules/swagger-codegen/src/main/resources/flash/Response.as similarity index 100% rename from src/main/resources/flash/Response.as rename to modules/swagger-codegen/src/main/resources/flash/Response.as diff --git a/src/main/resources/flash/SwaggerApi.as b/modules/swagger-codegen/src/main/resources/flash/SwaggerApi.as similarity index 100% rename from src/main/resources/flash/SwaggerApi.as rename to modules/swagger-codegen/src/main/resources/flash/SwaggerApi.as diff --git a/src/main/resources/flash/XMLWriter.as b/modules/swagger-codegen/src/main/resources/flash/XMLWriter.as similarity index 100% rename from src/main/resources/flash/XMLWriter.as rename to modules/swagger-codegen/src/main/resources/flash/XMLWriter.as diff --git a/src/main/resources/flash/api.mustache b/modules/swagger-codegen/src/main/resources/flash/api.mustache similarity index 100% rename from src/main/resources/flash/api.mustache rename to modules/swagger-codegen/src/main/resources/flash/api.mustache diff --git a/src/main/resources/flash/as3corelib.swc b/modules/swagger-codegen/src/main/resources/flash/as3corelib.swc similarity index 100% rename from src/main/resources/flash/as3corelib.swc rename to modules/swagger-codegen/src/main/resources/flash/as3corelib.swc diff --git a/src/main/resources/flash/build.properties b/modules/swagger-codegen/src/main/resources/flash/build.properties similarity index 100% rename from src/main/resources/flash/build.properties rename to modules/swagger-codegen/src/main/resources/flash/build.properties diff --git a/src/main/resources/flash/build.xml b/modules/swagger-codegen/src/main/resources/flash/build.xml similarity index 100% rename from src/main/resources/flash/build.xml rename to modules/swagger-codegen/src/main/resources/flash/build.xml diff --git a/src/main/resources/flash/facetValue.as b/modules/swagger-codegen/src/main/resources/flash/facetValue.as similarity index 100% rename from src/main/resources/flash/facetValue.as rename to modules/swagger-codegen/src/main/resources/flash/facetValue.as diff --git a/src/main/resources/flash/flexunit-4.1.0_RC2-28-flex_3.5.0.12683.swc b/modules/swagger-codegen/src/main/resources/flash/flexunit-4.1.0_RC2-28-flex_3.5.0.12683.swc similarity index 100% rename from src/main/resources/flash/flexunit-4.1.0_RC2-28-flex_3.5.0.12683.swc rename to modules/swagger-codegen/src/main/resources/flash/flexunit-4.1.0_RC2-28-flex_3.5.0.12683.swc diff --git a/src/main/resources/flash/flexunit-aircilistener-4.1.0_RC2-28-3.5.0.12683.swc b/modules/swagger-codegen/src/main/resources/flash/flexunit-aircilistener-4.1.0_RC2-28-3.5.0.12683.swc similarity index 100% rename from src/main/resources/flash/flexunit-aircilistener-4.1.0_RC2-28-3.5.0.12683.swc rename to modules/swagger-codegen/src/main/resources/flash/flexunit-aircilistener-4.1.0_RC2-28-3.5.0.12683.swc diff --git a/src/main/resources/flash/flexunit-cilistener-4.1.0_RC2-28-3.5.0.12683.swc b/modules/swagger-codegen/src/main/resources/flash/flexunit-cilistener-4.1.0_RC2-28-3.5.0.12683.swc similarity index 100% rename from src/main/resources/flash/flexunit-cilistener-4.1.0_RC2-28-3.5.0.12683.swc rename to modules/swagger-codegen/src/main/resources/flash/flexunit-cilistener-4.1.0_RC2-28-3.5.0.12683.swc diff --git a/src/main/resources/flash/flexunit-core-flex-4.0.0.2-sdk3.5.0.12683.swc b/modules/swagger-codegen/src/main/resources/flash/flexunit-core-flex-4.0.0.2-sdk3.5.0.12683.swc similarity index 100% rename from src/main/resources/flash/flexunit-core-flex-4.0.0.2-sdk3.5.0.12683.swc rename to modules/swagger-codegen/src/main/resources/flash/flexunit-core-flex-4.0.0.2-sdk3.5.0.12683.swc diff --git a/src/main/resources/flash/model.mustache b/modules/swagger-codegen/src/main/resources/flash/model.mustache similarity index 100% rename from src/main/resources/flash/model.mustache rename to modules/swagger-codegen/src/main/resources/flash/model.mustache diff --git a/src/main/resources/flash/modelList.mustache b/modules/swagger-codegen/src/main/resources/flash/modelList.mustache similarity index 100% rename from src/main/resources/flash/modelList.mustache rename to modules/swagger-codegen/src/main/resources/flash/modelList.mustache diff --git a/src/main/resources/htmlDocs/bodyParam.mustache b/modules/swagger-codegen/src/main/resources/htmlDocs/bodyParam.mustache similarity index 100% rename from src/main/resources/htmlDocs/bodyParam.mustache rename to modules/swagger-codegen/src/main/resources/htmlDocs/bodyParam.mustache diff --git a/src/main/resources/htmlDocs/formParam.mustache b/modules/swagger-codegen/src/main/resources/htmlDocs/formParam.mustache similarity index 100% rename from src/main/resources/htmlDocs/formParam.mustache rename to modules/swagger-codegen/src/main/resources/htmlDocs/formParam.mustache diff --git a/src/main/resources/htmlDocs/headerParam.mustache b/modules/swagger-codegen/src/main/resources/htmlDocs/headerParam.mustache similarity index 100% rename from src/main/resources/htmlDocs/headerParam.mustache rename to modules/swagger-codegen/src/main/resources/htmlDocs/headerParam.mustache diff --git a/src/main/resources/htmlDocs/index.mustache b/modules/swagger-codegen/src/main/resources/htmlDocs/index.mustache similarity index 100% rename from src/main/resources/htmlDocs/index.mustache rename to modules/swagger-codegen/src/main/resources/htmlDocs/index.mustache diff --git a/src/main/resources/htmlDocs/pathParam.mustache b/modules/swagger-codegen/src/main/resources/htmlDocs/pathParam.mustache similarity index 100% rename from src/main/resources/htmlDocs/pathParam.mustache rename to modules/swagger-codegen/src/main/resources/htmlDocs/pathParam.mustache diff --git a/src/main/resources/htmlDocs/queryParam.mustache b/modules/swagger-codegen/src/main/resources/htmlDocs/queryParam.mustache similarity index 100% rename from src/main/resources/htmlDocs/queryParam.mustache rename to modules/swagger-codegen/src/main/resources/htmlDocs/queryParam.mustache diff --git a/src/main/resources/htmlDocs/style.css.mustache b/modules/swagger-codegen/src/main/resources/htmlDocs/style.css.mustache similarity index 100% rename from src/main/resources/htmlDocs/style.css.mustache rename to modules/swagger-codegen/src/main/resources/htmlDocs/style.css.mustache diff --git a/src/main/resources/logback.xml b/modules/swagger-codegen/src/main/resources/logback.xml similarity index 100% rename from src/main/resources/logback.xml rename to modules/swagger-codegen/src/main/resources/logback.xml diff --git a/src/main/resources/nodejs/README.mustache b/modules/swagger-codegen/src/main/resources/nodejs/README.mustache similarity index 100% rename from src/main/resources/nodejs/README.mustache rename to modules/swagger-codegen/src/main/resources/nodejs/README.mustache diff --git a/src/main/resources/nodejs/api.mustache b/modules/swagger-codegen/src/main/resources/nodejs/api.mustache similarity index 100% rename from src/main/resources/nodejs/api.mustache rename to modules/swagger-codegen/src/main/resources/nodejs/api.mustache diff --git a/src/main/resources/nodejs/main.mustache b/modules/swagger-codegen/src/main/resources/nodejs/main.mustache similarity index 100% rename from src/main/resources/nodejs/main.mustache rename to modules/swagger-codegen/src/main/resources/nodejs/main.mustache diff --git a/src/main/resources/nodejs/models.mustache b/modules/swagger-codegen/src/main/resources/nodejs/models.mustache similarity index 100% rename from src/main/resources/nodejs/models.mustache rename to modules/swagger-codegen/src/main/resources/nodejs/models.mustache diff --git a/src/main/resources/nodejs/package.mustache b/modules/swagger-codegen/src/main/resources/nodejs/package.mustache similarity index 100% rename from src/main/resources/nodejs/package.mustache rename to modules/swagger-codegen/src/main/resources/nodejs/package.mustache diff --git a/src/main/resources/objc/Podfile.mustache b/modules/swagger-codegen/src/main/resources/objc/Podfile.mustache similarity index 100% rename from src/main/resources/objc/Podfile.mustache rename to modules/swagger-codegen/src/main/resources/objc/Podfile.mustache diff --git a/src/main/resources/objc/SWGApiClient.h b/modules/swagger-codegen/src/main/resources/objc/SWGApiClient.h similarity index 100% rename from src/main/resources/objc/SWGApiClient.h rename to modules/swagger-codegen/src/main/resources/objc/SWGApiClient.h diff --git a/src/main/resources/objc/SWGApiClient.m b/modules/swagger-codegen/src/main/resources/objc/SWGApiClient.m similarity index 100% rename from src/main/resources/objc/SWGApiClient.m rename to modules/swagger-codegen/src/main/resources/objc/SWGApiClient.m diff --git a/src/main/resources/objc/SWGDate.h b/modules/swagger-codegen/src/main/resources/objc/SWGDate.h similarity index 100% rename from src/main/resources/objc/SWGDate.h rename to modules/swagger-codegen/src/main/resources/objc/SWGDate.h diff --git a/src/main/resources/objc/SWGDate.m b/modules/swagger-codegen/src/main/resources/objc/SWGDate.m similarity index 100% rename from src/main/resources/objc/SWGDate.m rename to modules/swagger-codegen/src/main/resources/objc/SWGDate.m diff --git a/src/main/resources/objc/SWGFile.h b/modules/swagger-codegen/src/main/resources/objc/SWGFile.h similarity index 100% rename from src/main/resources/objc/SWGFile.h rename to modules/swagger-codegen/src/main/resources/objc/SWGFile.h diff --git a/src/main/resources/objc/SWGFile.m b/modules/swagger-codegen/src/main/resources/objc/SWGFile.m similarity index 100% rename from src/main/resources/objc/SWGFile.m rename to modules/swagger-codegen/src/main/resources/objc/SWGFile.m diff --git a/src/main/resources/objc/SWGObject.h b/modules/swagger-codegen/src/main/resources/objc/SWGObject.h similarity index 100% rename from src/main/resources/objc/SWGObject.h rename to modules/swagger-codegen/src/main/resources/objc/SWGObject.h diff --git a/src/main/resources/objc/SWGObject.m b/modules/swagger-codegen/src/main/resources/objc/SWGObject.m similarity index 100% rename from src/main/resources/objc/SWGObject.m rename to modules/swagger-codegen/src/main/resources/objc/SWGObject.m diff --git a/src/main/resources/objc/api-body.mustache b/modules/swagger-codegen/src/main/resources/objc/api-body.mustache similarity index 100% rename from src/main/resources/objc/api-body.mustache rename to modules/swagger-codegen/src/main/resources/objc/api-body.mustache diff --git a/src/main/resources/objc/api-header.mustache b/modules/swagger-codegen/src/main/resources/objc/api-header.mustache similarity index 100% rename from src/main/resources/objc/api-header.mustache rename to modules/swagger-codegen/src/main/resources/objc/api-header.mustache diff --git a/src/main/resources/objc/model-body.mustache b/modules/swagger-codegen/src/main/resources/objc/model-body.mustache similarity index 100% rename from src/main/resources/objc/model-body.mustache rename to modules/swagger-codegen/src/main/resources/objc/model-body.mustache diff --git a/src/main/resources/objc/model-header.mustache b/modules/swagger-codegen/src/main/resources/objc/model-header.mustache similarity index 100% rename from src/main/resources/objc/model-header.mustache rename to modules/swagger-codegen/src/main/resources/objc/model-header.mustache diff --git a/src/main/resources/php/Swagger.mustache b/modules/swagger-codegen/src/main/resources/php/Swagger.mustache similarity index 100% rename from src/main/resources/php/Swagger.mustache rename to modules/swagger-codegen/src/main/resources/php/Swagger.mustache diff --git a/src/main/resources/php/api.mustache b/modules/swagger-codegen/src/main/resources/php/api.mustache similarity index 100% rename from src/main/resources/php/api.mustache rename to modules/swagger-codegen/src/main/resources/php/api.mustache diff --git a/src/main/resources/php/model.mustache b/modules/swagger-codegen/src/main/resources/php/model.mustache similarity index 100% rename from src/main/resources/php/model.mustache rename to modules/swagger-codegen/src/main/resources/php/model.mustache diff --git a/src/main/resources/python/__init__.mustache b/modules/swagger-codegen/src/main/resources/python/__init__.mustache similarity index 100% rename from src/main/resources/python/__init__.mustache rename to modules/swagger-codegen/src/main/resources/python/__init__.mustache diff --git a/src/main/resources/python/api.mustache b/modules/swagger-codegen/src/main/resources/python/api.mustache similarity index 100% rename from src/main/resources/python/api.mustache rename to modules/swagger-codegen/src/main/resources/python/api.mustache diff --git a/src/main/resources/python/model.mustache b/modules/swagger-codegen/src/main/resources/python/model.mustache similarity index 100% rename from src/main/resources/python/model.mustache rename to modules/swagger-codegen/src/main/resources/python/model.mustache diff --git a/src/main/resources/python/swagger.mustache b/modules/swagger-codegen/src/main/resources/python/swagger.mustache similarity index 100% rename from src/main/resources/python/swagger.mustache rename to modules/swagger-codegen/src/main/resources/python/swagger.mustache diff --git a/src/main/resources/python3/__init__.mustache b/modules/swagger-codegen/src/main/resources/python3/__init__.mustache similarity index 100% rename from src/main/resources/python3/__init__.mustache rename to modules/swagger-codegen/src/main/resources/python3/__init__.mustache diff --git a/src/main/resources/python3/api.mustache b/modules/swagger-codegen/src/main/resources/python3/api.mustache similarity index 100% rename from src/main/resources/python3/api.mustache rename to modules/swagger-codegen/src/main/resources/python3/api.mustache diff --git a/src/main/resources/python3/model.mustache b/modules/swagger-codegen/src/main/resources/python3/model.mustache similarity index 100% rename from src/main/resources/python3/model.mustache rename to modules/swagger-codegen/src/main/resources/python3/model.mustache diff --git a/src/main/resources/python3/swagger.mustache b/modules/swagger-codegen/src/main/resources/python3/swagger.mustache similarity index 100% rename from src/main/resources/python3/swagger.mustache rename to modules/swagger-codegen/src/main/resources/python3/swagger.mustache diff --git a/src/main/resources/ruby/api.mustache b/modules/swagger-codegen/src/main/resources/ruby/api.mustache similarity index 100% rename from src/main/resources/ruby/api.mustache rename to modules/swagger-codegen/src/main/resources/ruby/api.mustache diff --git a/src/main/resources/ruby/model.mustache b/modules/swagger-codegen/src/main/resources/ruby/model.mustache similarity index 100% rename from src/main/resources/ruby/model.mustache rename to modules/swagger-codegen/src/main/resources/ruby/model.mustache diff --git a/src/main/resources/ruby/monkey.mustache b/modules/swagger-codegen/src/main/resources/ruby/monkey.mustache similarity index 100% rename from src/main/resources/ruby/monkey.mustache rename to modules/swagger-codegen/src/main/resources/ruby/monkey.mustache diff --git a/src/main/resources/ruby/swagger.mustache b/modules/swagger-codegen/src/main/resources/ruby/swagger.mustache similarity index 100% rename from src/main/resources/ruby/swagger.mustache rename to modules/swagger-codegen/src/main/resources/ruby/swagger.mustache diff --git a/src/main/resources/ruby/swagger/configuration.mustache b/modules/swagger-codegen/src/main/resources/ruby/swagger/configuration.mustache similarity index 100% rename from src/main/resources/ruby/swagger/configuration.mustache rename to modules/swagger-codegen/src/main/resources/ruby/swagger/configuration.mustache diff --git a/src/main/resources/ruby/swagger/request.mustache b/modules/swagger-codegen/src/main/resources/ruby/swagger/request.mustache similarity index 100% rename from src/main/resources/ruby/swagger/request.mustache rename to modules/swagger-codegen/src/main/resources/ruby/swagger/request.mustache diff --git a/src/main/resources/ruby/swagger/response.mustache b/modules/swagger-codegen/src/main/resources/ruby/swagger/response.mustache similarity index 100% rename from src/main/resources/ruby/swagger/response.mustache rename to modules/swagger-codegen/src/main/resources/ruby/swagger/response.mustache diff --git a/src/main/resources/ruby/swagger/version.mustache b/modules/swagger-codegen/src/main/resources/ruby/swagger/version.mustache similarity index 100% rename from src/main/resources/ruby/swagger/version.mustache rename to modules/swagger-codegen/src/main/resources/ruby/swagger/version.mustache diff --git a/src/main/resources/scala/api.mustache b/modules/swagger-codegen/src/main/resources/scala/api.mustache similarity index 100% rename from src/main/resources/scala/api.mustache rename to modules/swagger-codegen/src/main/resources/scala/api.mustache diff --git a/src/main/resources/scala/apiInvoker.mustache b/modules/swagger-codegen/src/main/resources/scala/apiInvoker.mustache similarity index 100% rename from src/main/resources/scala/apiInvoker.mustache rename to modules/swagger-codegen/src/main/resources/scala/apiInvoker.mustache diff --git a/src/main/resources/scala/model.mustache b/modules/swagger-codegen/src/main/resources/scala/model.mustache similarity index 100% rename from src/main/resources/scala/model.mustache rename to modules/swagger-codegen/src/main/resources/scala/model.mustache diff --git a/src/main/resources/scala/pom.mustache b/modules/swagger-codegen/src/main/resources/scala/pom.mustache similarity index 100% rename from src/main/resources/scala/pom.mustache rename to modules/swagger-codegen/src/main/resources/scala/pom.mustache diff --git a/src/main/resources/scalatra/Bootstrap.mustache b/modules/swagger-codegen/src/main/resources/scalatra/Bootstrap.mustache similarity index 100% rename from src/main/resources/scalatra/Bootstrap.mustache rename to modules/swagger-codegen/src/main/resources/scalatra/Bootstrap.mustache diff --git a/src/main/resources/scalatra/JettyMain.scala b/modules/swagger-codegen/src/main/resources/scalatra/JettyMain.scala similarity index 100% rename from src/main/resources/scalatra/JettyMain.scala rename to modules/swagger-codegen/src/main/resources/scalatra/JettyMain.scala diff --git a/src/main/resources/scalatra/JsonUtil.scala b/modules/swagger-codegen/src/main/resources/scalatra/JsonUtil.scala similarity index 100% rename from src/main/resources/scalatra/JsonUtil.scala rename to modules/swagger-codegen/src/main/resources/scalatra/JsonUtil.scala diff --git a/src/main/resources/scalatra/README.mustache b/modules/swagger-codegen/src/main/resources/scalatra/README.mustache similarity index 100% rename from src/main/resources/scalatra/README.mustache rename to modules/swagger-codegen/src/main/resources/scalatra/README.mustache diff --git a/src/main/resources/scalatra/ServletApp.mustache b/modules/swagger-codegen/src/main/resources/scalatra/ServletApp.mustache similarity index 100% rename from src/main/resources/scalatra/ServletApp.mustache rename to modules/swagger-codegen/src/main/resources/scalatra/ServletApp.mustache diff --git a/src/main/resources/scalatra/api.mustache b/modules/swagger-codegen/src/main/resources/scalatra/api.mustache similarity index 100% rename from src/main/resources/scalatra/api.mustache rename to modules/swagger-codegen/src/main/resources/scalatra/api.mustache diff --git a/src/main/resources/scalatra/build.sbt b/modules/swagger-codegen/src/main/resources/scalatra/build.sbt similarity index 100% rename from src/main/resources/scalatra/build.sbt rename to modules/swagger-codegen/src/main/resources/scalatra/build.sbt diff --git a/src/main/resources/scalatra/model.mustache b/modules/swagger-codegen/src/main/resources/scalatra/model.mustache similarity index 100% rename from src/main/resources/scalatra/model.mustache rename to modules/swagger-codegen/src/main/resources/scalatra/model.mustache diff --git a/src/main/resources/scalatra/project/build.properties b/modules/swagger-codegen/src/main/resources/scalatra/project/build.properties similarity index 100% rename from src/main/resources/scalatra/project/build.properties rename to modules/swagger-codegen/src/main/resources/scalatra/project/build.properties diff --git a/src/main/resources/scalatra/project/plugins.sbt b/modules/swagger-codegen/src/main/resources/scalatra/project/plugins.sbt similarity index 100% rename from src/main/resources/scalatra/project/plugins.sbt rename to modules/swagger-codegen/src/main/resources/scalatra/project/plugins.sbt diff --git a/src/main/resources/scalatra/sbt b/modules/swagger-codegen/src/main/resources/scalatra/sbt similarity index 100% rename from src/main/resources/scalatra/sbt rename to modules/swagger-codegen/src/main/resources/scalatra/sbt diff --git a/src/main/resources/scalatra/web.xml b/modules/swagger-codegen/src/main/resources/scalatra/web.xml similarity index 100% rename from src/main/resources/scalatra/web.xml rename to modules/swagger-codegen/src/main/resources/scalatra/web.xml diff --git a/src/main/resources/swagger-static/assets/css/bootstrap-responsive.css b/modules/swagger-codegen/src/main/resources/swagger-static/assets/css/bootstrap-responsive.css similarity index 100% rename from src/main/resources/swagger-static/assets/css/bootstrap-responsive.css rename to modules/swagger-codegen/src/main/resources/swagger-static/assets/css/bootstrap-responsive.css diff --git a/src/main/resources/swagger-static/assets/css/bootstrap.css b/modules/swagger-codegen/src/main/resources/swagger-static/assets/css/bootstrap.css similarity index 100% rename from src/main/resources/swagger-static/assets/css/bootstrap.css rename to modules/swagger-codegen/src/main/resources/swagger-static/assets/css/bootstrap.css diff --git a/src/main/resources/swagger-static/assets/css/site.css b/modules/swagger-codegen/src/main/resources/swagger-static/assets/css/site.css similarity index 100% rename from src/main/resources/swagger-static/assets/css/site.css rename to modules/swagger-codegen/src/main/resources/swagger-static/assets/css/site.css diff --git a/src/main/resources/swagger-static/assets/css/style.css b/modules/swagger-codegen/src/main/resources/swagger-static/assets/css/style.css similarity index 100% rename from src/main/resources/swagger-static/assets/css/style.css rename to modules/swagger-codegen/src/main/resources/swagger-static/assets/css/style.css diff --git a/src/main/resources/swagger-static/assets/images/logo.png b/modules/swagger-codegen/src/main/resources/swagger-static/assets/images/logo.png similarity index 100% rename from src/main/resources/swagger-static/assets/images/logo.png rename to modules/swagger-codegen/src/main/resources/swagger-static/assets/images/logo.png diff --git a/src/main/resources/swagger-static/assets/js/bootstrap.js b/modules/swagger-codegen/src/main/resources/swagger-static/assets/js/bootstrap.js similarity index 100% rename from src/main/resources/swagger-static/assets/js/bootstrap.js rename to modules/swagger-codegen/src/main/resources/swagger-static/assets/js/bootstrap.js diff --git a/src/main/resources/swagger-static/assets/js/jquery-1.8.3.min.js b/modules/swagger-codegen/src/main/resources/swagger-static/assets/js/jquery-1.8.3.min.js similarity index 100% rename from src/main/resources/swagger-static/assets/js/jquery-1.8.3.min.js rename to modules/swagger-codegen/src/main/resources/swagger-static/assets/js/jquery-1.8.3.min.js diff --git a/src/main/resources/swagger-static/assets/js/main.js b/modules/swagger-codegen/src/main/resources/swagger-static/assets/js/main.js similarity index 100% rename from src/main/resources/swagger-static/assets/js/main.js rename to modules/swagger-codegen/src/main/resources/swagger-static/assets/js/main.js diff --git a/src/main/resources/swagger-static/index.mustache b/modules/swagger-codegen/src/main/resources/swagger-static/index.mustache similarity index 100% rename from src/main/resources/swagger-static/index.mustache rename to modules/swagger-codegen/src/main/resources/swagger-static/index.mustache diff --git a/src/main/resources/swagger-static/main.mustache b/modules/swagger-codegen/src/main/resources/swagger-static/main.mustache similarity index 100% rename from src/main/resources/swagger-static/main.mustache rename to modules/swagger-codegen/src/main/resources/swagger-static/main.mustache diff --git a/src/main/resources/swagger-static/model.mustache b/modules/swagger-codegen/src/main/resources/swagger-static/model.mustache similarity index 100% rename from src/main/resources/swagger-static/model.mustache rename to modules/swagger-codegen/src/main/resources/swagger-static/model.mustache diff --git a/src/main/resources/swagger-static/operation.mustache b/modules/swagger-codegen/src/main/resources/swagger-static/operation.mustache similarity index 100% rename from src/main/resources/swagger-static/operation.mustache rename to modules/swagger-codegen/src/main/resources/swagger-static/operation.mustache diff --git a/src/main/resources/swagger-static/package.mustache b/modules/swagger-codegen/src/main/resources/swagger-static/package.mustache similarity index 100% rename from src/main/resources/swagger-static/package.mustache rename to modules/swagger-codegen/src/main/resources/swagger-static/package.mustache diff --git a/src/main/resources/swagger-static/pom.xml b/modules/swagger-codegen/src/main/resources/swagger-static/pom.xml similarity index 100% rename from src/main/resources/swagger-static/pom.xml rename to modules/swagger-codegen/src/main/resources/swagger-static/pom.xml diff --git a/src/main/resources/tizen/README.md b/modules/swagger-codegen/src/main/resources/tizen/README.md similarity index 100% rename from src/main/resources/tizen/README.md rename to modules/swagger-codegen/src/main/resources/tizen/README.md diff --git a/src/main/resources/tizen/api-body.mustache b/modules/swagger-codegen/src/main/resources/tizen/api-body.mustache similarity index 100% rename from src/main/resources/tizen/api-body.mustache rename to modules/swagger-codegen/src/main/resources/tizen/api-body.mustache diff --git a/src/main/resources/tizen/api-header.mustache b/modules/swagger-codegen/src/main/resources/tizen/api-header.mustache similarity index 100% rename from src/main/resources/tizen/api-header.mustache rename to modules/swagger-codegen/src/main/resources/tizen/api-header.mustache diff --git a/src/main/resources/tizen/apiclient-body.mustache b/modules/swagger-codegen/src/main/resources/tizen/apiclient-body.mustache similarity index 100% rename from src/main/resources/tizen/apiclient-body.mustache rename to modules/swagger-codegen/src/main/resources/tizen/apiclient-body.mustache diff --git a/src/main/resources/tizen/apiclient-header.mustache b/modules/swagger-codegen/src/main/resources/tizen/apiclient-header.mustache similarity index 100% rename from src/main/resources/tizen/apiclient-header.mustache rename to modules/swagger-codegen/src/main/resources/tizen/apiclient-header.mustache diff --git a/src/main/resources/tizen/error-body.mustache b/modules/swagger-codegen/src/main/resources/tizen/error-body.mustache similarity index 100% rename from src/main/resources/tizen/error-body.mustache rename to modules/swagger-codegen/src/main/resources/tizen/error-body.mustache diff --git a/src/main/resources/tizen/error-header.mustache b/modules/swagger-codegen/src/main/resources/tizen/error-header.mustache similarity index 100% rename from src/main/resources/tizen/error-header.mustache rename to modules/swagger-codegen/src/main/resources/tizen/error-header.mustache diff --git a/src/main/resources/tizen/helpers-body.mustache b/modules/swagger-codegen/src/main/resources/tizen/helpers-body.mustache similarity index 100% rename from src/main/resources/tizen/helpers-body.mustache rename to modules/swagger-codegen/src/main/resources/tizen/helpers-body.mustache diff --git a/src/main/resources/tizen/helpers-header.mustache b/modules/swagger-codegen/src/main/resources/tizen/helpers-header.mustache similarity index 100% rename from src/main/resources/tizen/helpers-header.mustache rename to modules/swagger-codegen/src/main/resources/tizen/helpers-header.mustache diff --git a/src/main/resources/tizen/model-body.mustache b/modules/swagger-codegen/src/main/resources/tizen/model-body.mustache similarity index 100% rename from src/main/resources/tizen/model-body.mustache rename to modules/swagger-codegen/src/main/resources/tizen/model-body.mustache diff --git a/src/main/resources/tizen/model-header.mustache b/modules/swagger-codegen/src/main/resources/tizen/model-header.mustache similarity index 100% rename from src/main/resources/tizen/model-header.mustache rename to modules/swagger-codegen/src/main/resources/tizen/model-header.mustache diff --git a/src/main/resources/tizen/modelFactory.mustache b/modules/swagger-codegen/src/main/resources/tizen/modelFactory.mustache similarity index 100% rename from src/main/resources/tizen/modelFactory.mustache rename to modules/swagger-codegen/src/main/resources/tizen/modelFactory.mustache diff --git a/src/main/resources/tizen/object.mustache b/modules/swagger-codegen/src/main/resources/tizen/object.mustache similarity index 100% rename from src/main/resources/tizen/object.mustache rename to modules/swagger-codegen/src/main/resources/tizen/object.mustache diff --git a/src/main/resources/validator/index.mustache b/modules/swagger-codegen/src/main/resources/validator/index.mustache similarity index 100% rename from src/main/resources/validator/index.mustache rename to modules/swagger-codegen/src/main/resources/validator/index.mustache diff --git a/src/test/resources/1_2/petstore-1.2/api-docs b/modules/swagger-codegen/src/test/resources/1_2/petstore-1.2/api-docs similarity index 100% rename from src/test/resources/1_2/petstore-1.2/api-docs rename to modules/swagger-codegen/src/test/resources/1_2/petstore-1.2/api-docs diff --git a/src/test/resources/1_2/petstore-1.2/pet b/modules/swagger-codegen/src/test/resources/1_2/petstore-1.2/pet similarity index 100% rename from src/test/resources/1_2/petstore-1.2/pet rename to modules/swagger-codegen/src/test/resources/1_2/petstore-1.2/pet diff --git a/src/test/resources/1_2/petstore-1.2/store b/modules/swagger-codegen/src/test/resources/1_2/petstore-1.2/store similarity index 100% rename from src/test/resources/1_2/petstore-1.2/store rename to modules/swagger-codegen/src/test/resources/1_2/petstore-1.2/store diff --git a/src/test/resources/1_2/petstore-1.2/user b/modules/swagger-codegen/src/test/resources/1_2/petstore-1.2/user similarity index 100% rename from src/test/resources/1_2/petstore-1.2/user rename to modules/swagger-codegen/src/test/resources/1_2/petstore-1.2/user diff --git a/src/test/resources/2_0/petstore.json b/modules/swagger-codegen/src/test/resources/2_0/petstore.json similarity index 100% rename from src/test/resources/2_0/petstore.json rename to modules/swagger-codegen/src/test/resources/2_0/petstore.json diff --git a/src/test/resources/2_0/postBodyTest.json b/modules/swagger-codegen/src/test/resources/2_0/postBodyTest.json similarity index 100% rename from src/test/resources/2_0/postBodyTest.json rename to modules/swagger-codegen/src/test/resources/2_0/postBodyTest.json diff --git a/modules/swagger-codegen/src/test/resources/2_0/wordnik.json b/modules/swagger-codegen/src/test/resources/2_0/wordnik.json new file mode 100644 index 00000000000..7d38550ef4a --- /dev/null +++ b/modules/swagger-codegen/src/test/resources/2_0/wordnik.json @@ -0,0 +1,2356 @@ +{ + "swagger": "2.0", + "info": { + "title": "The Wordnik Public API", + "version": "4.0" + }, + "host": "api.wordnik.com", + "basePath": "/v4", + "schemes": [ + "http" + ], + "security": [ + { + "apiKey": [] + } + ], + "paths": { + "/account.json/apiTokenStatus": { + "get": { + "tags": [ + "account" + ], + "summary": "Returns usage statistics for the API account.", + "operationId": "getApiTokenStatus", + "parameters": [ + { + "name": "api_key", + "in": "header", + "description": "Wordnik authentication token", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "success" + }, + "400": { + "description": "No token supplied." + }, + "404": { + "description": "No API account with supplied token." + } + } + } + }, + "/account.json/authenticate/{username}": { + "get": { + "tags": [ + "account" + ], + "summary": "Authenticates a User", + "operationId": "authenticate", + "parameters": [ + { + "name": "username", + "in": "path", + "description": "A confirmed Wordnik username", + "required": true, + "type": "string" + }, + { + "name": "password", + "in": "query", + "description": "The user's password", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "success" + }, + "403": { + "description": "Account not available." + }, + "404": { + "description": "User not found." + } + } + }, + "post": { + "tags": [ + "account" + ], + "summary": "Authenticates a user", + "operationId": "authenticatePost", + "parameters": [ + { + "name": "username", + "in": "path", + "description": "A confirmed Wordnik username", + "required": true, + "type": "string" + }, + { + "in": "body", + "name": "body", + "schema": { + "type": "string" + }, + "description": "The user's password", + "required": true + } + ], + "responses": { + "200": { + "description": "success" + }, + "403": { + "description": "Account not available." + }, + "404": { + "description": "User not found." + } + } + } + }, + "/account.json/user": { + "get": { + "tags": [ + "account" + ], + "summary": "Returns the logged-in User", + "description": "Requires a valid auth_token to be set.", + "operationId": "getLoggedInUser", + "parameters": [ + { + "name": "auth_token", + "in": "header", + "description": "The auth token of the logged-in user, obtained by calling /account.json/authenticate/{username} (described above)", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "success" + }, + "403": { + "description": "Not logged in." + }, + "404": { + "description": "User not found." + } + } + } + }, + "/account.json/wordLists": { + "get": { + "tags": [ + "account" + ], + "summary": "Fetches WordList objects for the logged-in user.", + "operationId": "getWordListsForLoggedInUser", + "parameters": [ + { + "name": "auth_token", + "in": "header", + "description": "auth_token of logged-in user", + "required": true, + "type": "string" + }, + { + "name": "skip", + "in": "query", + "description": "Results to skip", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "limit", + "in": "query", + "description": "Maximum number of results to return", + "required": false, + "type": "integer", + "format": "int32" + } + ], + "responses": { + "200": { + "description": "success" + }, + "403": { + "description": "Not authenticated." + }, + "404": { + "description": "User account not found." + } + } + } + }, + "/word.json/{word}": { + "get": { + "tags": [ + "word" + ], + "summary": "Given a word as a string, returns the WordObject that represents it", + "operationId": "getWord", + "parameters": [ + { + "name": "word", + "in": "path", + "description": "String value of WordObject to return", + "required": true, + "type": "string" + }, + { + "name": "useCanonical", + "in": "query", + "description": "If true will try to return the correct word root ('cats' -> 'cat'). If false returns exactly what was requested.", + "required": false, + "type": "string" + }, + { + "name": "includeSuggestions", + "in": "query", + "description": "Return suggestions (for correct spelling, case variants, etc.)", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "success" + }, + "400": { + "description": "Invalid word supplied." + } + } + } + }, + "/word.json/{word}/audio": { + "get": { + "tags": [ + "word" + ], + "summary": "Fetches audio metadata for a word.", + "description": "The metadata includes a time-expiring fileUrl which allows reading the audio file directly from the API. Currently only audio pronunciations from the American Heritage Dictionary in mp3 format are supported.", + "operationId": "getAudio", + "parameters": [ + { + "name": "word", + "in": "path", + "description": "Word to get audio for.", + "required": true, + "type": "string" + }, + { + "name": "useCanonical", + "in": "query", + "description": "Use the canonical form of the word", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Maximum number of results to return", + "required": false, + "type": "integer", + "format": "int32" + } + ], + "responses": { + "200": { + "description": "success" + }, + "400": { + "description": "Invalid word supplied." + } + } + } + }, + "/word.json/{word}/definitions": { + "get": { + "tags": [ + "word" + ], + "summary": "Return definitions for a word", + "operationId": "getDefinitions", + "parameters": [ + { + "name": "word", + "in": "path", + "description": "Word to return definitions for", + "required": true, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Maximum number of results to return", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "partOfSpeech", + "in": "query", + "description": "CSV list of part-of-speech types", + "required": false, + "type": "string" + }, + { + "name": "includeRelated", + "in": "query", + "description": "Return related words with definitions", + "required": false, + "type": "string" + }, + { + "name": "sourceDictionaries", + "in": "query", + "description": "Source dictionary to return definitions from. If 'all' is received, results are returned from all sources. If multiple values are received (e.g. 'century,wiktionary'), results are returned from the first specified dictionary that has definitions. If left blank, results are returned from the first dictionary that has definitions. By default, dictionaries are searched in this order: ahd, wiktionary, webster, century, wordnet", + "required": false, + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "csv" + }, + { + "name": "useCanonical", + "in": "query", + "description": "If true will try to return the correct word root ('cats' -> 'cat'). If false returns exactly what was requested.", + "required": false, + "type": "string" + }, + { + "name": "includeTags", + "in": "query", + "description": "Return a closed set of XML tags in response", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "success" + }, + "400": { + "description": "Invalid word supplied." + }, + "404": { + "description": "No definitions found." + } + } + } + }, + "/word.json/{word}/etymologies": { + "get": { + "tags": [ + "word" + ], + "summary": "Fetches etymology data", + "operationId": "getEtymologies", + "parameters": [ + { + "name": "word", + "in": "path", + "description": "Word to return", + "required": true, + "type": "string" + }, + { + "name": "useCanonical", + "in": "query", + "description": "If true will try to return the correct word root ('cats' -> 'cat'). If false returns exactly what was requested.", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "success" + }, + "400": { + "description": "Invalid word supplied." + }, + "404": { + "description": "No definitions found." + } + } + } + }, + "/word.json/{word}/examples": { + "get": { + "tags": [ + "word" + ], + "summary": "Returns examples for a word", + "operationId": "getExamples", + "parameters": [ + { + "name": "word", + "in": "path", + "description": "Word to return examples for", + "required": true, + "type": "string" + }, + { + "name": "includeDuplicates", + "in": "query", + "description": "Show duplicate examples from different sources", + "required": false, + "type": "string" + }, + { + "name": "useCanonical", + "in": "query", + "description": "If true will try to return the correct word root ('cats' -> 'cat'). If false returns exactly what was requested.", + "required": false, + "type": "string" + }, + { + "name": "skip", + "in": "query", + "description": "Results to skip", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "limit", + "in": "query", + "description": "Maximum number of results to return", + "required": false, + "type": "integer", + "format": "int32" + } + ], + "responses": { + "200": { + "description": "success" + }, + "400": { + "description": "Invalid word supplied." + } + } + } + }, + "/word.json/{word}/frequency": { + "get": { + "tags": [ + "word" + ], + "summary": "Returns word usage over time", + "operationId": "getWordFrequency", + "parameters": [ + { + "name": "word", + "in": "path", + "description": "Word to return", + "required": true, + "type": "string" + }, + { + "name": "useCanonical", + "in": "query", + "description": "If true will try to return the correct word root ('cats' -> 'cat'). If false returns exactly what was requested.", + "required": false, + "type": "string" + }, + { + "name": "startYear", + "in": "query", + "description": "Starting Year", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "endYear", + "in": "query", + "description": "Ending Year", + "required": false, + "type": "integer", + "format": "int32" + } + ], + "responses": { + "200": { + "description": "success" + }, + "400": { + "description": "Invalid word supplied." + }, + "404": { + "description": "No results." + } + } + } + }, + "/word.json/{word}/hyphenation": { + "get": { + "tags": [ + "word" + ], + "summary": "Returns syllable information for a word", + "operationId": "getHyphenation", + "parameters": [ + { + "name": "word", + "in": "path", + "description": "Word to get syllables for", + "required": true, + "type": "string" + }, + { + "name": "useCanonical", + "in": "query", + "description": "If true will try to return a correct word root ('cats' -> 'cat'). If false returns exactly what was requested.", + "required": false, + "type": "string" + }, + { + "name": "sourceDictionary", + "in": "query", + "description": "Get from a single dictionary. Valid options: ahd, century, wiktionary, webster, and wordnet.", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Maximum number of results to return", + "required": false, + "type": "integer", + "format": "int32" + } + ], + "responses": { + "200": { + "description": "success" + }, + "400": { + "description": "Invalid word supplied." + } + } + } + }, + "/word.json/{word}/phrases": { + "get": { + "tags": [ + "word" + ], + "summary": "Fetches bi-gram phrases for a word", + "operationId": "getPhrases", + "parameters": [ + { + "name": "word", + "in": "path", + "description": "Word to fetch phrases for", + "required": true, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Maximum number of results to return", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "wlmi", + "in": "query", + "description": "Minimum WLMI for the phrase", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "useCanonical", + "in": "query", + "description": "If true will try to return the correct word root ('cats' -> 'cat'). If false returns exactly what was requested.", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "success" + }, + "400": { + "description": "Invalid word supplied." + } + } + } + }, + "/word.json/{word}/pronunciations": { + "get": { + "tags": [ + "word" + ], + "summary": "Returns text pronunciations for a given word", + "operationId": "getTextPronunciations", + "parameters": [ + { + "name": "word", + "in": "path", + "description": "Word to get pronunciations for", + "required": true, + "type": "string" + }, + { + "name": "useCanonical", + "in": "query", + "description": "If true will try to return a correct word root ('cats' -> 'cat'). If false returns exactly what was requested.", + "required": false, + "type": "string" + }, + { + "name": "sourceDictionary", + "in": "query", + "description": "Get from a single dictionary", + "required": false, + "type": "string" + }, + { + "name": "typeFormat", + "in": "query", + "description": "Text pronunciation type", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Maximum number of results to return", + "required": false, + "type": "integer", + "format": "int32" + } + ], + "responses": { + "200": { + "description": "success" + }, + "400": { + "description": "Invalid word supplied." + } + } + } + }, + "/word.json/{word}/relatedWords": { + "get": { + "tags": [ + "word" + ], + "summary": "Given a word as a string, returns relationships from the Word Graph", + "operationId": "getRelatedWords", + "parameters": [ + { + "name": "word", + "in": "path", + "description": "Word to fetch relationships for", + "required": true, + "type": "string" + }, + { + "name": "useCanonical", + "in": "query", + "description": "If true will try to return the correct word root ('cats' -> 'cat'). If false returns exactly what was requested.", + "required": false, + "type": "string" + }, + { + "name": "relationshipTypes", + "in": "query", + "description": "Limits the total results per type of relationship type", + "required": false, + "type": "string" + }, + { + "name": "limitPerRelationshipType", + "in": "query", + "description": "Restrict to the supplied relationship types", + "required": false, + "type": "integer", + "format": "int32" + } + ], + "responses": { + "200": { + "description": "success" + }, + "400": { + "description": "Invalid word supplied." + } + } + } + }, + "/word.json/{word}/topExample": { + "get": { + "tags": [ + "word" + ], + "summary": "Returns a top example for a word", + "operationId": "getTopExample", + "parameters": [ + { + "name": "word", + "in": "path", + "description": "Word to fetch examples for", + "required": true, + "type": "string" + }, + { + "name": "useCanonical", + "in": "query", + "description": "If true will try to return the correct word root ('cats' -> 'cat'). If false returns exactly what was requested.", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "success" + }, + "400": { + "description": "Invalid word supplied." + } + } + } + }, + "/wordList.json/{permalink}": { + "get": { + "tags": [ + "wordList" + ], + "summary": "Fetches a WordList by ID", + "operationId": "getWordListByPermalink", + "parameters": [ + { + "name": "permalink", + "in": "path", + "description": "permalink of WordList to fetch", + "required": true, + "type": "string" + }, + { + "name": "auth_token", + "in": "header", + "description": "The auth token of the logged-in user, obtained by calling /account.json/authenticate/{username} (described above)", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "success" + }, + "400": { + "description": "Invalid ID supplied" + }, + "403": { + "description": "Not Authorized to access WordList" + }, + "404": { + "description": "WordList not found" + } + } + }, + "put": { + "tags": [ + "wordList" + ], + "summary": "Updates an existing WordList", + "operationId": "updateWordList", + "parameters": [ + { + "name": "permalink", + "in": "path", + "description": "permalink of WordList to update", + "required": true, + "type": "string" + }, + { + "in": "body", + "name": "body", + "description": "Updated WordList", + "required": false, + "schema": { + "$ref": "#/definitions/WordList" + } + }, + { + "name": "auth_token", + "in": "header", + "description": "The auth token of the logged-in user, obtained by calling /account.json/authenticate/{username} (described above)", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "success" + }, + "400": { + "description": "Invalid ID supplied" + }, + "403": { + "description": "Not Authorized to update WordList" + }, + "404": { + "description": "WordList not found" + } + } + }, + "delete": { + "tags": [ + "wordList" + ], + "summary": "Deletes an existing WordList", + "operationId": "deleteWordList", + "parameters": [ + { + "name": "permalink", + "in": "path", + "description": "ID of WordList to delete", + "required": true, + "type": "string" + }, + { + "name": "auth_token", + "in": "header", + "description": "The auth token of the logged-in user, obtained by calling /account.json/authenticate/{username} (described above)", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "success" + }, + "400": { + "description": "Invalid ID supplied" + }, + "403": { + "description": "Not Authorized to delete WordList" + }, + "404": { + "description": "WordList not found" + } + } + } + }, + "/wordList.json/{permalink}/deleteWords": { + "post": { + "tags": [ + "wordList" + ], + "summary": "Removes words from a WordList", + "operationId": "deleteWordsFromWordList", + "parameters": [ + { + "name": "permalink", + "in": "path", + "description": "permalink of WordList to use", + "required": true, + "type": "string" + }, + { + "in": "body", + "name": "body", + "description": "Words to remove from WordList", + "required": false, + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/StringValue" + } + } + }, + { + "name": "auth_token", + "in": "header", + "description": "The auth token of the logged-in user, obtained by calling /account.json/authenticate/{username} (described above)", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "success" + }, + "400": { + "description": "Invalid permalink supplied" + }, + "403": { + "description": "Not Authorized to modify WordList" + }, + "404": { + "description": "WordList not found" + } + } + } + }, + "/wordList.json/{permalink}/words": { + "get": { + "tags": [ + "wordList" + ], + "summary": "Fetches words in a WordList", + "operationId": "getWordListWords", + "parameters": [ + { + "name": "permalink", + "in": "path", + "description": "ID of WordList to use", + "required": true, + "type": "string" + }, + { + "name": "sortBy", + "in": "query", + "description": "Field to sort by", + "required": false, + "type": "string" + }, + { + "name": "sortOrder", + "in": "query", + "description": "Direction to sort", + "required": false, + "type": "string" + }, + { + "name": "skip", + "in": "query", + "description": "Results to skip", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "limit", + "in": "query", + "description": "Maximum number of results to return", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "auth_token", + "in": "header", + "description": "The auth token of the logged-in user, obtained by calling /account.json/authenticate/{username} (described above)", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "success" + }, + "400": { + "description": "Invalid ID supplied" + }, + "403": { + "description": "Not Authorized to access WordList" + }, + "404": { + "description": "WordList not found" + } + } + }, + "post": { + "tags": [ + "wordList" + ], + "summary": "Adds words to a WordList", + "operationId": "addWordsToWordList", + "parameters": [ + { + "name": "permalink", + "in": "path", + "description": "permalink of WordList to user", + "required": true, + "type": "string" + }, + { + "in": "body", + "name": "body", + "description": "Array of words to add to WordList", + "required": false, + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/StringValue" + } + } + }, + { + "name": "auth_token", + "in": "header", + "description": "The auth token of the logged-in user, obtained by calling /account.json/authenticate/{username} (described above)", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "success" + }, + "400": { + "description": "Invalid permalink supplied" + }, + "403": { + "description": "Not Authorized to access WordList" + }, + "404": { + "description": "WordList not found" + } + } + } + }, + "/wordLists.json": { + "post": { + "tags": [ + "wordLists" + ], + "summary": "Creates a WordList.", + "operationId": "createWordList", + "parameters": [ + { + "in": "body", + "name": "body", + "description": "WordList to create", + "required": false, + "schema": { + "$ref": "#/definitions/WordList" + } + }, + { + "name": "auth_token", + "in": "header", + "description": "The auth token of the logged-in user, obtained by calling /account.json/authenticate/{username} (described above)", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "success" + }, + "400": { + "description": "Invalid WordList supplied or mandatory fields are missing" + }, + "403": { + "description": "Not authenticated" + }, + "404": { + "description": "WordList owner not found" + } + } + } + }, + "/words.json/randomWord": { + "get": { + "tags": [ + "words" + ], + "summary": "Returns a single random WordObject", + "operationId": "getRandomWord", + "parameters": [ + { + "name": "hasDictionaryDef", + "in": "query", + "description": "Only return words with dictionary definitions", + "required": false, + "type": "string" + }, + { + "name": "includePartOfSpeech", + "in": "query", + "description": "CSV part-of-speech values to include", + "required": false, + "type": "string" + }, + { + "name": "excludePartOfSpeech", + "in": "query", + "description": "CSV part-of-speech values to exclude", + "required": false, + "type": "string" + }, + { + "name": "minCorpusCount", + "in": "query", + "description": "Minimum corpus frequency for terms", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "maxCorpusCount", + "in": "query", + "description": "Maximum corpus frequency for terms", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "minDictionaryCount", + "in": "query", + "description": "Minimum dictionary count", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "maxDictionaryCount", + "in": "query", + "description": "Maximum dictionary count", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "minLength", + "in": "query", + "description": "Minimum word length", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "maxLength", + "in": "query", + "description": "Maximum word length", + "required": false, + "type": "integer", + "format": "int32" + } + ], + "responses": { + "200": { + "description": "success" + }, + "404": { + "description": "No word found." + } + } + } + }, + "/words.json/randomWords": { + "get": { + "tags": [ + "words" + ], + "summary": "Returns an array of random WordObjects", + "operationId": "getRandomWords", + "parameters": [ + { + "name": "hasDictionaryDef", + "in": "query", + "description": "Only return words with dictionary definitions", + "required": false, + "type": "string" + }, + { + "name": "includePartOfSpeech", + "in": "query", + "description": "CSV part-of-speech values to include", + "required": false, + "type": "string" + }, + { + "name": "excludePartOfSpeech", + "in": "query", + "description": "CSV part-of-speech values to exclude", + "required": false, + "type": "string" + }, + { + "name": "minCorpusCount", + "in": "query", + "description": "Minimum corpus frequency for terms", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "maxCorpusCount", + "in": "query", + "description": "Maximum corpus frequency for terms", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "minDictionaryCount", + "in": "query", + "description": "Minimum dictionary count", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "maxDictionaryCount", + "in": "query", + "description": "Maximum dictionary count", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "minLength", + "in": "query", + "description": "Minimum word length", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "maxLength", + "in": "query", + "description": "Maximum word length", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "sortBy", + "in": "query", + "description": "Attribute to sort by", + "required": false, + "type": "string" + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort direction", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Maximum number of results to return", + "required": false, + "type": "integer", + "format": "int32" + } + ], + "responses": { + "200": { + "description": "success" + }, + "400": { + "description": "Invalid term supplied." + }, + "404": { + "description": "No results." + } + } + } + }, + "/words.json/reverseDictionary": { + "get": { + "tags": [ + "words" + ], + "summary": "Reverse dictionary search", + "operationId": "reverseDictionary", + "parameters": [ + { + "name": "query", + "in": "query", + "description": "Search term", + "required": true, + "type": "string" + }, + { + "name": "findSenseForWord", + "in": "query", + "description": "Restricts words and finds closest sense", + "required": false, + "type": "string" + }, + { + "name": "includeSourceDictionaries", + "in": "query", + "description": "Only include these comma-delimited source dictionaries", + "required": false, + "type": "string" + }, + { + "name": "excludeSourceDictionaries", + "in": "query", + "description": "Exclude these comma-delimited source dictionaries", + "required": false, + "type": "string" + }, + { + "name": "includePartOfSpeech", + "in": "query", + "description": "Only include these comma-delimited parts of speech", + "required": false, + "type": "string" + }, + { + "name": "excludePartOfSpeech", + "in": "query", + "description": "Exclude these comma-delimited parts of speech", + "required": false, + "type": "string" + }, + { + "name": "minCorpusCount", + "in": "query", + "description": "Minimum corpus frequency for terms", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "maxCorpusCount", + "in": "query", + "description": "Maximum corpus frequency for terms", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "minLength", + "in": "query", + "description": "Minimum word length", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "maxLength", + "in": "query", + "description": "Maximum word length", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "expandTerms", + "in": "query", + "description": "Expand terms", + "required": false, + "type": "string" + }, + { + "name": "includeTags", + "in": "query", + "description": "Return a closed set of XML tags in response", + "required": false, + "type": "string" + }, + { + "name": "sortBy", + "in": "query", + "description": "Attribute to sort by", + "required": false, + "type": "string" + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort direction", + "required": false, + "type": "string" + }, + { + "name": "skip", + "in": "query", + "description": "Results to skip", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Maximum number of results to return", + "required": false, + "type": "integer", + "format": "int32" + } + ], + "responses": { + "200": { + "description": "success" + }, + "400": { + "description": "Invalid term supplied." + } + } + } + }, + "/words.json/search/{query}": { + "get": { + "tags": [ + "words" + ], + "summary": "Searches words", + "operationId": "searchWords", + "parameters": [ + { + "name": "query", + "in": "path", + "description": "Search query", + "required": true, + "type": "string" + }, + { + "name": "caseSensitive", + "in": "query", + "description": "Search case sensitive", + "required": false, + "type": "string" + }, + { + "name": "includePartOfSpeech", + "in": "query", + "description": "Only include these comma-delimited parts of speech", + "required": false, + "type": "string" + }, + { + "name": "excludePartOfSpeech", + "in": "query", + "description": "Exclude these comma-delimited parts of speech", + "required": false, + "type": "string" + }, + { + "name": "minCorpusCount", + "in": "query", + "description": "Minimum corpus frequency for terms", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "maxCorpusCount", + "in": "query", + "description": "Maximum corpus frequency for terms", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "minDictionaryCount", + "in": "query", + "description": "Minimum number of dictionary entries for words returned", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "maxDictionaryCount", + "in": "query", + "description": "Maximum dictionary definition count", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "minLength", + "in": "query", + "description": "Minimum word length", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "maxLength", + "in": "query", + "description": "Maximum word length", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "skip", + "in": "query", + "description": "Results to skip", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "limit", + "in": "query", + "description": "Maximum number of results to return", + "required": false, + "type": "integer", + "format": "int32" + } + ], + "responses": { + "200": { + "description": "success" + }, + "400": { + "description": "Invalid query supplied." + } + } + } + }, + "/words.json/wordOfTheDay": { + "get": { + "tags": [ + "words" + ], + "summary": "Returns a specific WordOfTheDay", + "operationId": "getWordOfTheDay", + "parameters": [ + { + "name": "date", + "in": "query", + "description": "Fetches by date in yyyy-MM-dd", + "required": false, + "type": "string" + } + ], + "responses": { + "default": { + "description": "success" + } + } + } + } + }, + "definitions": { + "User": { + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "username": { + "type": "string" + }, + "email": { + "type": "string" + }, + "status": { + "type": "integer", + "format": "int32" + }, + "faceBookId": { + "type": "string" + }, + "userName": { + "type": "string" + }, + "displayName": { + "type": "string" + }, + "password": { + "type": "string" + } + } + }, + "Syllable": { + "properties": { + "text": { + "type": "string" + }, + "seq": { + "type": "integer", + "format": "int32" + }, + "type": { + "type": "string" + } + } + }, + "AudioType": { + "properties": { + "id": { + "type": "integer", + "format": "int32" + }, + "name": { + "type": "string" + } + } + }, + "WordOfTheDay": { + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "parentId": { + "type": "string" + }, + "category": { + "type": "string" + }, + "createdBy": { + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "contentProvider": { + "$ref": "#/definitions/ContentProvider" + }, + "htmlExtra": { + "type": "string" + }, + "word": { + "type": "string" + }, + "definitions": { + "type": "array", + "items": { + "$ref": "#/definitions/SimpleDefinition" + } + }, + "examples": { + "type": "array", + "items": { + "$ref": "#/definitions/SimpleExample" + } + }, + "note": { + "type": "string" + }, + "publishDate": { + "type": "string", + "format": "date-time" + } + } + }, + "Facet": { + "properties": { + "facetValues": { + "type": "array", + "items": { + "$ref": "#/definitions/FacetValue" + } + }, + "name": { + "type": "string" + } + } + }, + "WordObject": { + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "word": { + "type": "string" + }, + "originalWord": { + "type": "string" + }, + "suggestions": { + "type": "array", + "items": { + "type": "string" + } + }, + "canonicalForm": { + "type": "string" + }, + "vulgar": { + "type": "string" + } + } + }, + "WordSearchResults": { + "properties": { + "searchResults": { + "type": "array", + "items": { + "$ref": "#/definitions/WordSearchResult" + } + }, + "totalResults": { + "type": "integer", + "format": "int32" + } + } + }, + "AuthenticationToken": { + "properties": { + "token": { + "type": "string" + }, + "userId": { + "type": "integer", + "format": "int64" + }, + "userSignature": { + "type": "string" + } + } + }, + "ExampleSearchResults": { + "properties": { + "facets": { + "type": "array", + "items": { + "$ref": "#/definitions/Facet" + } + }, + "examples": { + "type": "array", + "items": { + "$ref": "#/definitions/Example" + } + } + } + }, + "Example": { + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "exampleId": { + "type": "integer", + "format": "int64" + }, + "title": { + "type": "string" + }, + "text": { + "type": "string" + }, + "score": { + "$ref": "#/definitions/ScoredWord" + }, + "sentence": { + "$ref": "#/definitions/Sentence" + }, + "word": { + "type": "string" + }, + "provider": { + "$ref": "#/definitions/ContentProvider" + }, + "year": { + "type": "integer", + "format": "int32" + }, + "rating": { + "type": "number", + "format": "float" + }, + "documentId": { + "type": "integer", + "format": "int64" + }, + "url": { + "type": "string" + } + } + }, + "SimpleDefinition": { + "properties": { + "text": { + "type": "string" + }, + "source": { + "type": "string" + }, + "note": { + "type": "string" + }, + "partOfSpeech": { + "type": "string" + } + } + }, + "ExampleUsage": { + "properties": { + "text": { + "type": "string" + } + } + }, + "AudioFile": { + "properties": { + "attributionUrl": { + "type": "string" + }, + "commentCount": { + "type": "integer", + "format": "int32" + }, + "voteCount": { + "type": "integer", + "format": "int32" + }, + "fileUrl": { + "type": "string" + }, + "audioType": { + "type": "string" + }, + "id": { + "type": "integer", + "format": "int64" + }, + "duration": { + "type": "number", + "format": "double" + }, + "attributionText": { + "type": "string" + }, + "createdBy": { + "type": "string" + }, + "description": { + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "voteWeightedAverage": { + "type": "number", + "format": "float" + }, + "voteAverage": { + "type": "number", + "format": "float" + }, + "word": { + "type": "string" + } + } + }, + "WordListWord": { + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "word": { + "type": "string" + }, + "username": { + "type": "string" + }, + "userId": { + "type": "integer", + "format": "int64" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "numberCommentsOnWord": { + "type": "integer", + "format": "int64" + }, + "numberLists": { + "type": "integer", + "format": "int64" + } + } + }, + "Bigram": { + "properties": { + "count": { + "type": "integer", + "format": "int64" + }, + "gram2": { + "type": "string" + }, + "gram1": { + "type": "string" + }, + "wlmi": { + "type": "number", + "format": "double" + }, + "mi": { + "type": "number", + "format": "double" + } + } + }, + "Frequency": { + "properties": { + "count": { + "type": "integer", + "format": "int64" + }, + "year": { + "type": "integer", + "format": "int32" + } + } + }, + "TextPron": { + "properties": { + "raw": { + "type": "string" + }, + "seq": { + "type": "integer", + "format": "int32" + }, + "rawType": { + "type": "string" + } + } + }, + "ApiTokenStatus": { + "properties": { + "valid": { + "type": "boolean" + }, + "token": { + "type": "string" + }, + "resetsInMillis": { + "type": "integer", + "format": "int64" + }, + "remainingCalls": { + "type": "integer", + "format": "int64" + }, + "expiresInMillis": { + "type": "integer", + "format": "int64" + }, + "totalRequests": { + "type": "integer", + "format": "int64" + } + } + }, + "WordList": { + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "permalink": { + "type": "string" + }, + "name": { + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "lastActivityAt": { + "type": "string", + "format": "date-time" + }, + "username": { + "type": "string" + }, + "userId": { + "type": "integer", + "format": "int64" + }, + "description": { + "type": "string" + }, + "numberWordsInList": { + "type": "integer", + "format": "int64" + }, + "type": { + "type": "string" + } + } + }, + "WordSearchResult": { + "properties": { + "count": { + "type": "integer", + "format": "int64" + }, + "lexicality": { + "type": "number", + "format": "double" + }, + "word": { + "type": "string" + } + } + }, + "DefinitionSearchResults": { + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/Definition" + } + }, + "totalResults": { + "type": "integer", + "format": "int32" + } + } + }, + "Note": { + "properties": { + "noteType": { + "type": "string" + }, + "appliesTo": { + "type": "array", + "items": { + "type": "string" + } + }, + "value": { + "type": "string" + }, + "pos": { + "type": "integer", + "format": "int32" + } + } + }, + "StringValue": { + "properties": { + "word": { + "type": "string" + } + } + }, + "Related": { + "properties": { + "label1": { + "type": "string" + }, + "relationshipType": { + "type": "string" + }, + "label2": { + "type": "string" + }, + "label3": { + "type": "string" + }, + "words": { + "type": "array", + "items": { + "type": "string" + } + }, + "gram": { + "type": "string" + }, + "label4": { + "type": "string" + } + } + }, + "FacetValue": { + "properties": { + "count": { + "type": "integer", + "format": "int64" + }, + "value": { + "type": "string" + } + } + }, + "ScoredWord": { + "properties": { + "position": { + "type": "integer", + "format": "int32" + }, + "id": { + "type": "integer", + "format": "int64" + }, + "docTermCount": { + "type": "integer", + "format": "int32" + }, + "lemma": { + "type": "string" + }, + "wordType": { + "type": "string" + }, + "score": { + "type": "number", + "format": "float" + }, + "sentenceId": { + "type": "integer", + "format": "int64" + }, + "word": { + "type": "string" + }, + "stopword": { + "type": "boolean" + }, + "baseWordScore": { + "type": "number", + "format": "double" + }, + "partOfSpeech": { + "type": "string" + } + } + }, + "Citation": { + "properties": { + "cite": { + "type": "string" + }, + "source": { + "type": "string" + } + } + }, + "Category": { + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "Root": { + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "categories": { + "type": "array", + "items": { + "$ref": "#/definitions/Category" + } + } + } + }, + "Sentence": { + "properties": { + "hasScoredWords": { + "type": "boolean" + }, + "id": { + "type": "integer", + "format": "int64" + }, + "scoredWords": { + "type": "array", + "items": { + "$ref": "#/definitions/ScoredWord" + } + }, + "display": { + "type": "string" + }, + "rating": { + "type": "integer", + "format": "int32" + }, + "documentMetadataId": { + "type": "integer", + "format": "int64" + } + } + }, + "ContentProvider": { + "properties": { + "id": { + "type": "integer", + "format": "int32" + }, + "name": { + "type": "string" + } + } + }, + "Label": { + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string" + } + } + }, + "SimpleExample": { + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "title": { + "type": "string" + }, + "text": { + "type": "string" + }, + "url": { + "type": "string" + } + } + }, + "PartOfSpeech": { + "properties": { + "roots": { + "type": "array", + "items": { + "$ref": "#/definitions/Root" + } + }, + "storageAbbr": { + "type": "array", + "items": { + "type": "string" + } + }, + "allCategories": { + "type": "array", + "items": { + "$ref": "#/definitions/Category" + } + } + } + }, + "Definition": { + "properties": { + "extendedText": { + "type": "string" + }, + "text": { + "type": "string" + }, + "sourceDictionary": { + "type": "string" + }, + "citations": { + "type": "array", + "items": { + "$ref": "#/definitions/Citation" + } + }, + "labels": { + "type": "array", + "items": { + "$ref": "#/definitions/Label" + } + }, + "score": { + "type": "number", + "format": "float" + }, + "exampleUses": { + "type": "array", + "items": { + "$ref": "#/definitions/ExampleUsage" + } + }, + "attributionUrl": { + "type": "string" + }, + "seqString": { + "type": "string" + }, + "attributionText": { + "type": "string" + }, + "relatedWords": { + "type": "array", + "items": { + "$ref": "#/definitions/Related" + } + }, + "sequence": { + "type": "string" + }, + "word": { + "type": "string" + }, + "notes": { + "type": "array", + "items": { + "$ref": "#/definitions/Note" + } + }, + "textProns": { + "type": "array", + "items": { + "$ref": "#/definitions/TextPron" + } + }, + "partOfSpeech": { + "type": "string" + } + } + }, + "FrequencySummary": { + "properties": { + "unknownYearCount": { + "type": "integer", + "format": "int32" + }, + "totalCount": { + "type": "integer", + "format": "int64" + }, + "frequencyString": { + "type": "string" + }, + "word": { + "type": "string" + }, + "frequency": { + "type": "array", + "items": { + "$ref": "#/definitions/Frequency" + } + } + } + } + }, + "securityDefinitions": { + "apiKey": { + "type": "apiKey", + "in": "header", + "name": "api_key" + } + } +} \ No newline at end of file diff --git a/src/test/scala/CodegenTest.scala b/modules/swagger-codegen/src/test/scala/CodegenTest.scala similarity index 100% rename from src/test/scala/CodegenTest.scala rename to modules/swagger-codegen/src/test/scala/CodegenTest.scala diff --git a/src/test/scala/Java/JavaModelEnumTest.scala b/modules/swagger-codegen/src/test/scala/Java/JavaModelEnumTest.scala similarity index 100% rename from src/test/scala/Java/JavaModelEnumTest.scala rename to modules/swagger-codegen/src/test/scala/Java/JavaModelEnumTest.scala diff --git a/src/test/scala/Java/JavaModelTest.scala b/modules/swagger-codegen/src/test/scala/Java/JavaModelTest.scala similarity index 100% rename from src/test/scala/Java/JavaModelTest.scala rename to modules/swagger-codegen/src/test/scala/Java/JavaModelTest.scala diff --git a/src/test/scala/Objc/ObjcModelTest.scala b/modules/swagger-codegen/src/test/scala/Objc/ObjcModelTest.scala similarity index 100% rename from src/test/scala/Objc/ObjcModelTest.scala rename to modules/swagger-codegen/src/test/scala/Objc/ObjcModelTest.scala diff --git a/src/test/scala/SwaggerMigratorTest.scala b/modules/swagger-codegen/src/test/scala/SwaggerMigratorTest.scala similarity index 100% rename from src/test/scala/SwaggerMigratorTest.scala rename to modules/swagger-codegen/src/test/scala/SwaggerMigratorTest.scala diff --git a/src/test/scala/php/PhpModelTest.scala b/modules/swagger-codegen/src/test/scala/php/PhpModelTest.scala similarity index 100% rename from src/test/scala/php/PhpModelTest.scala rename to modules/swagger-codegen/src/test/scala/php/PhpModelTest.scala diff --git a/src/test/scala/scala/ScalaModelTest.scala b/modules/swagger-codegen/src/test/scala/scala/ScalaModelTest.scala similarity index 100% rename from src/test/scala/scala/ScalaModelTest.scala rename to modules/swagger-codegen/src/test/scala/scala/ScalaModelTest.scala diff --git a/src/test/scala/staticDocs/StaticOperationTest.scala b/modules/swagger-codegen/src/test/scala/staticDocs/StaticOperationTest.scala similarity index 100% rename from src/test/scala/staticDocs/StaticOperationTest.scala rename to modules/swagger-codegen/src/test/scala/staticDocs/StaticOperationTest.scala diff --git a/pom.xml b/pom.xml index 1205eb5d152..40db216c563 100644 --- a/pom.xml +++ b/pom.xml @@ -6,15 +6,15 @@ 4.0.0 com.wordnik - swagger-codegen - jar - wordnik-swagger-codegen + swagger-codegen-project + pom + swagger-codegen-project 2.1.0-SNAPSHOT - https://github.com/wordnik/swagger-codegen + https://github.com/swagger-api/swagger-codegen - scm:git:git@github.com:wordnik/swagger-codegen.git - scm:git:git@github.com:wordnik/swagger-codegen.git - https://github.com/wordnik/swagger-codegen + scm:git:git@github.com:swagger-api/swagger-codegen.git + scm:git:git@github.com:swagger-api/swagger-codegen.git + https://github.com/swagger-api/swagger-codegen 2.2.0 @@ -28,7 +28,7 @@ github - https://github.com/wordnik/swagger-codegen/issues + https://github.com/swagger-api/swagger-core/issues @@ -44,9 +44,8 @@ - src/test/scala + src/main/java target/classes - target/test-classes org.jvnet.wagon-svn @@ -68,33 +67,6 @@ target ${project.artifactId}-${project.version} - - org.codehaus.mojo - exec-maven-plugin - 1.3.2 - - - - java - - - - - com.wordnik.swagger.codegen.Codegen - - - - org.apache.maven.plugins - maven-jar-plugin - - - - true - com.wordnik.swagger.codegen.Codegen - - - - maven-dependency-plugin @@ -109,44 +81,6 @@ - - net.alchim31.maven - scala-maven-plugin - - - - add-source - compile - testCompile - - - - - - incremental - - - -Xmx384m - - - -target:jvm-1.6 - -deprecation - - - - run-scalatest - org.scalatest.tools.Runner - - -p - ${project.build.testOutputDirectory} - - - -Xmx512m - - - - - org.apache.maven.plugins maven-source-plugin @@ -189,8 +123,8 @@ maven-compiler-plugin 3.0 - 1.7 - 1.7 + 1.6 + 1.6 @@ -218,7 +152,7 @@ maven-release-plugin 2.1 - + @@ -234,21 +168,6 @@ sign - - org.mortbay.jetty - jetty-maven-plugin - ${jetty-version} - - - com.sun.jersey - jersey-servlet - ${jersey-version} - - - - ${scala-version} - - @@ -321,6 +240,10 @@ + + modules/swagger-codegen + modules/swagger-codegen-distribution + target/site @@ -365,83 +288,16 @@ - - - io.swagger - swagger-parser - ${swagger-parser-version} - compile - - - io.swagger - swagger-legacy-spec-parser - ${swagger-parser-version} - compile - - - ${project.groupId} - swagger-core - ${swagger-core-version} - compile - - - com.samskivert - jmustache - ${jmustache-version} - compile - - - commons-io - commons-io - ${commons-io-version} - compile - - - org.apache.maven - maven-plugin-tools-api - 2.0 - - - org.apache.felix - maven-bundle-plugin - ${felix-version} - - - org.slf4j - slf4j-ext - ${slf4j-version} - compile - - - org.slf4j - slf4j-api - ${slf4j-version} - compile - - - commons-lang - commons-lang - ${commons-lang-version} - compile - - - commons-cli - commons-cli - ${commons-cli-version} - - - org.scalatest - scalatest_2.11 - ${scala-test-version} - test - - - junit - junit - ${junit-version} - test - - + + + + junit + junit + ${junit-version} + test + + + 1.0.0-SNAPSHOT 2.11.1 @@ -458,13 +314,4 @@ 2.10.4 1.9 - - - sonatype-snapshots - https://oss.sonatype.org/content/repositories/snapshots - - true - - - - + \ No newline at end of file diff --git a/samples/client/petstore/android-java/src/main/java/com/wordnik/client/api/PetApi.java b/samples/client/petstore/android-java/src/main/java/com/wordnik/client/api/PetApi.java index 5aa488c7577..c665531ff47 100644 --- a/samples/client/petstore/android-java/src/main/java/com/wordnik/client/api/PetApi.java +++ b/samples/client/petstore/android-java/src/main/java/com/wordnik/client/api/PetApi.java @@ -8,6 +8,7 @@ import com.wordnik.client.model.*; import java.util.*; import com.wordnik.client.model.Pet; +import java.io.File; import java.util.Map; import java.util.HashMap; @@ -298,4 +299,41 @@ public class PetApi { } } + + public void uploadImage (File petImage) throws ApiException { + Object postBody = null; + + + + // create path and map variables + String path = "/pet/{petId}/upload".replaceAll("\\{format\\}","json"); + + // query params + Map queryParams = new HashMap(); + Map headerParams = new HashMap(); + + + + + + String contentType = "application/json"; + + try { + String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, contentType); + if(response != null){ + return ; + } + else { + return ; + } + } catch (ApiException ex) { + if(ex.getCode() == 404) { + return ; + } + else { + throw ex; + } + } + } + } diff --git a/samples/client/petstore/java/JavaPetstoreCodegen.scala b/samples/client/petstore/java/JavaPetstoreCodegen.scala deleted file mode 100644 index 1e23a176813..00000000000 --- a/samples/client/petstore/java/JavaPetstoreCodegen.scala +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Copyright 2014 Wordnik, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import com.wordnik.swagger.codegen.BasicJavaGenerator - -object JavaPetstoreCodegen extends BasicJavaGenerator { - def main(args: Array[String]) = generateClient(args) - - // location of templates - override def templateDir = "src/main/resources/Java" - - // where to write generated code - override def destinationDir = "samples/client/petstore/java/src/main/java" - - // package for api invoker, error files - override def invokerPackage = Some("com.wordnik.client") - - // package for models - override def modelPackage = Some("com.wordnik.petstore.model") - - // package for api classes - override def apiPackage = Some("com.wordnik.petstore.api") - - additionalParams ++= Map( - "artifactId" -> "swagger-petstore", - "artifactVersion" -> "1.0.0", - "groupId" -> "com.wordnik") - - // supporting classes - override def supportingFiles = - List( - ("apiInvoker.mustache", destinationDir + java.io.File.separator + invokerPackage.get.replace(".", java.io.File.separator) + java.io.File.separator, "ApiInvoker.java"), - ("JsonUtil.mustache", destinationDir + java.io.File.separator + invokerPackage.get.replace(".", java.io.File.separator) + java.io.File.separator, "JsonUtil.java"), - ("apiException.mustache", destinationDir + java.io.File.separator + invokerPackage.get.replace(".", java.io.File.separator) + java.io.File.separator, "ApiException.java"), - ("pom.mustache", "samples/client/petstore/java", "pom.xml")) -} diff --git a/samples/client/petstore/java/src/main/java/com/wordnik/client/ApiException.java b/samples/client/petstore/java/src/main/java/io/swagger/client/ApiException.java similarity index 94% rename from samples/client/petstore/java/src/main/java/com/wordnik/client/ApiException.java rename to samples/client/petstore/java/src/main/java/io/swagger/client/ApiException.java index 9a1f62b3061..31bc8a0978a 100644 --- a/samples/client/petstore/java/src/main/java/com/wordnik/client/ApiException.java +++ b/samples/client/petstore/java/src/main/java/io/swagger/client/ApiException.java @@ -1,4 +1,4 @@ -package com.wordnik.client; +package io.swagger.client; public class ApiException extends Exception { int code = 0; diff --git a/samples/client/petstore/java/src/main/java/com/wordnik/client/ApiInvoker.java b/samples/client/petstore/java/src/main/java/io/swagger/client/ApiInvoker.java similarity index 99% rename from samples/client/petstore/java/src/main/java/com/wordnik/client/ApiInvoker.java rename to samples/client/petstore/java/src/main/java/io/swagger/client/ApiInvoker.java index cd6a73937ba..30f7e83c971 100644 --- a/samples/client/petstore/java/src/main/java/com/wordnik/client/ApiInvoker.java +++ b/samples/client/petstore/java/src/main/java/io/swagger/client/ApiInvoker.java @@ -1,4 +1,4 @@ -package com.wordnik.client; +package io.swagger.client; import com.fasterxml.jackson.core.JsonGenerator.Feature; import com.fasterxml.jackson.databind.*; diff --git a/samples/client/petstore/java/src/main/java/com/wordnik/client/JsonUtil.java b/samples/client/petstore/java/src/main/java/io/swagger/client/JsonUtil.java similarity index 95% rename from samples/client/petstore/java/src/main/java/com/wordnik/client/JsonUtil.java rename to samples/client/petstore/java/src/main/java/io/swagger/client/JsonUtil.java index a650c968f4c..8e7e686dd0c 100644 --- a/samples/client/petstore/java/src/main/java/com/wordnik/client/JsonUtil.java +++ b/samples/client/petstore/java/src/main/java/io/swagger/client/JsonUtil.java @@ -1,4 +1,4 @@ -package com.wordnik.client; +package io.swagger.client; import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; diff --git a/samples/client/petstore/java/src/main/java/com/wordnik/client/api/PetApi.java b/samples/client/petstore/java/src/main/java/io/swagger/client/api/PetApi.java similarity index 95% rename from samples/client/petstore/java/src/main/java/com/wordnik/client/api/PetApi.java rename to samples/client/petstore/java/src/main/java/io/swagger/client/api/PetApi.java index f89c0939dc4..21306184f1f 100644 --- a/samples/client/petstore/java/src/main/java/com/wordnik/client/api/PetApi.java +++ b/samples/client/petstore/java/src/main/java/io/swagger/client/api/PetApi.java @@ -1,13 +1,13 @@ -package com.wordnik.client.api; +package io.swagger.client.api; -import com.wordnik.client.ApiException; -import com.wordnik.client.ApiInvoker; +import io.swagger.client.ApiException; +import io.swagger.client.ApiInvoker; -import com.wordnik.client.model.*; +import io.swagger.client.model.*; import java.util.*; -import com.wordnik.client.model.Pet; +import io.swagger.client.model.Pet; import com.sun.jersey.multipart.FormDataMultiPart; @@ -48,9 +48,7 @@ public class PetApi { Map formParams = new HashMap(); - - String[] contentTypes = { "application/json","application/xml" }; @@ -100,9 +98,7 @@ public class PetApi { Map formParams = new HashMap(); - - String[] contentTypes = { "application/json","application/xml" }; @@ -154,9 +150,7 @@ public class PetApi { if(!"null".equals(String.valueOf(status))) queryParams.put("status", String.valueOf(status)); - - String[] contentTypes = { }; @@ -208,9 +202,7 @@ public class PetApi { if(!"null".equals(String.valueOf(tags))) queryParams.put("tags", String.valueOf(tags)); - - String[] contentTypes = { }; @@ -261,9 +253,7 @@ public class PetApi { Map formParams = new HashMap(); - - String[] contentTypes = { }; @@ -314,9 +304,7 @@ public class PetApi { Map formParams = new HashMap(); - - String[] contentTypes = { "application/x-www-form-urlencoded" }; @@ -327,10 +315,18 @@ public class PetApi { boolean hasFields = false; FormDataMultiPart mp = new FormDataMultiPart(); + hasFields = true; + mp.field("name", name, MediaType.MULTIPART_FORM_DATA_TYPE); + + hasFields = true; + mp.field("status", status, MediaType.MULTIPART_FORM_DATA_TYPE); + if(hasFields) postBody = mp; } else { + formParams.put("name", name); + formParams.put("status", status); } @@ -367,10 +363,8 @@ public class PetApi { Map formParams = new HashMap(); - headerParams.put("api_key", api_key); - String[] contentTypes = { }; diff --git a/samples/client/petstore/java/src/main/java/com/wordnik/client/api/StoreApi.java b/samples/client/petstore/java/src/main/java/io/swagger/client/api/StoreApi.java similarity index 75% rename from samples/client/petstore/java/src/main/java/com/wordnik/client/api/StoreApi.java rename to samples/client/petstore/java/src/main/java/io/swagger/client/api/StoreApi.java index 968d5840a78..63309b2ae39 100644 --- a/samples/client/petstore/java/src/main/java/com/wordnik/client/api/StoreApi.java +++ b/samples/client/petstore/java/src/main/java/io/swagger/client/api/StoreApi.java @@ -1,13 +1,14 @@ -package com.wordnik.client.api; +package io.swagger.client.api; -import com.wordnik.client.ApiException; -import com.wordnik.client.ApiInvoker; +import io.swagger.client.ApiException; +import io.swagger.client.ApiInvoker; -import com.wordnik.client.model.*; +import io.swagger.client.model.*; import java.util.*; -import com.wordnik.client.model.Order; +import java.util.Map; +import io.swagger.client.model.Order; import com.sun.jersey.multipart.FormDataMultiPart; @@ -35,6 +36,56 @@ public class StoreApi { + public Map getInventory () throws ApiException { + Object postBody = null; + + + // create path and map variables + String path = "/store/inventory".replaceAll("\\{format\\}","json"); + + // query params + Map queryParams = new HashMap(); + Map headerParams = new HashMap(); + Map formParams = new HashMap(); + + + + String[] contentTypes = { + + }; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + if(contentType.startsWith("multipart/form-data")) { + boolean hasFields = false; + FormDataMultiPart mp = new FormDataMultiPart(); + + if(hasFields) + postBody = mp; + } + else { + + } + + try { + String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType); + if(response != null){ + return (Map) ApiInvoker.deserialize(response, "", Map.class); + } + else { + return null; + } + } catch (ApiException ex) { + if(ex.getCode() == 404) { + return null; + } + else { + throw ex; + } + } + } + + public Order placeOrder (Order body) throws ApiException { Object postBody = body; @@ -48,9 +99,7 @@ public class StoreApi { Map formParams = new HashMap(); - - String[] contentTypes = { }; @@ -101,9 +150,7 @@ public class StoreApi { Map formParams = new HashMap(); - - String[] contentTypes = { }; @@ -154,9 +201,7 @@ public class StoreApi { Map formParams = new HashMap(); - - String[] contentTypes = { }; diff --git a/samples/client/petstore/java/src/main/java/com/wordnik/client/api/UserApi.java b/samples/client/petstore/java/src/main/java/io/swagger/client/api/UserApi.java similarity index 98% rename from samples/client/petstore/java/src/main/java/com/wordnik/client/api/UserApi.java rename to samples/client/petstore/java/src/main/java/io/swagger/client/api/UserApi.java index 73b764f1a3d..307fd2b399b 100644 --- a/samples/client/petstore/java/src/main/java/com/wordnik/client/api/UserApi.java +++ b/samples/client/petstore/java/src/main/java/io/swagger/client/api/UserApi.java @@ -1,13 +1,13 @@ -package com.wordnik.client.api; +package io.swagger.client.api; -import com.wordnik.client.ApiException; -import com.wordnik.client.ApiInvoker; +import io.swagger.client.ApiException; +import io.swagger.client.ApiInvoker; -import com.wordnik.client.model.*; +import io.swagger.client.model.*; import java.util.*; -import com.wordnik.client.model.User; +import io.swagger.client.model.User; import java.util.*; import com.sun.jersey.multipart.FormDataMultiPart; @@ -49,9 +49,7 @@ public class UserApi { Map formParams = new HashMap(); - - String[] contentTypes = { }; @@ -101,9 +99,7 @@ public class UserApi { Map formParams = new HashMap(); - - String[] contentTypes = { }; @@ -153,9 +149,7 @@ public class UserApi { Map formParams = new HashMap(); - - String[] contentTypes = { }; @@ -209,9 +203,7 @@ public class UserApi { if(!"null".equals(String.valueOf(password))) queryParams.put("password", String.valueOf(password)); - - String[] contentTypes = { }; @@ -261,9 +253,7 @@ public class UserApi { Map formParams = new HashMap(); - - String[] contentTypes = { }; @@ -314,9 +304,7 @@ public class UserApi { Map formParams = new HashMap(); - - String[] contentTypes = { }; @@ -367,9 +355,7 @@ public class UserApi { Map formParams = new HashMap(); - - String[] contentTypes = { }; @@ -420,9 +406,7 @@ public class UserApi { Map formParams = new HashMap(); - - String[] contentTypes = { }; diff --git a/samples/client/petstore/java/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/src/main/java/io/swagger/client/model/Category.java new file mode 100644 index 00000000000..32427482d2a --- /dev/null +++ b/samples/client/petstore/java/src/main/java/io/swagger/client/model/Category.java @@ -0,0 +1,52 @@ +package io.swagger.client.model; + + +import com.wordnik.swagger.annotations.*; +import com.fasterxml.jackson.annotation.JsonProperty; + + +@ApiModel(description = "") +public class Category { + private Long id = null; + + //public enum idEnum { }; + + private String name = null; + + + /** + **/ + @ApiModelProperty(required = false, value = "") + @JsonProperty("id") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + + + /** + **/ + @ApiModelProperty(required = false, value = "") + @JsonProperty("name") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Category {\n"); + + sb.append(" id: ").append(id).append("\n"); + sb.append(" name: ").append(name).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/samples/client/petstore/java/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/src/main/java/io/swagger/client/model/Order.java new file mode 100644 index 00000000000..1b1c94c3910 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/io/swagger/client/model/Order.java @@ -0,0 +1,116 @@ +package io.swagger.client.model; + +import java.util.Date; + +import com.wordnik.swagger.annotations.*; +import com.fasterxml.jackson.annotation.JsonProperty; + + +@ApiModel(description = "") +public class Order { + private Long id = null; + + //public enum idEnum { }; + + private Long petId = null; + + //public enum petIdEnum { }; + + private Integer quantity = null; + + //public enum quantityEnum { }; + + private Date shipDate = null; + private String status = null; + private Boolean complete = null; + + + /** + **/ + @ApiModelProperty(required = false, value = "") + @JsonProperty("id") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + + + /** + **/ + @ApiModelProperty(required = false, value = "") + @JsonProperty("petId") + public Long getPetId() { + return petId; + } + public void setPetId(Long petId) { + this.petId = petId; + } + + + /** + **/ + @ApiModelProperty(required = false, value = "") + @JsonProperty("quantity") + public Integer getQuantity() { + return quantity; + } + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } + + + /** + **/ + @ApiModelProperty(required = false, value = "") + @JsonProperty("shipDate") + public Date getShipDate() { + return shipDate; + } + public void setShipDate(Date shipDate) { + this.shipDate = shipDate; + } + + + /** + * Order Status + **/ + @ApiModelProperty(required = false, value = "Order Status") + @JsonProperty("status") + public String getStatus() { + return status; + } + public void setStatus(String status) { + this.status = status; + } + + + /** + **/ + @ApiModelProperty(required = false, value = "") + @JsonProperty("complete") + public Boolean getComplete() { + return complete; + } + public void setComplete(Boolean complete) { + this.complete = complete; + } + + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Order {\n"); + + sb.append(" id: ").append(id).append("\n"); + sb.append(" petId: ").append(petId).append("\n"); + sb.append(" quantity: ").append(quantity).append("\n"); + sb.append(" shipDate: ").append(shipDate).append("\n"); + sb.append(" status: ").append(status).append("\n"); + sb.append(" complete: ").append(complete).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/samples/client/petstore/java/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/src/main/java/io/swagger/client/model/Pet.java new file mode 100644 index 00000000000..fe374748c0a --- /dev/null +++ b/samples/client/petstore/java/src/main/java/io/swagger/client/model/Pet.java @@ -0,0 +1,112 @@ +package io.swagger.client.model; + +import io.swagger.client.model.Category; +import io.swagger.client.model.Tag; +import java.util.*; + +import com.wordnik.swagger.annotations.*; +import com.fasterxml.jackson.annotation.JsonProperty; + + +@ApiModel(description = "") +public class Pet { + private Long id = null; + + //public enum idEnum { }; + + private Category category = null; + private String name = null; + private List photoUrls = new ArrayList() ; + private List tags = new ArrayList() ; + private String status = null; + + + /** + **/ + @ApiModelProperty(required = false, value = "") + @JsonProperty("id") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + + + /** + **/ + @ApiModelProperty(required = false, value = "") + @JsonProperty("category") + public Category getCategory() { + return category; + } + public void setCategory(Category category) { + this.category = category; + } + + + /** + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty("name") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + + /** + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty("photoUrls") + public List getPhotoUrls() { + return photoUrls; + } + public void setPhotoUrls(List photoUrls) { + this.photoUrls = photoUrls; + } + + + /** + **/ + @ApiModelProperty(required = false, value = "") + @JsonProperty("tags") + public List getTags() { + return tags; + } + public void setTags(List tags) { + this.tags = tags; + } + + + /** + * pet status in the store + **/ + @ApiModelProperty(required = false, value = "pet status in the store") + @JsonProperty("status") + public String getStatus() { + return status; + } + public void setStatus(String status) { + this.status = status; + } + + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Pet {\n"); + + sb.append(" id: ").append(id).append("\n"); + sb.append(" category: ").append(category).append("\n"); + sb.append(" name: ").append(name).append("\n"); + sb.append(" photoUrls: ").append(photoUrls).append("\n"); + sb.append(" tags: ").append(tags).append("\n"); + sb.append(" status: ").append(status).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/samples/client/petstore/java/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/src/main/java/io/swagger/client/model/Tag.java new file mode 100644 index 00000000000..862a736d604 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/io/swagger/client/model/Tag.java @@ -0,0 +1,52 @@ +package io.swagger.client.model; + + +import com.wordnik.swagger.annotations.*; +import com.fasterxml.jackson.annotation.JsonProperty; + + +@ApiModel(description = "") +public class Tag { + private Long id = null; + + //public enum idEnum { }; + + private String name = null; + + + /** + **/ + @ApiModelProperty(required = false, value = "") + @JsonProperty("id") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + + + /** + **/ + @ApiModelProperty(required = false, value = "") + @JsonProperty("name") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Tag {\n"); + + sb.append(" id: ").append(id).append("\n"); + sb.append(" name: ").append(name).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/samples/client/petstore/java/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/src/main/java/io/swagger/client/model/User.java new file mode 100644 index 00000000000..024515e6b8c --- /dev/null +++ b/samples/client/petstore/java/src/main/java/io/swagger/client/model/User.java @@ -0,0 +1,140 @@ +package io.swagger.client.model; + + +import com.wordnik.swagger.annotations.*; +import com.fasterxml.jackson.annotation.JsonProperty; + + +@ApiModel(description = "") +public class User { + private Long id = null; + + //public enum idEnum { }; + + private String username = null; + private String firstName = null; + private String lastName = null; + private String email = null; + private String password = null; + private String phone = null; + private Integer userStatus = null; + + //public enum userStatusEnum { }; + + + + /** + **/ + @ApiModelProperty(required = false, value = "") + @JsonProperty("id") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + + + /** + **/ + @ApiModelProperty(required = false, value = "") + @JsonProperty("username") + public String getUsername() { + return username; + } + public void setUsername(String username) { + this.username = username; + } + + + /** + **/ + @ApiModelProperty(required = false, value = "") + @JsonProperty("firstName") + public String getFirstName() { + return firstName; + } + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + + /** + **/ + @ApiModelProperty(required = false, value = "") + @JsonProperty("lastName") + public String getLastName() { + return lastName; + } + public void setLastName(String lastName) { + this.lastName = lastName; + } + + + /** + **/ + @ApiModelProperty(required = false, value = "") + @JsonProperty("email") + public String getEmail() { + return email; + } + public void setEmail(String email) { + this.email = email; + } + + + /** + **/ + @ApiModelProperty(required = false, value = "") + @JsonProperty("password") + public String getPassword() { + return password; + } + public void setPassword(String password) { + this.password = password; + } + + + /** + **/ + @ApiModelProperty(required = false, value = "") + @JsonProperty("phone") + public String getPhone() { + return phone; + } + public void setPhone(String phone) { + this.phone = phone; + } + + + /** + * User Status + **/ + @ApiModelProperty(required = false, value = "User Status") + @JsonProperty("userStatus") + public Integer getUserStatus() { + return userStatus; + } + public void setUserStatus(Integer userStatus) { + this.userStatus = userStatus; + } + + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class User {\n"); + + sb.append(" id: ").append(id).append("\n"); + sb.append(" username: ").append(username).append("\n"); + sb.append(" firstName: ").append(firstName).append("\n"); + sb.append(" lastName: ").append(lastName).append("\n"); + sb.append(" email: ").append(email).append("\n"); + sb.append(" password: ").append(password).append("\n"); + sb.append(" phone: ").append(phone).append("\n"); + sb.append(" userStatus: ").append(userStatus).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/samples/client/petstore/tizen/client/SamiStoreApi.cpp b/samples/client/petstore/tizen/client/SamiStoreApi.cpp index 0c0833ecfbd..c567896c48d 100644 --- a/samples/client/petstore/tizen/client/SamiStoreApi.cpp +++ b/samples/client/petstore/tizen/client/SamiStoreApi.cpp @@ -16,6 +16,68 @@ SamiStoreApi::~SamiStoreApi() { } +void +getInventoryProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) { + int code = pHttpResponse->GetHttpStatusCode(); + + if(code >= 200 && code < 300) { + ByteBuffer* pBuffer = pHttpResponse->ReadBodyN(); + IJsonValue* pJson = JsonParser::ParseN(*pBuffer); + + HashMap* out = new HashMap(); + jsonToValue(out, pJson, L"HashMap*", L"Integer"); + + if (pJson) { + if (pJson->GetType() == JSON_TYPE_OBJECT) { + JsonObject* pObject = static_cast< JsonObject* >(pJson); + pObject->RemoveAll(true); + } + else if (pJson->GetType() == JSON_TYPE_ARRAY) { + JsonArray* pArray = static_cast< JsonArray* >(pJson); + pArray->RemoveAll(true); + } + handler(out, null); + } + else { + SamiError* error = new SamiError(0, new String(L"No parsable response received")); + handler(null, error); + } + + } + else { + SamiError* error = new SamiError(code, new String(pHttpResponse->GetStatusText())); + handler(null, error); + + } +} + +HashMap* +SamiStoreApi::getInventoryWithCompletion( void (* success)(HashMap*, SamiError*)) { + client = new SamiApiClient(); + + client->success(&getInventoryProcessor, (void(*)(void*, SamiError*))success); + HashMap* headerParams = new HashMap(SingleObjectDeleter); + headerParams->Construct(); + + + + HashMap* queryParams = new HashMap(SingleObjectDeleter); + queryParams->Construct(); + + + + String* mBody = null; + + + + String url(L"/store/inventory"); + + + + client->execute(SamiStoreApi::getBasePath(), url, "GET", (IMap*)queryParams, mBody, (IMap*)headerParams, null, L"application/json"); + return null; +} + void placeOrderProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) { int code = pHttpResponse->GetHttpStatusCode(); diff --git a/samples/client/petstore/tizen/client/SamiStoreApi.h b/samples/client/petstore/tizen/client/SamiStoreApi.h index ad835cd42a9..510e74e9a53 100644 --- a/samples/client/petstore/tizen/client/SamiStoreApi.h +++ b/samples/client/petstore/tizen/client/SamiStoreApi.h @@ -7,6 +7,7 @@ #include "SamiOrder.h" using Tizen::Base::String; +using Tizen::Base::Integer; using namespace Tizen::Net::Http; @@ -18,6 +19,9 @@ public: virtual ~SamiStoreApi(); + HashMap* + getInventoryWithCompletion( void (* handler)(HashMap*, SamiError*)); + SamiOrder* placeOrderWithCompletion(SamiOrder* body, void (* handler)(SamiOrder*, SamiError*)); diff --git a/samples/server/petstore/jaxrs/README.md b/samples/server/petstore/jaxrs/README.md new file mode 100644 index 00000000000..f8a560b776f --- /dev/null +++ b/samples/server/petstore/jaxrs/README.md @@ -0,0 +1,10 @@ +# Swagger generated server + +## Overview +This server was generated by the [swagger-codegen](https://github.com/wordnik/swagger-codegen) project. By using the +[swagger-spec](https://github.com/wordnik/swagger-core/wiki) from a remote server, you can easily generate a server stub. This +is an example of building a swagger-enabled scalatra server. + +This example uses the [scalatra](http://scalatra.org/) framework. To see how to make this your own, look here: + +[README](https://github.com/wordnik/swagger-codegen/tree/master/samples/server-generator/scalatra) \ No newline at end of file diff --git a/samples/server/petstore/jaxrs/pom.xml b/samples/server/petstore/jaxrs/pom.xml new file mode 100644 index 00000000000..a8bb02cb557 --- /dev/null +++ b/samples/server/petstore/jaxrs/pom.xml @@ -0,0 +1,135 @@ + + 4.0.0 + io.swagger + swagger-server + jar + swagger-server + 1.0.0 + + src/main/java + + + org.apache.maven.plugins + maven-war-plugin + 2.1.1 + + + maven-failsafe-plugin + 2.6 + + + + integration-test + verify + + + + + + org.mortbay.jetty + jetty-maven-plugin + ${jetty-version} + + + /v2 + + target/${project.artifactId}-${project.version} + ${project.basedir}/conf/jetty/webdefault.xml + 8079 + stopit + + + 8002 + 60000 + 8443 + + + + + + start-jetty + pre-integration-test + + run + + + 0 + true + + + + stop-jetty + post-integration-test + + stop + + + + + + + + + com.wordnik + swagger-jersey-jaxrs + ${swagger-core-version} + + + org.slf4j + slf4j-log4j12 + ${slf4j-version} + + + com.sun.jersey + jersey-core + ${jersey-version} + + + com.sun.jersey + jersey-json + ${jersey-version} + + + com.sun.jersey + jersey-servlet + ${jersey-version} + + + com.sun.jersey.contribs + jersey-multipart + ${jersey-version} + + + com.sun.jersey + jersey-server + ${jersey-version} + + + + org.scalatest + scalatest_2.9.1 + ${scala-test-version} + test + + + junit + junit + ${junit-version} + test + + + javax.servlet + servlet-api + ${servlet-api-version} + + + + 1.5.0-M1 + 8.1.11.v20130520 + 1.13 + 1.6.3 + 1.6.1 + 4.8.1 + 2.5 + + \ No newline at end of file diff --git a/samples/server/petstore/jaxrs/src/main/java/io/swagger/api/ApiException.java b/samples/server/petstore/jaxrs/src/main/java/io/swagger/api/ApiException.java new file mode 100644 index 00000000000..cae767c0393 --- /dev/null +++ b/samples/server/petstore/jaxrs/src/main/java/io/swagger/api/ApiException.java @@ -0,0 +1,9 @@ +package io.swagger.api; + +public class ApiException extends Exception{ + private int code; + public ApiException (int code, String msg) { + super(msg); + this.code = code; + } +} diff --git a/samples/server/petstore/jaxrs/src/main/java/io/swagger/api/ApiOriginFilter.java b/samples/server/petstore/jaxrs/src/main/java/io/swagger/api/ApiOriginFilter.java new file mode 100644 index 00000000000..c2eeacf13d3 --- /dev/null +++ b/samples/server/petstore/jaxrs/src/main/java/io/swagger/api/ApiOriginFilter.java @@ -0,0 +1,26 @@ +package io.swagger.api; + +import java.io.IOException; + +import javax.servlet.*; +import javax.servlet.http.HttpServletResponse; + +public class ApiOriginFilter implements javax.servlet.Filter { + @Override + public void doFilter(ServletRequest request, ServletResponse response, + FilterChain chain) throws IOException, ServletException { + HttpServletResponse res = (HttpServletResponse) response; + res.addHeader("Access-Control-Allow-Origin", "*"); + res.addHeader("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT"); + res.addHeader("Access-Control-Allow-Headers", "Content-Type"); + chain.doFilter(request, response); + } + + @Override + public void destroy() { + } + + @Override + public void init(FilterConfig filterConfig) throws ServletException { + } +} \ No newline at end of file diff --git a/samples/server/petstore/jaxrs/src/main/java/io/swagger/api/ApiResponseMessage.java b/samples/server/petstore/jaxrs/src/main/java/io/swagger/api/ApiResponseMessage.java new file mode 100644 index 00000000000..9e5b0ee44e2 --- /dev/null +++ b/samples/server/petstore/jaxrs/src/main/java/io/swagger/api/ApiResponseMessage.java @@ -0,0 +1,68 @@ +package io.swagger.api; + +import javax.xml.bind.annotation.XmlTransient; + +@javax.xml.bind.annotation.XmlRootElement +public class ApiResponseMessage { + public static final int ERROR = 1; + public static final int WARNING = 2; + public static final int INFO = 3; + public static final int OK = 4; + public static final int TOO_BUSY = 5; + + int code; + String type; + String message; + + public ApiResponseMessage(){} + + public ApiResponseMessage(int code, String message){ + this.code = code; + switch(code){ + case ERROR: + setType("error"); + break; + case WARNING: + setType("warning"); + break; + case INFO: + setType("info"); + break; + case OK: + setType("ok"); + break; + case TOO_BUSY: + setType("too busy"); + break; + default: + setType("unknown"); + break; + } + this.message = message; + } + + @XmlTransient + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } +} diff --git a/samples/server/petstore/jaxrs/src/main/java/io/swagger/api/NotFoundException.java b/samples/server/petstore/jaxrs/src/main/java/io/swagger/api/NotFoundException.java new file mode 100644 index 00000000000..9c8410e47ab --- /dev/null +++ b/samples/server/petstore/jaxrs/src/main/java/io/swagger/api/NotFoundException.java @@ -0,0 +1,9 @@ +package io.swagger.api; + +public class NotFoundException extends ApiException { + private int code; + public NotFoundException (int code, String msg) { + super(code, msg); + this.code = code; + } +} diff --git a/samples/server/petstore/jaxrs/src/main/java/io/swagger/api/PetApi.java b/samples/server/petstore/jaxrs/src/main/java/io/swagger/api/PetApi.java new file mode 100644 index 00000000000..9aef181a3f6 --- /dev/null +++ b/samples/server/petstore/jaxrs/src/main/java/io/swagger/api/PetApi.java @@ -0,0 +1,141 @@ +package io.swagger.api; + +import io.swagger.model.*; + +import com.wordnik.swagger.annotations.*; +import com.sun.jersey.multipart.FormDataParam; + +import io.swagger.model.Pet; + +import java.util.List; +import io.swagger.api.NotFoundException; + +import javax.ws.rs.core.Response; +import javax.ws.rs.*; + +@Path("/pet") +@Api(value = "/pet", description = "the pet API") +public class PetApi { + + @PUT + + @Consumes({ "application/json", "application/xml" }) + @Produces({ "application/json", "application/xml" }) + // Void + @ApiOperation(value = "Update an existing pet", notes = "", response = Void.class) + @ApiResponses(value = { + @ApiResponse(code = 405, message = "Validation exception"), + + @ApiResponse(code = 404, message = "Pet not found"), + + @ApiResponse(code = 400, message = "Invalid ID supplied") }) + + public Response updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ) Pet body) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + + + @POST + + @Consumes({ "application/json", "application/xml" }) + @Produces({ "application/json", "application/xml" }) + // Void + @ApiOperation(value = "Add a new pet to the store", notes = "", response = Void.class) + @ApiResponses(value = { + @ApiResponse(code = 405, message = "Invalid input") }) + + public Response addPet(@ApiParam(value = "Pet object that needs to be added to the store" ) Pet body) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + + + @GET + @Path("/findByStatus") + + @Produces({ "application/json", "application/xml" }) + // Pet + @ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma seperated strings", response = Pet.class, responseContainer = "List") + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid status value") }) + + public Response findPetsByStatus(@ApiParam(value = "Status values that need to be considered for filter") @QueryParam("status") List status) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + + + @GET + @Path("/findByTags") + + @Produces({ "application/json", "application/xml" }) + // Pet + @ApiOperation(value = "Finds Pets by tags", notes = "Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List") + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid tag value") }) + + public Response findPetsByTags(@ApiParam(value = "Tags to filter by") @QueryParam("tags") List tags) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + + + @GET + @Path("/{petId}") + + @Produces({ "application/json", "application/xml" }) + // Pet + @ApiOperation(value = "Find pet by ID", notes = "Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions", response = Pet.class) + @ApiResponses(value = { + @ApiResponse(code = 404, message = "Pet not found"), + + @ApiResponse(code = 400, message = "Invalid ID supplied") }) + + public Response getPetById(@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathParam("petId") Long petId) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + + + @POST + @Path("/{petId}") + @Consumes({ "application/x-www-form-urlencoded" }) + @Produces({ "application/json", "application/xml" }) + // Void + @ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class) + @ApiResponses(value = { + @ApiResponse(code = 405, message = "Invalid input") }) + + public Response updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathParam("petId") String petId, + @ApiParam(value = "Updated name of the pet" )@FormParam("name") String name, + @ApiParam(value = "Updated status of the pet" )@FormParam("status") String status) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + + + @DELETE + @Path("/{petId}") + + @Produces({ "application/json", "application/xml" }) + // Void + @ApiOperation(value = "Deletes a pet", notes = "", response = Void.class) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid pet value") }) + + public Response deletePet(@ApiParam(value = "" )@HeaderParam("api_key") String api_key, + @ApiParam(value = "Pet id to delete",required=true ) @PathParam("petId") Long petId) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + + +} diff --git a/samples/server/petstore/jaxrs/src/main/java/io/swagger/api/StoreApi.java b/samples/server/petstore/jaxrs/src/main/java/io/swagger/api/StoreApi.java new file mode 100644 index 00000000000..1706d633258 --- /dev/null +++ b/samples/server/petstore/jaxrs/src/main/java/io/swagger/api/StoreApi.java @@ -0,0 +1,88 @@ +package io.swagger.api; + +import io.swagger.model.*; + +import com.wordnik.swagger.annotations.*; +import com.sun.jersey.multipart.FormDataParam; + +import java.util.Map; +import io.swagger.model.Order; + +import java.util.List; +import io.swagger.api.NotFoundException; + +import javax.ws.rs.core.Response; +import javax.ws.rs.*; + +@Path("/store") +@Api(value = "/store", description = "the store API") +public class StoreApi { + + @GET + @Path("/inventory") + + @Produces({ "application/json", "application/xml" }) + // Integer + @ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class) + @ApiResponses(value = { }) + + public Response getInventory() + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + + + @POST + @Path("/order") + + @Produces({ "application/json", "application/xml" }) + // Order + @ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid Order") }) + + public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet" ) Order body) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + + + @GET + @Path("/order/{orderId}") + + @Produces({ "application/json", "application/xml" }) + // Order + @ApiOperation(value = "Find purchase order by ID", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class) + @ApiResponses(value = { + @ApiResponse(code = 404, message = "Order not found"), + + @ApiResponse(code = 400, message = "Invalid ID supplied") }) + + public Response getOrderById(@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathParam("orderId") String orderId) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + + + @DELETE + @Path("/order/{orderId}") + + @Produces({ "application/json", "application/xml" }) + // Void + @ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = Void.class) + @ApiResponses(value = { + @ApiResponse(code = 404, message = "Order not found"), + + @ApiResponse(code = 400, message = "Invalid ID supplied") }) + + public Response deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathParam("orderId") String orderId) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + + +} diff --git a/samples/server/petstore/jaxrs/src/main/java/io/swagger/api/UserApi.java b/samples/server/petstore/jaxrs/src/main/java/io/swagger/api/UserApi.java new file mode 100644 index 00000000000..b98f79880ba --- /dev/null +++ b/samples/server/petstore/jaxrs/src/main/java/io/swagger/api/UserApi.java @@ -0,0 +1,153 @@ +package io.swagger.api; + +import io.swagger.model.*; + +import com.wordnik.swagger.annotations.*; +import com.sun.jersey.multipart.FormDataParam; + +import io.swagger.model.User; +import java.util.*; + +import java.util.List; +import io.swagger.api.NotFoundException; + +import javax.ws.rs.core.Response; +import javax.ws.rs.*; + +@Path("/user") +@Api(value = "/user", description = "the user API") +public class UserApi { + + @POST + + + @Produces({ "application/json", "application/xml" }) + // Void + @ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class) + @ApiResponses(value = { }) + + public Response createUser(@ApiParam(value = "Created user object" ) User body) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + + + @POST + @Path("/createWithArray") + + @Produces({ "application/json", "application/xml" }) + // Void + @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class) + @ApiResponses(value = { }) + + public Response createUsersWithArrayInput(@ApiParam(value = "List of user object" ) List body) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + + + @POST + @Path("/createWithList") + + @Produces({ "application/json", "application/xml" }) + // Void + @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class) + @ApiResponses(value = { }) + + public Response createUsersWithListInput(@ApiParam(value = "List of user object" ) List body) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + + + @GET + @Path("/login") + + @Produces({ "application/json", "application/xml" }) + // String + @ApiOperation(value = "Logs user into the system", notes = "", response = String.class) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid username/password supplied") }) + + public Response loginUser(@ApiParam(value = "The user name for login") @QueryParam("username") String username, + @ApiParam(value = "The password for login in clear text") @QueryParam("password") String password) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + + + @GET + @Path("/logout") + + @Produces({ "application/json", "application/xml" }) + // Void + @ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class) + @ApiResponses(value = { }) + + public Response logoutUser() + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + + + @GET + @Path("/{username}") + + @Produces({ "application/json", "application/xml" }) + // User + @ApiOperation(value = "Get user by user name", notes = "", response = User.class) + @ApiResponses(value = { + @ApiResponse(code = 404, message = "User not found"), + + @ApiResponse(code = 400, message = "Invalid username supplied") }) + + public Response getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing. ",required=true ) @PathParam("username") String username) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + + + @PUT + @Path("/{username}") + + @Produces({ "application/json", "application/xml" }) + // Void + @ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class) + @ApiResponses(value = { + @ApiResponse(code = 404, message = "User not found"), + + @ApiResponse(code = 400, message = "Invalid user supplied") }) + + public Response updateUser(@ApiParam(value = "name that need to be deleted",required=true ) @PathParam("username") String username, + @ApiParam(value = "Updated user object" ) User body) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + + + @DELETE + @Path("/{username}") + + @Produces({ "application/json", "application/xml" }) + // Void + @ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class) + @ApiResponses(value = { + @ApiResponse(code = 404, message = "User not found"), + + @ApiResponse(code = 400, message = "Invalid username supplied") }) + + public Response deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true ) @PathParam("username") String username) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + + +} diff --git a/samples/client/petstore/java/src/main/java/com/wordnik/client/model/Category.java b/samples/server/petstore/jaxrs/src/main/java/io/swagger/model/Category.java similarity index 91% rename from samples/client/petstore/java/src/main/java/com/wordnik/client/model/Category.java rename to samples/server/petstore/jaxrs/src/main/java/io/swagger/model/Category.java index 5a0a18d40a5..e6a7f9e1c7c 100644 --- a/samples/client/petstore/java/src/main/java/com/wordnik/client/model/Category.java +++ b/samples/server/petstore/jaxrs/src/main/java/io/swagger/model/Category.java @@ -1,4 +1,4 @@ -package com.wordnik.client.model; +package io.swagger.model; import com.wordnik.swagger.annotations.*; @@ -6,15 +6,14 @@ import com.wordnik.swagger.annotations.*; @ApiModel(description = "") public class Category { + /** + **/ private Long id = null; - - //public enum idEnum { }; - + /** + **/ private String name = null; - /** - **/ @ApiModelProperty(required = false, value = "") public Long getId() { return id; @@ -24,8 +23,6 @@ public class Category { } - /** - **/ @ApiModelProperty(required = false, value = "") public String getName() { return name; diff --git a/samples/client/petstore/java/src/main/java/com/wordnik/client/model/Order.java b/samples/server/petstore/jaxrs/src/main/java/io/swagger/model/Order.java similarity index 93% rename from samples/client/petstore/java/src/main/java/com/wordnik/client/model/Order.java rename to samples/server/petstore/jaxrs/src/main/java/io/swagger/model/Order.java index 65af51c2f6d..edbc5250df0 100644 --- a/samples/client/petstore/java/src/main/java/com/wordnik/client/model/Order.java +++ b/samples/server/petstore/jaxrs/src/main/java/io/swagger/model/Order.java @@ -1,4 +1,4 @@ -package com.wordnik.client.model; +package io.swagger.model; import java.util.Date; @@ -7,25 +7,27 @@ import com.wordnik.swagger.annotations.*; @ApiModel(description = "") public class Order { + /** + **/ private Long id = null; - - //public enum idEnum { }; - + /** + **/ private Long petId = null; - - //public enum petIdEnum { }; - + /** + **/ private Integer quantity = null; - - //public enum quantityEnum { }; - + /** + **/ private Date shipDate = null; + /** + * Order Status + **/ private String status = null; + /** + **/ private Boolean complete = null; - /** - **/ @ApiModelProperty(required = false, value = "") public Long getId() { return id; @@ -35,8 +37,6 @@ public class Order { } - /** - **/ @ApiModelProperty(required = false, value = "") public Long getPetId() { return petId; @@ -46,8 +46,6 @@ public class Order { } - /** - **/ @ApiModelProperty(required = false, value = "") public Integer getQuantity() { return quantity; @@ -57,8 +55,6 @@ public class Order { } - /** - **/ @ApiModelProperty(required = false, value = "") public Date getShipDate() { return shipDate; @@ -68,9 +64,6 @@ public class Order { } - /** - * Order Status - **/ @ApiModelProperty(required = false, value = "Order Status") public String getStatus() { return status; @@ -80,8 +73,6 @@ public class Order { } - /** - **/ @ApiModelProperty(required = false, value = "") public Boolean getComplete() { return complete; diff --git a/samples/client/petstore/java/src/main/java/com/wordnik/client/model/Pet.java b/samples/server/petstore/jaxrs/src/main/java/io/swagger/model/Pet.java similarity index 93% rename from samples/client/petstore/java/src/main/java/com/wordnik/client/model/Pet.java rename to samples/server/petstore/jaxrs/src/main/java/io/swagger/model/Pet.java index f84c1d0d925..b8de517cb78 100644 --- a/samples/client/petstore/java/src/main/java/com/wordnik/client/model/Pet.java +++ b/samples/server/petstore/jaxrs/src/main/java/io/swagger/model/Pet.java @@ -1,7 +1,7 @@ -package com.wordnik.client.model; +package io.swagger.model; -import com.wordnik.client.model.Category; -import com.wordnik.client.model.Tag; +import io.swagger.model.Category; +import io.swagger.model.Tag; import java.util.*; import com.wordnik.swagger.annotations.*; @@ -9,19 +9,27 @@ import com.wordnik.swagger.annotations.*; @ApiModel(description = "") public class Pet { + /** + **/ private Long id = null; - - //public enum idEnum { }; - + /** + **/ private Category category = null; + /** + **/ private String name = null; + /** + **/ private List photoUrls = new ArrayList() ; + /** + **/ private List tags = new ArrayList() ; + /** + * pet status in the store + **/ private String status = null; - /** - **/ @ApiModelProperty(required = false, value = "") public Long getId() { return id; @@ -31,8 +39,6 @@ public class Pet { } - /** - **/ @ApiModelProperty(required = false, value = "") public Category getCategory() { return category; @@ -42,8 +48,6 @@ public class Pet { } - /** - **/ @ApiModelProperty(required = true, value = "") public String getName() { return name; @@ -53,8 +57,6 @@ public class Pet { } - /** - **/ @ApiModelProperty(required = true, value = "") public List getPhotoUrls() { return photoUrls; @@ -64,8 +66,6 @@ public class Pet { } - /** - **/ @ApiModelProperty(required = false, value = "") public List getTags() { return tags; @@ -75,9 +75,6 @@ public class Pet { } - /** - * pet status in the store - **/ @ApiModelProperty(required = false, value = "pet status in the store") public String getStatus() { return status; diff --git a/samples/client/petstore/java/src/main/java/com/wordnik/client/model/Tag.java b/samples/server/petstore/jaxrs/src/main/java/io/swagger/model/Tag.java similarity index 91% rename from samples/client/petstore/java/src/main/java/com/wordnik/client/model/Tag.java rename to samples/server/petstore/jaxrs/src/main/java/io/swagger/model/Tag.java index 6fdc13bb049..ee3ad3baeb9 100644 --- a/samples/client/petstore/java/src/main/java/com/wordnik/client/model/Tag.java +++ b/samples/server/petstore/jaxrs/src/main/java/io/swagger/model/Tag.java @@ -1,4 +1,4 @@ -package com.wordnik.client.model; +package io.swagger.model; import com.wordnik.swagger.annotations.*; @@ -6,15 +6,14 @@ import com.wordnik.swagger.annotations.*; @ApiModel(description = "") public class Tag { + /** + **/ private Long id = null; - - //public enum idEnum { }; - + /** + **/ private String name = null; - /** - **/ @ApiModelProperty(required = false, value = "") public Long getId() { return id; @@ -24,8 +23,6 @@ public class Tag { } - /** - **/ @ApiModelProperty(required = false, value = "") public String getName() { return name; diff --git a/samples/client/petstore/java/src/main/java/com/wordnik/client/model/User.java b/samples/server/petstore/jaxrs/src/main/java/io/swagger/model/User.java similarity index 95% rename from samples/client/petstore/java/src/main/java/com/wordnik/client/model/User.java rename to samples/server/petstore/jaxrs/src/main/java/io/swagger/model/User.java index 3e1d8d032e6..0cf49ba9684 100644 --- a/samples/client/petstore/java/src/main/java/com/wordnik/client/model/User.java +++ b/samples/server/petstore/jaxrs/src/main/java/io/swagger/model/User.java @@ -1,4 +1,4 @@ -package com.wordnik.client.model; +package io.swagger.model; import com.wordnik.swagger.annotations.*; @@ -6,24 +6,33 @@ import com.wordnik.swagger.annotations.*; @ApiModel(description = "") public class User { - private Long id = null; - - //public enum idEnum { }; - - private String username = null; - private String firstName = null; - private String lastName = null; - private String email = null; - private String password = null; - private String phone = null; - private Integer userStatus = null; - - //public enum userStatusEnum { }; - - - /** **/ + private Long id = null; + /** + **/ + private String username = null; + /** + **/ + private String firstName = null; + /** + **/ + private String lastName = null; + /** + **/ + private String email = null; + /** + **/ + private String password = null; + /** + **/ + private String phone = null; + /** + * User Status + **/ + private Integer userStatus = null; + + @ApiModelProperty(required = false, value = "") public Long getId() { return id; @@ -33,8 +42,6 @@ public class User { } - /** - **/ @ApiModelProperty(required = false, value = "") public String getUsername() { return username; @@ -44,8 +51,6 @@ public class User { } - /** - **/ @ApiModelProperty(required = false, value = "") public String getFirstName() { return firstName; @@ -55,8 +60,6 @@ public class User { } - /** - **/ @ApiModelProperty(required = false, value = "") public String getLastName() { return lastName; @@ -66,8 +69,6 @@ public class User { } - /** - **/ @ApiModelProperty(required = false, value = "") public String getEmail() { return email; @@ -77,8 +78,6 @@ public class User { } - /** - **/ @ApiModelProperty(required = false, value = "") public String getPassword() { return password; @@ -88,8 +87,6 @@ public class User { } - /** - **/ @ApiModelProperty(required = false, value = "") public String getPhone() { return phone; @@ -99,9 +96,6 @@ public class User { } - /** - * User Status - **/ @ApiModelProperty(required = false, value = "User Status") public Integer getUserStatus() { return userStatus; diff --git a/samples/server/petstore/jaxrs/src/main/webapp/WEB-INF/web.xml b/samples/server/petstore/jaxrs/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 00000000000..2708ad5dd48 --- /dev/null +++ b/samples/server/petstore/jaxrs/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,54 @@ + + + + + jersey + com.sun.jersey.spi.container.servlet.ServletContainer + + com.sun.jersey.config.property.packages + com.wordnik.swagger.jaxrs.json;com.wordnik.swagger.jaxrs.listing;io.swagger.api + + + com.sun.jersey.spi.container.ContainerRequestFilters + com.sun.jersey.api.container.filter.PostReplaceFilter + + + com.sun.jersey.api.json.POJOMappingFeature + true + + 1 + + + + DefaultJaxrsConfig + com.wordnik.swagger.jaxrs.config.DefaultJaxrsConfig + + api.version + 1.0.0 + + + swagger.api.title + Swagger Server + + + swagger.api.basepath + http://localhost:8002 + + 2 + + + + jersey + /* + + + ApiOriginFilter + io.swagger.api.ApiOriginFilter + + + ApiOriginFilter + /* + + diff --git a/samples/swagger-dynamic-html/docs/index.html b/samples/swagger-dynamic-html/docs/index.html index 3fc58893379..e6c5488d455 100644 --- a/samples/swagger-dynamic-html/docs/index.html +++ b/samples/swagger-dynamic-html/docs/index.html @@ -90,6 +90,8 @@
    +
  • getInventory
  • +
  • placeOrder
  • getOrderById
  • diff --git a/samples/swagger-dynamic-html/docs/operations/StoreApi.html b/samples/swagger-dynamic-html/docs/operations/StoreApi.html index 75bd19e01a3..ecfa5fef653 100644 --- a/samples/swagger-dynamic-html/docs/operations/StoreApi.html +++ b/samples/swagger-dynamic-html/docs/operations/StoreApi.html @@ -4,6 +4,21 @@ +

    getInventory

    +
    +

    +

    Returns a map of status codes to quantities

    +

    URL

    + http://petstore.swagger.wordnik.com/v2/store/inventory +

    HTTP Method

    + GET +

    Response Type

    + +

    Parameters

    +
      + +
    +

    placeOrder


    diff --git a/samples/swagger-html/index.html b/samples/swagger-html/index.html index 077295b4a9e..2fc19ee462a 100644 --- a/samples/swagger-html/index.html +++ b/samples/swagger-html/index.html @@ -292,8 +292,12 @@
    petId (required)
    Path Parameter — ID of pet that needs to be updated
    - - +
    name (optional)
    + +
    Form Parameter — Updated name of the pet
    +
    status (optional)
    + +
    Form Parameter — Updated status of the pet

    Return type

    @@ -311,7 +315,7 @@

    Parameters

    -
    api_key (required)
    +
    api_key (optional)
    Header Parameter
    petId (required)
    @@ -329,6 +333,23 @@ +
    +
    get: /store/inventory
    +
    getInventory Returns pet inventories by status
    +
    Returns a map of status codes to quantities
    + +

    Parameters

    +
    + +
    +

    Return type

    + + + + +
    +
    +
    post: /store/order
    placeOrder Place an order for a pet