diff --git a/.gitignore b/.gitignore index f91fa3af631..589e45f6934 100644 --- a/.gitignore +++ b/.gitignore @@ -54,7 +54,7 @@ samples/client/petstore/qt5cpp/PetStore/PetStore samples/client/petstore/qt5cpp/PetStore/Makefile #Java/Android -**/.gradle/ +**/.gradle samples/client/petstore/java/hello.txt samples/client/petstore/android/default/hello.txt samples/client/petstore/android/volley/.gradle/ diff --git a/bin/jaxrs-resteasy-joda-petstore-server.json b/bin/jaxrs-resteasy-joda-petstore-server.json new file mode 100755 index 00000000000..785c7acdc6a --- /dev/null +++ b/bin/jaxrs-resteasy-joda-petstore-server.json @@ -0,0 +1,3 @@ +{ + "dateLibrary": "joda" +} diff --git a/bin/jaxrs-resteasy-joda-petstore-server.sh b/bin/jaxrs-resteasy-joda-petstore-server.sh new file mode 100755 index 00000000000..c1bbf6d71bf --- /dev/null +++ b/bin/jaxrs-resteasy-joda-petstore-server.sh @@ -0,0 +1,31 @@ +#!/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 + +executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.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="$@ generate -t modules/swagger-codegen/src/main/resources/JavaJaxRS -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l jaxrs-resteasy -o samples/server/petstore/jaxrs-resteasy/joda -DhideGenerationTimestamp=true -c ./bin/jaxrs-resteasy-joda-petstore-server.json" + +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/jaxrs-resteasy-petstore-server.sh b/bin/jaxrs-resteasy-petstore-server.sh index a715ded67f9..8fb30411d64 100755 --- a/bin/jaxrs-resteasy-petstore-server.sh +++ b/bin/jaxrs-resteasy-petstore-server.sh @@ -26,6 +26,6 @@ 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="$@ generate -t modules/swagger-codegen/src/main/resources/JavaJaxRS -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l jaxrs-resteasy -o samples/server/petstore/jaxrs-resteasy -DhideGenerationTimestamp=true" +ags="$@ generate -t modules/swagger-codegen/src/main/resources/JavaJaxRS -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l jaxrs-resteasy -o samples/server/petstore/jaxrs-resteasy/default -DhideGenerationTimestamp=true" java $JAVA_OPTS -jar $executable $ags diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/JacksonConfig.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/JacksonConfig.mustache index f2caa6c8331..0f591e315dc 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/JacksonConfig.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/JacksonConfig.mustache @@ -40,7 +40,6 @@ public class JacksonConfig implements ContextResolver { }); } - @Override public ObjectMapper getContext(Class arg0) { return objectMapper; } diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/gradle.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/gradle.mustache index b5d7e2378ef..ae34de08166 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/gradle.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/gradle.mustache @@ -15,10 +15,10 @@ dependencies { providedCompile 'javax.annotation:javax.annotation-api:1.2' providedCompile 'org.jboss.spec.javax.servlet:jboss-servlet-api_3.0_spec:1.0.0.Final' compile 'org.jboss.resteasy:resteasy-jackson2-provider:3.0.11.Final' - -// compile 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.4.1' -// compile 'joda-time:joda-time:2.7' - +{{#joda}} + compile 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.4.1' + compile 'joda-time:joda-time:2.7' +{{/joda}} testCompile 'junit:junit:4.12', 'org.hamcrest:hamcrest-core:1.3' } diff --git a/pom.xml b/pom.xml index 37cd5602fb8..c502c48914d 100644 --- a/pom.xml +++ b/pom.xml @@ -423,7 +423,19 @@ - samples/server/petstore/jaxrs-resteasy + samples/server/petstore/jaxrs-resteasy/default + + + + jaxrs-resteasy-server-joda + + + env + java + + + + samples/server/petstore/jaxrs-resteasy/joda @@ -591,7 +603,8 @@ samples/server/petstore/spring-mvc samples/server/petstore/jaxrs/jersey1 samples/server/petstore/jaxrs/jersey2 - samples/server/petstore/jaxrs-resteasy + samples/server/petstore/jaxrs-resteasy/default + samples/server/petstore/jaxrs-resteasy/joda diff --git a/samples/server/petstore/jaxrs-resteasy/default/.swagger-codegen-ignore b/samples/server/petstore/jaxrs-resteasy/default/.swagger-codegen-ignore new file mode 100644 index 00000000000..c5fa491b4c5 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/default/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/server/petstore/jaxrs-resteasy/default/LICENSE b/samples/server/petstore/jaxrs-resteasy/default/LICENSE new file mode 100644 index 00000000000..8dada3edaf5 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/default/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + 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. diff --git a/samples/server/petstore/jaxrs-resteasy/README.md b/samples/server/petstore/jaxrs-resteasy/default/README.md similarity index 100% rename from samples/server/petstore/jaxrs-resteasy/README.md rename to samples/server/petstore/jaxrs-resteasy/default/README.md diff --git a/samples/server/petstore/jaxrs-resteasy/build.gradle b/samples/server/petstore/jaxrs-resteasy/default/build.gradle similarity index 86% rename from samples/server/petstore/jaxrs-resteasy/build.gradle rename to samples/server/petstore/jaxrs-resteasy/default/build.gradle index d7afa6c5222..879fe11de18 100644 --- a/samples/server/petstore/jaxrs-resteasy/build.gradle +++ b/samples/server/petstore/jaxrs-resteasy/default/build.gradle @@ -15,10 +15,6 @@ dependencies { providedCompile 'javax.annotation:javax.annotation-api:1.2' providedCompile 'org.jboss.spec.javax.servlet:jboss-servlet-api_3.0_spec:1.0.0.Final' compile 'org.jboss.resteasy:resteasy-jackson2-provider:3.0.11.Final' - -// compile 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.4.1' -// compile 'joda-time:joda-time:2.7' - testCompile 'junit:junit:4.12', 'org.hamcrest:hamcrest-core:1.3' } diff --git a/samples/server/petstore/jaxrs-resteasy/pom.xml b/samples/server/petstore/jaxrs-resteasy/default/pom.xml similarity index 98% rename from samples/server/petstore/jaxrs-resteasy/pom.xml rename to samples/server/petstore/jaxrs-resteasy/default/pom.xml index c87fa4ab30d..3fe937dbc9b 100644 --- a/samples/server/petstore/jaxrs-resteasy/pom.xml +++ b/samples/server/petstore/jaxrs-resteasy/default/pom.xml @@ -145,7 +145,7 @@ - 1.5.7 + 1.5.8 9.2.9.v20150224 3.0.11.Final 1.6.3 diff --git a/samples/server/petstore/jaxrs-resteasy/settings.gradle b/samples/server/petstore/jaxrs-resteasy/default/settings.gradle similarity index 100% rename from samples/server/petstore/jaxrs-resteasy/settings.gradle rename to samples/server/petstore/jaxrs-resteasy/default/settings.gradle diff --git a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/ApiException.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/ApiException.java similarity index 75% rename from samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/ApiException.java rename to samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/ApiException.java index 269b2e95c5e..32c1e58df06 100644 --- a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/ApiException.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/ApiException.java @@ -1,6 +1,6 @@ package io.swagger.api; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-29T00:20:47.240+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-07-01T21:32:05.980+08:00") public class ApiException extends Exception{ private int code; public ApiException (int code, String msg) { diff --git a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/ApiOriginFilter.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/ApiOriginFilter.java similarity index 91% rename from samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/ApiOriginFilter.java rename to samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/ApiOriginFilter.java index a12422230ec..eeb813c3a22 100644 --- a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/ApiOriginFilter.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/ApiOriginFilter.java @@ -5,7 +5,7 @@ import java.io.IOException; import javax.servlet.*; import javax.servlet.http.HttpServletResponse; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-29T00:20:47.240+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-07-01T21:32:05.980+08:00") public class ApiOriginFilter implements javax.servlet.Filter { public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { diff --git a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/ApiResponseMessage.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/ApiResponseMessage.java similarity index 94% rename from samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/ApiResponseMessage.java rename to samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/ApiResponseMessage.java index 43cc54796d5..a9534f09f5d 100644 --- a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/ApiResponseMessage.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/ApiResponseMessage.java @@ -3,7 +3,7 @@ package io.swagger.api; import javax.xml.bind.annotation.XmlTransient; @javax.xml.bind.annotation.XmlRootElement -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-29T00:20:47.240+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-07-01T21:32:05.980+08:00") public class ApiResponseMessage { public static final int ERROR = 1; public static final int WARNING = 2; diff --git a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/NotFoundException.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/NotFoundException.java similarity index 77% rename from samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/NotFoundException.java rename to samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/NotFoundException.java index a367cfec514..6379b2b4499 100644 --- a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/NotFoundException.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/NotFoundException.java @@ -1,6 +1,6 @@ package io.swagger.api; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-29T00:20:47.240+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-07-01T21:32:05.980+08:00") public class NotFoundException extends ApiException { private int code; public NotFoundException (int code, String msg) { diff --git a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/PetApi.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/PetApi.java similarity index 97% rename from samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/PetApi.java rename to samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/PetApi.java index 6e360c1e23f..8b3ec467613 100644 --- a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/PetApi.java @@ -22,7 +22,7 @@ import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput; @Path("/pet") -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-29T00:20:47.240+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-07-01T21:32:05.980+08:00") public class PetApi { private final PetApiService delegate = PetApiServiceFactory.getPetApi(); diff --git a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/PetApiService.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/PetApiService.java similarity index 95% rename from samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/PetApiService.java rename to samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/PetApiService.java index f1a3e2465c2..0d3e9bb280a 100644 --- a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/PetApiService.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/PetApiService.java @@ -17,7 +17,7 @@ import java.io.InputStream; import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-29T00:20:47.240+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-07-01T21:32:05.980+08:00") public abstract class PetApiService { public abstract Response addPet(Pet body,SecurityContext securityContext) throws NotFoundException; diff --git a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/RestApplication.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/RestApplication.java similarity index 100% rename from samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/RestApplication.java rename to samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/RestApplication.java diff --git a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/StoreApi.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/StoreApi.java similarity index 95% rename from samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/StoreApi.java rename to samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/StoreApi.java index ed21293f466..2fdc2718271 100644 --- a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/StoreApi.java @@ -20,7 +20,7 @@ import javax.ws.rs.*; @Path("/store") -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-29T00:20:47.240+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-07-01T21:32:05.980+08:00") public class StoreApi { private final StoreApiService delegate = StoreApiServiceFactory.getStoreApi(); diff --git a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/StoreApiService.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/StoreApiService.java similarity index 92% rename from samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/StoreApiService.java rename to samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/StoreApiService.java index 52ea6fba817..f4b9a5ad692 100644 --- a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/StoreApiService.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/StoreApiService.java @@ -15,7 +15,7 @@ import java.io.InputStream; import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-29T00:20:47.240+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-07-01T21:32:05.980+08:00") public abstract class StoreApiService { public abstract Response deleteOrder(String orderId,SecurityContext securityContext) throws NotFoundException; diff --git a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/StringUtil.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/StringUtil.java similarity index 94% rename from samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/StringUtil.java rename to samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/StringUtil.java index 2fce17c06ce..2fb1f82f391 100644 --- a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/StringUtil.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/StringUtil.java @@ -1,6 +1,6 @@ package io.swagger.api; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-29T00:20:47.240+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-07-01T21:32:05.980+08:00") public class StringUtil { /** * Check if the given array contains the given value (with case-insensitive comparison). diff --git a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/UserApi.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/UserApi.java similarity index 97% rename from samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/UserApi.java rename to samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/UserApi.java index 55bd0c185d9..195e99f1a20 100644 --- a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/UserApi.java @@ -20,7 +20,7 @@ import javax.ws.rs.*; @Path("/user") -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-29T00:20:47.240+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-07-01T21:32:05.980+08:00") public class UserApi { private final UserApiService delegate = UserApiServiceFactory.getUserApi(); diff --git a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/UserApiService.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/UserApiService.java similarity index 94% rename from samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/UserApiService.java rename to samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/UserApiService.java index ea30abb522f..dc81bf13cb6 100644 --- a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/api/UserApiService.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/UserApiService.java @@ -15,7 +15,7 @@ import java.io.InputStream; import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-29T00:20:47.240+08:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-07-01T21:32:05.980+08:00") public abstract class UserApiService { public abstract Response createUser(User body,SecurityContext securityContext) throws NotFoundException; diff --git a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Category.java similarity index 95% rename from samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/model/Category.java rename to samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Category.java index fca6b39bfa8..172a2ce4436 100644 --- a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Category.java @@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-06-16T10:34:51.577+02:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-07-01T21:32:05.980+08:00") public class Category { private Long id = null; diff --git a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/ModelApiResponse.java similarity index 96% rename from samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/model/ModelApiResponse.java rename to samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/ModelApiResponse.java index 8229b459bd0..c55816bd394 100644 --- a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-06-16T10:34:51.577+02:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-07-01T21:32:05.980+08:00") public class ModelApiResponse { private Integer code = null; diff --git a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Order.java similarity index 97% rename from samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/model/Order.java rename to samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Order.java index fe59a870a06..3d62d7e86e0 100644 --- a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Order.java @@ -9,7 +9,7 @@ import java.util.Date; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-06-16T10:34:51.577+02:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-07-01T21:32:05.980+08:00") public class Order { private Long id = null; diff --git a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Pet.java similarity index 97% rename from samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/model/Pet.java rename to samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Pet.java index c56d0930366..8fa4e7486d8 100644 --- a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Pet.java @@ -11,7 +11,7 @@ import java.util.List; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-06-16T10:34:51.577+02:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-07-01T21:32:05.980+08:00") public class Pet { private Long id = null; diff --git a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Tag.java similarity index 95% rename from samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/model/Tag.java rename to samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Tag.java index 952f4e39d24..7018295e7f9 100644 --- a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Tag.java @@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-06-16T10:34:51.577+02:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-07-01T21:32:05.980+08:00") public class Tag { private Long id = null; diff --git a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/User.java similarity index 97% rename from samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/model/User.java rename to samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/User.java index a3e69975601..abfecb310fd 100644 --- a/samples/server/petstore/jaxrs-resteasy/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/User.java @@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-06-16T10:34:51.577+02:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-07-01T21:32:05.980+08:00") public class User { private Long id = null; diff --git a/samples/server/petstore/jaxrs-resteasy/src/main/java/io/swagger/api/factories/PetApiServiceFactory.java b/samples/server/petstore/jaxrs-resteasy/default/src/main/java/io/swagger/api/factories/PetApiServiceFactory.java similarity index 82% rename from samples/server/petstore/jaxrs-resteasy/src/main/java/io/swagger/api/factories/PetApiServiceFactory.java rename to samples/server/petstore/jaxrs-resteasy/default/src/main/java/io/swagger/api/factories/PetApiServiceFactory.java index 5b59c799d83..e191d6bbd95 100644 --- a/samples/server/petstore/jaxrs-resteasy/src/main/java/io/swagger/api/factories/PetApiServiceFactory.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/main/java/io/swagger/api/factories/PetApiServiceFactory.java @@ -3,7 +3,7 @@ package io.swagger.api.factories; import io.swagger.api.PetApiService; import io.swagger.api.impl.PetApiServiceImpl; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-02-04T01:58:20.368+07:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-07-01T21:32:05.980+08:00") public class PetApiServiceFactory { private final static PetApiService service = new PetApiServiceImpl(); diff --git a/samples/server/petstore/jaxrs-resteasy/src/main/java/io/swagger/api/factories/StoreApiServiceFactory.java b/samples/server/petstore/jaxrs-resteasy/default/src/main/java/io/swagger/api/factories/StoreApiServiceFactory.java similarity index 83% rename from samples/server/petstore/jaxrs-resteasy/src/main/java/io/swagger/api/factories/StoreApiServiceFactory.java rename to samples/server/petstore/jaxrs-resteasy/default/src/main/java/io/swagger/api/factories/StoreApiServiceFactory.java index d24f09ed8fc..3f8808798dd 100644 --- a/samples/server/petstore/jaxrs-resteasy/src/main/java/io/swagger/api/factories/StoreApiServiceFactory.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/main/java/io/swagger/api/factories/StoreApiServiceFactory.java @@ -3,7 +3,7 @@ package io.swagger.api.factories; import io.swagger.api.StoreApiService; import io.swagger.api.impl.StoreApiServiceImpl; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-02-04T01:58:20.368+07:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-07-01T21:32:05.980+08:00") public class StoreApiServiceFactory { private final static StoreApiService service = new StoreApiServiceImpl(); diff --git a/samples/server/petstore/jaxrs-resteasy/src/main/java/io/swagger/api/factories/UserApiServiceFactory.java b/samples/server/petstore/jaxrs-resteasy/default/src/main/java/io/swagger/api/factories/UserApiServiceFactory.java similarity index 83% rename from samples/server/petstore/jaxrs-resteasy/src/main/java/io/swagger/api/factories/UserApiServiceFactory.java rename to samples/server/petstore/jaxrs-resteasy/default/src/main/java/io/swagger/api/factories/UserApiServiceFactory.java index 8a976ccd354..1efe9e725df 100644 --- a/samples/server/petstore/jaxrs-resteasy/src/main/java/io/swagger/api/factories/UserApiServiceFactory.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/main/java/io/swagger/api/factories/UserApiServiceFactory.java @@ -3,7 +3,7 @@ package io.swagger.api.factories; import io.swagger.api.UserApiService; import io.swagger.api.impl.UserApiServiceImpl; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-02-04T01:58:20.368+07:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-07-01T21:32:05.980+08:00") public class UserApiServiceFactory { private final static UserApiService service = new UserApiServiceImpl(); diff --git a/samples/server/petstore/jaxrs-resteasy/default/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java b/samples/server/petstore/jaxrs-resteasy/default/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java new file mode 100644 index 00000000000..7bc1c47236d --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/default/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java @@ -0,0 +1,70 @@ +package io.swagger.api.impl; + +import io.swagger.api.*; +import io.swagger.model.*; +import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput; + + +import io.swagger.model.Pet; +import java.io.File; +import io.swagger.model.ModelApiResponse; + +import java.util.List; +import io.swagger.api.NotFoundException; + +import java.io.InputStream; + +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; + +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-07-01T21:32:05.980+08:00") +public class PetApiServiceImpl extends PetApiService { + @Override + public Response addPet(Pet body,SecurityContext securityContext) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + @Override + public Response deletePet(Long petId,String apiKey,SecurityContext securityContext) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + @Override + public Response findPetsByStatus(List status,SecurityContext securityContext) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + @Override + public Response findPetsByTags(List tags,SecurityContext securityContext) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + @Override + public Response getPetById(Long petId,SecurityContext securityContext) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + @Override + public Response updatePet(Pet body,SecurityContext securityContext) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + @Override + public Response updatePetWithForm(Long petId,String name,String status,SecurityContext securityContext) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + @Override + public Response uploadFile(MultipartFormDataInput input,Long petId,SecurityContext securityContext) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } +} diff --git a/samples/server/petstore/jaxrs-resteasy/default/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java b/samples/server/petstore/jaxrs-resteasy/default/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java new file mode 100644 index 00000000000..942bb9cd4f1 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/default/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java @@ -0,0 +1,44 @@ +package io.swagger.api.impl; + +import io.swagger.api.*; +import io.swagger.model.*; + + +import java.util.Map; +import io.swagger.model.Order; + +import java.util.List; +import io.swagger.api.NotFoundException; + +import java.io.InputStream; + +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; + +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-07-01T21:32:05.980+08:00") +public class StoreApiServiceImpl extends StoreApiService { + @Override + public Response deleteOrder(String orderId,SecurityContext securityContext) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + @Override + public Response getInventory(SecurityContext securityContext) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + @Override + public Response getOrderById(Long orderId,SecurityContext securityContext) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + @Override + public Response placeOrder(Order body,SecurityContext securityContext) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } +} diff --git a/samples/server/petstore/jaxrs-resteasy/default/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs-resteasy/default/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java new file mode 100644 index 00000000000..23a17f2827e --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/default/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java @@ -0,0 +1,68 @@ +package io.swagger.api.impl; + +import io.swagger.api.*; +import io.swagger.model.*; + + +import io.swagger.model.User; +import java.util.List; + +import java.util.List; +import io.swagger.api.NotFoundException; + +import java.io.InputStream; + +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; + +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-07-01T21:32:05.980+08:00") +public class UserApiServiceImpl extends UserApiService { + @Override + public Response createUser(User body,SecurityContext securityContext) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + @Override + public Response createUsersWithArrayInput(List body,SecurityContext securityContext) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + @Override + public Response createUsersWithListInput(List body,SecurityContext securityContext) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + @Override + public Response deleteUser(String username,SecurityContext securityContext) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + @Override + public Response getUserByName(String username,SecurityContext securityContext) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + @Override + public Response loginUser(String username,String password,SecurityContext securityContext) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + @Override + public Response logoutUser(SecurityContext securityContext) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + @Override + public Response updateUser(String username,User body,SecurityContext securityContext) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } +} diff --git a/samples/server/petstore/jaxrs-resteasy/src/main/webapp/WEB-INF/jboss-web.xml b/samples/server/petstore/jaxrs-resteasy/default/src/main/webapp/WEB-INF/jboss-web.xml similarity index 100% rename from samples/server/petstore/jaxrs-resteasy/src/main/webapp/WEB-INF/jboss-web.xml rename to samples/server/petstore/jaxrs-resteasy/default/src/main/webapp/WEB-INF/jboss-web.xml diff --git a/samples/server/petstore/jaxrs-resteasy/src/main/webapp/WEB-INF/web.xml b/samples/server/petstore/jaxrs-resteasy/default/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from samples/server/petstore/jaxrs-resteasy/src/main/webapp/WEB-INF/web.xml rename to samples/server/petstore/jaxrs-resteasy/default/src/main/webapp/WEB-INF/web.xml diff --git a/samples/server/petstore/jaxrs-resteasy/joda/.swagger-codegen-ignore b/samples/server/petstore/jaxrs-resteasy/joda/.swagger-codegen-ignore new file mode 100644 index 00000000000..c5fa491b4c5 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/joda/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/server/petstore/jaxrs-resteasy/joda/LICENSE b/samples/server/petstore/jaxrs-resteasy/joda/LICENSE new file mode 100644 index 00000000000..8dada3edaf5 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/joda/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + 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. diff --git a/samples/server/petstore/jaxrs-resteasy/joda/README.md b/samples/server/petstore/jaxrs-resteasy/joda/README.md new file mode 100644 index 00000000000..cc011c37ee5 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/joda/README.md @@ -0,0 +1,23 @@ +# Swagger generated server + +## Overview +This server was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the +[OpenAPI-Spec](https://github.com/swagger-api/swagger-core/wiki) from a remote server, you can easily generate a server stub. This +is an example of building a swagger-enabled JAX-RS server. + +This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework. + +To run the server, please execute the following: + +``` +mvn clean package jetty:run +``` + +You can then view the swagger listing here: + +``` +http://localhost:8080/v2/swagger.json +``` + +Note that if you have configured the `host` to be something other than localhost, the calls through +swagger-ui will be directed to that host and not localhost! \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build.gradle b/samples/server/petstore/jaxrs-resteasy/joda/build.gradle new file mode 100644 index 00000000000..ed888aecd20 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/joda/build.gradle @@ -0,0 +1,30 @@ +apply plugin: 'war' + +project.version = "1.0.0" +project.group = "io.swagger" + +repositories { + mavenCentral() +} + +dependencies { + providedCompile 'org.jboss.resteasy:resteasy-jaxrs:3.0.11.Final' + providedCompile 'org.jboss.resteasy:jaxrs-api:3.0.11.Final' + providedCompile 'org.jboss.resteasy:resteasy-validator-provider-11:3.0.11.Final' + providedCompile 'org.jboss.resteasy:resteasy-multipart-provider:3.0.11.Final' + providedCompile 'javax.annotation:javax.annotation-api:1.2' + providedCompile 'org.jboss.spec.javax.servlet:jboss-servlet-api_3.0_spec:1.0.0.Final' + compile 'org.jboss.resteasy:resteasy-jackson2-provider:3.0.11.Final' + compile 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.4.1' + compile 'joda-time:joda-time:2.7' + testCompile 'junit:junit:4.12', + 'org.hamcrest:hamcrest-core:1.3' +} + +sourceSets { + main { + java { + srcDir 'src/gen/java' + } + } +} diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/ApiException.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/ApiException.class new file mode 100644 index 00000000000..1a5809e0121 Binary files /dev/null and b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/ApiException.class differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/ApiOriginFilter.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/ApiOriginFilter.class new file mode 100644 index 00000000000..dd4fb4e630e Binary files /dev/null and b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/ApiOriginFilter.class differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/ApiResponseMessage.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/ApiResponseMessage.class new file mode 100644 index 00000000000..965310aed6b Binary files /dev/null and b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/ApiResponseMessage.class differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/JacksonConfig$1$1.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/JacksonConfig$1$1.class new file mode 100644 index 00000000000..82ef0b2dc84 Binary files /dev/null and b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/JacksonConfig$1$1.class differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/JacksonConfig$1$2.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/JacksonConfig$1$2.class new file mode 100644 index 00000000000..cb642d371b5 Binary files /dev/null and b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/JacksonConfig$1$2.class differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/JacksonConfig$1.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/JacksonConfig$1.class new file mode 100644 index 00000000000..841c18a9358 Binary files /dev/null and b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/JacksonConfig$1.class differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/JacksonConfig.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/JacksonConfig.class new file mode 100644 index 00000000000..e85d8d3ded0 Binary files /dev/null and b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/JacksonConfig.class differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/JodaDateTimeProvider$JodaDateTimeConverter.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/JodaDateTimeProvider$JodaDateTimeConverter.class new file mode 100644 index 00000000000..7113adb510a Binary files /dev/null and b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/JodaDateTimeProvider$JodaDateTimeConverter.class differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/JodaDateTimeProvider.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/JodaDateTimeProvider.class new file mode 100644 index 00000000000..3bbb134bccb Binary files /dev/null and b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/JodaDateTimeProvider.class differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/JodaLocalDateProvider$JodaLocalDateConverter.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/JodaLocalDateProvider$JodaLocalDateConverter.class new file mode 100644 index 00000000000..f6d4a456385 Binary files /dev/null and b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/JodaLocalDateProvider$JodaLocalDateConverter.class differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/JodaLocalDateProvider.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/JodaLocalDateProvider.class new file mode 100644 index 00000000000..cbd65fbdfa0 Binary files /dev/null and b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/JodaLocalDateProvider.class differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/NotFoundException.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/NotFoundException.class new file mode 100644 index 00000000000..5a4a6efb20b Binary files /dev/null and b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/NotFoundException.class differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/PetApi.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/PetApi.class new file mode 100644 index 00000000000..d79031aa47a Binary files /dev/null and b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/PetApi.class differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/PetApiService.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/PetApiService.class new file mode 100644 index 00000000000..8b92de3726b Binary files /dev/null and b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/PetApiService.class differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/RestApplication.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/RestApplication.class new file mode 100644 index 00000000000..ccb5a878805 Binary files /dev/null and b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/RestApplication.class differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/StoreApi.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/StoreApi.class new file mode 100644 index 00000000000..3ec261898f7 Binary files /dev/null and b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/StoreApi.class differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/StoreApiService.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/StoreApiService.class new file mode 100644 index 00000000000..97dc7ec7517 Binary files /dev/null and b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/StoreApiService.class differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/StringUtil.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/StringUtil.class new file mode 100644 index 00000000000..ef5d2e2e15f Binary files /dev/null and b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/StringUtil.class differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/UserApi.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/UserApi.class new file mode 100644 index 00000000000..0d8e9d98a7f Binary files /dev/null and b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/UserApi.class differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/UserApiService.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/UserApiService.class new file mode 100644 index 00000000000..efc4546a763 Binary files /dev/null and b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/UserApiService.class differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/factories/PetApiServiceFactory.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/factories/PetApiServiceFactory.class new file mode 100644 index 00000000000..959aad11df0 Binary files /dev/null and b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/factories/PetApiServiceFactory.class differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/factories/StoreApiServiceFactory.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/factories/StoreApiServiceFactory.class new file mode 100644 index 00000000000..bc1ef570a1d Binary files /dev/null and b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/factories/StoreApiServiceFactory.class differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/factories/UserApiServiceFactory.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/factories/UserApiServiceFactory.class new file mode 100644 index 00000000000..df26a6dc422 Binary files /dev/null and b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/factories/UserApiServiceFactory.class differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/impl/PetApiServiceImpl.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/impl/PetApiServiceImpl.class new file mode 100644 index 00000000000..45937fc2b85 Binary files /dev/null and b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/impl/PetApiServiceImpl.class differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/impl/StoreApiServiceImpl.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/impl/StoreApiServiceImpl.class new file mode 100644 index 00000000000..e6ec58a2ea9 Binary files /dev/null and b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/impl/StoreApiServiceImpl.class differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/impl/UserApiServiceImpl.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/impl/UserApiServiceImpl.class new file mode 100644 index 00000000000..9fa2e01da72 Binary files /dev/null and b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/impl/UserApiServiceImpl.class differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/model/Category.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/model/Category.class new file mode 100644 index 00000000000..88f5b8a208b Binary files /dev/null and b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/model/Category.class differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/model/ModelApiResponse.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/model/ModelApiResponse.class new file mode 100644 index 00000000000..791cf2bc40c Binary files /dev/null and b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/model/ModelApiResponse.class differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/model/Order$StatusEnum.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/model/Order$StatusEnum.class new file mode 100644 index 00000000000..464b6e1b696 Binary files /dev/null and b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/model/Order$StatusEnum.class differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/model/Order.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/model/Order.class new file mode 100644 index 00000000000..4e5b5a3c6c2 Binary files /dev/null and b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/model/Order.class differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/model/Pet$StatusEnum.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/model/Pet$StatusEnum.class new file mode 100644 index 00000000000..259e818d7c2 Binary files /dev/null and b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/model/Pet$StatusEnum.class differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/model/Pet.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/model/Pet.class new file mode 100644 index 00000000000..fdb8183739f Binary files /dev/null and b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/model/Pet.class differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/model/Tag.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/model/Tag.class new file mode 100644 index 00000000000..fbb273fe8e6 Binary files /dev/null and b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/model/Tag.class differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/model/User.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/model/User.class new file mode 100644 index 00000000000..303b9109b4e Binary files /dev/null and b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/model/User.class differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/pom.xml b/samples/server/petstore/jaxrs-resteasy/joda/pom.xml new file mode 100644 index 00000000000..3fe937dbc9b --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/joda/pom.xml @@ -0,0 +1,155 @@ + + 4.0.0 + io.swagger + swagger-jaxrs-resteasy-server + war + swagger-jaxrs-resteasy-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.codehaus.mojo + build-helper-maven-plugin + 1.9.1 + + + add-source + generate-sources + + add-source + + + + + src/gen/java + + + + + + + + + + org.slf4j + slf4j-log4j12 + ${slf4j-version} + + + javax.servlet + servlet-api + ${servlet-api-version} + provided + + + + org.jboss.resteasy + resteasy-jaxrs + ${resteasy-version} + provided + + + org.jboss.resteasy + jaxrs-api + ${resteasy-version} + provided + + + org.jboss.resteasy + resteasy-validator-provider-11 + ${resteasy-version} + provided + + + org.jboss.resteasy + resteasy-multipart-provider + ${resteasy-version} + provided + + + org.jboss.resteasy + resteasy-jackson2-provider + ${resteasy-version} + + + javax.annotation + javax.annotation-api + 1.2 + provided + + + + com.fasterxml.jackson.datatype + jackson-datatype-joda + 2.4.1 + + + joda-time + joda-time + 2.7 + + + + junit + junit + ${junit-version} + test + + + org.testng + testng + 6.8.8 + test + + + junit + junit + + + snakeyaml + org.yaml + + + bsh + org.beanshell + + + + + + + sonatype-snapshots + https://oss.sonatype.org/content/repositories/snapshots + + true + + + + + 1.5.8 + 9.2.9.v20150224 + 3.0.11.Final + 1.6.3 + 4.8.1 + 2.5 + + \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/joda/settings.gradle b/samples/server/petstore/jaxrs-resteasy/joda/settings.gradle new file mode 100644 index 00000000000..6392b5011e0 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/joda/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "swagger-jaxrs-resteasy-server" \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/ApiException.java b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/ApiException.java new file mode 100644 index 00000000000..9614941b59f --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/ApiException.java @@ -0,0 +1,10 @@ +package io.swagger.api; + +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-07-01T21:32:16.906+08:00") +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-resteasy/joda/src/gen/java/io/swagger/api/ApiOriginFilter.java b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/ApiOriginFilter.java new file mode 100644 index 00000000000..e3ed722543c --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/ApiOriginFilter.java @@ -0,0 +1,22 @@ +package io.swagger.api; + +import java.io.IOException; + +import javax.servlet.*; +import javax.servlet.http.HttpServletResponse; + +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-07-01T21:32:16.906+08:00") +public class ApiOriginFilter implements javax.servlet.Filter { + 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); + } + + public void destroy() {} + + public void init(FilterConfig filterConfig) throws ServletException {} +} \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/ApiResponseMessage.java b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/ApiResponseMessage.java new file mode 100644 index 00000000000..fcaebb85946 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/ApiResponseMessage.java @@ -0,0 +1,69 @@ +package io.swagger.api; + +import javax.xml.bind.annotation.XmlTransient; + +@javax.xml.bind.annotation.XmlRootElement +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-07-01T21:32:16.906+08:00") +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-resteasy/joda/src/gen/java/io/swagger/api/JacksonConfig.java b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/JacksonConfig.java new file mode 100644 index 00000000000..a2360fcc82b --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/JacksonConfig.java @@ -0,0 +1,46 @@ +package io.swagger.api; + +import com.fasterxml.jackson.core.JsonGenerationException; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import com.fasterxml.jackson.datatype.joda.JodaModule; +import org.joda.time.DateTime; +import org.joda.time.LocalDate; +import org.joda.time.format.ISODateTimeFormat; + +import javax.ws.rs.ext.ContextResolver; +import javax.ws.rs.ext.Provider; +import java.io.IOException; + +@Provider +public class JacksonConfig implements ContextResolver { + private final ObjectMapper objectMapper; + + public JacksonConfig() throws Exception { + + objectMapper = new ObjectMapper(); + objectMapper.registerModule(new JodaModule() { + { + addSerializer(DateTime.class, new StdSerializer(DateTime.class) { + @Override + public void serialize(DateTime value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonGenerationException { + jgen.writeString(ISODateTimeFormat.dateTimeNoMillis().print(value)); + } + }); + addSerializer(LocalDate.class, new StdSerializer(LocalDate.class) { + @Override + public void serialize(LocalDate value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonGenerationException { + jgen.writeString(ISODateTimeFormat.date().print(value)); + } + }); + + } + }); + } + + public ObjectMapper getContext(Class arg0) { + return objectMapper; + } +} \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/JodaDateTimeProvider.java b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/JodaDateTimeProvider.java new file mode 100644 index 00000000000..918d08ac95d --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/JodaDateTimeProvider.java @@ -0,0 +1,42 @@ +package io.swagger.api; + +import org.joda.time.DateTime; +import javax.ws.rs.ext.ParamConverter; +import javax.ws.rs.ext.ParamConverterProvider; +import javax.ws.rs.ext.Provider; +import java.lang.annotation.Annotation; +import java.lang.reflect.Type; +import javax.ws.rs.WebApplicationException; +import javax.ws.rs.core.Response; + + +@Provider +public class JodaDateTimeProvider implements ParamConverterProvider { + + public static class JodaDateTimeConverter implements ParamConverter { + + @Override + public DateTime fromString(String string) { + try { + DateTime dateTime = DateTime.parse(string); + return dateTime; + } catch (Exception e) { + throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST). + entity(string + " must be valid DateTime").build()); + } + } + + @Override + public String toString(DateTime t) { + return t.toString(); + } + } + + @Override + public ParamConverter getConverter(Class type, Type type1, Annotation[] antns) { + if (DateTime.class.equals(type)) { + return (ParamConverter) new JodaDateTimeConverter(); + } + return null; + } +} \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/JodaLocalDateProvider.java b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/JodaLocalDateProvider.java new file mode 100644 index 00000000000..a4298e4f6ea --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/JodaLocalDateProvider.java @@ -0,0 +1,42 @@ +package io.swagger.api; + +import org.joda.time.LocalDate; +import javax.ws.rs.ext.ParamConverter; +import javax.ws.rs.ext.ParamConverterProvider; +import javax.ws.rs.ext.Provider; +import java.lang.annotation.Annotation; +import java.lang.reflect.Type; +import javax.ws.rs.WebApplicationException; +import javax.ws.rs.core.Response; + + +@Provider +public class JodaLocalDateProvider implements ParamConverterProvider { + + public static class JodaLocalDateConverter implements ParamConverter { + + @Override + public LocalDate fromString(String string) { + try { + LocalDate localDate = LocalDate.parse(string); + return localDate; + } catch (Exception e) { + throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST). + entity(string + " must be valid LocalDate").build()); + } + } + + @Override + public String toString(LocalDate t) { + return t.toString(); + } + } + + @Override + public ParamConverter getConverter(Class type, Type type1, Annotation[] antns) { + if (LocalDate.class.equals(type)) { + return (ParamConverter) new JodaLocalDateConverter(); + } + return null; + } +} \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/NotFoundException.java b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/NotFoundException.java new file mode 100644 index 00000000000..ddb41ff1ac0 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/NotFoundException.java @@ -0,0 +1,10 @@ +package io.swagger.api; + +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-07-01T21:32:16.906+08:00") +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-resteasy/joda/src/gen/java/io/swagger/api/PetApi.java b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/PetApi.java new file mode 100644 index 00000000000..b879a0f1a89 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/PetApi.java @@ -0,0 +1,93 @@ +package io.swagger.api; + +import io.swagger.model.*; +import io.swagger.api.PetApiService; +import io.swagger.api.factories.PetApiServiceFactory; + +import io.swagger.model.Pet; +import java.io.File; +import io.swagger.model.ModelApiResponse; + +import java.util.List; +import io.swagger.api.NotFoundException; + +import java.io.InputStream; + +import javax.ws.rs.core.Context; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; +import javax.ws.rs.*; +import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput; + +@Path("/pet") + + +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-07-01T21:32:16.906+08:00") +public class PetApi { + private final PetApiService delegate = PetApiServiceFactory.getPetApi(); + + @POST + + @Consumes({ "application/json", "application/xml" }) + @Produces({ "application/xml", "application/json" }) + public Response addPet( Pet body,@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.addPet(body,securityContext); + } + @DELETE + @Path("/{petId}") + + @Produces({ "application/xml", "application/json" }) + public Response deletePet( @PathParam("petId") Long petId,@HeaderParam("api_key") String apiKey,@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.deletePet(petId,apiKey,securityContext); + } + @GET + @Path("/findByStatus") + + @Produces({ "application/xml", "application/json" }) + public Response findPetsByStatus( @QueryParam("status") List status,@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.findPetsByStatus(status,securityContext); + } + @GET + @Path("/findByTags") + + @Produces({ "application/xml", "application/json" }) + public Response findPetsByTags( @QueryParam("tags") List tags,@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.findPetsByTags(tags,securityContext); + } + @GET + @Path("/{petId}") + + @Produces({ "application/xml", "application/json" }) + public Response getPetById( @PathParam("petId") Long petId,@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.getPetById(petId,securityContext); + } + @PUT + + @Consumes({ "application/json", "application/xml" }) + @Produces({ "application/xml", "application/json" }) + public Response updatePet( Pet body,@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.updatePet(body,securityContext); + } + @POST + @Path("/{petId}") + @Consumes({ "application/x-www-form-urlencoded" }) + @Produces({ "application/xml", "application/json" }) + public Response updatePetWithForm( @PathParam("petId") Long petId,@FormParam("name") String name,@FormParam("status") String status,@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.updatePetWithForm(petId,name,status,securityContext); + } + @POST + @Path("/{petId}/uploadImage") + @Consumes({ "multipart/form-data" }) + @Produces({ "application/json" }) + public Response uploadFile(MultipartFormDataInput input, @PathParam("petId") Long petId,@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.uploadFile(input,petId,securityContext); + } +} diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/PetApiService.java b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/PetApiService.java new file mode 100644 index 00000000000..1902d3d3a8e --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/PetApiService.java @@ -0,0 +1,38 @@ +package io.swagger.api; + +import io.swagger.api.*; +import io.swagger.model.*; +import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput; + + +import io.swagger.model.Pet; +import java.io.File; +import io.swagger.model.ModelApiResponse; + +import java.util.List; +import io.swagger.api.NotFoundException; + +import java.io.InputStream; + +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; + +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-07-01T21:32:16.906+08:00") +public abstract class PetApiService { + public abstract Response addPet(Pet body,SecurityContext securityContext) + throws NotFoundException; + public abstract Response deletePet(Long petId,String apiKey,SecurityContext securityContext) + throws NotFoundException; + public abstract Response findPetsByStatus(List status,SecurityContext securityContext) + throws NotFoundException; + public abstract Response findPetsByTags(List tags,SecurityContext securityContext) + throws NotFoundException; + public abstract Response getPetById(Long petId,SecurityContext securityContext) + throws NotFoundException; + public abstract Response updatePet(Pet body,SecurityContext securityContext) + throws NotFoundException; + public abstract Response updatePetWithForm(Long petId,String name,String status,SecurityContext securityContext) + throws NotFoundException; + public abstract Response uploadFile(MultipartFormDataInput input,Long petId,SecurityContext securityContext) + throws NotFoundException; +} diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/RestApplication.java b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/RestApplication.java new file mode 100644 index 00000000000..24aa63ce824 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/RestApplication.java @@ -0,0 +1,9 @@ +package io.swagger.api; + +import javax.ws.rs.ApplicationPath; +import javax.ws.rs.core.Application; + +@ApplicationPath("/") +public class RestApplication extends Application { + +} \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/StoreApi.java b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/StoreApi.java new file mode 100644 index 00000000000..09b8dcc2518 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/StoreApi.java @@ -0,0 +1,59 @@ +package io.swagger.api; + +import io.swagger.model.*; +import io.swagger.api.StoreApiService; +import io.swagger.api.factories.StoreApiServiceFactory; + +import java.util.Map; +import io.swagger.model.Order; + +import java.util.List; +import io.swagger.api.NotFoundException; + +import java.io.InputStream; + +import javax.ws.rs.core.Context; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; +import javax.ws.rs.*; + +@Path("/store") + + +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-07-01T21:32:16.906+08:00") +public class StoreApi { + private final StoreApiService delegate = StoreApiServiceFactory.getStoreApi(); + + @DELETE + @Path("/order/{orderId}") + + @Produces({ "application/xml", "application/json" }) + public Response deleteOrder( @PathParam("orderId") String orderId,@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.deleteOrder(orderId,securityContext); + } + @GET + @Path("/inventory") + + @Produces({ "application/json" }) + public Response getInventory(@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.getInventory(securityContext); + } + @GET + @Path("/order/{orderId}") + + @Produces({ "application/xml", "application/json" }) + public Response getOrderById( @PathParam("orderId") Long orderId,@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.getOrderById(orderId,securityContext); + } + @POST + @Path("/order") + + @Produces({ "application/xml", "application/json" }) + public Response placeOrder( Order body,@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.placeOrder(body,securityContext); + } +} diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/StoreApiService.java b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/StoreApiService.java new file mode 100644 index 00000000000..9adc467a735 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/StoreApiService.java @@ -0,0 +1,28 @@ +package io.swagger.api; + +import io.swagger.api.*; +import io.swagger.model.*; + + +import java.util.Map; +import io.swagger.model.Order; + +import java.util.List; +import io.swagger.api.NotFoundException; + +import java.io.InputStream; + +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; + +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-07-01T21:32:16.906+08:00") +public abstract class StoreApiService { + public abstract Response deleteOrder(String orderId,SecurityContext securityContext) + throws NotFoundException; + public abstract Response getInventory(SecurityContext securityContext) + throws NotFoundException; + public abstract Response getOrderById(Long orderId,SecurityContext securityContext) + throws NotFoundException; + public abstract Response placeOrder(Order body,SecurityContext securityContext) + throws NotFoundException; +} diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/StringUtil.java b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/StringUtil.java new file mode 100644 index 00000000000..128c83a4abd --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/StringUtil.java @@ -0,0 +1,42 @@ +package io.swagger.api; + +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-07-01T21:32:16.906+08:00") +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) return true; + if (value != null && value.equalsIgnoreCase(str)) return true; + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

+ * Note: This might be replaced by utility method from commons-lang or guava someday + * if one of those libraries is added as dependency. + *

+ * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) return ""; + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } +} diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/UserApi.java b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/UserApi.java new file mode 100644 index 00000000000..7e6ac878913 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/UserApi.java @@ -0,0 +1,91 @@ +package io.swagger.api; + +import io.swagger.model.*; +import io.swagger.api.UserApiService; +import io.swagger.api.factories.UserApiServiceFactory; + +import io.swagger.model.User; +import java.util.List; + +import java.util.List; +import io.swagger.api.NotFoundException; + +import java.io.InputStream; + +import javax.ws.rs.core.Context; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; +import javax.ws.rs.*; + +@Path("/user") + + +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-07-01T21:32:16.906+08:00") +public class UserApi { + private final UserApiService delegate = UserApiServiceFactory.getUserApi(); + + @POST + + + @Produces({ "application/xml", "application/json" }) + public Response createUser( User body,@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.createUser(body,securityContext); + } + @POST + @Path("/createWithArray") + + @Produces({ "application/xml", "application/json" }) + public Response createUsersWithArrayInput( List body,@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.createUsersWithArrayInput(body,securityContext); + } + @POST + @Path("/createWithList") + + @Produces({ "application/xml", "application/json" }) + public Response createUsersWithListInput( List body,@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.createUsersWithListInput(body,securityContext); + } + @DELETE + @Path("/{username}") + + @Produces({ "application/xml", "application/json" }) + public Response deleteUser( @PathParam("username") String username,@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.deleteUser(username,securityContext); + } + @GET + @Path("/{username}") + + @Produces({ "application/xml", "application/json" }) + public Response getUserByName( @PathParam("username") String username,@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.getUserByName(username,securityContext); + } + @GET + @Path("/login") + + @Produces({ "application/xml", "application/json" }) + public Response loginUser( @QueryParam("username") String username, @QueryParam("password") String password,@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.loginUser(username,password,securityContext); + } + @GET + @Path("/logout") + + @Produces({ "application/xml", "application/json" }) + public Response logoutUser(@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.logoutUser(securityContext); + } + @PUT + @Path("/{username}") + + @Produces({ "application/xml", "application/json" }) + public Response updateUser( @PathParam("username") String username, User body,@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.updateUser(username,body,securityContext); + } +} diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/UserApiService.java b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/UserApiService.java new file mode 100644 index 00000000000..fdbeb37c6b8 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/api/UserApiService.java @@ -0,0 +1,36 @@ +package io.swagger.api; + +import io.swagger.api.*; +import io.swagger.model.*; + + +import io.swagger.model.User; +import java.util.List; + +import java.util.List; +import io.swagger.api.NotFoundException; + +import java.io.InputStream; + +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; + +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-07-01T21:32:16.906+08:00") +public abstract class UserApiService { + public abstract Response createUser(User body,SecurityContext securityContext) + throws NotFoundException; + public abstract Response createUsersWithArrayInput(List body,SecurityContext securityContext) + throws NotFoundException; + public abstract Response createUsersWithListInput(List body,SecurityContext securityContext) + throws NotFoundException; + public abstract Response deleteUser(String username,SecurityContext securityContext) + throws NotFoundException; + public abstract Response getUserByName(String username,SecurityContext securityContext) + throws NotFoundException; + public abstract Response loginUser(String username,String password,SecurityContext securityContext) + throws NotFoundException; + public abstract Response logoutUser(SecurityContext securityContext) + throws NotFoundException; + public abstract Response updateUser(String username,User body,SecurityContext securityContext) + throws NotFoundException; +} diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/Category.java new file mode 100644 index 00000000000..8e4077bf511 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/Category.java @@ -0,0 +1,79 @@ +package io.swagger.model; + +import java.util.Objects; +import java.util.ArrayList; +import com.fasterxml.jackson.annotation.JsonProperty; + + + + +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-07-01T21:32:16.906+08:00") +public class Category { + + private Long id = null; + private String name = null; + + /** + **/ + + @JsonProperty("id") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + + /** + **/ + + @JsonProperty("name") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Category category = (Category) o; + return Objects.equals(id, category.id) && + Objects.equals(name, category.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Category {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/ModelApiResponse.java new file mode 100644 index 00000000000..96b11ce19e5 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -0,0 +1,93 @@ +package io.swagger.model; + +import java.util.Objects; +import java.util.ArrayList; +import com.fasterxml.jackson.annotation.JsonProperty; + + + + +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-07-01T21:32:16.906+08:00") +public class ModelApiResponse { + + private Integer code = null; + private String type = null; + private String message = null; + + /** + **/ + + @JsonProperty("code") + public Integer getCode() { + return code; + } + public void setCode(Integer code) { + this.code = code; + } + + /** + **/ + + @JsonProperty("type") + public String getType() { + return type; + } + public void setType(String type) { + this.type = type; + } + + /** + **/ + + @JsonProperty("message") + public String getMessage() { + return message; + } + public void setMessage(String message) { + this.message = message; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelApiResponse _apiResponse = (ModelApiResponse) o; + return Objects.equals(code, _apiResponse.code) && + Objects.equals(type, _apiResponse.type) && + Objects.equals(message, _apiResponse.message); + } + + @Override + public int hashCode() { + return Objects.hash(code, type, message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelApiResponse {\n"); + + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/Order.java new file mode 100644 index 00000000000..843d9b91421 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/Order.java @@ -0,0 +1,161 @@ +package io.swagger.model; + +import java.util.Objects; +import java.util.ArrayList; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import org.joda.time.DateTime; + + + + +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-07-01T21:32:16.906+08:00") +public class Order { + + private Long id = null; + private Long petId = null; + private Integer quantity = null; + private DateTime shipDate = null; + + /** + * Order Status + */ + public enum StatusEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + } + + private StatusEnum status = null; + private Boolean complete = false; + + /** + **/ + + @JsonProperty("id") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + + /** + **/ + + @JsonProperty("petId") + public Long getPetId() { + return petId; + } + public void setPetId(Long petId) { + this.petId = petId; + } + + /** + **/ + + @JsonProperty("quantity") + public Integer getQuantity() { + return quantity; + } + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } + + /** + **/ + + @JsonProperty("shipDate") + public DateTime getShipDate() { + return shipDate; + } + public void setShipDate(DateTime shipDate) { + this.shipDate = shipDate; + } + + /** + * Order Status + **/ + + @JsonProperty("status") + public StatusEnum getStatus() { + return status; + } + public void setStatus(StatusEnum status) { + this.status = status; + } + + /** + **/ + + @JsonProperty("complete") + public Boolean getComplete() { + return complete; + } + public void setComplete(Boolean complete) { + this.complete = complete; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Order order = (Order) o; + return Objects.equals(id, order.id) && + Objects.equals(petId, order.petId) && + Objects.equals(quantity, order.quantity) && + Objects.equals(shipDate, order.shipDate) && + Objects.equals(status, order.status) && + Objects.equals(complete, order.complete); + } + + @Override + public int hashCode() { + return Objects.hash(id, petId, quantity, shipDate, status, complete); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Order {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/Pet.java new file mode 100644 index 00000000000..f367b3e32b6 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/Pet.java @@ -0,0 +1,163 @@ +package io.swagger.model; + +import java.util.Objects; +import java.util.ArrayList; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.model.Category; +import io.swagger.model.Tag; +import java.util.List; + + + + +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-07-01T21:32:16.906+08:00") +public class Pet { + + private Long id = null; + private Category category = null; + private String name = null; + private List photoUrls = new ArrayList(); + private List tags = new ArrayList(); + + /** + * pet status in the store + */ + public enum StatusEnum { + AVAILABLE("available"), + + PENDING("pending"), + + SOLD("sold"); + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + } + + private StatusEnum status = null; + + /** + **/ + + @JsonProperty("id") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + + /** + **/ + + @JsonProperty("category") + public Category getCategory() { + return category; + } + public void setCategory(Category category) { + this.category = category; + } + + /** + **/ + + @JsonProperty("name") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + /** + **/ + + @JsonProperty("photoUrls") + public List getPhotoUrls() { + return photoUrls; + } + public void setPhotoUrls(List photoUrls) { + this.photoUrls = photoUrls; + } + + /** + **/ + + @JsonProperty("tags") + public List getTags() { + return tags; + } + public void setTags(List tags) { + this.tags = tags; + } + + /** + * pet status in the store + **/ + + @JsonProperty("status") + public StatusEnum getStatus() { + return status; + } + public void setStatus(StatusEnum status) { + this.status = status; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Pet pet = (Pet) o; + return Objects.equals(id, pet.id) && + Objects.equals(category, pet.category) && + Objects.equals(name, pet.name) && + Objects.equals(photoUrls, pet.photoUrls) && + Objects.equals(tags, pet.tags) && + Objects.equals(status, pet.status); + } + + @Override + public int hashCode() { + return Objects.hash(id, category, name, photoUrls, tags, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Pet {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/Tag.java new file mode 100644 index 00000000000..3815af34412 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/Tag.java @@ -0,0 +1,79 @@ +package io.swagger.model; + +import java.util.Objects; +import java.util.ArrayList; +import com.fasterxml.jackson.annotation.JsonProperty; + + + + +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-07-01T21:32:16.906+08:00") +public class Tag { + + private Long id = null; + private String name = null; + + /** + **/ + + @JsonProperty("id") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + + /** + **/ + + @JsonProperty("name") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Tag tag = (Tag) o; + return Objects.equals(id, tag.id) && + Objects.equals(name, tag.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Tag {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/User.java new file mode 100644 index 00000000000..45464c9de08 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/User.java @@ -0,0 +1,164 @@ +package io.swagger.model; + +import java.util.Objects; +import java.util.ArrayList; +import com.fasterxml.jackson.annotation.JsonProperty; + + + + +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-07-01T21:32:16.906+08:00") +public class User { + + 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; + private Integer userStatus = null; + + /** + **/ + + @JsonProperty("id") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + + /** + **/ + + @JsonProperty("username") + public String getUsername() { + return username; + } + public void setUsername(String username) { + this.username = username; + } + + /** + **/ + + @JsonProperty("firstName") + public String getFirstName() { + return firstName; + } + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + /** + **/ + + @JsonProperty("lastName") + public String getLastName() { + return lastName; + } + public void setLastName(String lastName) { + this.lastName = lastName; + } + + /** + **/ + + @JsonProperty("email") + public String getEmail() { + return email; + } + public void setEmail(String email) { + this.email = email; + } + + /** + **/ + + @JsonProperty("password") + public String getPassword() { + return password; + } + public void setPassword(String password) { + this.password = password; + } + + /** + **/ + + @JsonProperty("phone") + public String getPhone() { + return phone; + } + public void setPhone(String phone) { + this.phone = phone; + } + + /** + * User Status + **/ + + @JsonProperty("userStatus") + public Integer getUserStatus() { + return userStatus; + } + public void setUserStatus(Integer userStatus) { + this.userStatus = userStatus; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + User user = (User) o; + return Objects.equals(id, user.id) && + Objects.equals(username, user.username) && + Objects.equals(firstName, user.firstName) && + Objects.equals(lastName, user.lastName) && + Objects.equals(email, user.email) && + Objects.equals(password, user.password) && + Objects.equals(phone, user.phone) && + Objects.equals(userStatus, user.userStatus); + } + + @Override + public int hashCode() { + return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class User {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/main/java/io/swagger/api/factories/PetApiServiceFactory.java b/samples/server/petstore/jaxrs-resteasy/joda/src/main/java/io/swagger/api/factories/PetApiServiceFactory.java new file mode 100644 index 00000000000..001606d8e53 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/main/java/io/swagger/api/factories/PetApiServiceFactory.java @@ -0,0 +1,15 @@ +package io.swagger.api.factories; + +import io.swagger.api.PetApiService; +import io.swagger.api.impl.PetApiServiceImpl; + +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-07-01T21:32:16.906+08:00") +public class PetApiServiceFactory { + + private final static PetApiService service = new PetApiServiceImpl(); + + public static PetApiService getPetApi() + { + return service; + } +} diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/main/java/io/swagger/api/factories/StoreApiServiceFactory.java b/samples/server/petstore/jaxrs-resteasy/joda/src/main/java/io/swagger/api/factories/StoreApiServiceFactory.java new file mode 100644 index 00000000000..3372e08c682 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/main/java/io/swagger/api/factories/StoreApiServiceFactory.java @@ -0,0 +1,15 @@ +package io.swagger.api.factories; + +import io.swagger.api.StoreApiService; +import io.swagger.api.impl.StoreApiServiceImpl; + +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-07-01T21:32:16.906+08:00") +public class StoreApiServiceFactory { + + private final static StoreApiService service = new StoreApiServiceImpl(); + + public static StoreApiService getStoreApi() + { + return service; + } +} diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/main/java/io/swagger/api/factories/UserApiServiceFactory.java b/samples/server/petstore/jaxrs-resteasy/joda/src/main/java/io/swagger/api/factories/UserApiServiceFactory.java new file mode 100644 index 00000000000..036ec3bfa9e --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/main/java/io/swagger/api/factories/UserApiServiceFactory.java @@ -0,0 +1,15 @@ +package io.swagger.api.factories; + +import io.swagger.api.UserApiService; +import io.swagger.api.impl.UserApiServiceImpl; + +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-07-01T21:32:16.906+08:00") +public class UserApiServiceFactory { + + private final static UserApiService service = new UserApiServiceImpl(); + + public static UserApiService getUserApi() + { + return service; + } +} diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java b/samples/server/petstore/jaxrs-resteasy/joda/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java new file mode 100644 index 00000000000..4e088969fbf --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java @@ -0,0 +1,70 @@ +package io.swagger.api.impl; + +import io.swagger.api.*; +import io.swagger.model.*; +import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput; + + +import io.swagger.model.Pet; +import java.io.File; +import io.swagger.model.ModelApiResponse; + +import java.util.List; +import io.swagger.api.NotFoundException; + +import java.io.InputStream; + +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; + +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-07-01T21:32:16.906+08:00") +public class PetApiServiceImpl extends PetApiService { + @Override + public Response addPet(Pet body,SecurityContext securityContext) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + @Override + public Response deletePet(Long petId,String apiKey,SecurityContext securityContext) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + @Override + public Response findPetsByStatus(List status,SecurityContext securityContext) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + @Override + public Response findPetsByTags(List tags,SecurityContext securityContext) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + @Override + public Response getPetById(Long petId,SecurityContext securityContext) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + @Override + public Response updatePet(Pet body,SecurityContext securityContext) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + @Override + public Response updatePetWithForm(Long petId,String name,String status,SecurityContext securityContext) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + @Override + public Response uploadFile(MultipartFormDataInput input,Long petId,SecurityContext securityContext) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } +} diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java b/samples/server/petstore/jaxrs-resteasy/joda/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java new file mode 100644 index 00000000000..d77f7ad19ca --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java @@ -0,0 +1,44 @@ +package io.swagger.api.impl; + +import io.swagger.api.*; +import io.swagger.model.*; + + +import java.util.Map; +import io.swagger.model.Order; + +import java.util.List; +import io.swagger.api.NotFoundException; + +import java.io.InputStream; + +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; + +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-07-01T21:32:16.906+08:00") +public class StoreApiServiceImpl extends StoreApiService { + @Override + public Response deleteOrder(String orderId,SecurityContext securityContext) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + @Override + public Response getInventory(SecurityContext securityContext) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + @Override + public Response getOrderById(Long orderId,SecurityContext securityContext) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + @Override + public Response placeOrder(Order body,SecurityContext securityContext) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } +} diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs-resteasy/joda/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java new file mode 100644 index 00000000000..ec3dff01ece --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java @@ -0,0 +1,68 @@ +package io.swagger.api.impl; + +import io.swagger.api.*; +import io.swagger.model.*; + + +import io.swagger.model.User; +import java.util.List; + +import java.util.List; +import io.swagger.api.NotFoundException; + +import java.io.InputStream; + +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; + +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-07-01T21:32:16.906+08:00") +public class UserApiServiceImpl extends UserApiService { + @Override + public Response createUser(User body,SecurityContext securityContext) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + @Override + public Response createUsersWithArrayInput(List body,SecurityContext securityContext) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + @Override + public Response createUsersWithListInput(List body,SecurityContext securityContext) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + @Override + public Response deleteUser(String username,SecurityContext securityContext) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + @Override + public Response getUserByName(String username,SecurityContext securityContext) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + @Override + public Response loginUser(String username,String password,SecurityContext securityContext) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + @Override + public Response logoutUser(SecurityContext securityContext) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + @Override + public Response updateUser(String username,User body,SecurityContext securityContext) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } +} diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/main/webapp/WEB-INF/jboss-web.xml b/samples/server/petstore/jaxrs-resteasy/joda/src/main/webapp/WEB-INF/jboss-web.xml new file mode 100644 index 00000000000..9c05ed07b78 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/main/webapp/WEB-INF/jboss-web.xml @@ -0,0 +1,3 @@ + + /v2 + \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/main/webapp/WEB-INF/web.xml b/samples/server/petstore/jaxrs-resteasy/joda/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 00000000000..52a89e92132 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,14 @@ + + + + + ApiOriginFilter + io.swagger.api.ApiOriginFilter + + + ApiOriginFilter + /* + + diff --git a/samples/server/petstore/jaxrs-resteasy/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java b/samples/server/petstore/jaxrs-resteasy/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java deleted file mode 100644 index c1192247ba3..00000000000 --- a/samples/server/petstore/jaxrs-resteasy/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java +++ /dev/null @@ -1,93 +0,0 @@ -package io.swagger.api.impl; - -import io.swagger.api.*; -import io.swagger.model.*; -import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput; - - -import io.swagger.model.Pet; -import java.io.File; - - -import java.util.List; -import io.swagger.api.NotFoundException; - -import java.io.InputStream; - -import javax.ws.rs.core.Response; -import javax.ws.rs.core.SecurityContext; - -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-02-04T01:58:20.368+07:00") - -public class PetApiServiceImpl extends PetApiService { - - @Override - public Response updatePet(Pet body,SecurityContext securityContext) throws NotFoundException { - // do some magic! - return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); - } - - @Override - public Response addPet(Pet body,SecurityContext securityContext) throws NotFoundException { - // do some magic! - return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); - } - - @Override - public Response findPetsByStatus(List status,SecurityContext securityContext) throws NotFoundException { - // do some magic! - return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); - } - - @Override - public Response findPetsByTags(List tags,SecurityContext securityContext) throws NotFoundException { - // do some magic! - return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); - } - - @Override - public Response getPetById(Long petId,SecurityContext securityContext) throws NotFoundException { - // do some magic! - return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); - } - - /* - * comment out as the method (for testing) does not exit in the original swagger spec - * we'll uncomment this code block later if we update the petstore server - @Override - public Response getPetByIdInObject(Long petId,SecurityContext securityContext) throws NotFoundException { - // do some magic! - return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); - } - */ - - @Override - public Response updatePetWithForm(Long petId,String name,String status,SecurityContext securityContext) throws NotFoundException { - // do some magic! - return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); - } - - @Override - public Response deletePet(Long petId,String apiKey,SecurityContext securityContext) throws NotFoundException { - // do some magic! - return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); - } - - @Override - public Response uploadFile(MultipartFormDataInput input,Long petId,SecurityContext securityContext) throws NotFoundException { - // do some magic! - return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); - } - - /* - * comment out as the method (for testing) does not exit in the original swagger spec - * we'll uncomment this code block later if we update the petstore server - @Override - public Response petPetIdtestingByteArraytrueGet(Long petId,SecurityContext securityContext) throws NotFoundException { - // do some magic! - return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); - } - */ - -} - diff --git a/samples/server/petstore/jaxrs-resteasy/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java b/samples/server/petstore/jaxrs-resteasy/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java deleted file mode 100644 index b19e9003af5..00000000000 --- a/samples/server/petstore/jaxrs-resteasy/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java +++ /dev/null @@ -1,68 +0,0 @@ -package io.swagger.api.impl; - -import io.swagger.api.*; -import io.swagger.model.*; - - -import java.util.Map; -import io.swagger.model.Order; - - -import java.util.List; -import io.swagger.api.NotFoundException; - -import java.io.InputStream; - -import javax.ws.rs.core.Response; -import javax.ws.rs.core.SecurityContext; - -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-02-04T01:58:20.368+07:00") - -public class StoreApiServiceImpl extends StoreApiService { - - @Override - public Response getInventory(SecurityContext securityContext) throws NotFoundException { - // do some magic! - return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); - } - - /* - * * comment out as the method (for testing) does not exit in the original swagger spec - * * we'll uncomment this code block later if we update the petstore server - @Override - public Response getInventoryInObject(SecurityContext securityContext) throws NotFoundException { - // do some magic! - return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); - } - */ - - @Override - public Response placeOrder(Order body,SecurityContext securityContext) throws NotFoundException { - // do some magic! - return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); - } - - @Override - public Response getOrderById(Long orderId,SecurityContext securityContext) throws NotFoundException { - // do some magic! - return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); - } - - @Override - public Response deleteOrder(String orderId,SecurityContext securityContext) throws NotFoundException { - // do some magic! - return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); - } - - /* - * * comment out as the method (for testing) does not exit in the original swagger spec - * * we'll uncomment this code block later if we update the petstore server - @Override - public Response findOrdersByStatus(String status, SecurityContext securityContext) throws NotFoundException { - // do some magic! - return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); - } - */ - -} - diff --git a/samples/server/petstore/jaxrs-resteasy/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs-resteasy/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java deleted file mode 100644 index e2d9acb67ba..00000000000 --- a/samples/server/petstore/jaxrs-resteasy/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java +++ /dev/null @@ -1,72 +0,0 @@ -package io.swagger.api.impl; - -import io.swagger.api.*; -import io.swagger.model.*; - - -import io.swagger.model.User; -import java.util.*; - - -import java.util.List; -import io.swagger.api.NotFoundException; - -import java.io.InputStream; - -import javax.ws.rs.core.Response; -import javax.ws.rs.core.SecurityContext; - -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-02-04T01:58:20.368+07:00") - -public class UserApiServiceImpl extends UserApiService { - - @Override - public Response createUser(User body,SecurityContext securityContext) throws NotFoundException { - // do some magic! - return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); - } - - @Override - public Response createUsersWithArrayInput(List body,SecurityContext securityContext) throws NotFoundException { - // do some magic! - return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); - } - - @Override - public Response createUsersWithListInput(List body,SecurityContext securityContext) throws NotFoundException { - // do some magic! - return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); - } - - @Override - public Response loginUser(String username,String password,SecurityContext securityContext) throws NotFoundException { - // do some magic! - return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); - } - - @Override - public Response logoutUser(SecurityContext securityContext) throws NotFoundException { - // do some magic! - return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); - } - - @Override - public Response getUserByName(String username,SecurityContext securityContext) throws NotFoundException { - // do some magic! - return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); - } - - @Override - public Response updateUser(String username,User body,SecurityContext securityContext) throws NotFoundException { - // do some magic! - return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); - } - - @Override - public Response deleteUser(String username,SecurityContext securityContext) throws NotFoundException { - // do some magic! - return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); - } - -} -