diff --git a/bin/jaxrs-cxf-cdi-petstore-server.sh b/bin/jaxrs-cxf-cdi-petstore-server.sh index de76a381d80..2144dc4199b 100755 --- a/bin/jaxrs-cxf-cdi-petstore-server.sh +++ b/bin/jaxrs-cxf-cdi-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/cxf-cdi -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l jaxrs-cxf-cdi -o samples/server/petstore/jaxrs-cxf-cdi -DhideGenerationTimestamp=true" +ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l jaxrs-cxf-cdi -o samples/server/petstore/jaxrs-cxf-cdi -DhideGenerationTimestamp=true" -# java $JAVA_OPTS -jar $executable $ags +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/jaxrs-cxf-petstore-server-annotated-base-path.sh b/bin/jaxrs-cxf-petstore-server-annotated-base-path.sh index 4a52ab0919e..fb63deb74c7 100755 --- a/bin/jaxrs-cxf-petstore-server-annotated-base-path.sh +++ b/bin/jaxrs-cxf-petstore-server-annotated-base-path.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 --artifact-id swagger-cxf-annotated-basepath -t modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l jaxrs-cxf -o samples/server/petstore/jaxrs-cxf-annotated-base-path -DhideGenerationTimestamp=true,useAnnotatedBasePath=true" +ags="$@ generate --artifact-id swagger-cxf-annotated-basepath -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l jaxrs-cxf -o samples/server/petstore/jaxrs-cxf-annotated-base-path -DhideGenerationTimestamp=true,useAnnotatedBasePath=true" -# java $JAVA_OPTS -jar $executable $ags +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/jaxrs-cxf-petstore-server-non-spring-application.sh b/bin/jaxrs-cxf-petstore-server-non-spring-application.sh index a473ed4cbd9..c2112d412fb 100755 --- a/bin/jaxrs-cxf-petstore-server-non-spring-application.sh +++ b/bin/jaxrs-cxf-petstore-server-non-spring-application.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 --artifact-id swagger-cxf-server-non-spring -t modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l jaxrs-cxf -o samples/server/petstore/jaxrs-cxf-non-spring-app -DhideGenerationTimestamp=true,generateNonSpringApplication=true" +ags="$@ generate --artifact-id swagger-cxf-server-non-spring -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l jaxrs-cxf -o samples/server/petstore/jaxrs-cxf-non-spring-app -DhideGenerationTimestamp=true,generateNonSpringApplication=true" -# java $JAVA_OPTS -jar $executable $ags +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/jaxrs-cxf-petstore-server.sh b/bin/jaxrs-cxf-petstore-server.sh index 6bb330f2a96..e0a01f74538 100755 --- a/bin/jaxrs-cxf-petstore-server.sh +++ b/bin/jaxrs-cxf-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/cxf -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l jaxrs-cxf -o samples/server/petstore/jaxrs-cxf -DhideGenerationTimestamp=true" +ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l jaxrs-cxf -o samples/server/petstore/jaxrs-cxf -DhideGenerationTimestamp=true" -# java $JAVA_OPTS -jar $executable $ags +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/jaxrs-jersey1-petstore-server.sh b/bin/jaxrs-jersey1-petstore-server.sh index 87df38d37e5..d0ebbb85314 100755 --- a/bin/jaxrs-jersey1-petstore-server.sh +++ b/bin/jaxrs-jersey1-petstore-server.sh @@ -26,9 +26,9 @@ 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-with-fake-endpoints-models-for-testing.yaml -l jaxrs-jersey -o samples/server/petstore/jaxrs/jersey1 -DhideGenerationTimestamp=true,serverPort=8080 --library=jersey1 --artifact-id=swagger-jaxrs-jersey1-server" +ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l jaxrs-jersey -o samples/server/petstore/jaxrs/jersey1 -DhideGenerationTimestamp=true,serverPort=8080 --library=jersey1 --artifact-id=swagger-jaxrs-jersey1-server" echo "Removing files and folders under samples/server/petstore/jaxrs/jersey1/src/main" rm -rf samples/server/petstore/jaxrs/jersey1/src/main find samples/server/petstore/jaxrs/jersey1 -maxdepth 1 -type f ! -name "README.md" -exec rm {} + -# java $JAVA_OPTS -jar $executable $ags +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/jaxrs-jersey1-usetags-petstore-server.sh b/bin/jaxrs-jersey1-usetags-petstore-server.sh index 1d5b9b9b145..2fbc345b6fb 100755 --- a/bin/jaxrs-jersey1-usetags-petstore-server.sh +++ b/bin/jaxrs-jersey1-usetags-petstore-server.sh @@ -26,9 +26,9 @@ 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-with-fake-endpoints-models-for-testing.yaml -l jaxrs-jersey -o samples/server/petstore/jaxrs/jersey1-useTags -DhideGenerationTimestamp=true,serverPort=8080 --library=jersey1 --artifact-id=swagger-jaxrs-jersey1-useTags --additional-properties useTags=true" +ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l jaxrs-jersey -o samples/server/petstore/jaxrs/jersey1-useTags -DhideGenerationTimestamp=true,serverPort=8080 --library=jersey1 --artifact-id=swagger-jaxrs-jersey1-useTags --additional-properties useTags=true" echo "Removing files and folders under samples/server/petstore/jaxrs/jersey1-useTags/src/main" rm -rf samples/server/petstore/jaxrs/jersey1-useTags/src/main find samples/server/petstore/jaxrs/jersey1-useTags -maxdepth 1 -type f ! -name "README.md" -exec rm {} + -# java $JAVA_OPTS -jar $executable $ags +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/jaxrs-petstore-server.sh b/bin/jaxrs-petstore-server.sh index 5353400d2fa..a8378337ae7 100755 --- a/bin/jaxrs-petstore-server.sh +++ b/bin/jaxrs-petstore-server.sh @@ -26,9 +26,9 @@ 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-with-fake-endpoints-models-for-testing.yaml -l jaxrs-jersey -o samples/server/petstore/jaxrs/jersey2 -DhideGenerationTimestamp=true,serverPort=8080" +ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l jaxrs-jersey -o samples/server/petstore/jaxrs/jersey2 -DhideGenerationTimestamp=true,serverPort=8080" echo "Removing files and folders under samples/server/petstore/jaxrs/jersey2/src/main" rm -rf samples/server/petstore/jaxrs/jersey2/src/main find samples/server/petstore/jaxrs/jersey2 -maxdepth 1 -type f ! -name "README.md" -exec rm {} + -# java $JAVA_OPTS -jar $executable $ags +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/jaxrs-resteasy-eap-java8-petstore-server.sh b/bin/jaxrs-resteasy-eap-java8-petstore-server.sh index f12540637fa..0f4f9f4dae4 100755 --- a/bin/jaxrs-resteasy-eap-java8-petstore-server.sh +++ b/bin/jaxrs-resteasy-eap-java8-petstore-server.sh @@ -26,10 +26,10 @@ 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 --artifact-id swagger-jaxrs-resteasy-eap-java8-server -t modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l jaxrs-resteasy-eap -o samples/server/petstore/jaxrs-resteasy/eap-java8 -DhideGenerationTimestamp=true -c ./bin/jaxrs-resteasy-eap-java8-petstore-server.json" +ags="$@ generate --artifact-id swagger-jaxrs-resteasy-eap-java8-server -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l jaxrs-resteasy-eap -o samples/server/petstore/jaxrs-resteasy/eap-java8 -DhideGenerationTimestamp=true -c ./bin/jaxrs-resteasy-eap-java8-petstore-server.json" echo "Removing files and folders under samples/server/petstore/jaxrs-resteasy/eap-java8/src/main" rm -rf samples/server/petstore/jaxrs-resteasy/eap-java8/src/main find samples/server/petstore/jaxrs-resteasy/eap-java8 -maxdepth 1 -type f ! -name "README.md" -exec rm {} + -# java $JAVA_OPTS -jar $executable $ags +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/jaxrs-resteasy-eap-joda-petstore-server.sh b/bin/jaxrs-resteasy-eap-joda-petstore-server.sh index ad30910e0a8..2908926f554 100755 --- a/bin/jaxrs-resteasy-eap-joda-petstore-server.sh +++ b/bin/jaxrs-resteasy-eap-joda-petstore-server.sh @@ -26,10 +26,10 @@ 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 --artifact-id swagger-jaxrs-resteasy-eap-joda-server -t modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l jaxrs-resteasy-eap -o samples/server/petstore/jaxrs-resteasy/eap-joda -DhideGenerationTimestamp=true -c ./bin/jaxrs-resteasy-eap-joda-petstore-server.json" +ags="$@ generate --artifact-id swagger-jaxrs-resteasy-eap-joda-server -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l jaxrs-resteasy-eap -o samples/server/petstore/jaxrs-resteasy/eap-joda -DhideGenerationTimestamp=true -c ./bin/jaxrs-resteasy-eap-joda-petstore-server.json" echo "Removing files and folders under samples/server/petstore/jaxrs-resteasy/eap-joda/src/main" rm -rf samples/server/petstore/jaxrs-resteasy/eap-joda/src/main find samples/server/petstore/jaxrs-resteasy/eap-joda -maxdepth 1 -type f ! -name "README.md" -exec rm {} + -# java $JAVA_OPTS -jar $executable $ags +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/jaxrs-resteasy-eap-petstore-server.sh b/bin/jaxrs-resteasy-eap-petstore-server.sh index 3c6d88cdb3a..d732bb14804 100755 --- a/bin/jaxrs-resteasy-eap-petstore-server.sh +++ b/bin/jaxrs-resteasy-eap-petstore-server.sh @@ -26,10 +26,10 @@ 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/resteasy/eap -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l jaxrs-resteasy-eap -o samples/server/petstore/jaxrs-resteasy/eap -DhideGenerationTimestamp=true" +ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l jaxrs-resteasy-eap -o samples/server/petstore/jaxrs-resteasy/eap -DhideGenerationTimestamp=true" echo "Removing files and folders under samples/server/petstore/jaxrs-resteasy/eap/src/main" rm -rf samples/server/petstore/jaxrs-resteasy/eap/src/main find samples/server/petstore/jaxrs-resteasy/eap -maxdepth 1 -type f ! -name "README.md" -exec rm {} + -# java $JAVA_OPTS -jar $executable $ags +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/jaxrs-resteasy-joda-petstore-server.sh b/bin/jaxrs-resteasy-joda-petstore-server.sh index 48a9cb99897..a314e5c3b5b 100755 --- a/bin/jaxrs-resteasy-joda-petstore-server.sh +++ b/bin/jaxrs-resteasy-joda-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 --artifact-id swagger-jaxrs-resteasy-joda-server -t modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy -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" +ags="$@ generate --artifact-id swagger-jaxrs-resteasy-joda-server -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 +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/jaxrs-resteasy-petstore-server.sh b/bin/jaxrs-resteasy-petstore-server.sh index 02507c2f393..56b828212f8 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/resteasy -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l jaxrs-resteasy -o samples/server/petstore/jaxrs-resteasy/default -DhideGenerationTimestamp=true" +ags="$@ generate -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 +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/jaxrs-spec-petstore-server-interface.sh b/bin/jaxrs-spec-petstore-server-interface.sh index df6c7039613..d47718f2788 100755 --- a/bin/jaxrs-spec-petstore-server-interface.sh +++ b/bin/jaxrs-spec-petstore-server-interface.sh @@ -31,4 +31,4 @@ ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore-with -DserializableModel=true -DinterfaceOnly=true" -# java $JAVA_OPTS -jar $executable $ags +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/jaxrs-spec-petstore-server.sh b/bin/jaxrs-spec-petstore-server.sh index 7a93d914ff9..5350bab881c 100755 --- a/bin/jaxrs-spec-petstore-server.sh +++ b/bin/jaxrs-spec-petstore-server.sh @@ -30,4 +30,4 @@ ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore-with -DhideGenerationTimestamp=true -DserializableModel=true" -# java $JAVA_OPTS -jar $executable $ags +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/jaxrs-usetags-petstore-server.sh b/bin/jaxrs-usetags-petstore-server.sh index 2c8ecb9e9d1..1a3d0dda4a4 100755 --- a/bin/jaxrs-usetags-petstore-server.sh +++ b/bin/jaxrs-usetags-petstore-server.sh @@ -26,9 +26,9 @@ 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-with-fake-endpoints-models-for-testing.yaml -l jaxrs-jersey -o samples/server/petstore/jaxrs/jersey2-useTags -DhideGenerationTimestamp=true,serverPort=8080 --artifact-id=swagger-jaxrs-jersey2-useTags --additional-properties useTags=true" +ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l jaxrs-jersey -o samples/server/petstore/jaxrs/jersey2-useTags -DhideGenerationTimestamp=true,serverPort=8080 --artifact-id=swagger-jaxrs-jersey2-useTags --additional-properties useTags=true" echo "Removing files and folders under samples/server/petstore/jaxrs/jersey2-useTags/src/main" rm -rf samples/server/petstore/jaxrs/jersey2-useTags/src/main find samples/server/petstore/jaxrs/jersey2-useTags -maxdepth 1 -type f ! -name "README.md" -exec rm {} + -# java $JAVA_OPTS -jar $executable $ags +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/windows/jaxrs-spec-petstore-server-interface.bat b/bin/windows/jaxrs-spec-petstore-server-interface.bat index 7d5f7745c9e..5ca4f38101e 100644 --- a/bin/windows/jaxrs-spec-petstore-server-interface.bat +++ b/bin/windows/jaxrs-spec-petstore-server-interface.bat @@ -7,4 +7,4 @@ If Not Exist %executable% ( REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties set ags=generate --artifact-id "jaxrs-cxf-client-petstore-client" -i modules\swagger-codegen\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -l jaxrs-spec -o samples\server\petstore\jaxrs-spec-interface -DhideGenerationTimestamp=true,serializableModel=true,interfaceOnly=true -REM java %JAVA_OPTS% -jar %executable% %ags% +java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/jaxrs-spec-petstore-server.bat b/bin/windows/jaxrs-spec-petstore-server.bat index 87678ad7752..30c19a50891 100644 --- a/bin/windows/jaxrs-spec-petstore-server.bat +++ b/bin/windows/jaxrs-spec-petstore-server.bat @@ -7,4 +7,4 @@ If Not Exist %executable% ( REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties set ags=generate --artifact-id "jaxrs-cxf-client-petstore-client" -i modules\swagger-codegen\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -l jaxrs-spec -o samples\server\petstore\jaxrs-spec -DhideGenerationTimestamp=true,serializableModel=true -REM java %JAVA_OPTS% -jar %executable% %ags% +java %JAVA_OPTS% -jar %executable% %ags% diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/.swagger-codegen-ignore b/samples/server/petstore/jaxrs-cxf-annotated-base-path/.swagger-codegen-ignore index c5fa491b4c5..70b88e71039 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/.swagger-codegen-ignore +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/.swagger-codegen-ignore @@ -21,3 +21,5 @@ #docs/*.md # Then explicitly reverse the ignore rule for a single file: #!docs/README.md + +**/impl/* \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/.swagger-codegen/VERSION b/samples/server/petstore/jaxrs-cxf-annotated-base-path/.swagger-codegen/VERSION index f9f7450d135..096bf47efe3 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/.swagger-codegen/VERSION +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.0-SNAPSHOT \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/pom.xml b/samples/server/petstore/jaxrs-cxf-annotated-base-path/pom.xml index 0136d8f0a76..e9346df3697 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/pom.xml +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/pom.xml @@ -4,7 +4,9 @@ swagger-cxf-annotated-basepath war swagger-cxf-annotated-basepath + This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + 1.0.0 src/main/java @@ -33,10 +35,19 @@ 8079 stopit - 8080 + -1 60000 + + + + javax.validation + validation-api + ${beanvalidation-version} + + + start-jetty @@ -113,6 +124,7 @@ ${junit-version} test + javax.validation @@ -120,6 +132,7 @@ ${beanvalidation-version} provided + org.apache.cxf @@ -165,12 +178,17 @@ ${jackson-jaxrs-version} compile + + - com.fasterxml.jackson.datatype - jackson-datatype-joda - ${jackson-jaxrs-version} - compile + com.fasterxml.jackson.datatype + jackson-datatype-joda + ${jackson-jaxrs-version} + + + + @@ -185,14 +203,18 @@ 1.7 ${java.version} ${java.version} - 1.5.15 + 1.5.18 9.2.9.v20150224 4.12 1.1.7 2.5 + 1.1.0.Final - 3.1.11 - 2.8.9 + + + + 3.2.1 + 2.9.1 UTF-8 diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/api/PetApi.java b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/api/PetApi.java index c576178bcc0..4b4d21d2c06 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/api/PetApi.java @@ -1,9 +1,9 @@ package io.swagger.api; -import java.io.File; import io.swagger.model.ModelApiResponse; import io.swagger.model.Pet; + import java.io.InputStream; import java.io.OutputStream; import java.util.List; @@ -18,139 +18,194 @@ import io.swagger.annotations.ApiResponses; import io.swagger.annotations.ApiResponse; import io.swagger.jaxrs.PATCH; + import javax.validation.constraints.*; import javax.validation.Valid; + + /** * Swagger Petstore * + *

This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * + */ + @Path("/v2") @Api(value = "/", description = "") + public interface PetApi { + + + /** * Add a new pet to the store * - * - * + */ + @POST @Path("/pet") + @Consumes({ "application/json", "application/xml" }) - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Add a new pet to the store", tags={ "pet", }) + + + @ApiOperation(value = "Add a new pet to the store", tags={ "pet" }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input") }) - public void addPet(@Valid Pet body); + public void addPet(@Valid Pet pet); + + /** * Deletes a pet * - * - * + */ + @DELETE @Path("/pet/{petId}") - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Deletes a pet", tags={ "pet", }) + + + @ApiOperation(value = "Deletes a pet", tags={ "pet" }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid pet value") }) - public void deletePet(@PathParam("petId") Long petId, @HeaderParam("api_key") String apiKey); + public void deletePet(@PathParam("petId") Integer petId, @HeaderParam("api_key") String apiKey); + + /** * Finds Pets by status * + * Multiple status values can be provided with comma separated strings * + */ + @GET @Path("/pet/findByStatus") + + @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Finds Pets by status", tags={ "pet", }) + + @ApiOperation(value = "Finds Pets by status", tags={ "pet" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid status value") }) public List findPetsByStatus(@QueryParam("status") @NotNull List status); + + /** * Finds Pets by tags * + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * + */ + @GET @Path("/pet/findByTags") + + @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Finds Pets by tags", tags={ "pet", }) + + @ApiOperation(value = "Finds Pets by tags", tags={ "pet" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid tag value") }) public List findPetsByTags(@QueryParam("tags") @NotNull List tags); + + /** * Find pet by ID * + * Returns a single pet * + */ + @GET @Path("/pet/{petId}") + + @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Find pet by ID", tags={ "pet", }) + + @ApiOperation(value = "Find pet by ID", tags={ "pet" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found") }) - public Pet getPetById(@PathParam("petId") Long petId); + public Pet getPetById(@PathParam("petId") Integer petId); + + /** * Update an existing pet * - * - * + */ + @PUT @Path("/pet") + @Consumes({ "application/json", "application/xml" }) - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Update an existing pet", tags={ "pet", }) + + + @ApiOperation(value = "Update an existing pet", tags={ "pet" }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found"), @ApiResponse(code = 405, message = "Validation exception") }) - public void updatePet(@Valid Pet body); + public void updatePet(@Valid Pet pet); + + /** * Updates a pet in the store with form data * - * - * + */ + @POST @Path("/pet/{petId}") + @Consumes({ "application/x-www-form-urlencoded" }) - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Updates a pet in the store with form data", tags={ "pet", }) + + + @ApiOperation(value = "Updates a pet in the store with form data", tags={ "pet" }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input") }) - public void updatePetWithForm(@PathParam("petId") Long petId, @Multipart(value = "name", required = false) String name, @Multipart(value = "status", required = false) String status); + public void updatePetWithForm(@PathParam("petId") Integer petId, @Valid Object body); + + /** * uploads an image * - * - * + */ + @POST @Path("/pet/{petId}/uploadImage") + @Consumes({ "multipart/form-data" }) + + @Produces({ "application/json" }) + @ApiOperation(value = "uploads an image", tags={ "pet" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - public ModelApiResponse uploadFile(@PathParam("petId") Long petId, @Multipart(value = "additionalMetadata", required = false) String additionalMetadata, @Multipart(value = "file" , required = false) Attachment fileDetail); + public ModelApiResponse uploadFile(@PathParam("petId") Integer petId, @Valid Object body); + } + diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/api/StoreApi.java b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/api/StoreApi.java index 5e18529e1b5..bbdfa6722a4 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/api/StoreApi.java @@ -3,6 +3,7 @@ import java.util.Map; import io.swagger.model.Order; + import java.io.InputStream; import java.io.OutputStream; import java.util.List; @@ -17,77 +18,116 @@ import io.swagger.annotations.ApiResponses; import io.swagger.annotations.ApiResponse; import io.swagger.jaxrs.PATCH; + import javax.validation.constraints.*; import javax.validation.Valid; + + /** * Swagger Petstore * + *

This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * + */ + @Path("/v2") @Api(value = "/", description = "") + public interface StoreApi { + + + /** * Delete purchase order by ID * + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * + */ + @DELETE @Path("/store/order/{orderId}") - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Delete purchase order by ID", tags={ "store", }) + + + @ApiOperation(value = "Delete purchase order by ID", tags={ "store" }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) public void deleteOrder(@PathParam("orderId") String orderId); + + /** * Returns pet inventories by status * + * Returns a map of status codes to quantities * + */ + @GET @Path("/store/inventory") + + @Produces({ "application/json" }) - @ApiOperation(value = "Returns pet inventories by status", tags={ "store", }) + + @ApiOperation(value = "Returns pet inventories by status", tags={ "store" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) public Map getInventory(); + + /** * Find purchase order by ID * + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * + */ + @GET @Path("/store/order/{orderId}") + + @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Find purchase order by ID", tags={ "store", }) + + @ApiOperation(value = "Find purchase order by ID", tags={ "store" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) - public Order getOrderById(@PathParam("orderId") @Min(1) @Max(5) Long orderId); + public Order getOrderById(@PathParam("orderId") @DecimalMin("1") @DecimalMax("5") Integer orderId); + + /** * Place an order for a pet * - * - * + */ + @POST @Path("/store/order") + + @Consumes({ "*/*" }) + + @Produces({ "application/xml", "application/json" }) + @ApiOperation(value = "Place an order for a pet", tags={ "store" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order") }) - public Order placeOrder(@Valid Order body); + public Order placeOrder(@Valid Order order); + } + diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/api/UserApi.java b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/api/UserApi.java index a5fd5adf01c..9a058049225 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/api/UserApi.java @@ -1,8 +1,8 @@ package io.swagger.api; -import java.util.List; import io.swagger.model.User; + import java.io.InputStream; import java.io.OutputStream; import java.util.List; @@ -17,134 +17,189 @@ import io.swagger.annotations.ApiResponses; import io.swagger.annotations.ApiResponse; import io.swagger.jaxrs.PATCH; + import javax.validation.constraints.*; import javax.validation.Valid; + + /** * Swagger Petstore * + *

This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * + */ + @Path("/v2") @Api(value = "/", description = "") + public interface UserApi { + + + /** * Create user * + * This can only be done by the logged in user. * + */ + @POST @Path("/user") - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Create user", tags={ "user", }) + + @Consumes({ "*/*" }) + + + @ApiOperation(value = "Create user", tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - public void createUser(@Valid User body); + public void createUser(@Valid User user); + + /** * Creates list of users with given input array * - * - * + */ + @POST @Path("/user/createWithArray") - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Creates list of users with given input array", tags={ "user", }) + + @Consumes({ "*/*" }) + + + @ApiOperation(value = "Creates list of users with given input array", tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) public void createUsersWithArrayInput(@Valid List body); + + /** * Creates list of users with given input array * - * - * + */ + @POST @Path("/user/createWithList") - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Creates list of users with given input array", tags={ "user", }) + + @Consumes({ "*/*" }) + + + @ApiOperation(value = "Creates list of users with given input array", tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) public void createUsersWithListInput(@Valid List body); + + /** * Delete user * + * This can only be done by the logged in user. * + */ + @DELETE @Path("/user/{username}") - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Delete user", tags={ "user", }) + + + @ApiOperation(value = "Delete user", tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) public void deleteUser(@PathParam("username") String username); + + /** * Get user by user name * - * - * + */ + @GET @Path("/user/{username}") + + @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Get user by user name", tags={ "user", }) + + @ApiOperation(value = "Get user by user name", tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) public User getUserByName(@PathParam("username") String username); + + /** * Logs user into the system * - * - * + */ + @GET @Path("/user/login") + + @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Logs user into the system", tags={ "user", }) + + @ApiOperation(value = "Logs user into the system", tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied") }) public String loginUser(@QueryParam("username") @NotNull String username, @QueryParam("password") @NotNull String password); + + /** * Logs out current logged in user session * - * - * + */ + @GET @Path("/user/logout") - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Logs out current logged in user session", tags={ "user", }) + + + @ApiOperation(value = "Logs out current logged in user session", tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) public void logoutUser(); + + /** * Updated user * + * This can only be done by the logged in user. * + */ + @PUT @Path("/user/{username}") - @Produces({ "application/xml", "application/json" }) + + @Consumes({ "*/*" }) + + @ApiOperation(value = "Updated user", tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied"), @ApiResponse(code = 404, message = "User not found") }) - public void updateUser(@PathParam("username") String username, @Valid User body); + public void updateUser(@Valid User user, @PathParam("username") String username); + } + diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Category.java index 9a1956aae8c..4e55dd2757e 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Category.java @@ -1,8 +1,15 @@ package io.swagger.model; import io.swagger.annotations.ApiModel; + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @@ -13,26 +20,49 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; + + /** * A category for a pet **/ @ApiModel(description="A category for a pet") + public class Category { + @ApiModelProperty(value = "") + + + private Long id = null; + + + @ApiModelProperty(value = "") + + + private String name = null; + + /** + + * Get id + + + * @return id **/ @JsonProperty("id") + + public Long getId() { return id; } + public void setId(Long id) { this.id = id; } @@ -41,16 +71,28 @@ public Category id(Long id) { this.id = id; return this; } + + + + /** + + * Get name + + + * @return name **/ @JsonProperty("name") + + public String getName() { return name; } + public void setName(String name) { this.name = name; } @@ -59,7 +101,11 @@ public Category name(String name) { this.name = name; return this; } + + + + @Override public String toString() { @@ -84,3 +130,6 @@ private static String toIndentedString(java.lang.Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/ModelApiResponse.java index 51ffbeff6da..d1071cd241b 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -1,8 +1,15 @@ package io.swagger.model; import io.swagger.annotations.ApiModel; + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @@ -13,28 +20,57 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; + + /** * Describes the result of uploading an image resource **/ @ApiModel(description="Describes the result of uploading an image resource") + public class ModelApiResponse { + @ApiModelProperty(value = "") + + + private Integer code = null; + + + @ApiModelProperty(value = "") + + + private String type = null; + + + @ApiModelProperty(value = "") + + + private String message = null; + + /** + + * Get code + + + * @return code **/ @JsonProperty("code") + + public Integer getCode() { return code; } + public void setCode(Integer code) { this.code = code; } @@ -43,16 +79,28 @@ public ModelApiResponse code(Integer code) { this.code = code; return this; } + + + + /** + + * Get type + + + * @return type **/ @JsonProperty("type") + + public String getType() { return type; } + public void setType(String type) { this.type = type; } @@ -61,16 +109,28 @@ public ModelApiResponse type(String type) { this.type = type; return this; } + + + + /** + + * Get message + + + * @return message **/ @JsonProperty("message") + + public String getMessage() { return message; } + public void setMessage(String message) { this.message = message; } @@ -79,7 +139,11 @@ public ModelApiResponse message(String message) { this.message = message; return this; } + + + + @Override public String toString() { @@ -105,3 +169,6 @@ private static String toIndentedString(java.lang.Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Order.java index dac33686761..86a6f175a37 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Order.java @@ -2,8 +2,15 @@ import io.swagger.annotations.ApiModel; import java.util.Date; + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @@ -14,26 +21,55 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; + + /** * An order for a pets from the pet store **/ @ApiModel(description="An order for a pets from the pet store") + public class Order { + @ApiModelProperty(value = "") + + + private Long id = null; + + + @ApiModelProperty(value = "") + + + private Long petId = null; + + + @ApiModelProperty(value = "") + + + private Integer quantity = null; + + + @ApiModelProperty(value = "") + + + private Date shipDate = null; + + @XmlType(name="StatusEnum") @XmlEnum(String.class) public enum StatusEnum { + @XmlEnumValue("placed") PLACED(String.valueOf("placed")), @XmlEnumValue("approved") APPROVED(String.valueOf("approved")), @XmlEnumValue("delivered") DELIVERED(String.valueOf("delivered")); + private String value; @@ -61,23 +97,44 @@ public static StatusEnum fromValue(String v) { } } + @ApiModelProperty(value = "Order Status") + /** * Order Status **/ + + + private StatusEnum status = null; + + + @ApiModelProperty(value = "") + + + private Boolean complete = false; + + /** + + * Get id + + + * @return id **/ @JsonProperty("id") + + public Long getId() { return id; } + public void setId(Long id) { this.id = id; } @@ -86,16 +143,28 @@ public Order id(Long id) { this.id = id; return this; } + + + + /** + + * Get petId + + + * @return petId **/ @JsonProperty("petId") + + public Long getPetId() { return petId; } + public void setPetId(Long petId) { this.petId = petId; } @@ -104,16 +173,28 @@ public Order petId(Long petId) { this.petId = petId; return this; } + + + + /** + + * Get quantity + + + * @return quantity **/ @JsonProperty("quantity") + + public Integer getQuantity() { return quantity; } + public void setQuantity(Integer quantity) { this.quantity = quantity; } @@ -122,16 +203,28 @@ public Order quantity(Integer quantity) { this.quantity = quantity; return this; } + + + + /** + + * Get shipDate + + + * @return shipDate **/ @JsonProperty("shipDate") + + public Date getShipDate() { return shipDate; } + public void setShipDate(Date shipDate) { this.shipDate = shipDate; } @@ -140,12 +233,23 @@ public Order shipDate(Date shipDate) { this.shipDate = shipDate; return this; } + + + + /** + * Order Status + + + + * @return status **/ @JsonProperty("status") + + public String getStatus() { if (status == null) { return null; @@ -153,6 +257,7 @@ public String getStatus() { return status.value(); } + public void setStatus(StatusEnum status) { this.status = status; } @@ -161,16 +266,28 @@ public Order status(StatusEnum status) { this.status = status; return this; } + + + + /** + + * Get complete + + + * @return complete **/ @JsonProperty("complete") - public Boolean isComplete() { + + + public Boolean isisComplete() { return complete; } + public void setComplete(Boolean complete) { this.complete = complete; } @@ -179,7 +296,11 @@ public Order complete(Boolean complete) { this.complete = complete; return this; } + + + + @Override public String toString() { @@ -208,3 +329,6 @@ private static String toIndentedString(java.lang.Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Pet.java index 3c8ab5da478..20dde62cb84 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Pet.java @@ -5,8 +5,15 @@ import io.swagger.model.Tag; import java.util.ArrayList; import java.util.List; + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @@ -17,28 +24,63 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; + + /** * A pet for sale in the pet store **/ @ApiModel(description="A pet for sale in the pet store") + public class Pet { + @ApiModelProperty(value = "") + + + private Long id = null; + + + @ApiModelProperty(value = "") + + + private Category category = null; + + + @ApiModelProperty(example = "doggie", required = true, value = "") + + + private String name = null; + + + @ApiModelProperty(required = true, value = "") + + private List photoUrls = new ArrayList(); + + + + @ApiModelProperty(value = "") - private List tags = new ArrayList(); + + + private List tags = null; + + + @XmlType(name="StatusEnum") @XmlEnum(String.class) public enum StatusEnum { + @XmlEnumValue("available") AVAILABLE(String.valueOf("available")), @XmlEnumValue("pending") PENDING(String.valueOf("pending")), @XmlEnumValue("sold") SOLD(String.valueOf("sold")); + private String value; @@ -66,21 +108,36 @@ public static StatusEnum fromValue(String v) { } } + @ApiModelProperty(value = "pet status in the store") + /** * pet status in the store **/ + + + private StatusEnum status = null; + + /** + + * Get id + + + * @return id **/ @JsonProperty("id") + + public Long getId() { return id; } + public void setId(Long id) { this.id = id; } @@ -89,16 +146,28 @@ public Pet id(Long id) { this.id = id; return this; } + + + + /** + + * Get category + + + * @return category **/ @JsonProperty("category") + + public Category getCategory() { return category; } + public void setCategory(Category category) { this.category = category; } @@ -107,17 +176,30 @@ public Pet category(Category category) { this.category = category; return this; } + + + + /** + + * Get name + + + * @return name **/ @JsonProperty("name") + + @NotNull + public String getName() { return name; } + public void setName(String name) { this.name = name; } @@ -126,17 +208,30 @@ public Pet name(String name) { this.name = name; return this; } + + + + /** + + * Get photoUrls + + + * @return photoUrls **/ @JsonProperty("photoUrls") + + @NotNull + public List getPhotoUrls() { return photoUrls; } + public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } @@ -145,21 +240,34 @@ public Pet photoUrls(List photoUrls) { this.photoUrls = photoUrls; return this; } + public Pet addPhotoUrlsItem(String photoUrlsItem) { this.photoUrls.add(photoUrlsItem); return this; } + + + + /** + + * Get tags + + + * @return tags **/ @JsonProperty("tags") + + public List getTags() { return tags; } + public void setTags(List tags) { this.tags = tags; } @@ -168,17 +276,29 @@ public Pet tags(List tags) { this.tags = tags; return this; } + public Pet addTagsItem(Tag tagsItem) { this.tags.add(tagsItem); return this; } + + + + /** + * pet status in the store + + + + * @return status **/ @JsonProperty("status") + + public String getStatus() { if (status == null) { return null; @@ -186,6 +306,7 @@ public String getStatus() { return status.value(); } + public void setStatus(StatusEnum status) { this.status = status; } @@ -194,7 +315,11 @@ public Pet status(StatusEnum status) { this.status = status; return this; } + + + + @Override public String toString() { @@ -223,3 +348,6 @@ private static String toIndentedString(java.lang.Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Tag.java index 24fd1d55d2a..4bc35fff324 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Tag.java @@ -1,8 +1,15 @@ package io.swagger.model; import io.swagger.annotations.ApiModel; + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @@ -13,26 +20,49 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; + + /** * A tag for a pet **/ @ApiModel(description="A tag for a pet") + public class Tag { + @ApiModelProperty(value = "") + + + private Long id = null; + + + @ApiModelProperty(value = "") + + + private String name = null; + + /** + + * Get id + + + * @return id **/ @JsonProperty("id") + + public Long getId() { return id; } + public void setId(Long id) { this.id = id; } @@ -41,16 +71,28 @@ public Tag id(Long id) { this.id = id; return this; } + + + + /** + + * Get name + + + * @return name **/ @JsonProperty("name") + + public String getName() { return name; } + public void setName(String name) { this.name = name; } @@ -59,7 +101,11 @@ public Tag name(String name) { this.name = name; return this; } + + + + @Override public String toString() { @@ -84,3 +130,6 @@ private static String toIndentedString(java.lang.Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/User.java index 858e8e14268..e4fda8362c6 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/User.java @@ -1,8 +1,15 @@ package io.swagger.model; import io.swagger.annotations.ApiModel; + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @@ -13,41 +20,101 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; + + /** * A User who is purchasing from the pet store **/ @ApiModel(description="A User who is purchasing from the pet store") + public class User { + @ApiModelProperty(value = "") + + + private Long id = null; + + + @ApiModelProperty(value = "") + + + private String username = null; + + + @ApiModelProperty(value = "") + + + private String firstName = null; + + + @ApiModelProperty(value = "") + + + private String lastName = null; + + + @ApiModelProperty(value = "") + + + private String email = null; + + + @ApiModelProperty(value = "") + + + private String password = null; + + + @ApiModelProperty(value = "") + + + private String phone = null; + + + @ApiModelProperty(value = "User Status") + /** * User Status **/ + + + private Integer userStatus = null; + + /** + + * Get id + + + * @return id **/ @JsonProperty("id") + + public Long getId() { return id; } + public void setId(Long id) { this.id = id; } @@ -56,16 +123,28 @@ public User id(Long id) { this.id = id; return this; } + + + + /** + + * Get username + + + * @return username **/ @JsonProperty("username") + + public String getUsername() { return username; } + public void setUsername(String username) { this.username = username; } @@ -74,16 +153,28 @@ public User username(String username) { this.username = username; return this; } + + + + /** + + * Get firstName + + + * @return firstName **/ @JsonProperty("firstName") + + public String getFirstName() { return firstName; } + public void setFirstName(String firstName) { this.firstName = firstName; } @@ -92,16 +183,28 @@ public User firstName(String firstName) { this.firstName = firstName; return this; } + + + + /** + + * Get lastName + + + * @return lastName **/ @JsonProperty("lastName") + + public String getLastName() { return lastName; } + public void setLastName(String lastName) { this.lastName = lastName; } @@ -110,16 +213,28 @@ public User lastName(String lastName) { this.lastName = lastName; return this; } + + + + /** + + * Get email + + + * @return email **/ @JsonProperty("email") + + public String getEmail() { return email; } + public void setEmail(String email) { this.email = email; } @@ -128,16 +243,28 @@ public User email(String email) { this.email = email; return this; } + + + + /** + + * Get password + + + * @return password **/ @JsonProperty("password") + + public String getPassword() { return password; } + public void setPassword(String password) { this.password = password; } @@ -146,16 +273,28 @@ public User password(String password) { this.password = password; return this; } + + + + /** + + * Get phone + + + * @return phone **/ @JsonProperty("phone") + + public String getPhone() { return phone; } + public void setPhone(String phone) { this.phone = phone; } @@ -164,16 +303,28 @@ public User phone(String phone) { this.phone = phone; return this; } + + + + /** + * User Status + + + + * @return userStatus **/ @JsonProperty("userStatus") + + public Integer getUserStatus() { return userStatus; } + public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } @@ -182,7 +333,11 @@ public User userStatus(Integer userStatus) { this.userStatus = userStatus; return this; } + + + + @Override public String toString() { @@ -213,3 +368,6 @@ private static String toIndentedString(java.lang.Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java index 0f19eb3098d..5326cc9006c 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java @@ -1,10 +1,10 @@ package io.swagger.api.impl; import io.swagger.api.*; -import java.io.File; import io.swagger.model.ModelApiResponse; import io.swagger.model.Pet; + import java.io.InputStream; import java.io.OutputStream; import java.util.List; @@ -18,108 +18,143 @@ import io.swagger.annotations.Api; + + + + /** * Swagger Petstore * + *

This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * */ + public class PetApiServiceImpl implements PetApi { + + + /** * Add a new pet to the store * - * - * + */ - public void addPet(Pet body) { + + public void addPet(Pet pet) { // TODO: Implement... } + + /** * Deletes a pet * - * - * + */ - public void deletePet(Long petId, String apiKey) { + + public void deletePet(Integer petId, String apiKey) { // TODO: Implement... } + + /** * Finds Pets by status * + * Multiple status values can be provided with comma separated strings * + */ + public List findPetsByStatus(List status) { // TODO: Implement... return null; } + + /** * Finds Pets by tags * + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * + */ + public List findPetsByTags(List tags) { // TODO: Implement... return null; } + + /** * Find pet by ID * + * Returns a single pet * + */ - public Pet getPetById(Long petId) { + + public Pet getPetById(Integer petId) { // TODO: Implement... return null; } + + /** * Update an existing pet * - * - * + */ - public void updatePet(Pet body) { + + public void updatePet(Pet pet) { // TODO: Implement... } + + /** * Updates a pet in the store with form data * - * - * + */ - public void updatePetWithForm(Long petId, String name, String status) { + + public void updatePetWithForm(Integer petId, Object body) { // TODO: Implement... } + + /** * uploads an image * - * - * + */ - public ModelApiResponse uploadFile(Long petId, String additionalMetadata, Attachment fileDetail) { + + public ModelApiResponse uploadFile(Integer petId, Object body) { // TODO: Implement... return null; } + } + diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java index 9d3f93f8c3d..c3753800fbd 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java @@ -4,6 +4,7 @@ import java.util.Map; import io.swagger.model.Order; + import java.io.InputStream; import java.io.OutputStream; import java.util.List; @@ -17,60 +18,87 @@ import io.swagger.annotations.Api; + + + + /** * Swagger Petstore * + *

This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * */ + public class StoreApiServiceImpl implements StoreApi { + + + /** * Delete purchase order by ID * + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * + */ + public void deleteOrder(String orderId) { // TODO: Implement... } + + /** * Returns pet inventories by status * + * Returns a map of status codes to quantities * + */ + public Map getInventory() { // TODO: Implement... return null; } + + /** * Find purchase order by ID * + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * + */ - public Order getOrderById(Long orderId) { + + public Order getOrderById(Integer orderId) { // TODO: Implement... return null; } + + /** * Place an order for a pet * - * - * + */ - public Order placeOrder(Order body) { + + public Order placeOrder(Order order) { // TODO: Implement... return null; } + } + diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java index c569dbf5c15..cdb8e9ebea8 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java @@ -1,9 +1,9 @@ package io.swagger.api.impl; import io.swagger.api.*; -import java.util.List; import io.swagger.model.User; + import java.io.InputStream; import java.io.OutputStream; import java.util.List; @@ -17,108 +17,143 @@ import io.swagger.annotations.Api; + + + + /** * Swagger Petstore * + *

This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * */ + public class UserApiServiceImpl implements UserApi { + + + /** * Create user * + * This can only be done by the logged in user. * + */ - public void createUser(User body) { + + public void createUser(User user) { // TODO: Implement... } + + /** * Creates list of users with given input array * - * - * + */ + public void createUsersWithArrayInput(List body) { // TODO: Implement... } + + /** * Creates list of users with given input array * - * - * + */ + public void createUsersWithListInput(List body) { // TODO: Implement... } + + /** * Delete user * + * This can only be done by the logged in user. * + */ + public void deleteUser(String username) { // TODO: Implement... } + + /** * Get user by user name * - * - * + */ + public User getUserByName(String username) { // TODO: Implement... return null; } + + /** * Logs user into the system * - * - * + */ + public String loginUser(String username, String password) { // TODO: Implement... return null; } + + /** * Logs out current logged in user session * - * - * + */ + public void logoutUser() { // TODO: Implement... } + + /** * Updated user * + * This can only be done by the logged in user. * + */ - public void updateUser(String username, User body) { + + public void updateUser(User user, String username) { // TODO: Implement... } + } + diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/test/java/io/swagger/api/PetApiTest.java b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/test/java/io/swagger/api/PetApiTest.java index bbb67c24390..e07af12923c 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/test/java/io/swagger/api/PetApiTest.java +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/test/java/io/swagger/api/PetApiTest.java @@ -25,9 +25,9 @@ package io.swagger.api; -import java.io.File; import io.swagger.model.ModelApiResponse; import io.swagger.model.Pet; + import org.junit.Test; import org.junit.Before; import static org.junit.Assert.*; @@ -38,8 +38,11 @@ import org.apache.cxf.jaxrs.client.WebClient; + + import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -48,11 +51,23 @@ + + /** - * API tests for PetApi + + * Swagger Petstore + * + + + *

This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + + * API tests for PetApi */ + public class PetApiTest { + private PetApi api; @@ -62,25 +77,33 @@ public void setup() { List providers = new ArrayList(); providers.add(provider); + + api = JAXRSClientFactory.create("http://petstore.swagger.io/v2", PetApi.class, providers); + org.apache.cxf.jaxrs.client.Client client = WebClient.client(api); ClientConfiguration config = WebClient.getConfig(client); + + } /** + * Add a new pet to the store * - * - * + + * @throws ApiException * if the Api call fails */ @Test public void addPetTest() { - Pet body = null; - //api.addPet(body); + + Pet pet = null; + + //api.addPet(pet); // TODO: test validations @@ -88,18 +111,22 @@ public void addPetTest() { } /** + * Deletes a pet * - * - * + + * @throws ApiException * if the Api call fails */ @Test public void deletePetTest() { - Long petId = null; + + Integer petId = null; + String apiKey = null; - //api.deletePet(petId, apiKey); + + //api.deletePet(petId, apiKey); // TODO: test validations @@ -107,17 +134,23 @@ public void deletePetTest() { } /** + * Finds Pets by status * + * Multiple status values can be provided with comma separated strings * + + * @throws ApiException * if the Api call fails */ @Test public void findPetsByStatusTest() { + List status = null; - //List response = api.findPetsByStatus(status); + + //List response = api.findPetsByStatus(status); //assertNotNull(response); // TODO: test validations @@ -125,17 +158,23 @@ public void findPetsByStatusTest() { } /** + * Finds Pets by tags * + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * + + * @throws ApiException * if the Api call fails */ @Test public void findPetsByTagsTest() { + List tags = null; - //List response = api.findPetsByTags(tags); + + //List response = api.findPetsByTags(tags); //assertNotNull(response); // TODO: test validations @@ -143,17 +182,23 @@ public void findPetsByTagsTest() { } /** + * Find pet by ID * + * Returns a single pet * + + * @throws ApiException * if the Api call fails */ @Test public void getPetByIdTest() { - Long petId = null; - //Pet response = api.getPetById(petId); + + Integer petId = null; + + //Pet response = api.getPetById(petId); //assertNotNull(response); // TODO: test validations @@ -161,17 +206,20 @@ public void getPetByIdTest() { } /** + * Update an existing pet * - * - * + + * @throws ApiException * if the Api call fails */ @Test public void updatePetTest() { - Pet body = null; - //api.updatePet(body); + + Pet pet = null; + + //api.updatePet(pet); // TODO: test validations @@ -179,19 +227,22 @@ public void updatePetTest() { } /** + * Updates a pet in the store with form data * - * - * + + * @throws ApiException * if the Api call fails */ @Test public void updatePetWithFormTest() { - Long petId = null; - String name = null; - String status = null; - //api.updatePetWithForm(petId, name, status); + + Integer petId = null; + + Object body = null; + + //api.updatePetWithForm(petId, body); // TODO: test validations @@ -199,19 +250,22 @@ public void updatePetWithFormTest() { } /** + * uploads an image * - * - * + + * @throws ApiException * if the Api call fails */ @Test public void uploadFileTest() { - Long petId = null; - String additionalMetadata = null; - org.apache.cxf.jaxrs.ext.multipart.Attachment file = null; - //ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file); + + Integer petId = null; + + Object body = null; + + //ModelApiResponse response = api.uploadFile(petId, body); //assertNotNull(response); // TODO: test validations diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/test/java/io/swagger/api/StoreApiTest.java b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/test/java/io/swagger/api/StoreApiTest.java index af89e255a9f..d4621c886ad 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/test/java/io/swagger/api/StoreApiTest.java +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/test/java/io/swagger/api/StoreApiTest.java @@ -27,6 +27,7 @@ import java.util.Map; import io.swagger.model.Order; + import org.junit.Test; import org.junit.Before; import static org.junit.Assert.*; @@ -37,8 +38,11 @@ import org.apache.cxf.jaxrs.client.WebClient; + + import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -47,11 +51,23 @@ + + /** - * API tests for StoreApi + + * Swagger Petstore + * + + + *

This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + + * API tests for StoreApi */ + public class StoreApiTest { + private StoreApi api; @@ -61,25 +77,36 @@ public void setup() { List providers = new ArrayList(); providers.add(provider); + + api = JAXRSClientFactory.create("http://petstore.swagger.io/v2", StoreApi.class, providers); + org.apache.cxf.jaxrs.client.Client client = WebClient.client(api); ClientConfiguration config = WebClient.getConfig(client); + + } /** + * Delete purchase order by ID * + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * + + * @throws ApiException * if the Api call fails */ @Test public void deleteOrderTest() { + String orderId = null; - //api.deleteOrder(orderId); + + //api.deleteOrder(orderId); // TODO: test validations @@ -87,16 +114,21 @@ public void deleteOrderTest() { } /** + * Returns pet inventories by status * + * Returns a map of status codes to quantities * + + * @throws ApiException * if the Api call fails */ @Test public void getInventoryTest() { - //Map response = api.getInventory(); + + //Map response = api.getInventory(); //assertNotNull(response); // TODO: test validations @@ -104,17 +136,23 @@ public void getInventoryTest() { } /** + * Find purchase order by ID * + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * + + * @throws ApiException * if the Api call fails */ @Test public void getOrderByIdTest() { - Long orderId = null; - //Order response = api.getOrderById(orderId); + + Integer orderId = null; + + //Order response = api.getOrderById(orderId); //assertNotNull(response); // TODO: test validations @@ -122,17 +160,20 @@ public void getOrderByIdTest() { } /** + * Place an order for a pet * - * - * + + * @throws ApiException * if the Api call fails */ @Test public void placeOrderTest() { - Order body = null; - //Order response = api.placeOrder(body); + + Order order = null; + + //Order response = api.placeOrder(order); //assertNotNull(response); // TODO: test validations diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/test/java/io/swagger/api/UserApiTest.java b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/test/java/io/swagger/api/UserApiTest.java index f789f0fc936..f3794c02c30 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/test/java/io/swagger/api/UserApiTest.java +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/test/java/io/swagger/api/UserApiTest.java @@ -25,8 +25,8 @@ package io.swagger.api; -import java.util.List; import io.swagger.model.User; + import org.junit.Test; import org.junit.Before; import static org.junit.Assert.*; @@ -37,8 +37,11 @@ import org.apache.cxf.jaxrs.client.WebClient; + + import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -47,11 +50,23 @@ + + /** - * API tests for UserApi + + * Swagger Petstore + * + + + *

This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + + * API tests for UserApi */ + public class UserApiTest { + private UserApi api; @@ -61,25 +76,36 @@ public void setup() { List providers = new ArrayList(); providers.add(provider); + + api = JAXRSClientFactory.create("http://petstore.swagger.io/v2", UserApi.class, providers); + org.apache.cxf.jaxrs.client.Client client = WebClient.client(api); ClientConfiguration config = WebClient.getConfig(client); + + } /** + * Create user * + * This can only be done by the logged in user. * + + * @throws ApiException * if the Api call fails */ @Test public void createUserTest() { - User body = null; - //api.createUser(body); + + User user = null; + + //api.createUser(user); // TODO: test validations @@ -87,17 +113,20 @@ public void createUserTest() { } /** + * Creates list of users with given input array * - * - * + + * @throws ApiException * if the Api call fails */ @Test public void createUsersWithArrayInputTest() { + List body = null; - //api.createUsersWithArrayInput(body); + + //api.createUsersWithArrayInput(body); // TODO: test validations @@ -105,17 +134,20 @@ public void createUsersWithArrayInputTest() { } /** + * Creates list of users with given input array * - * - * + + * @throws ApiException * if the Api call fails */ @Test public void createUsersWithListInputTest() { + List body = null; - //api.createUsersWithListInput(body); + + //api.createUsersWithListInput(body); // TODO: test validations @@ -123,17 +155,23 @@ public void createUsersWithListInputTest() { } /** + * Delete user * + * This can only be done by the logged in user. * + + * @throws ApiException * if the Api call fails */ @Test public void deleteUserTest() { + String username = null; - //api.deleteUser(username); + + //api.deleteUser(username); // TODO: test validations @@ -141,17 +179,20 @@ public void deleteUserTest() { } /** + * Get user by user name * - * - * + + * @throws ApiException * if the Api call fails */ @Test public void getUserByNameTest() { + String username = null; - //User response = api.getUserByName(username); + + //User response = api.getUserByName(username); //assertNotNull(response); // TODO: test validations @@ -159,18 +200,22 @@ public void getUserByNameTest() { } /** + * Logs user into the system * - * - * + + * @throws ApiException * if the Api call fails */ @Test public void loginUserTest() { + String username = null; + String password = null; - //String response = api.loginUser(username, password); + + //String response = api.loginUser(username, password); //assertNotNull(response); // TODO: test validations @@ -178,16 +223,18 @@ public void loginUserTest() { } /** + * Logs out current logged in user session * - * - * + + * @throws ApiException * if the Api call fails */ @Test public void logoutUserTest() { - //api.logoutUser(); + + //api.logoutUser(); // TODO: test validations @@ -195,18 +242,25 @@ public void logoutUserTest() { } /** + * Updated user * + * This can only be done by the logged in user. * + + * @throws ApiException * if the Api call fails */ @Test public void updateUserTest() { + + User user = null; + String username = null; - User body = null; - //api.updateUser(username, body); + + //api.updateUser(user, username); // TODO: test validations diff --git a/samples/server/petstore/jaxrs-cxf-cdi/.swagger-codegen/VERSION b/samples/server/petstore/jaxrs-cxf-cdi/.swagger-codegen/VERSION index 50794f17f1a..096bf47efe3 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/.swagger-codegen/VERSION +++ b/samples/server/petstore/jaxrs-cxf-cdi/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.1-SNAPSHOT \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf-cdi/pom.xml b/samples/server/petstore/jaxrs-cxf-cdi/pom.xml index 94292deb437..fb513add6a4 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/pom.xml +++ b/samples/server/petstore/jaxrs-cxf-cdi/pom.xml @@ -77,6 +77,7 @@ [1.5.3,1.5.16] + javax.validation @@ -85,6 +86,7 @@ provided + diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/PetApi.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/PetApi.java index 791ba8bbd1b..842c25dbd5c 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/PetApi.java @@ -1,8 +1,8 @@ package io.swagger.api; -import java.io.File; import io.swagger.model.ModelApiResponse; import io.swagger.model.Pet; + import io.swagger.api.PetApiService; import javax.ws.rs.*; @@ -20,7 +20,9 @@ import java.util.Map; import java.util.List; + import javax.validation.constraints.*; + @Path("/pet") @RequestScoped @@ -36,65 +38,50 @@ public class PetApi { @Inject PetApiService delegate; + + @POST @Consumes({ "application/json", "application/xml" }) - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Add a new pet to the store", notes = "", response = Void.class, authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + + @ApiOperation(value = "Add a new pet to the store", notes = "", response = Void.class, tags={ "pet" }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) - public Response addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet body) { - return delegate.addPet(body, securityContext); + public Response addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet pet) { + return delegate.addPet(pet, securityContext); } + @DELETE @Path("/{petId}") - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + + @ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, tags={ "pet" }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) - public Response deletePet(@ApiParam(value = "Pet id to delete",required=true) @PathParam("petId") Long petId, @ApiParam(value = "" )@HeaderParam("api_key") String apiKey) { + public Response deletePet(@ApiParam(value = "Pet id to delete",required=true) @PathParam("petId") Integer petId, @ApiParam(value = "" )@HeaderParam("api_key") String apiKey) { return delegate.deletePet(petId, apiKey, securityContext); } + @GET @Path("/findByStatus") @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + @ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", tags={ "pet" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid status value", response = Void.class) }) - public Response findPetsByStatus( @NotNull @ApiParam(value = "Status values that need to be considered for filter",required=true, allowableValues="available, pending, sold") @QueryParam("status") List status) { + public Response findPetsByStatus( @NotNull @ApiParam(value = "Status values that need to be considered for filter",required=true, allowableValues="range=[-infinity, infinity]") @QueryParam("status") List status) { return delegate.findPetsByStatus(status, securityContext); } + @GET @Path("/findByTags") @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + @ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", tags={ "pet" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid tag value", response = Void.class) }) @@ -102,68 +89,57 @@ public Response findPetsByTags( @NotNull @ApiParam(value = "Tags to filter by",r return delegate.findPetsByTags(tags, securityContext); } + @GET @Path("/{petId}") @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = { - @Authorization(value = "api_key") - }, tags={ "pet", }) + @ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, tags={ "pet" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Pet not found", response = Void.class) }) - public Response getPetById(@ApiParam(value = "ID of pet to return",required=true) @PathParam("petId") Long petId) { + public Response getPetById(@ApiParam(value = "ID of pet to return",required=true) @PathParam("petId") Integer petId) { return delegate.getPetById(petId, securityContext); } + @PUT @Consumes({ "application/json", "application/xml" }) - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + + @ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, tags={ "pet" }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Pet not found", response = Void.class), @ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) - public Response updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet body) { - return delegate.updatePet(body, securityContext); + public Response updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet pet) { + return delegate.updatePet(pet, securityContext); } + @POST @Path("/{petId}") @Consumes({ "application/x-www-form-urlencoded" }) - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + + @ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, tags={ "pet" }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) - public Response updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true) @PathParam("petId") Long petId, @Multipart(value = "name", required = false) String name, @Multipart(value = "status", required = false) String status) { - return delegate.updatePetWithForm(petId, name, status, securityContext); + public Response updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true) @PathParam("petId") Integer petId, @ApiParam(value = "" ) Object body) { + return delegate.updatePetWithForm(petId, body, securityContext); } + @POST @Path("/{petId}/uploadImage") @Consumes({ "multipart/form-data" }) @Produces({ "application/json" }) - @ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet" }) + @ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, tags={ "pet" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - public Response uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathParam("petId") Long petId, @Multipart(value = "additionalMetadata", required = false) String additionalMetadata, @Multipart(value = "file", required = false) InputStream fileInputStream, @Multipart(value = "file" , required = false) Attachment fileDetail) { - return delegate.uploadFile(petId, additionalMetadata, fileInputStream, fileDetail, securityContext); + public Response uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathParam("petId") Integer petId, @ApiParam(value = "" ) Object body) { + return delegate.uploadFile(petId, body, securityContext); } + } + diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/PetApiService.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/PetApiService.java index ac8e4a52ff7..cc51a712fe5 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/PetApiService.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/PetApiService.java @@ -6,10 +6,10 @@ import org.apache.cxf.jaxrs.ext.multipart.Attachment; import org.apache.cxf.jaxrs.ext.multipart.Multipart; -import java.io.File; import io.swagger.model.ModelApiResponse; import io.swagger.model.Pet; + import java.util.List; import java.io.InputStream; @@ -18,13 +18,24 @@ import javax.ws.rs.core.SecurityContext; + public interface PetApiService { - public Response addPet(Pet body, SecurityContext securityContext); - public Response deletePet(Long petId, String apiKey, SecurityContext securityContext); + + public Response addPet(Pet pet, SecurityContext securityContext); + + public Response deletePet(Integer petId, String apiKey, SecurityContext securityContext); + public Response findPetsByStatus(List status, SecurityContext securityContext); + public Response findPetsByTags(List tags, SecurityContext securityContext); - public Response getPetById(Long petId, SecurityContext securityContext); - public Response updatePet(Pet body, SecurityContext securityContext); - public Response updatePetWithForm(Long petId, String name, String status, SecurityContext securityContext); - public Response uploadFile(Long petId, String additionalMetadata, InputStream fileInputStream, Attachment fileDetail, SecurityContext securityContext); + + public Response getPetById(Integer petId, SecurityContext securityContext); + + public Response updatePet(Pet pet, SecurityContext securityContext); + + public Response updatePetWithForm(Integer petId, Object body, SecurityContext securityContext); + + public Response uploadFile(Integer petId, Object body, SecurityContext securityContext); + } + diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/StoreApi.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/StoreApi.java index f8bc97ba37d..93305c1b397 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/StoreApi.java @@ -2,6 +2,7 @@ import java.util.Map; import io.swagger.model.Order; + import io.swagger.api.StoreApiService; import javax.ws.rs.*; @@ -19,7 +20,9 @@ import java.util.Map; import java.util.List; + import javax.validation.constraints.*; + @Path("/store") @RequestScoped @@ -35,11 +38,13 @@ public class StoreApi { @Inject StoreApiService delegate; + + @DELETE @Path("/order/{orderId}") - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = Void.class, tags={ "store", }) + + @ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = Void.class, tags={ "store" }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Order not found", response = Void.class) }) @@ -47,41 +52,44 @@ public Response deleteOrder(@ApiParam(value = "ID of the order that needs to be return delegate.deleteOrder(orderId, securityContext); } + @GET @Path("/inventory") @Produces({ "application/json" }) - @ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { - @Authorization(value = "api_key") - }, tags={ "store", }) + @ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", tags={ "store" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) public Response getInventory() { return delegate.getInventory(securityContext); } + @GET @Path("/order/{orderId}") @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Find purchase order by ID", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) + @ApiOperation(value = "Find purchase order by ID", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Order not found", response = Void.class) }) - public Response getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathParam("orderId") Long orderId) { + public Response getOrderById( @DecimalMin("1") @DecimalMax("5")@ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathParam("orderId") Integer orderId) { return delegate.getOrderById(orderId, securityContext); } + @POST @Path("/order") - + @Consumes({ "*/*" }) @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order", response = Void.class) }) - public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true) Order body) { - return delegate.placeOrder(body, securityContext); + public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true) Order order) { + return delegate.placeOrder(order, securityContext); } + } + diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/StoreApiService.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/StoreApiService.java index 45580cf4183..26606e3f246 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/StoreApiService.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/StoreApiService.java @@ -9,6 +9,7 @@ import java.util.Map; import io.swagger.model.Order; + import java.util.List; import java.io.InputStream; @@ -17,9 +18,16 @@ import javax.ws.rs.core.SecurityContext; + public interface StoreApiService { + public Response deleteOrder(String orderId, SecurityContext securityContext); + public Response getInventory(SecurityContext securityContext); - public Response getOrderById(Long orderId, SecurityContext securityContext); - public Response placeOrder(Order body, SecurityContext securityContext); + + public Response getOrderById(Integer orderId, SecurityContext securityContext); + + public Response placeOrder(Order order, SecurityContext securityContext); + } + diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/UserApi.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/UserApi.java index ff25df94fe7..e58a2395422 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/UserApi.java @@ -1,7 +1,7 @@ package io.swagger.api; -import java.util.List; import io.swagger.model.User; + import io.swagger.api.UserApiService; import javax.ws.rs.*; @@ -19,7 +19,9 @@ import java.util.Map; import java.util.List; + import javax.validation.constraints.*; + @Path("/user") @RequestScoped @@ -35,44 +37,49 @@ public class UserApi { @Inject UserApiService delegate; + + @POST + @Consumes({ "*/*" }) - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - public Response createUser(@ApiParam(value = "Created user object" ,required=true) User body) { - return delegate.createUser(body, securityContext); + public Response createUser(@ApiParam(value = "Created user object" ,required=true) User user) { + return delegate.createUser(user, securityContext); } + @POST @Path("/createWithArray") + @Consumes({ "*/*" }) - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true) List body) { return delegate.createUsersWithArrayInput(body, securityContext); } + @POST @Path("/createWithList") + @Consumes({ "*/*" }) - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true) List body) { return delegate.createUsersWithListInput(body, securityContext); } + @DELETE @Path("/{username}") - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + + @ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) @@ -80,11 +87,12 @@ public Response deleteUser(@ApiParam(value = "The name that needs to be deleted" return delegate.deleteUser(username, securityContext); } + @GET @Path("/{username}") @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user", }) + @ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), @@ -93,11 +101,12 @@ public Response getUserByName(@ApiParam(value = "The name that needs to be fetch return delegate.getUserByName(username, securityContext); } + @GET @Path("/login") @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user", }) + @ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied", response = Void.class) }) @@ -105,26 +114,30 @@ public Response loginUser( @NotNull @ApiParam(value = "The user name for login", return delegate.loginUser(username, password, securityContext); } + @GET @Path("/logout") - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) + + @ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response logoutUser() { return delegate.logoutUser(securityContext); } + @PUT @Path("/{username}") + @Consumes({ "*/*" }) - @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) - public Response updateUser(@ApiParam(value = "name that need to be deleted",required=true) @PathParam("username") String username, @ApiParam(value = "Updated user object" ,required=true) User body) { - return delegate.updateUser(username, body, securityContext); + public Response updateUser(@ApiParam(value = "Updated user object" ,required=true) User user, @ApiParam(value = "name that need to be deleted",required=true) @PathParam("username") String username) { + return delegate.updateUser(user, username, securityContext); } + } + diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/UserApiService.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/UserApiService.java index ed05f0abe27..9ea52173e78 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/UserApiService.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/UserApiService.java @@ -6,9 +6,9 @@ import org.apache.cxf.jaxrs.ext.multipart.Attachment; import org.apache.cxf.jaxrs.ext.multipart.Multipart; -import java.util.List; import io.swagger.model.User; + import java.util.List; import java.io.InputStream; @@ -17,13 +17,24 @@ import javax.ws.rs.core.SecurityContext; + public interface UserApiService { - public Response createUser(User body, SecurityContext securityContext); + + public Response createUser(User user, SecurityContext securityContext); + public Response createUsersWithArrayInput(List body, SecurityContext securityContext); + public Response createUsersWithListInput(List body, SecurityContext securityContext); + public Response deleteUser(String username, SecurityContext securityContext); + public Response getUserByName(String username, SecurityContext securityContext); + public Response loginUser(String username, String password, SecurityContext securityContext); + public Response logoutUser(SecurityContext securityContext); - public Response updateUser(String username, User body, SecurityContext securityContext); + + public Response updateUser(User user, String username, SecurityContext securityContext); + } + diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Category.java index 92a3fc286e3..367cecd8aaa 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Category.java @@ -3,8 +3,12 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; + + import javax.validation.constraints.*; + + /** * A category for a pet **/ @@ -21,7 +25,11 @@ public class Category { private Long id = null; private String name = null; + /** + + + **/ public Category id(Long id) { this.id = id; @@ -31,6 +39,7 @@ public Category id(Long id) { @ApiModelProperty(value = "") @JsonProperty("id") + public Long getId() { return id; } @@ -38,7 +47,11 @@ public void setId(Long id) { this.id = id; } + /** + + + **/ public Category name(String name) { this.name = name; @@ -48,6 +61,7 @@ public Category name(String name) { @ApiModelProperty(value = "") @JsonProperty("name") + public String getName() { return name; } @@ -55,6 +69,7 @@ public void setName(String name) { this.name = name; } + @Override public boolean equals(java.lang.Object o) { @@ -97,3 +112,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/ModelApiResponse.java index becb77ed19e..c935cd8afc2 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -3,8 +3,12 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; + + import javax.validation.constraints.*; + + /** * Describes the result of uploading an image resource **/ @@ -22,7 +26,11 @@ public class ModelApiResponse { private String type = null; private String message = null; + /** + + + **/ public ModelApiResponse code(Integer code) { this.code = code; @@ -32,6 +40,7 @@ public ModelApiResponse code(Integer code) { @ApiModelProperty(value = "") @JsonProperty("code") + public Integer getCode() { return code; } @@ -39,7 +48,11 @@ public void setCode(Integer code) { this.code = code; } + /** + + + **/ public ModelApiResponse type(String type) { this.type = type; @@ -49,6 +62,7 @@ public ModelApiResponse type(String type) { @ApiModelProperty(value = "") @JsonProperty("type") + public String getType() { return type; } @@ -56,7 +70,11 @@ public void setType(String type) { this.type = type; } + /** + + + **/ public ModelApiResponse message(String message) { this.message = message; @@ -66,6 +84,7 @@ public ModelApiResponse message(String message) { @ApiModelProperty(value = "") @JsonProperty("message") + public String getMessage() { return message; } @@ -73,6 +92,7 @@ public void setMessage(String message) { this.message = message; } + @Override public boolean equals(java.lang.Object o) { @@ -117,3 +137,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Order.java index e5e8aacb1a5..cb74ed4099c 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Order.java @@ -3,8 +3,12 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; + + import javax.validation.constraints.*; + + /** * An order for a pets from the pet store **/ @@ -27,7 +31,9 @@ public class Order { @XmlEnum(String.class) public enum StatusEnum { + @XmlEnumValue("placed") PLACED(String.valueOf("placed")), @XmlEnumValue("approved") APPROVED(String.valueOf("approved")), @XmlEnumValue("delivered") DELIVERED(String.valueOf("delivered")); + private String value; @@ -58,7 +64,11 @@ public static StatusEnum fromValue(String v) { private StatusEnum status = null; private Boolean complete = false; + /** + + + **/ public Order id(Long id) { this.id = id; @@ -68,6 +78,7 @@ public Order id(Long id) { @ApiModelProperty(value = "") @JsonProperty("id") + public Long getId() { return id; } @@ -75,7 +86,11 @@ public void setId(Long id) { this.id = id; } + /** + + + **/ public Order petId(Long petId) { this.petId = petId; @@ -85,6 +100,7 @@ public Order petId(Long petId) { @ApiModelProperty(value = "") @JsonProperty("petId") + public Long getPetId() { return petId; } @@ -92,7 +108,11 @@ public void setPetId(Long petId) { this.petId = petId; } + /** + + + **/ public Order quantity(Integer quantity) { this.quantity = quantity; @@ -102,6 +122,7 @@ public Order quantity(Integer quantity) { @ApiModelProperty(value = "") @JsonProperty("quantity") + public Integer getQuantity() { return quantity; } @@ -109,7 +130,11 @@ public void setQuantity(Integer quantity) { this.quantity = quantity; } + /** + + + **/ public Order shipDate(java.util.Date shipDate) { this.shipDate = shipDate; @@ -119,6 +144,7 @@ public Order shipDate(java.util.Date shipDate) { @ApiModelProperty(value = "") @JsonProperty("shipDate") + public java.util.Date getShipDate() { return shipDate; } @@ -126,8 +152,13 @@ public void setShipDate(java.util.Date shipDate) { this.shipDate = shipDate; } + /** + * Order Status + + + **/ public Order status(StatusEnum status) { this.status = status; @@ -137,6 +168,7 @@ public Order status(StatusEnum status) { @ApiModelProperty(value = "Order Status") @JsonProperty("status") + public StatusEnum getStatus() { return status; } @@ -144,7 +176,11 @@ public void setStatus(StatusEnum status) { this.status = status; } + /** + + + **/ public Order complete(Boolean complete) { this.complete = complete; @@ -154,13 +190,15 @@ public Order complete(Boolean complete) { @ApiModelProperty(value = "") @JsonProperty("complete") - public Boolean isComplete() { + + public Boolean isisComplete() { return complete; } public void setComplete(Boolean complete) { this.complete = complete; } + @Override public boolean equals(java.lang.Object o) { @@ -211,3 +249,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Pet.java index c8868b563d0..10373b73fd7 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Pet.java @@ -7,8 +7,12 @@ import io.swagger.model.Tag; import java.util.ArrayList; import java.util.List; + + import javax.validation.constraints.*; + + /** * A pet for sale in the pet store **/ @@ -32,7 +36,9 @@ public class Pet { @XmlEnum(String.class) public enum StatusEnum { + @XmlEnumValue("available") AVAILABLE(String.valueOf("available")), @XmlEnumValue("pending") PENDING(String.valueOf("pending")), @XmlEnumValue("sold") SOLD(String.valueOf("sold")); + private String value; @@ -62,7 +68,11 @@ public static StatusEnum fromValue(String v) { private StatusEnum status = null; + /** + + + **/ public Pet id(Long id) { this.id = id; @@ -72,6 +82,7 @@ public Pet id(Long id) { @ApiModelProperty(value = "") @JsonProperty("id") + public Long getId() { return id; } @@ -79,7 +90,11 @@ public void setId(Long id) { this.id = id; } + /** + + + **/ public Pet category(Category category) { this.category = category; @@ -89,6 +104,7 @@ public Pet category(Category category) { @ApiModelProperty(value = "") @JsonProperty("category") + public Category getCategory() { return category; } @@ -96,7 +112,11 @@ public void setCategory(Category category) { this.category = category; } + /** + + + **/ public Pet name(String name) { this.name = name; @@ -106,7 +126,9 @@ public Pet name(String name) { @ApiModelProperty(example = "doggie", required = true, value = "") @JsonProperty("name") + @NotNull + public String getName() { return name; } @@ -114,7 +136,11 @@ public void setName(String name) { this.name = name; } + /** + + + **/ public Pet photoUrls(List photoUrls) { this.photoUrls = photoUrls; @@ -124,7 +150,9 @@ public Pet photoUrls(List photoUrls) { @ApiModelProperty(required = true, value = "") @JsonProperty("photoUrls") + @NotNull + public List getPhotoUrls() { return photoUrls; } @@ -132,7 +160,11 @@ public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } + /** + + + **/ public Pet tags(List tags) { this.tags = tags; @@ -142,6 +174,7 @@ public Pet tags(List tags) { @ApiModelProperty(value = "") @JsonProperty("tags") + public List getTags() { return tags; } @@ -149,8 +182,13 @@ public void setTags(List tags) { this.tags = tags; } + /** + * pet status in the store + + + **/ public Pet status(StatusEnum status) { this.status = status; @@ -160,6 +198,7 @@ public Pet status(StatusEnum status) { @ApiModelProperty(value = "pet status in the store") @JsonProperty("status") + public StatusEnum getStatus() { return status; } @@ -167,6 +206,7 @@ public void setStatus(StatusEnum status) { this.status = status; } + @Override public boolean equals(java.lang.Object o) { @@ -217,3 +257,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Tag.java index 42f36861a08..32f4872bc3f 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Tag.java @@ -3,8 +3,12 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; + + import javax.validation.constraints.*; + + /** * A tag for a pet **/ @@ -21,7 +25,11 @@ public class Tag { private Long id = null; private String name = null; + /** + + + **/ public Tag id(Long id) { this.id = id; @@ -31,6 +39,7 @@ public Tag id(Long id) { @ApiModelProperty(value = "") @JsonProperty("id") + public Long getId() { return id; } @@ -38,7 +47,11 @@ public void setId(Long id) { this.id = id; } + /** + + + **/ public Tag name(String name) { this.name = name; @@ -48,6 +61,7 @@ public Tag name(String name) { @ApiModelProperty(value = "") @JsonProperty("name") + public String getName() { return name; } @@ -55,6 +69,7 @@ public void setName(String name) { this.name = name; } + @Override public boolean equals(java.lang.Object o) { @@ -97,3 +112,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/User.java index e8cfc7d6b1d..ae17371b632 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/User.java @@ -3,8 +3,12 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; + + import javax.validation.constraints.*; + + /** * A User who is purchasing from the pet store **/ @@ -27,7 +31,11 @@ public class User { private String phone = null; private Integer userStatus = null; + /** + + + **/ public User id(Long id) { this.id = id; @@ -37,6 +45,7 @@ public User id(Long id) { @ApiModelProperty(value = "") @JsonProperty("id") + public Long getId() { return id; } @@ -44,7 +53,11 @@ public void setId(Long id) { this.id = id; } + /** + + + **/ public User username(String username) { this.username = username; @@ -54,6 +67,7 @@ public User username(String username) { @ApiModelProperty(value = "") @JsonProperty("username") + public String getUsername() { return username; } @@ -61,7 +75,11 @@ public void setUsername(String username) { this.username = username; } + /** + + + **/ public User firstName(String firstName) { this.firstName = firstName; @@ -71,6 +89,7 @@ public User firstName(String firstName) { @ApiModelProperty(value = "") @JsonProperty("firstName") + public String getFirstName() { return firstName; } @@ -78,7 +97,11 @@ public void setFirstName(String firstName) { this.firstName = firstName; } + /** + + + **/ public User lastName(String lastName) { this.lastName = lastName; @@ -88,6 +111,7 @@ public User lastName(String lastName) { @ApiModelProperty(value = "") @JsonProperty("lastName") + public String getLastName() { return lastName; } @@ -95,7 +119,11 @@ public void setLastName(String lastName) { this.lastName = lastName; } + /** + + + **/ public User email(String email) { this.email = email; @@ -105,6 +133,7 @@ public User email(String email) { @ApiModelProperty(value = "") @JsonProperty("email") + public String getEmail() { return email; } @@ -112,7 +141,11 @@ public void setEmail(String email) { this.email = email; } + /** + + + **/ public User password(String password) { this.password = password; @@ -122,6 +155,7 @@ public User password(String password) { @ApiModelProperty(value = "") @JsonProperty("password") + public String getPassword() { return password; } @@ -129,7 +163,11 @@ public void setPassword(String password) { this.password = password; } + /** + + + **/ public User phone(String phone) { this.phone = phone; @@ -139,6 +177,7 @@ public User phone(String phone) { @ApiModelProperty(value = "") @JsonProperty("phone") + public String getPhone() { return phone; } @@ -146,8 +185,13 @@ public void setPhone(String phone) { this.phone = phone; } + /** + * User Status + + + **/ public User userStatus(Integer userStatus) { this.userStatus = userStatus; @@ -157,6 +201,7 @@ public User userStatus(Integer userStatus) { @ApiModelProperty(value = "User Status") @JsonProperty("userStatus") + public Integer getUserStatus() { return userStatus; } @@ -164,6 +209,7 @@ public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } + @Override public boolean equals(java.lang.Object o) { @@ -218,3 +264,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/RestApplication.java b/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/RestApplication.java index 3b43beeb9be..1ae54938776 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/RestApplication.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/RestApplication.java @@ -1,9 +1,9 @@ -package io.swagger.api; - -import javax.ws.rs.ApplicationPath; -import javax.ws.rs.core.Application; - -@ApplicationPath("/") -public class RestApplication extends Application { - // Add implementation-specific details here +package io.swagger.api; + +import javax.ws.rs.ApplicationPath; +import javax.ws.rs.core.Application; + +@ApplicationPath("/") +public class RestApplication extends Application { + // Add implementation-specific details here } \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java index c56aee7e580..6c7a4056651 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java @@ -5,10 +5,10 @@ import org.apache.cxf.jaxrs.ext.multipart.Attachment; -import java.io.File; import io.swagger.model.ModelApiResponse; import io.swagger.model.Pet; + import java.util.List; import java.io.InputStream; @@ -19,45 +19,56 @@ @RequestScoped + public class PetApiServiceImpl implements PetApiService { + @Override - public Response addPet(Pet body, SecurityContext securityContext) { + public Response addPet(Pet pet, SecurityContext securityContext) { // do some magic! return Response.ok().entity("magic!").build(); } + @Override - public Response deletePet(Long petId, String apiKey, SecurityContext securityContext) { + public Response deletePet(Integer petId, String apiKey, SecurityContext securityContext) { // do some magic! return Response.ok().entity("magic!").build(); } + @Override public Response findPetsByStatus(List status, SecurityContext securityContext) { // do some magic! return Response.ok().entity("magic!").build(); } + @Override public Response findPetsByTags(List tags, SecurityContext securityContext) { // do some magic! return Response.ok().entity("magic!").build(); } + @Override - public Response getPetById(Long petId, SecurityContext securityContext) { + public Response getPetById(Integer petId, SecurityContext securityContext) { // do some magic! return Response.ok().entity("magic!").build(); } + @Override - public Response updatePet(Pet body, SecurityContext securityContext) { + public Response updatePet(Pet pet, SecurityContext securityContext) { // do some magic! return Response.ok().entity("magic!").build(); } + @Override - public Response updatePetWithForm(Long petId, String name, String status, SecurityContext securityContext) { + public Response updatePetWithForm(Integer petId, Object body, SecurityContext securityContext) { // do some magic! return Response.ok().entity("magic!").build(); } + @Override - public Response uploadFile(Long petId, String additionalMetadata, InputStream fileInputStream, Attachment fileDetail, SecurityContext securityContext) { + public Response uploadFile(Integer petId, Object body, SecurityContext securityContext) { // do some magic! return Response.ok().entity("magic!").build(); } + } + diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java index 50bd4b8501b..3c01ab32c06 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java @@ -8,6 +8,7 @@ import java.util.Map; import io.swagger.model.Order; + import java.util.List; import java.io.InputStream; @@ -18,25 +19,32 @@ @RequestScoped + public class StoreApiServiceImpl implements StoreApiService { + @Override public Response deleteOrder(String orderId, SecurityContext securityContext) { // do some magic! return Response.ok().entity("magic!").build(); } + @Override public Response getInventory(SecurityContext securityContext) { // do some magic! return Response.ok().entity("magic!").build(); } + @Override - public Response getOrderById(Long orderId, SecurityContext securityContext) { + public Response getOrderById(Integer orderId, SecurityContext securityContext) { // do some magic! return Response.ok().entity("magic!").build(); } + @Override - public Response placeOrder(Order body, SecurityContext securityContext) { + public Response placeOrder(Order order, SecurityContext securityContext) { // do some magic! return Response.ok().entity("magic!").build(); } + } + diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java index 2870f45fb4c..25118746595 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java @@ -5,9 +5,9 @@ import org.apache.cxf.jaxrs.ext.multipart.Attachment; -import java.util.List; import io.swagger.model.User; + import java.util.List; import java.io.InputStream; @@ -18,45 +18,56 @@ @RequestScoped + public class UserApiServiceImpl implements UserApiService { + @Override - public Response createUser(User body, SecurityContext securityContext) { + public Response createUser(User user, SecurityContext securityContext) { // do some magic! return Response.ok().entity("magic!").build(); } + @Override public Response createUsersWithArrayInput(List body, SecurityContext securityContext) { // do some magic! return Response.ok().entity("magic!").build(); } + @Override public Response createUsersWithListInput(List body, SecurityContext securityContext) { // do some magic! return Response.ok().entity("magic!").build(); } + @Override public Response deleteUser(String username, SecurityContext securityContext) { // do some magic! return Response.ok().entity("magic!").build(); } + @Override public Response getUserByName(String username, SecurityContext securityContext) { // do some magic! return Response.ok().entity("magic!").build(); } + @Override public Response loginUser(String username, String password, SecurityContext securityContext) { // do some magic! return Response.ok().entity("magic!").build(); } + @Override public Response logoutUser(SecurityContext securityContext) { // do some magic! return Response.ok().entity("magic!").build(); } + @Override - public Response updateUser(String username, User body, SecurityContext securityContext) { + public Response updateUser(User user, String username, SecurityContext securityContext) { // do some magic! return Response.ok().entity("magic!").build(); } + } + diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/main/webapp/WEB-INF/beans.xml b/samples/server/petstore/jaxrs-cxf-cdi/src/main/webapp/WEB-INF/beans.xml index f9f7d3d948b..cb6d500d43f 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/main/webapp/WEB-INF/beans.xml +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/main/webapp/WEB-INF/beans.xml @@ -1,13 +1,13 @@ - - - - - + + + + + \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf-cdi/swagger.json b/samples/server/petstore/jaxrs-cxf-cdi/swagger.json index 388bfca1154..a008660cc4e 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/swagger.json +++ b/samples/server/petstore/jaxrs-cxf-cdi/swagger.json @@ -1,9 +1,8 @@ { - "swagger" : "2.0", + "openapi" : "3.0.1", "info" : { - "description" : "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.", - "version" : "1.0.0", "title" : "Swagger Petstore", + "description" : "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.", "termsOfService" : "http://swagger.io/terms/", "contact" : { "email" : "apiteam@swagger.io" @@ -11,10 +10,16 @@ "license" : { "name" : "Apache-2.0", "url" : "http://www.apache.org/licenses/LICENSE-2.0.html" - } + }, + "version" : "1.0.0" }, - "host" : "petstore.swagger.io", - "basePath" : "/v2", + "externalDocs" : { + "description" : "Find out more about Swagger", + "url" : "http://swagger.io" + }, + "servers" : [ { + "url" : "http://petstore.swagger.io/v2" + } ], "tags" : [ { "name" : "pet", "description" : "Everything about your Pets", @@ -33,59 +38,70 @@ "url" : "http://swagger.io" } } ], - "schemes" : [ "http" ], "paths" : { "/pet" : { - "post" : { + "put" : { "tags" : [ "pet" ], - "summary" : "Add a new pet to the store", - "description" : "", - "operationId" : "addPet", - "consumes" : [ "application/json", "application/xml" ], - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", + "summary" : "Update an existing pet", + "operationId" : "updatePet", + "requestBody" : { "description" : "Pet object that needs to be added to the store", - "required" : true, - "schema" : { - "$ref" : "#/definitions/Pet" - } - } ], + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + }, + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + } + }, + "required" : true + }, "responses" : { + "400" : { + "description" : "Invalid ID supplied", + "content" : { } + }, + "404" : { + "description" : "Pet not found", + "content" : { } + }, "405" : { - "description" : "Invalid input" + "description" : "Validation exception", + "content" : { } } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ] }, - "put" : { + "post" : { "tags" : [ "pet" ], - "summary" : "Update an existing pet", - "description" : "", - "operationId" : "updatePet", - "consumes" : [ "application/json", "application/xml" ], - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", + "summary" : "Add a new pet to the store", + "operationId" : "addPet", + "requestBody" : { "description" : "Pet object that needs to be added to the store", - "required" : true, - "schema" : { - "$ref" : "#/definitions/Pet" - } - } ], - "responses" : { - "400" : { - "description" : "Invalid ID supplied" - }, - "404" : { - "description" : "Pet not found" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + }, + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + } }, + "required" : true + }, + "responses" : { "405" : { - "description" : "Validation exception" + "description" : "Invalid input", + "content" : { } } }, "security" : [ { @@ -99,32 +115,46 @@ "summary" : "Finds Pets by status", "description" : "Multiple status values can be provided with comma separated strings", "operationId" : "findPetsByStatus", - "produces" : [ "application/xml", "application/json" ], "parameters" : [ { "name" : "status", "in" : "query", "description" : "Status values that need to be considered for filter", "required" : true, - "type" : "array", - "items" : { - "type" : "string", - "default" : "available", - "enum" : [ "available", "pending", "sold" ] - }, - "collectionFormat" : "csv" + "explode" : false, + "schema" : { + "type" : "array", + "items" : { + "type" : "string", + "default" : "available", + "enum" : [ "available", "pending", "sold" ] + } + } } ], "responses" : { "200" : { "description" : "successful operation", - "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/Pet" + "content" : { + "application/xml" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Pet" + } + } + }, + "application/json" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Pet" + } + } } } }, "400" : { - "description" : "Invalid status value" + "description" : "Invalid status value", + "content" : { } } }, "security" : [ { @@ -138,36 +168,50 @@ "summary" : "Finds Pets by tags", "description" : "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", "operationId" : "findPetsByTags", - "produces" : [ "application/xml", "application/json" ], "parameters" : [ { "name" : "tags", "in" : "query", "description" : "Tags to filter by", "required" : true, - "type" : "array", - "items" : { - "type" : "string" - }, - "collectionFormat" : "csv" + "explode" : false, + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } } ], "responses" : { "200" : { "description" : "successful operation", - "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/Pet" + "content" : { + "application/xml" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Pet" + } + } + }, + "application/json" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Pet" + } + } } } }, "400" : { - "description" : "Invalid tag value" + "description" : "Invalid tag value", + "content" : { } } }, + "deprecated" : true, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] - } ], - "deprecated" : true + } ] } }, "/pet/{petId}" : { @@ -176,27 +220,39 @@ "summary" : "Find pet by ID", "description" : "Returns a single pet", "operationId" : "getPetById", - "produces" : [ "application/xml", "application/json" ], "parameters" : [ { "name" : "petId", "in" : "path", "description" : "ID of pet to return", "required" : true, - "type" : "integer", - "format" : "int64" + "schema" : { + "type" : "integer", + "format" : "int64" + } } ], "responses" : { "200" : { "description" : "successful operation", - "schema" : { - "$ref" : "#/definitions/Pet" + "content" : { + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + }, + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + } } }, "400" : { - "description" : "Invalid ID supplied" + "description" : "Invalid ID supplied", + "content" : { } }, "404" : { - "description" : "Pet not found" + "description" : "Pet not found", + "content" : { } } }, "security" : [ { @@ -206,33 +262,39 @@ "post" : { "tags" : [ "pet" ], "summary" : "Updates a pet in the store with form data", - "description" : "", "operationId" : "updatePetWithForm", - "consumes" : [ "application/x-www-form-urlencoded" ], - "produces" : [ "application/xml", "application/json" ], "parameters" : [ { "name" : "petId", "in" : "path", "description" : "ID of pet that needs to be updated", "required" : true, - "type" : "integer", - "format" : "int64" - }, { - "name" : "name", - "in" : "formData", - "description" : "Updated name of the pet", - "required" : false, - "type" : "string" - }, { - "name" : "status", - "in" : "formData", - "description" : "Updated status of the pet", - "required" : false, - "type" : "string" + "schema" : { + "type" : "integer", + "format" : "int64" + } } ], + "requestBody" : { + "content" : { + "application/x-www-form-urlencoded" : { + "schema" : { + "properties" : { + "name" : { + "type" : "string", + "description" : "Updated name of the pet" + }, + "status" : { + "type" : "string", + "description" : "Updated status of the pet" + } + } + } + } + } + }, "responses" : { "405" : { - "description" : "Invalid input" + "description" : "Invalid input", + "content" : { } } }, "security" : [ { @@ -242,25 +304,27 @@ "delete" : { "tags" : [ "pet" ], "summary" : "Deletes a pet", - "description" : "", "operationId" : "deletePet", - "produces" : [ "application/xml", "application/json" ], "parameters" : [ { "name" : "api_key", "in" : "header", - "required" : false, - "type" : "string" + "schema" : { + "type" : "string" + } }, { "name" : "petId", "in" : "path", "description" : "Pet id to delete", "required" : true, - "type" : "integer", - "format" : "int64" + "schema" : { + "type" : "integer", + "format" : "int64" + } } ], "responses" : { "400" : { - "description" : "Invalid pet value" + "description" : "Invalid pet value", + "content" : { } } }, "security" : [ { @@ -272,35 +336,45 @@ "post" : { "tags" : [ "pet" ], "summary" : "uploads an image", - "description" : "", "operationId" : "uploadFile", - "consumes" : [ "multipart/form-data" ], - "produces" : [ "application/json" ], "parameters" : [ { "name" : "petId", "in" : "path", "description" : "ID of pet to update", "required" : true, - "type" : "integer", - "format" : "int64" - }, { - "name" : "additionalMetadata", - "in" : "formData", - "description" : "Additional data to pass to server", - "required" : false, - "type" : "string" - }, { - "name" : "file", - "in" : "formData", - "description" : "file to upload", - "required" : false, - "type" : "file" + "schema" : { + "type" : "integer", + "format" : "int64" + } } ], + "requestBody" : { + "content" : { + "multipart/form-data" : { + "schema" : { + "properties" : { + "additionalMetadata" : { + "type" : "string", + "description" : "Additional data to pass to server" + }, + "file" : { + "type" : "string", + "description" : "file to upload", + "format" : "binary" + } + } + } + } + } + }, "responses" : { "200" : { "description" : "successful operation", - "schema" : { - "$ref" : "#/definitions/ApiResponse" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ApiResponse" + } + } } } }, @@ -315,16 +389,18 @@ "summary" : "Returns pet inventories by status", "description" : "Returns a map of status codes to quantities", "operationId" : "getInventory", - "produces" : [ "application/json" ], - "parameters" : [ ], "responses" : { "200" : { "description" : "successful operation", - "schema" : { - "type" : "object", - "additionalProperties" : { - "type" : "integer", - "format" : "int32" + "content" : { + "application/json" : { + "schema" : { + "type" : "object", + "additionalProperties" : { + "type" : "integer", + "format" : "int32" + } + } } } } @@ -338,27 +414,37 @@ "post" : { "tags" : [ "store" ], "summary" : "Place an order for a pet", - "description" : "", "operationId" : "placeOrder", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", + "requestBody" : { "description" : "order placed for purchasing the pet", - "required" : true, - "schema" : { - "$ref" : "#/definitions/Order" - } - } ], + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/Order" + } + } + }, + "required" : true + }, "responses" : { "200" : { "description" : "successful operation", - "schema" : { - "$ref" : "#/definitions/Order" + "content" : { + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/Order" + } + }, + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Order" + } + } } }, "400" : { - "description" : "Invalid Order" + "description" : "Invalid Order", + "content" : { } } } } @@ -369,29 +455,41 @@ "summary" : "Find purchase order by ID", "description" : "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", "operationId" : "getOrderById", - "produces" : [ "application/xml", "application/json" ], "parameters" : [ { "name" : "orderId", "in" : "path", "description" : "ID of pet that needs to be fetched", "required" : true, - "type" : "integer", - "maximum" : 5, - "minimum" : 1, - "format" : "int64" + "schema" : { + "maximum" : 5, + "minimum" : 1, + "type" : "integer", + "format" : "int64" + } } ], "responses" : { "200" : { "description" : "successful operation", - "schema" : { - "$ref" : "#/definitions/Order" + "content" : { + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/Order" + } + }, + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Order" + } + } } }, "400" : { - "description" : "Invalid ID supplied" + "description" : "Invalid ID supplied", + "content" : { } }, "404" : { - "description" : "Order not found" + "description" : "Order not found", + "content" : { } } } }, @@ -400,20 +498,23 @@ "summary" : "Delete purchase order by ID", "description" : "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", "operationId" : "deleteOrder", - "produces" : [ "application/xml", "application/json" ], "parameters" : [ { "name" : "orderId", "in" : "path", "description" : "ID of the order that needs to be deleted", "required" : true, - "type" : "string" + "schema" : { + "type" : "string" + } } ], "responses" : { "400" : { - "description" : "Invalid ID supplied" + "description" : "Invalid ID supplied", + "content" : { } }, "404" : { - "description" : "Order not found" + "description" : "Order not found", + "content" : { } } } } @@ -424,19 +525,21 @@ "summary" : "Create user", "description" : "This can only be done by the logged in user.", "operationId" : "createUser", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", + "requestBody" : { "description" : "Created user object", - "required" : true, - "schema" : { - "$ref" : "#/definitions/User" - } - } ], + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/User" + } + } + }, + "required" : true + }, "responses" : { "default" : { - "description" : "successful operation" + "description" : "successful operation", + "content" : { } } } } @@ -445,24 +548,25 @@ "post" : { "tags" : [ "user" ], "summary" : "Creates list of users with given input array", - "description" : "", "operationId" : "createUsersWithArrayInput", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", + "requestBody" : { "description" : "List of user object", - "required" : true, - "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/User" + "content" : { + "*/*" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/User" + } + } } - } - } ], + }, + "required" : true + }, "responses" : { "default" : { - "description" : "successful operation" + "description" : "successful operation", + "content" : { } } } } @@ -471,24 +575,25 @@ "post" : { "tags" : [ "user" ], "summary" : "Creates list of users with given input array", - "description" : "", "operationId" : "createUsersWithListInput", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", + "requestBody" : { "description" : "List of user object", - "required" : true, - "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/User" + "content" : { + "*/*" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/User" + } + } } - } - } ], + }, + "required" : true + }, "responses" : { "default" : { - "description" : "successful operation" + "description" : "successful operation", + "content" : { } } } } @@ -497,43 +602,59 @@ "get" : { "tags" : [ "user" ], "summary" : "Logs user into the system", - "description" : "", "operationId" : "loginUser", - "produces" : [ "application/xml", "application/json" ], "parameters" : [ { "name" : "username", "in" : "query", "description" : "The user name for login", "required" : true, - "type" : "string" + "schema" : { + "type" : "string" + } }, { "name" : "password", "in" : "query", "description" : "The password for login in clear text", "required" : true, - "type" : "string" + "schema" : { + "type" : "string" + } } ], "responses" : { "200" : { "description" : "successful operation", - "schema" : { - "type" : "string" - }, "headers" : { "X-Rate-Limit" : { - "type" : "integer", - "format" : "int32", - "description" : "calls per hour allowed by the user" + "description" : "calls per hour allowed by the user", + "schema" : { + "type" : "integer", + "format" : "int32" + } }, "X-Expires-After" : { - "type" : "string", - "format" : "date-time", - "description" : "date in UTC when toekn expires" + "description" : "date in UTC when toekn expires", + "schema" : { + "type" : "string", + "format" : "date-time" + } + } + }, + "content" : { + "application/xml" : { + "schema" : { + "type" : "string" + } + }, + "application/json" : { + "schema" : { + "type" : "string" + } } } }, "400" : { - "description" : "Invalid username/password supplied" + "description" : "Invalid username/password supplied", + "content" : { } } } } @@ -542,13 +663,11 @@ "get" : { "tags" : [ "user" ], "summary" : "Logs out current logged in user session", - "description" : "", "operationId" : "logoutUser", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ ], "responses" : { "default" : { - "description" : "successful operation" + "description" : "successful operation", + "content" : { } } } } @@ -557,28 +676,39 @@ "get" : { "tags" : [ "user" ], "summary" : "Get user by user name", - "description" : "", "operationId" : "getUserByName", - "produces" : [ "application/xml", "application/json" ], "parameters" : [ { "name" : "username", "in" : "path", "description" : "The name that needs to be fetched. Use user1 for testing. ", "required" : true, - "type" : "string" + "schema" : { + "type" : "string" + } } ], "responses" : { "200" : { "description" : "successful operation", - "schema" : { - "$ref" : "#/definitions/User" + "content" : { + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/User" + } + }, + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/User" + } + } } }, "400" : { - "description" : "Invalid username supplied" + "description" : "Invalid username supplied", + "content" : { } }, "404" : { - "description" : "User not found" + "description" : "User not found", + "content" : { } } } }, @@ -587,28 +717,34 @@ "summary" : "Updated user", "description" : "This can only be done by the logged in user.", "operationId" : "updateUser", - "produces" : [ "application/xml", "application/json" ], "parameters" : [ { "name" : "username", "in" : "path", "description" : "name that need to be deleted", "required" : true, - "type" : "string" - }, { - "in" : "body", - "name" : "body", - "description" : "Updated user object", - "required" : true, "schema" : { - "$ref" : "#/definitions/User" + "type" : "string" } } ], + "requestBody" : { + "description" : "Updated user object", + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/User" + } + } + }, + "required" : true + }, "responses" : { "400" : { - "description" : "Invalid user supplied" + "description" : "Invalid user supplied", + "content" : { } }, "404" : { - "description" : "User not found" + "description" : "User not found", + "content" : { } } } }, @@ -617,215 +753,219 @@ "summary" : "Delete user", "description" : "This can only be done by the logged in user.", "operationId" : "deleteUser", - "produces" : [ "application/xml", "application/json" ], "parameters" : [ { "name" : "username", "in" : "path", "description" : "The name that needs to be deleted", "required" : true, - "type" : "string" + "schema" : { + "type" : "string" + } } ], "responses" : { "400" : { - "description" : "Invalid username supplied" + "description" : "Invalid username supplied", + "content" : { } }, "404" : { - "description" : "User not found" + "description" : "User not found", + "content" : { } } } } } }, - "securityDefinitions" : { - "petstore_auth" : { - "type" : "oauth2", - "authorizationUrl" : "http://petstore.swagger.io/api/oauth/dialog", - "flow" : "implicit", - "scopes" : { - "write:pets" : "modify pets in your account", - "read:pets" : "read your pets" - } - }, - "api_key" : { - "type" : "apiKey", - "name" : "api_key", - "in" : "header" - } - }, - "definitions" : { - "Order" : { - "type" : "object", - "properties" : { - "id" : { - "type" : "integer", - "format" : "int64" - }, - "petId" : { - "type" : "integer", - "format" : "int64" - }, - "quantity" : { - "type" : "integer", - "format" : "int32" - }, - "shipDate" : { - "type" : "string", - "format" : "date-time" - }, - "status" : { - "type" : "string", - "description" : "Order Status", - "enum" : [ "placed", "approved", "delivered" ] - }, - "complete" : { - "type" : "boolean", - "default" : false - } - }, - "title" : "Pet Order", - "description" : "An order for a pets from the pet store", - "xml" : { - "name" : "Order" - } - }, - "Category" : { - "type" : "object", - "properties" : { - "id" : { - "type" : "integer", - "format" : "int64" + "components" : { + "schemas" : { + "Order" : { + "title" : "Pet Order", + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64" + }, + "petId" : { + "type" : "integer", + "format" : "int64" + }, + "quantity" : { + "type" : "integer", + "format" : "int32" + }, + "shipDate" : { + "type" : "string", + "format" : "date-time" + }, + "status" : { + "type" : "string", + "description" : "Order Status", + "enum" : [ "placed", "approved", "delivered" ] + }, + "complete" : { + "type" : "boolean", + "default" : false + } }, - "name" : { - "type" : "string" + "description" : "An order for a pets from the pet store", + "xml" : { + "name" : "Order" } }, - "title" : "Pet category", - "description" : "A category for a pet", - "xml" : { - "name" : "Category" - } - }, - "User" : { - "type" : "object", - "properties" : { - "id" : { - "type" : "integer", - "format" : "int64" - }, - "username" : { - "type" : "string" - }, - "firstName" : { - "type" : "string" - }, - "lastName" : { - "type" : "string" - }, - "email" : { - "type" : "string" - }, - "password" : { - "type" : "string" - }, - "phone" : { - "type" : "string" + "Category" : { + "title" : "Pet category", + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64" + }, + "name" : { + "type" : "string" + } }, - "userStatus" : { - "type" : "integer", - "format" : "int32", - "description" : "User Status" + "description" : "A category for a pet", + "xml" : { + "name" : "Category" } }, - "title" : "a User", - "description" : "A User who is purchasing from the pet store", - "xml" : { - "name" : "User" - } - }, - "Tag" : { - "type" : "object", - "properties" : { - "id" : { - "type" : "integer", - "format" : "int64" + "User" : { + "title" : "a User", + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64" + }, + "username" : { + "type" : "string" + }, + "firstName" : { + "type" : "string" + }, + "lastName" : { + "type" : "string" + }, + "email" : { + "type" : "string" + }, + "password" : { + "type" : "string" + }, + "phone" : { + "type" : "string" + }, + "userStatus" : { + "type" : "integer", + "description" : "User Status", + "format" : "int32" + } }, - "name" : { - "type" : "string" + "description" : "A User who is purchasing from the pet store", + "xml" : { + "name" : "User" } }, - "title" : "Pet Tag", - "description" : "A tag for a pet", - "xml" : { - "name" : "Tag" - } - }, - "Pet" : { - "type" : "object", - "required" : [ "name", "photoUrls" ], - "properties" : { - "id" : { - "type" : "integer", - "format" : "int64" - }, - "category" : { - "$ref" : "#/definitions/Category" - }, - "name" : { - "type" : "string", - "example" : "doggie" - }, - "photoUrls" : { - "type" : "array", - "xml" : { - "name" : "photoUrl", - "wrapped" : true + "Tag" : { + "title" : "Pet Tag", + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64" }, - "items" : { + "name" : { "type" : "string" } }, - "tags" : { - "type" : "array", - "xml" : { - "name" : "tag", - "wrapped" : true + "description" : "A tag for a pet", + "xml" : { + "name" : "Tag" + } + }, + "Pet" : { + "title" : "a Pet", + "required" : [ "name", "photoUrls" ], + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64" + }, + "category" : { + "$ref" : "#/components/schemas/Category" + }, + "name" : { + "type" : "string", + "example" : "doggie" + }, + "photoUrls" : { + "type" : "array", + "xml" : { + "name" : "photoUrl", + "wrapped" : true + }, + "items" : { + "type" : "string" + } + }, + "tags" : { + "type" : "array", + "xml" : { + "name" : "tag", + "wrapped" : true + }, + "items" : { + "$ref" : "#/components/schemas/Tag" + } }, - "items" : { - "$ref" : "#/definitions/Tag" + "status" : { + "type" : "string", + "description" : "pet status in the store", + "enum" : [ "available", "pending", "sold" ] } }, - "status" : { - "type" : "string", - "description" : "pet status in the store", - "enum" : [ "available", "pending", "sold" ] + "description" : "A pet for sale in the pet store", + "xml" : { + "name" : "Pet" } }, - "title" : "a Pet", - "description" : "A pet for sale in the pet store", - "xml" : { - "name" : "Pet" + "ApiResponse" : { + "title" : "An uploaded response", + "type" : "object", + "properties" : { + "code" : { + "type" : "integer", + "format" : "int32" + }, + "type" : { + "type" : "string" + }, + "message" : { + "type" : "string" + } + }, + "description" : "Describes the result of uploading an image resource" } }, - "ApiResponse" : { - "type" : "object", - "properties" : { - "code" : { - "type" : "integer", - "format" : "int32" - }, - "type" : { - "type" : "string" - }, - "message" : { - "type" : "string" + "securitySchemes" : { + "petstore_auth" : { + "type" : "oauth2", + "flows" : { + "implicit" : { + "authorizationUrl" : "http://petstore.swagger.io/api/oauth/dialog", + "scopes" : { + "write:pets" : "modify pets in your account", + "read:pets" : "read your pets" + } + } } }, - "title" : "An uploaded response", - "description" : "Describes the result of uploading an image resource" + "api_key" : { + "type" : "apiKey", + "name" : "api_key", + "in" : "header" + } } - }, - "externalDocs" : { - "description" : "Find out more about Swagger", - "url" : "http://swagger.io" } } \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/.swagger-codegen/VERSION b/samples/server/petstore/jaxrs-cxf-non-spring-app/.swagger-codegen/VERSION index f9f7450d135..096bf47efe3 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/.swagger-codegen/VERSION +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.0-SNAPSHOT \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/api/PetApi.java b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/api/PetApi.java index f8b8a10d288..cfb5812adf2 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/api/PetApi.java @@ -1,9 +1,9 @@ package io.swagger.api; -import java.io.File; import io.swagger.model.ModelApiResponse; import io.swagger.model.Pet; + import java.io.InputStream; import java.io.OutputStream; import java.util.List; @@ -18,139 +18,194 @@ import io.swagger.annotations.ApiResponses; import io.swagger.annotations.ApiResponse; import io.swagger.jaxrs.PATCH; + import javax.validation.constraints.*; import javax.validation.Valid; + + /** * Swagger Petstore * + *

This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * + */ + @Path("/") @Api(value = "/", description = "") + public interface PetApi { + + + /** * Add a new pet to the store * - * - * + */ + @POST @Path("/pet") + @Consumes({ "application/json", "application/xml" }) - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Add a new pet to the store", tags={ "pet", }) + + + @ApiOperation(value = "Add a new pet to the store", tags={ "pet" }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input") }) - public void addPet(@Valid Pet body); + public void addPet(@Valid Pet pet); + + /** * Deletes a pet * - * - * + */ + @DELETE @Path("/pet/{petId}") - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Deletes a pet", tags={ "pet", }) + + + @ApiOperation(value = "Deletes a pet", tags={ "pet" }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid pet value") }) - public void deletePet(@PathParam("petId") Long petId, @HeaderParam("api_key") String apiKey); + public void deletePet(@PathParam("petId") Integer petId, @HeaderParam("api_key") String apiKey); + + /** * Finds Pets by status * + * Multiple status values can be provided with comma separated strings * + */ + @GET @Path("/pet/findByStatus") + + @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Finds Pets by status", tags={ "pet", }) + + @ApiOperation(value = "Finds Pets by status", tags={ "pet" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid status value") }) public List findPetsByStatus(@QueryParam("status") @NotNull List status); + + /** * Finds Pets by tags * + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * + */ + @GET @Path("/pet/findByTags") + + @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Finds Pets by tags", tags={ "pet", }) + + @ApiOperation(value = "Finds Pets by tags", tags={ "pet" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid tag value") }) public List findPetsByTags(@QueryParam("tags") @NotNull List tags); + + /** * Find pet by ID * + * Returns a single pet * + */ + @GET @Path("/pet/{petId}") + + @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Find pet by ID", tags={ "pet", }) + + @ApiOperation(value = "Find pet by ID", tags={ "pet" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found") }) - public Pet getPetById(@PathParam("petId") Long petId); + public Pet getPetById(@PathParam("petId") Integer petId); + + /** * Update an existing pet * - * - * + */ + @PUT @Path("/pet") + @Consumes({ "application/json", "application/xml" }) - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Update an existing pet", tags={ "pet", }) + + + @ApiOperation(value = "Update an existing pet", tags={ "pet" }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found"), @ApiResponse(code = 405, message = "Validation exception") }) - public void updatePet(@Valid Pet body); + public void updatePet(@Valid Pet pet); + + /** * Updates a pet in the store with form data * - * - * + */ + @POST @Path("/pet/{petId}") + @Consumes({ "application/x-www-form-urlencoded" }) - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Updates a pet in the store with form data", tags={ "pet", }) + + + @ApiOperation(value = "Updates a pet in the store with form data", tags={ "pet" }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input") }) - public void updatePetWithForm(@PathParam("petId") Long petId, @Multipart(value = "name", required = false) String name, @Multipart(value = "status", required = false) String status); + public void updatePetWithForm(@PathParam("petId") Integer petId, @Valid Object body); + + /** * uploads an image * - * - * + */ + @POST @Path("/pet/{petId}/uploadImage") + @Consumes({ "multipart/form-data" }) + + @Produces({ "application/json" }) + @ApiOperation(value = "uploads an image", tags={ "pet" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - public ModelApiResponse uploadFile(@PathParam("petId") Long petId, @Multipart(value = "additionalMetadata", required = false) String additionalMetadata, @Multipart(value = "file" , required = false) Attachment fileDetail); + public ModelApiResponse uploadFile(@PathParam("petId") Integer petId, @Valid Object body); + } + diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/api/StoreApi.java b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/api/StoreApi.java index 72508ea286a..5409f81ac25 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/api/StoreApi.java @@ -3,6 +3,7 @@ import java.util.Map; import io.swagger.model.Order; + import java.io.InputStream; import java.io.OutputStream; import java.util.List; @@ -17,77 +18,116 @@ import io.swagger.annotations.ApiResponses; import io.swagger.annotations.ApiResponse; import io.swagger.jaxrs.PATCH; + import javax.validation.constraints.*; import javax.validation.Valid; + + /** * Swagger Petstore * + *

This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * + */ + @Path("/") @Api(value = "/", description = "") + public interface StoreApi { + + + /** * Delete purchase order by ID * + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * + */ + @DELETE @Path("/store/order/{orderId}") - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Delete purchase order by ID", tags={ "store", }) + + + @ApiOperation(value = "Delete purchase order by ID", tags={ "store" }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) public void deleteOrder(@PathParam("orderId") String orderId); + + /** * Returns pet inventories by status * + * Returns a map of status codes to quantities * + */ + @GET @Path("/store/inventory") + + @Produces({ "application/json" }) - @ApiOperation(value = "Returns pet inventories by status", tags={ "store", }) + + @ApiOperation(value = "Returns pet inventories by status", tags={ "store" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) public Map getInventory(); + + /** * Find purchase order by ID * + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * + */ + @GET @Path("/store/order/{orderId}") + + @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Find purchase order by ID", tags={ "store", }) + + @ApiOperation(value = "Find purchase order by ID", tags={ "store" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) - public Order getOrderById(@PathParam("orderId") @Min(1) @Max(5) Long orderId); + public Order getOrderById(@PathParam("orderId") @DecimalMin("1") @DecimalMax("5") Integer orderId); + + /** * Place an order for a pet * - * - * + */ + @POST @Path("/store/order") + + @Consumes({ "*/*" }) + + @Produces({ "application/xml", "application/json" }) + @ApiOperation(value = "Place an order for a pet", tags={ "store" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order") }) - public Order placeOrder(@Valid Order body); + public Order placeOrder(@Valid Order order); + } + diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/api/UserApi.java b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/api/UserApi.java index 7aba6911b46..88678459877 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/api/UserApi.java @@ -1,8 +1,8 @@ package io.swagger.api; -import java.util.List; import io.swagger.model.User; + import java.io.InputStream; import java.io.OutputStream; import java.util.List; @@ -17,134 +17,189 @@ import io.swagger.annotations.ApiResponses; import io.swagger.annotations.ApiResponse; import io.swagger.jaxrs.PATCH; + import javax.validation.constraints.*; import javax.validation.Valid; + + /** * Swagger Petstore * + *

This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * + */ + @Path("/") @Api(value = "/", description = "") + public interface UserApi { + + + /** * Create user * + * This can only be done by the logged in user. * + */ + @POST @Path("/user") - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Create user", tags={ "user", }) + + @Consumes({ "*/*" }) + + + @ApiOperation(value = "Create user", tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - public void createUser(@Valid User body); + public void createUser(@Valid User user); + + /** * Creates list of users with given input array * - * - * + */ + @POST @Path("/user/createWithArray") - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Creates list of users with given input array", tags={ "user", }) + + @Consumes({ "*/*" }) + + + @ApiOperation(value = "Creates list of users with given input array", tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) public void createUsersWithArrayInput(@Valid List body); + + /** * Creates list of users with given input array * - * - * + */ + @POST @Path("/user/createWithList") - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Creates list of users with given input array", tags={ "user", }) + + @Consumes({ "*/*" }) + + + @ApiOperation(value = "Creates list of users with given input array", tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) public void createUsersWithListInput(@Valid List body); + + /** * Delete user * + * This can only be done by the logged in user. * + */ + @DELETE @Path("/user/{username}") - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Delete user", tags={ "user", }) + + + @ApiOperation(value = "Delete user", tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) public void deleteUser(@PathParam("username") String username); + + /** * Get user by user name * - * - * + */ + @GET @Path("/user/{username}") + + @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Get user by user name", tags={ "user", }) + + @ApiOperation(value = "Get user by user name", tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) public User getUserByName(@PathParam("username") String username); + + /** * Logs user into the system * - * - * + */ + @GET @Path("/user/login") + + @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Logs user into the system", tags={ "user", }) + + @ApiOperation(value = "Logs user into the system", tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied") }) public String loginUser(@QueryParam("username") @NotNull String username, @QueryParam("password") @NotNull String password); + + /** * Logs out current logged in user session * - * - * + */ + @GET @Path("/user/logout") - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Logs out current logged in user session", tags={ "user", }) + + + @ApiOperation(value = "Logs out current logged in user session", tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) public void logoutUser(); + + /** * Updated user * + * This can only be done by the logged in user. * + */ + @PUT @Path("/user/{username}") - @Produces({ "application/xml", "application/json" }) + + @Consumes({ "*/*" }) + + @ApiOperation(value = "Updated user", tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied"), @ApiResponse(code = 404, message = "User not found") }) - public void updateUser(@PathParam("username") String username, @Valid User body); + public void updateUser(@Valid User user, @PathParam("username") String username); + } + diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Category.java index 9a1956aae8c..4e55dd2757e 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Category.java @@ -1,8 +1,15 @@ package io.swagger.model; import io.swagger.annotations.ApiModel; + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @@ -13,26 +20,49 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; + + /** * A category for a pet **/ @ApiModel(description="A category for a pet") + public class Category { + @ApiModelProperty(value = "") + + + private Long id = null; + + + @ApiModelProperty(value = "") + + + private String name = null; + + /** + + * Get id + + + * @return id **/ @JsonProperty("id") + + public Long getId() { return id; } + public void setId(Long id) { this.id = id; } @@ -41,16 +71,28 @@ public Category id(Long id) { this.id = id; return this; } + + + + /** + + * Get name + + + * @return name **/ @JsonProperty("name") + + public String getName() { return name; } + public void setName(String name) { this.name = name; } @@ -59,7 +101,11 @@ public Category name(String name) { this.name = name; return this; } + + + + @Override public String toString() { @@ -84,3 +130,6 @@ private static String toIndentedString(java.lang.Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/ModelApiResponse.java index 51ffbeff6da..d1071cd241b 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -1,8 +1,15 @@ package io.swagger.model; import io.swagger.annotations.ApiModel; + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @@ -13,28 +20,57 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; + + /** * Describes the result of uploading an image resource **/ @ApiModel(description="Describes the result of uploading an image resource") + public class ModelApiResponse { + @ApiModelProperty(value = "") + + + private Integer code = null; + + + @ApiModelProperty(value = "") + + + private String type = null; + + + @ApiModelProperty(value = "") + + + private String message = null; + + /** + + * Get code + + + * @return code **/ @JsonProperty("code") + + public Integer getCode() { return code; } + public void setCode(Integer code) { this.code = code; } @@ -43,16 +79,28 @@ public ModelApiResponse code(Integer code) { this.code = code; return this; } + + + + /** + + * Get type + + + * @return type **/ @JsonProperty("type") + + public String getType() { return type; } + public void setType(String type) { this.type = type; } @@ -61,16 +109,28 @@ public ModelApiResponse type(String type) { this.type = type; return this; } + + + + /** + + * Get message + + + * @return message **/ @JsonProperty("message") + + public String getMessage() { return message; } + public void setMessage(String message) { this.message = message; } @@ -79,7 +139,11 @@ public ModelApiResponse message(String message) { this.message = message; return this; } + + + + @Override public String toString() { @@ -105,3 +169,6 @@ private static String toIndentedString(java.lang.Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Order.java index dac33686761..86a6f175a37 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Order.java @@ -2,8 +2,15 @@ import io.swagger.annotations.ApiModel; import java.util.Date; + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @@ -14,26 +21,55 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; + + /** * An order for a pets from the pet store **/ @ApiModel(description="An order for a pets from the pet store") + public class Order { + @ApiModelProperty(value = "") + + + private Long id = null; + + + @ApiModelProperty(value = "") + + + private Long petId = null; + + + @ApiModelProperty(value = "") + + + private Integer quantity = null; + + + @ApiModelProperty(value = "") + + + private Date shipDate = null; + + @XmlType(name="StatusEnum") @XmlEnum(String.class) public enum StatusEnum { + @XmlEnumValue("placed") PLACED(String.valueOf("placed")), @XmlEnumValue("approved") APPROVED(String.valueOf("approved")), @XmlEnumValue("delivered") DELIVERED(String.valueOf("delivered")); + private String value; @@ -61,23 +97,44 @@ public static StatusEnum fromValue(String v) { } } + @ApiModelProperty(value = "Order Status") + /** * Order Status **/ + + + private StatusEnum status = null; + + + @ApiModelProperty(value = "") + + + private Boolean complete = false; + + /** + + * Get id + + + * @return id **/ @JsonProperty("id") + + public Long getId() { return id; } + public void setId(Long id) { this.id = id; } @@ -86,16 +143,28 @@ public Order id(Long id) { this.id = id; return this; } + + + + /** + + * Get petId + + + * @return petId **/ @JsonProperty("petId") + + public Long getPetId() { return petId; } + public void setPetId(Long petId) { this.petId = petId; } @@ -104,16 +173,28 @@ public Order petId(Long petId) { this.petId = petId; return this; } + + + + /** + + * Get quantity + + + * @return quantity **/ @JsonProperty("quantity") + + public Integer getQuantity() { return quantity; } + public void setQuantity(Integer quantity) { this.quantity = quantity; } @@ -122,16 +203,28 @@ public Order quantity(Integer quantity) { this.quantity = quantity; return this; } + + + + /** + + * Get shipDate + + + * @return shipDate **/ @JsonProperty("shipDate") + + public Date getShipDate() { return shipDate; } + public void setShipDate(Date shipDate) { this.shipDate = shipDate; } @@ -140,12 +233,23 @@ public Order shipDate(Date shipDate) { this.shipDate = shipDate; return this; } + + + + /** + * Order Status + + + + * @return status **/ @JsonProperty("status") + + public String getStatus() { if (status == null) { return null; @@ -153,6 +257,7 @@ public String getStatus() { return status.value(); } + public void setStatus(StatusEnum status) { this.status = status; } @@ -161,16 +266,28 @@ public Order status(StatusEnum status) { this.status = status; return this; } + + + + /** + + * Get complete + + + * @return complete **/ @JsonProperty("complete") - public Boolean isComplete() { + + + public Boolean isisComplete() { return complete; } + public void setComplete(Boolean complete) { this.complete = complete; } @@ -179,7 +296,11 @@ public Order complete(Boolean complete) { this.complete = complete; return this; } + + + + @Override public String toString() { @@ -208,3 +329,6 @@ private static String toIndentedString(java.lang.Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Pet.java index 3c8ab5da478..9b5d81b1549 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Pet.java @@ -5,8 +5,15 @@ import io.swagger.model.Tag; import java.util.ArrayList; import java.util.List; + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @@ -17,28 +24,63 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; + + /** * A pet for sale in the pet store **/ @ApiModel(description="A pet for sale in the pet store") + public class Pet { + @ApiModelProperty(value = "") + + + private Long id = null; + + + @ApiModelProperty(value = "") + + + private Category category = null; + + + @ApiModelProperty(example = "doggie", required = true, value = "") + + + private String name = null; + + + @ApiModelProperty(required = true, value = "") + + private List photoUrls = new ArrayList(); + + + + @ApiModelProperty(value = "") - private List tags = new ArrayList(); + + + private List tags = null; + + + @XmlType(name="StatusEnum") @XmlEnum(String.class) public enum StatusEnum { + @XmlEnumValue("available") AVAILABLE(String.valueOf("available")), @XmlEnumValue("pending") PENDING(String.valueOf("pending")), @XmlEnumValue("sold") SOLD(String.valueOf("sold")); + private String value; @@ -66,21 +108,36 @@ public static StatusEnum fromValue(String v) { } } + @ApiModelProperty(value = "pet status in the store") + /** * pet status in the store **/ + + + private StatusEnum status = null; + + /** + + * Get id + + + * @return id **/ @JsonProperty("id") + + public Long getId() { return id; } + public void setId(Long id) { this.id = id; } @@ -89,16 +146,28 @@ public Pet id(Long id) { this.id = id; return this; } + + + + /** + + * Get category + + + * @return category **/ @JsonProperty("category") + + public Category getCategory() { return category; } + public void setCategory(Category category) { this.category = category; } @@ -107,17 +176,30 @@ public Pet category(Category category) { this.category = category; return this; } + + + + /** + + * Get name + + + * @return name **/ @JsonProperty("name") + + @NotNull + public String getName() { return name; } + public void setName(String name) { this.name = name; } @@ -126,17 +208,30 @@ public Pet name(String name) { this.name = name; return this; } + + + + /** + + * Get photoUrls + + + * @return photoUrls **/ @JsonProperty("photoUrls") + + @NotNull + public List getPhotoUrls() { return photoUrls; } + public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } @@ -145,21 +240,28 @@ public Pet photoUrls(List photoUrls) { this.photoUrls = photoUrls; return this; } + + + - public Pet addPhotoUrlsItem(String photoUrlsItem) { - this.photoUrls.add(photoUrlsItem); - return this; - } - + /** + + * Get tags + + + * @return tags **/ @JsonProperty("tags") + + public List getTags() { return tags; } + public void setTags(List tags) { this.tags = tags; } @@ -168,17 +270,23 @@ public Pet tags(List tags) { this.tags = tags; return this; } + + + - public Pet addTagsItem(Tag tagsItem) { - this.tags.add(tagsItem); - return this; - } - + /** + * pet status in the store + + + + * @return status **/ @JsonProperty("status") + + public String getStatus() { if (status == null) { return null; @@ -186,6 +294,7 @@ public String getStatus() { return status.value(); } + public void setStatus(StatusEnum status) { this.status = status; } @@ -194,7 +303,11 @@ public Pet status(StatusEnum status) { this.status = status; return this; } + + + + @Override public String toString() { @@ -223,3 +336,6 @@ private static String toIndentedString(java.lang.Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Tag.java index 24fd1d55d2a..4bc35fff324 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Tag.java @@ -1,8 +1,15 @@ package io.swagger.model; import io.swagger.annotations.ApiModel; + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @@ -13,26 +20,49 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; + + /** * A tag for a pet **/ @ApiModel(description="A tag for a pet") + public class Tag { + @ApiModelProperty(value = "") + + + private Long id = null; + + + @ApiModelProperty(value = "") + + + private String name = null; + + /** + + * Get id + + + * @return id **/ @JsonProperty("id") + + public Long getId() { return id; } + public void setId(Long id) { this.id = id; } @@ -41,16 +71,28 @@ public Tag id(Long id) { this.id = id; return this; } + + + + /** + + * Get name + + + * @return name **/ @JsonProperty("name") + + public String getName() { return name; } + public void setName(String name) { this.name = name; } @@ -59,7 +101,11 @@ public Tag name(String name) { this.name = name; return this; } + + + + @Override public String toString() { @@ -84,3 +130,6 @@ private static String toIndentedString(java.lang.Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/User.java index 858e8e14268..e4fda8362c6 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/User.java @@ -1,8 +1,15 @@ package io.swagger.model; import io.swagger.annotations.ApiModel; + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @@ -13,41 +20,101 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; + + /** * A User who is purchasing from the pet store **/ @ApiModel(description="A User who is purchasing from the pet store") + public class User { + @ApiModelProperty(value = "") + + + private Long id = null; + + + @ApiModelProperty(value = "") + + + private String username = null; + + + @ApiModelProperty(value = "") + + + private String firstName = null; + + + @ApiModelProperty(value = "") + + + private String lastName = null; + + + @ApiModelProperty(value = "") + + + private String email = null; + + + @ApiModelProperty(value = "") + + + private String password = null; + + + @ApiModelProperty(value = "") + + + private String phone = null; + + + @ApiModelProperty(value = "User Status") + /** * User Status **/ + + + private Integer userStatus = null; + + /** + + * Get id + + + * @return id **/ @JsonProperty("id") + + public Long getId() { return id; } + public void setId(Long id) { this.id = id; } @@ -56,16 +123,28 @@ public User id(Long id) { this.id = id; return this; } + + + + /** + + * Get username + + + * @return username **/ @JsonProperty("username") + + public String getUsername() { return username; } + public void setUsername(String username) { this.username = username; } @@ -74,16 +153,28 @@ public User username(String username) { this.username = username; return this; } + + + + /** + + * Get firstName + + + * @return firstName **/ @JsonProperty("firstName") + + public String getFirstName() { return firstName; } + public void setFirstName(String firstName) { this.firstName = firstName; } @@ -92,16 +183,28 @@ public User firstName(String firstName) { this.firstName = firstName; return this; } + + + + /** + + * Get lastName + + + * @return lastName **/ @JsonProperty("lastName") + + public String getLastName() { return lastName; } + public void setLastName(String lastName) { this.lastName = lastName; } @@ -110,16 +213,28 @@ public User lastName(String lastName) { this.lastName = lastName; return this; } + + + + /** + + * Get email + + + * @return email **/ @JsonProperty("email") + + public String getEmail() { return email; } + public void setEmail(String email) { this.email = email; } @@ -128,16 +243,28 @@ public User email(String email) { this.email = email; return this; } + + + + /** + + * Get password + + + * @return password **/ @JsonProperty("password") + + public String getPassword() { return password; } + public void setPassword(String password) { this.password = password; } @@ -146,16 +273,28 @@ public User password(String password) { this.password = password; return this; } + + + + /** + + * Get phone + + + * @return phone **/ @JsonProperty("phone") + + public String getPhone() { return phone; } + public void setPhone(String phone) { this.phone = phone; } @@ -164,16 +303,28 @@ public User phone(String phone) { this.phone = phone; return this; } + + + + /** + * User Status + + + + * @return userStatus **/ @JsonProperty("userStatus") + + public Integer getUserStatus() { return userStatus; } + public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } @@ -182,7 +333,11 @@ public User userStatus(Integer userStatus) { this.userStatus = userStatus; return this; } + + + + @Override public String toString() { @@ -213,3 +368,6 @@ private static String toIndentedString(java.lang.Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java index 0f19eb3098d..5326cc9006c 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java @@ -1,10 +1,10 @@ package io.swagger.api.impl; import io.swagger.api.*; -import java.io.File; import io.swagger.model.ModelApiResponse; import io.swagger.model.Pet; + import java.io.InputStream; import java.io.OutputStream; import java.util.List; @@ -18,108 +18,143 @@ import io.swagger.annotations.Api; + + + + /** * Swagger Petstore * + *

This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * */ + public class PetApiServiceImpl implements PetApi { + + + /** * Add a new pet to the store * - * - * + */ - public void addPet(Pet body) { + + public void addPet(Pet pet) { // TODO: Implement... } + + /** * Deletes a pet * - * - * + */ - public void deletePet(Long petId, String apiKey) { + + public void deletePet(Integer petId, String apiKey) { // TODO: Implement... } + + /** * Finds Pets by status * + * Multiple status values can be provided with comma separated strings * + */ + public List findPetsByStatus(List status) { // TODO: Implement... return null; } + + /** * Finds Pets by tags * + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * + */ + public List findPetsByTags(List tags) { // TODO: Implement... return null; } + + /** * Find pet by ID * + * Returns a single pet * + */ - public Pet getPetById(Long petId) { + + public Pet getPetById(Integer petId) { // TODO: Implement... return null; } + + /** * Update an existing pet * - * - * + */ - public void updatePet(Pet body) { + + public void updatePet(Pet pet) { // TODO: Implement... } + + /** * Updates a pet in the store with form data * - * - * + */ - public void updatePetWithForm(Long petId, String name, String status) { + + public void updatePetWithForm(Integer petId, Object body) { // TODO: Implement... } + + /** * uploads an image * - * - * + */ - public ModelApiResponse uploadFile(Long petId, String additionalMetadata, Attachment fileDetail) { + + public ModelApiResponse uploadFile(Integer petId, Object body) { // TODO: Implement... return null; } + } + diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java index 9d3f93f8c3d..c3753800fbd 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java @@ -4,6 +4,7 @@ import java.util.Map; import io.swagger.model.Order; + import java.io.InputStream; import java.io.OutputStream; import java.util.List; @@ -17,60 +18,87 @@ import io.swagger.annotations.Api; + + + + /** * Swagger Petstore * + *

This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * */ + public class StoreApiServiceImpl implements StoreApi { + + + /** * Delete purchase order by ID * + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * + */ + public void deleteOrder(String orderId) { // TODO: Implement... } + + /** * Returns pet inventories by status * + * Returns a map of status codes to quantities * + */ + public Map getInventory() { // TODO: Implement... return null; } + + /** * Find purchase order by ID * + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * + */ - public Order getOrderById(Long orderId) { + + public Order getOrderById(Integer orderId) { // TODO: Implement... return null; } + + /** * Place an order for a pet * - * - * + */ - public Order placeOrder(Order body) { + + public Order placeOrder(Order order) { // TODO: Implement... return null; } + } + diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java index c569dbf5c15..cdb8e9ebea8 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java @@ -1,9 +1,9 @@ package io.swagger.api.impl; import io.swagger.api.*; -import java.util.List; import io.swagger.model.User; + import java.io.InputStream; import java.io.OutputStream; import java.util.List; @@ -17,108 +17,143 @@ import io.swagger.annotations.Api; + + + + /** * Swagger Petstore * + *

This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * */ + public class UserApiServiceImpl implements UserApi { + + + /** * Create user * + * This can only be done by the logged in user. * + */ - public void createUser(User body) { + + public void createUser(User user) { // TODO: Implement... } + + /** * Creates list of users with given input array * - * - * + */ + public void createUsersWithArrayInput(List body) { // TODO: Implement... } + + /** * Creates list of users with given input array * - * - * + */ + public void createUsersWithListInput(List body) { // TODO: Implement... } + + /** * Delete user * + * This can only be done by the logged in user. * + */ + public void deleteUser(String username) { // TODO: Implement... } + + /** * Get user by user name * - * - * + */ + public User getUserByName(String username) { // TODO: Implement... return null; } + + /** * Logs user into the system * - * - * + */ + public String loginUser(String username, String password) { // TODO: Implement... return null; } + + /** * Logs out current logged in user session * - * - * + */ + public void logoutUser() { // TODO: Implement... } + + /** * Updated user * + * This can only be done by the logged in user. * + */ - public void updateUser(String username, User body) { + + public void updateUser(User user, String username) { // TODO: Implement... } + } + diff --git a/samples/server/petstore/jaxrs-cxf/.swagger-codegen-ignore b/samples/server/petstore/jaxrs-cxf/.swagger-codegen-ignore index e36d46f1344..70b88e71039 100644 --- a/samples/server/petstore/jaxrs-cxf/.swagger-codegen-ignore +++ b/samples/server/petstore/jaxrs-cxf/.swagger-codegen-ignore @@ -22,4 +22,4 @@ # Then explicitly reverse the ignore rule for a single file: #!docs/README.md -#**/impl/* +**/impl/* \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf/.swagger-codegen/VERSION b/samples/server/petstore/jaxrs-cxf/.swagger-codegen/VERSION index f9f7450d135..096bf47efe3 100644 --- a/samples/server/petstore/jaxrs-cxf/.swagger-codegen/VERSION +++ b/samples/server/petstore/jaxrs-cxf/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.0-SNAPSHOT \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf/pom.xml b/samples/server/petstore/jaxrs-cxf/pom.xml index 1ab75579100..6bfc459822e 100644 --- a/samples/server/petstore/jaxrs-cxf/pom.xml +++ b/samples/server/petstore/jaxrs-cxf/pom.xml @@ -4,7 +4,9 @@ swagger-cxf-server war swagger-cxf-server + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + 1.0.0 src/main/java @@ -37,6 +39,15 @@ 60000 + + + + javax.validation + validation-api + ${beanvalidation-version} + + + start-jetty @@ -113,6 +124,7 @@ ${junit-version} test + javax.validation @@ -120,6 +132,7 @@ ${beanvalidation-version} provided + org.apache.cxf @@ -165,12 +178,17 @@ ${jackson-jaxrs-version} compile + + - com.fasterxml.jackson.datatype - jackson-datatype-joda - ${jackson-jaxrs-version} - compile + com.fasterxml.jackson.datatype + jackson-datatype-joda + ${jackson-jaxrs-version} + + + + @@ -185,14 +203,18 @@ 1.7 ${java.version} ${java.version} - 1.5.15 + 1.5.18 9.2.9.v20150224 4.12 1.1.7 2.5 + 1.1.0.Final - 3.1.11 - 2.8.9 + + + + 3.2.1 + 2.9.1 UTF-8 diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/AnotherFakeApi.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/AnotherFakeApi.java index c05c51bee51..e13642c89d5 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/AnotherFakeApi.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/AnotherFakeApi.java @@ -2,6 +2,7 @@ import io.swagger.model.Client; + import java.io.InputStream; import java.io.OutputStream; import java.util.List; @@ -16,32 +17,51 @@ import io.swagger.annotations.ApiResponses; import io.swagger.annotations.ApiResponse; import io.swagger.jaxrs.PATCH; + import javax.validation.constraints.*; import javax.validation.Valid; + + /** * Swagger Petstore * + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * + */ + @Path("/") @Api(value = "/", description = "") + public interface AnotherFakeApi { + + + /** * To test special tags * + * To test special tags * + */ + @PATCH @Path("/another-fake/dummy") + @Consumes({ "application/json" }) + + @Produces({ "application/json" }) + @ApiOperation(value = "To test special tags", tags={ "$another-fake?" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - public Client testSpecialTags(@Valid Client body); + public Client testSpecialTags(@Valid Client client); + } + diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/FakeApi.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/FakeApi.java index 96c3a2b16e0..316267a573e 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/FakeApi.java @@ -2,10 +2,9 @@ import java.math.BigDecimal; import io.swagger.model.Client; -import java.util.Date; -import org.joda.time.LocalDate; import io.swagger.model.OuterComposite; + import java.io.InputStream; import java.io.OutputStream; import java.util.List; @@ -20,120 +19,195 @@ import io.swagger.annotations.ApiResponses; import io.swagger.annotations.ApiResponse; import io.swagger.jaxrs.PATCH; + import javax.validation.constraints.*; import javax.validation.Valid; + + /** * Swagger Petstore * + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * + */ + @Path("/") @Api(value = "/", description = "") + public interface FakeApi { + + + @POST @Path("/fake/outer/boolean") - @ApiOperation(value = "", tags={ "fake", }) + + @Consumes({ "*/*" }) + + + @Produces({ "*/*" }) + + @ApiOperation(value = "", tags={ "fake" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) public Boolean fakeOuterBooleanSerialize(@Valid Boolean body); + + @POST @Path("/fake/outer/composite") - @ApiOperation(value = "", tags={ "fake", }) + + @Consumes({ "*/*" }) + + + @Produces({ "*/*" }) + + @ApiOperation(value = "", tags={ "fake" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) - public OuterComposite fakeOuterCompositeSerialize(@Valid OuterComposite body); + public OuterComposite fakeOuterCompositeSerialize(@Valid OuterComposite outercomposite); + + @POST @Path("/fake/outer/number") - @ApiOperation(value = "", tags={ "fake", }) + + @Consumes({ "*/*" }) + + + @Produces({ "*/*" }) + + @ApiOperation(value = "", tags={ "fake" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) public BigDecimal fakeOuterNumberSerialize(@Valid BigDecimal body); + + @POST @Path("/fake/outer/string") - @ApiOperation(value = "", tags={ "fake", }) + + @Consumes({ "*/*" }) + + + @Produces({ "*/*" }) + + @ApiOperation(value = "", tags={ "fake" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output string", response = String.class) }) public String fakeOuterStringSerialize(@Valid String body); + + /** * To test \"client\" model * + * To test \"client\" model * + */ + @PATCH @Path("/fake") + @Consumes({ "application/json" }) + + @Produces({ "application/json" }) - @ApiOperation(value = "To test \"client\" model", tags={ "fake", }) + + @ApiOperation(value = "To test \"client\" model", tags={ "fake" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - public Client testClientModel(@Valid Client body); + public Client testClientModel(@Valid Client client); + + /** * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * + */ + @POST @Path("/fake") + @Consumes({ "application/xml; charset=utf-8", "application/json; charset=utf-8" }) - @Produces({ "application/xml; charset=utf-8", "application/json; charset=utf-8" }) - @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", tags={ "fake", }) + + + @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", tags={ "fake" }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) - public void testEndpointParameters(@Multipart(value = "number") BigDecimal number, @Multipart(value = "double") Double _double, @Multipart(value = "pattern_without_delimiter") String patternWithoutDelimiter, @Multipart(value = "byte") byte[] _byte, @Multipart(value = "integer", required = false) Integer integer, @Multipart(value = "int32", required = false) Integer int32, @Multipart(value = "int64", required = false) Long int64, @Multipart(value = "float", required = false) Float _float, @Multipart(value = "string", required = false) String string, @Multipart(value = "binary", required = false) byte[] binary, @Multipart(value = "date", required = false) LocalDate date, @Multipart(value = "dateTime", required = false) Date dateTime, @Multipart(value = "password", required = false) String password, @Multipart(value = "callback", required = false) String paramCallback); + public void testEndpointParameters(@Valid Object body); + + /** * To test enum parameters * + * To test enum parameters * + */ + @GET @Path("/fake") + @Consumes({ "*/*" }) - @Produces({ "*/*" }) - @ApiOperation(value = "To test enum parameters", tags={ "fake", }) + + + @ApiOperation(value = "To test enum parameters", tags={ "fake" }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request"), @ApiResponse(code = 404, message = "Not found") }) - public void testEnumParameters(@Multipart(value = "enum_form_string_array", required = false) List enumFormStringArray, @Multipart(value = "enum_form_string", required = false) String enumFormString, @HeaderParam("enum_header_string_array") List enumHeaderStringArray, @HeaderParam("enum_header_string") String enumHeaderString, @QueryParam("enum_query_string_array") List enumQueryStringArray, @QueryParam("enum_query_string") @DefaultValue("-efg") String enumQueryString, @QueryParam("enum_query_integer") Integer enumQueryInteger, @Multipart(value = "enum_query_double", required = false) Double enumQueryDouble); + public void testEnumParameters(@Valid Object body, @HeaderParam("enum_header_string_array") List enumHeaderStringArray, @HeaderParam("enum_header_string") String enumHeaderString, @QueryParam("enum_query_string_array") List enumQueryStringArray, @QueryParam("enum_query_string") String enumQueryString, @QueryParam("enum_query_integer") Integer enumQueryInteger); + + /** * test inline additionalProperties * - * - * + */ + @POST @Path("/fake/inline-additionalProperties") + @Consumes({ "application/json" }) - @ApiOperation(value = "test inline additionalProperties", tags={ "fake", }) + + + @ApiOperation(value = "test inline additionalProperties", tags={ "fake" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - public void testInlineAdditionalProperties(@Valid Object param); + public void testInlineAdditionalProperties(@Valid Map body); + + /** * test json serialization of form data * - * - * + */ + @GET @Path("/fake/jsonFormData") + @Consumes({ "application/json" }) + + @ApiOperation(value = "test json serialization of form data", tags={ "fake" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - public void testJsonFormData(@Multipart(value = "param") String param, @Multipart(value = "param2") String param2); + public void testJsonFormData(@Valid Object body); + } + diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/FakeClassnameTags123Api.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/FakeClassnameTags123Api.java index 63de6839dc1..4443a066af5 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/FakeClassnameTags123Api.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/FakeClassnameTags123Api.java @@ -2,6 +2,7 @@ import io.swagger.model.Client; + import java.io.InputStream; import java.io.OutputStream; import java.util.List; @@ -16,30 +17,48 @@ import io.swagger.annotations.ApiResponses; import io.swagger.annotations.ApiResponse; import io.swagger.jaxrs.PATCH; + import javax.validation.constraints.*; import javax.validation.Valid; + + /** * Swagger Petstore * + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * + */ + @Path("/") @Api(value = "/", description = "") + public interface FakeClassnameTags123Api { + + + /** * To test class name in snake case * + */ + @PATCH @Path("/fake_classname_test") + @Consumes({ "application/json" }) + + @Produces({ "application/json" }) + @ApiOperation(value = "To test class name in snake case", tags={ "fake_classname_tags 123#$%^" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - public Client testClassname(@Valid Client body); + public Client testClassname(@Valid Client client); + } + diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/PetApi.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/PetApi.java index 20fab16db0c..4b364218958 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/PetApi.java @@ -1,9 +1,9 @@ package io.swagger.api; -import java.io.File; import io.swagger.model.ModelApiResponse; import io.swagger.model.Pet; + import java.io.InputStream; import java.io.OutputStream; import java.util.List; @@ -18,139 +18,194 @@ import io.swagger.annotations.ApiResponses; import io.swagger.annotations.ApiResponse; import io.swagger.jaxrs.PATCH; + import javax.validation.constraints.*; import javax.validation.Valid; + + /** * Swagger Petstore * + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * + */ + @Path("/") @Api(value = "/", description = "") + public interface PetApi { + + + /** * Add a new pet to the store * - * - * + */ + @POST @Path("/pet") + @Consumes({ "application/json", "application/xml" }) - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Add a new pet to the store", tags={ "pet", }) + + + @ApiOperation(value = "Add a new pet to the store", tags={ "pet" }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input") }) - public void addPet(@Valid Pet body); + public void addPet(@Valid Pet pet); + + /** * Deletes a pet * - * - * + */ + @DELETE @Path("/pet/{petId}") - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Deletes a pet", tags={ "pet", }) + + + @ApiOperation(value = "Deletes a pet", tags={ "pet" }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid pet value") }) - public void deletePet(@PathParam("petId") Long petId, @HeaderParam("api_key") String apiKey); + public void deletePet(@PathParam("petId") Integer petId, @HeaderParam("api_key") String apiKey); + + /** * Finds Pets by status * + * Multiple status values can be provided with comma separated strings * + */ + @GET @Path("/pet/findByStatus") + + @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Finds Pets by status", tags={ "pet", }) + + @ApiOperation(value = "Finds Pets by status", tags={ "pet" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid status value") }) public List findPetsByStatus(@QueryParam("status") @NotNull List status); + + /** * Finds Pets by tags * + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * + */ + @GET @Path("/pet/findByTags") + + @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Finds Pets by tags", tags={ "pet", }) + + @ApiOperation(value = "Finds Pets by tags", tags={ "pet" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid tag value") }) public List findPetsByTags(@QueryParam("tags") @NotNull List tags); + + /** * Find pet by ID * + * Returns a single pet * + */ + @GET @Path("/pet/{petId}") + + @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Find pet by ID", tags={ "pet", }) + + @ApiOperation(value = "Find pet by ID", tags={ "pet" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found") }) - public Pet getPetById(@PathParam("petId") Long petId); + public Pet getPetById(@PathParam("petId") Integer petId); + + /** * Update an existing pet * - * - * + */ + @PUT @Path("/pet") + @Consumes({ "application/json", "application/xml" }) - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Update an existing pet", tags={ "pet", }) + + + @ApiOperation(value = "Update an existing pet", tags={ "pet" }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found"), @ApiResponse(code = 405, message = "Validation exception") }) - public void updatePet(@Valid Pet body); + public void updatePet(@Valid Pet pet); + + /** * Updates a pet in the store with form data * - * - * + */ + @POST @Path("/pet/{petId}") + @Consumes({ "application/x-www-form-urlencoded" }) - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Updates a pet in the store with form data", tags={ "pet", }) + + + @ApiOperation(value = "Updates a pet in the store with form data", tags={ "pet" }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input") }) - public void updatePetWithForm(@PathParam("petId") Long petId, @Multipart(value = "name", required = false) String name, @Multipart(value = "status", required = false) String status); + public void updatePetWithForm(@PathParam("petId") Integer petId, @Valid Object body); + + /** * uploads an image * - * - * + */ + @POST @Path("/pet/{petId}/uploadImage") + @Consumes({ "multipart/form-data" }) + + @Produces({ "application/json" }) + @ApiOperation(value = "uploads an image", tags={ "pet" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - public ModelApiResponse uploadFile(@PathParam("petId") Long petId, @Multipart(value = "additionalMetadata", required = false) String additionalMetadata, @Multipart(value = "file" , required = false) Attachment fileDetail); + public ModelApiResponse uploadFile(@PathParam("petId") Integer petId, @Valid Object body); + } + diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/StoreApi.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/StoreApi.java index 065420cf357..e1224f07999 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/StoreApi.java @@ -3,6 +3,7 @@ import java.util.Map; import io.swagger.model.Order; + import java.io.InputStream; import java.io.OutputStream; import java.util.List; @@ -17,77 +18,116 @@ import io.swagger.annotations.ApiResponses; import io.swagger.annotations.ApiResponse; import io.swagger.jaxrs.PATCH; + import javax.validation.constraints.*; import javax.validation.Valid; + + /** * Swagger Petstore * + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * + */ + @Path("/") @Api(value = "/", description = "") + public interface StoreApi { + + + /** * Delete purchase order by ID * + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * + */ + @DELETE @Path("/store/order/{order_id}") - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Delete purchase order by ID", tags={ "store", }) + + + @ApiOperation(value = "Delete purchase order by ID", tags={ "store" }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) public void deleteOrder(@PathParam("order_id") String orderId); + + /** * Returns pet inventories by status * + * Returns a map of status codes to quantities * + */ + @GET @Path("/store/inventory") + + @Produces({ "application/json" }) - @ApiOperation(value = "Returns pet inventories by status", tags={ "store", }) + + @ApiOperation(value = "Returns pet inventories by status", tags={ "store" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) public Map getInventory(); + + /** * Find purchase order by ID * + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * + */ + @GET @Path("/store/order/{order_id}") + + @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Find purchase order by ID", tags={ "store", }) + + @ApiOperation(value = "Find purchase order by ID", tags={ "store" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) - public Order getOrderById(@PathParam("order_id") @Min(1) @Max(5) Long orderId); + public Order getOrderById(@PathParam("order_id") @DecimalMin("1") @DecimalMax("5") Integer orderId); + + /** * Place an order for a pet * - * - * + */ + @POST @Path("/store/order") + + @Consumes({ "*/*" }) + + @Produces({ "application/xml", "application/json" }) + @ApiOperation(value = "Place an order for a pet", tags={ "store" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order") }) - public Order placeOrder(@Valid Order body); + public Order placeOrder(@Valid Order order); + } + diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/UserApi.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/UserApi.java index 3e0d6350623..64612dd6172 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/UserApi.java @@ -1,8 +1,8 @@ package io.swagger.api; -import java.util.List; import io.swagger.model.User; + import java.io.InputStream; import java.io.OutputStream; import java.util.List; @@ -17,134 +17,189 @@ import io.swagger.annotations.ApiResponses; import io.swagger.annotations.ApiResponse; import io.swagger.jaxrs.PATCH; + import javax.validation.constraints.*; import javax.validation.Valid; + + /** * Swagger Petstore * + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * + */ + @Path("/") @Api(value = "/", description = "") + public interface UserApi { + + + /** * Create user * + * This can only be done by the logged in user. * + */ + @POST @Path("/user") - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Create user", tags={ "user", }) + + @Consumes({ "*/*" }) + + + @ApiOperation(value = "Create user", tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) - public void createUser(@Valid User body); + public void createUser(@Valid User user); + + /** * Creates list of users with given input array * - * - * + */ + @POST @Path("/user/createWithArray") - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Creates list of users with given input array", tags={ "user", }) + + @Consumes({ "*/*" }) + + + @ApiOperation(value = "Creates list of users with given input array", tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) public void createUsersWithArrayInput(@Valid List body); + + /** * Creates list of users with given input array * - * - * + */ + @POST @Path("/user/createWithList") - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Creates list of users with given input array", tags={ "user", }) + + @Consumes({ "*/*" }) + + + @ApiOperation(value = "Creates list of users with given input array", tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) public void createUsersWithListInput(@Valid List body); + + /** * Delete user * + * This can only be done by the logged in user. * + */ + @DELETE @Path("/user/{username}") - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Delete user", tags={ "user", }) + + + @ApiOperation(value = "Delete user", tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) public void deleteUser(@PathParam("username") String username); + + /** * Get user by user name * - * - * + */ + @GET @Path("/user/{username}") + + @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Get user by user name", tags={ "user", }) + + @ApiOperation(value = "Get user by user name", tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) public User getUserByName(@PathParam("username") String username); + + /** * Logs user into the system * - * - * + */ + @GET @Path("/user/login") + + @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Logs user into the system", tags={ "user", }) + + @ApiOperation(value = "Logs user into the system", tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied") }) public String loginUser(@QueryParam("username") @NotNull String username, @QueryParam("password") @NotNull String password); + + /** * Logs out current logged in user session * - * - * + */ + @GET @Path("/user/logout") - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Logs out current logged in user session", tags={ "user", }) + + + @ApiOperation(value = "Logs out current logged in user session", tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) public void logoutUser(); + + /** * Updated user * + * This can only be done by the logged in user. * + */ + @PUT @Path("/user/{username}") - @Produces({ "application/xml", "application/json" }) + + @Consumes({ "*/*" }) + + @ApiOperation(value = "Updated user", tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied"), @ApiResponse(code = 404, message = "User not found") }) - public void updateUser(@PathParam("username") String username, @Valid User body); + public void updateUser(@Valid User user, @PathParam("username") String username); + } + diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java index 353bc6e2cbc..30fa36c5273 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java @@ -3,8 +3,15 @@ import java.util.HashMap; import java.util.List; import java.util.Map; + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @@ -15,22 +22,44 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; + + public class AdditionalPropertiesClass { + @ApiModelProperty(value = "") + + private Map mapProperty = null; + + + @ApiModelProperty(value = "") + + private Map> mapOfMapProperty = null; + + + + /** + + * Get mapProperty + + + * @return mapProperty **/ @JsonProperty("map_property") + + public Map getMapProperty() { return mapProperty; } + public void setMapProperty(Map mapProperty) { this.mapProperty = mapProperty; } @@ -39,21 +68,34 @@ public AdditionalPropertiesClass mapProperty(Map mapProperty) { this.mapProperty = mapProperty; return this; } + + public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { this.mapProperty.put(key, mapPropertyItem); return this; } + + + /** + + * Get mapOfMapProperty + + + * @return mapOfMapProperty **/ @JsonProperty("map_of_map_property") + + public Map> getMapOfMapProperty() { return mapOfMapProperty; } + public void setMapOfMapProperty(Map> mapOfMapProperty) { this.mapOfMapProperty = mapOfMapProperty; } @@ -62,12 +104,17 @@ public AdditionalPropertiesClass mapOfMapProperty(Map mapOfMapPropertyItem) { this.mapOfMapProperty.put(key, mapOfMapPropertyItem); return this; } + + + @Override public String toString() { @@ -92,3 +139,6 @@ private static String toIndentedString(java.lang.Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Animal.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Animal.java index 2962c676df8..90c5d53afeb 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Animal.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Animal.java @@ -2,8 +2,15 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @@ -14,23 +21,46 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; + + public class Animal { + @ApiModelProperty(required = true, value = "") + + + private String className = null; + + @ApiModelProperty(value = "") + + + private String color = "red"; + + + /** + + * Get className + + + * @return className **/ @JsonProperty("className") + + @NotNull + public String getClassName() { return className; } + public void setClassName(String className) { this.className = className; } @@ -39,16 +69,28 @@ public Animal className(String className) { this.className = className; return this; } + + + + /** + + * Get color + + + * @return color **/ @JsonProperty("color") + + public String getColor() { return color; } + public void setColor(String color) { this.color = color; } @@ -57,7 +99,11 @@ public Animal color(String color) { this.color = color; return this; } + + + + @Override public String toString() { @@ -82,3 +128,6 @@ private static String toIndentedString(java.lang.Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/AnimalFarm.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/AnimalFarm.java index f124292c31d..62815648ccb 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/AnimalFarm.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/AnimalFarm.java @@ -3,8 +3,15 @@ import io.swagger.model.Animal; import java.util.ArrayList; import java.util.List; + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @@ -15,8 +22,12 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; + + public class AnimalFarm extends ArrayList { + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -38,3 +49,6 @@ private static String toIndentedString(java.lang.Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java index de5d9f8863c..1cd5b86fbcc 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java @@ -3,8 +3,15 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @@ -15,19 +22,36 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; + + public class ArrayOfArrayOfNumberOnly { + @ApiModelProperty(value = "") + + private List> arrayArrayNumber = null; + + + + /** + + * Get arrayArrayNumber + + + * @return arrayArrayNumber **/ @JsonProperty("ArrayArrayNumber") + + public List> getArrayArrayNumber() { return arrayArrayNumber; } + public void setArrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; } @@ -36,12 +60,17 @@ public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArr this.arrayArrayNumber = arrayArrayNumber; return this; } + public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { this.arrayArrayNumber.add(arrayArrayNumberItem); return this; } + + + + @Override public String toString() { @@ -65,3 +94,6 @@ private static String toIndentedString(java.lang.Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java index d9e2795aa97..a52f5920ee6 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java @@ -3,8 +3,15 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @@ -15,19 +22,36 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; + + public class ArrayOfNumberOnly { + @ApiModelProperty(value = "") + + private List arrayNumber = null; + + + + /** + + * Get arrayNumber + + + * @return arrayNumber **/ @JsonProperty("ArrayNumber") + + public List getArrayNumber() { return arrayNumber; } + public void setArrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; } @@ -36,12 +60,17 @@ public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; return this; } + public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { this.arrayNumber.add(arrayNumberItem); return this; } + + + + @Override public String toString() { @@ -65,3 +94,6 @@ private static String toIndentedString(java.lang.Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayTest.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayTest.java index fa3e7f481ab..38305c5f1f6 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayTest.java @@ -3,8 +3,15 @@ import io.swagger.model.ReadOnlyFirst; import java.util.ArrayList; import java.util.List; + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @@ -15,25 +22,52 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; + + public class ArrayTest { + @ApiModelProperty(value = "") + + private List arrayOfString = null; + + + @ApiModelProperty(value = "") + + private List> arrayArrayOfInteger = null; + + + @ApiModelProperty(value = "") + + private List> arrayArrayOfModel = null; + + + + /** + + * Get arrayOfString + + + * @return arrayOfString **/ @JsonProperty("array_of_string") + + public List getArrayOfString() { return arrayOfString; } + public void setArrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; } @@ -42,21 +76,34 @@ public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; return this; } + public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { this.arrayOfString.add(arrayOfStringItem); return this; } + + + + /** + + * Get arrayArrayOfInteger + + + * @return arrayArrayOfInteger **/ @JsonProperty("array_array_of_integer") + + public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; } @@ -65,21 +112,34 @@ public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; return this; } + public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; } + + + + /** + + * Get arrayArrayOfModel + + + * @return arrayArrayOfModel **/ @JsonProperty("array_array_of_model") + + public List> getArrayArrayOfModel() { return arrayArrayOfModel; } + public void setArrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } @@ -88,12 +148,17 @@ public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) this.arrayArrayOfModel = arrayArrayOfModel; return this; } + public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; } + + + + @Override public String toString() { @@ -119,3 +184,6 @@ private static String toIndentedString(java.lang.Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Capitalization.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Capitalization.java index 7333898c61f..63f7008871f 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Capitalization.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Capitalization.java @@ -1,7 +1,14 @@ package io.swagger.model; + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @@ -12,37 +19,80 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; + + public class Capitalization { + @ApiModelProperty(value = "") + + + private String smallCamel = null; + + @ApiModelProperty(value = "") + + + private String capitalCamel = null; + + @ApiModelProperty(value = "") + + + private String smallSnake = null; + + @ApiModelProperty(value = "") + + + private String capitalSnake = null; + + @ApiModelProperty(value = "") + + + private String scAETHFlowPoints = null; + + @ApiModelProperty(value = "Name of the pet ") + /** * Name of the pet **/ + + + private String ATT_NAME = null; + + + /** + + * Get smallCamel + + + * @return smallCamel **/ @JsonProperty("smallCamel") + + public String getSmallCamel() { return smallCamel; } + public void setSmallCamel(String smallCamel) { this.smallCamel = smallCamel; } @@ -51,16 +101,28 @@ public Capitalization smallCamel(String smallCamel) { this.smallCamel = smallCamel; return this; } + + + + /** + + * Get capitalCamel + + + * @return capitalCamel **/ @JsonProperty("CapitalCamel") + + public String getCapitalCamel() { return capitalCamel; } + public void setCapitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; } @@ -69,16 +131,28 @@ public Capitalization capitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; return this; } + + + + /** + + * Get smallSnake + + + * @return smallSnake **/ @JsonProperty("small_Snake") + + public String getSmallSnake() { return smallSnake; } + public void setSmallSnake(String smallSnake) { this.smallSnake = smallSnake; } @@ -87,16 +161,28 @@ public Capitalization smallSnake(String smallSnake) { this.smallSnake = smallSnake; return this; } + + + + /** + + * Get capitalSnake + + + * @return capitalSnake **/ @JsonProperty("Capital_Snake") + + public String getCapitalSnake() { return capitalSnake; } + public void setCapitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; } @@ -105,16 +191,28 @@ public Capitalization capitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; return this; } + + + + /** + + * Get scAETHFlowPoints + + + * @return scAETHFlowPoints **/ @JsonProperty("SCA_ETH_Flow_Points") + + public String getScAETHFlowPoints() { return scAETHFlowPoints; } + public void setScAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; } @@ -123,16 +221,28 @@ public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; return this; } + + + + /** + * Name of the pet + + + + * @return ATT_NAME **/ @JsonProperty("ATT_NAME") + + public String getATTNAME() { return ATT_NAME; } + public void setATTNAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; } @@ -141,7 +251,11 @@ public Capitalization ATT_NAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; return this; } + + + + @Override public String toString() { @@ -170,3 +284,6 @@ private static String toIndentedString(java.lang.Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Cat.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Cat.java index f5af4d9c733..38de9d40f4c 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Cat.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Cat.java @@ -1,8 +1,15 @@ package io.swagger.model; import io.swagger.model.Animal; + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @@ -13,19 +20,114 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; + + public class Cat extends Animal { + + @ApiModelProperty(required = true, value = "") + + + + private String className = null; + + + + @ApiModelProperty(value = "") + + + + private String color = "red"; + + + @ApiModelProperty(value = "") + + + private Boolean declawed = null; + + + /** + + + * Get className + + + + * @return className + **/ + @JsonProperty("className") + + + @NotNull + + public String getClassName() { + return className; + } + + + public void setClassName(String className) { + this.className = className; + } + + public Cat className(String className) { + this.className = className; + return this; + } + + + + + + /** + + + * Get color + + + + * @return color + **/ + @JsonProperty("color") + + + public String getColor() { + return color; + } + + + public void setColor(String color) { + this.color = color; + } + + public Cat color(String color) { + this.color = color; + return this; + } + + + + + + /** + + * Get declawed + + + * @return declawed **/ @JsonProperty("declawed") - public Boolean isDeclawed() { + + + public Boolean isisDeclawed() { return declawed; } + public void setDeclawed(Boolean declawed) { this.declawed = declawed; } @@ -34,13 +136,19 @@ public Cat declawed(Boolean declawed) { this.declawed = declawed; return this; } + + + + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Cat {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); sb.append("}"); return sb.toString(); @@ -58,3 +166,6 @@ private static String toIndentedString(java.lang.Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Category.java index 2be982a410b..7d2f8c97aa0 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Category.java @@ -1,7 +1,14 @@ package io.swagger.model; + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @@ -12,22 +19,44 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; + + public class Category { + @ApiModelProperty(value = "") + + + private Long id = null; + + @ApiModelProperty(value = "") + + + private String name = null; + + + /** + + * Get id + + + * @return id **/ @JsonProperty("id") + + public Long getId() { return id; } + public void setId(Long id) { this.id = id; } @@ -36,16 +65,28 @@ public Category id(Long id) { this.id = id; return this; } + + + + /** + + * Get name + + + * @return name **/ @JsonProperty("name") + + public String getName() { return name; } + public void setName(String name) { this.name = name; } @@ -54,7 +95,11 @@ public Category name(String name) { this.name = name; return this; } + + + + @Override public String toString() { @@ -79,3 +124,6 @@ private static String toIndentedString(java.lang.Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ClassModel.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ClassModel.java index e3af436a21c..9afea9a6d1d 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ClassModel.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ClassModel.java @@ -1,8 +1,15 @@ package io.swagger.model; import io.swagger.annotations.ApiModel; + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @@ -13,23 +20,41 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; + + /** * Model for testing model with \"_class\" property **/ @ApiModel(description="Model for testing model with \"_class\" property") + public class ClassModel { + @ApiModelProperty(value = "") + + + private String propertyClass = null; + + + /** + + * Get propertyClass + + + * @return propertyClass **/ @JsonProperty("_class") + + public String getPropertyClass() { return propertyClass; } + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } @@ -38,7 +63,11 @@ public ClassModel propertyClass(String propertyClass) { this.propertyClass = propertyClass; return this; } + + + + @Override public String toString() { @@ -62,3 +91,6 @@ private static String toIndentedString(java.lang.Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Client.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Client.java index 4d6bd4d0363..e500e03af17 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Client.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Client.java @@ -1,7 +1,14 @@ package io.swagger.model; + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @@ -12,19 +19,36 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; + + public class Client { + @ApiModelProperty(value = "") + + + private String client = null; + + + /** + + * Get client + + + * @return client **/ @JsonProperty("client") + + public String getClient() { return client; } + public void setClient(String client) { this.client = client; } @@ -33,7 +57,11 @@ public Client client(String client) { this.client = client; return this; } + + + + @Override public String toString() { @@ -57,3 +85,6 @@ private static String toIndentedString(java.lang.Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Dog.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Dog.java index aca8d694c72..28316a24cc7 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Dog.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Dog.java @@ -1,8 +1,15 @@ package io.swagger.model; import io.swagger.model.Animal; + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @@ -13,19 +20,114 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; + + public class Dog extends Animal { + + @ApiModelProperty(required = true, value = "") + + + + private String className = null; + + + + @ApiModelProperty(value = "") + + + + private String color = "red"; + + + @ApiModelProperty(value = "") + + + private String breed = null; + + + /** + + + * Get className + + + + * @return className + **/ + @JsonProperty("className") + + + @NotNull + + public String getClassName() { + return className; + } + + + public void setClassName(String className) { + this.className = className; + } + + public Dog className(String className) { + this.className = className; + return this; + } + + + + + + /** + + + * Get color + + + + * @return color + **/ + @JsonProperty("color") + + + public String getColor() { + return color; + } + + + public void setColor(String color) { + this.color = color; + } + + public Dog color(String color) { + this.color = color; + return this; + } + + + + + + /** + + * Get breed + + + * @return breed **/ @JsonProperty("breed") + + public String getBreed() { return breed; } + public void setBreed(String breed) { this.breed = breed; } @@ -34,13 +136,19 @@ public Dog breed(String breed) { this.breed = breed; return this; } + + + + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Dog {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); sb.append("}"); return sb.toString(); @@ -58,3 +166,6 @@ private static String toIndentedString(java.lang.Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumArrays.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumArrays.java index ecf3512c1d2..7cdbee4de73 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumArrays.java @@ -2,8 +2,15 @@ import java.util.ArrayList; import java.util.List; + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @@ -14,6 +21,8 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; + + public class EnumArrays { @@ -21,7 +30,9 @@ public class EnumArrays { @XmlEnum(String.class) public enum JustSymbolEnum { + @XmlEnumValue(">=") GREATER_THAN_OR_EQUAL_TO(String.valueOf(">=")), @XmlEnumValue("$") DOLLAR(String.valueOf("$")); + private String value; @@ -49,15 +60,22 @@ public static JustSymbolEnum fromValue(String v) { } } + @ApiModelProperty(value = "") + + + private JustSymbolEnum justSymbol = null; + @XmlType(name="ArrayEnumEnum") @XmlEnum(String.class) public enum ArrayEnumEnum { + @XmlEnumValue("fish") FISH(String.valueOf("fish")), @XmlEnumValue("crab") CRAB(String.valueOf("crab")); + private String value; @@ -85,13 +103,27 @@ public static ArrayEnumEnum fromValue(String v) { } } + @ApiModelProperty(value = "") + + private List arrayEnum = null; + + + + /** + + * Get justSymbol + + + * @return justSymbol **/ @JsonProperty("just_symbol") + + public String getJustSymbol() { if (justSymbol == null) { return null; @@ -99,6 +131,7 @@ public String getJustSymbol() { return justSymbol.value(); } + public void setJustSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; } @@ -107,16 +140,28 @@ public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; return this; } + + + + /** + + * Get arrayEnum + + + * @return arrayEnum **/ @JsonProperty("array_enum") + + public List getArrayEnum() { return arrayEnum; } + public void setArrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; } @@ -125,12 +170,17 @@ public EnumArrays arrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; return this; } + public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { this.arrayEnum.add(arrayEnumItem); return this; } + + + + @Override public String toString() { @@ -155,3 +205,6 @@ private static String toIndentedString(java.lang.Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumClass.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumClass.java index 928ecf719c8..74ae54a9cae 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumClass.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumClass.java @@ -1,20 +1,31 @@ package io.swagger.model; + + import javax.validation.constraints.*; + + + + + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; + /** * Gets or Sets EnumClass */ public enum EnumClass { + + _ABC("_abc"), _EFG("-efg"), _XYZ_("(xyz)"); + private String value; @@ -23,12 +34,16 @@ public enum EnumClass { } @Override + @JsonValue + public String toString() { return String.valueOf(value); } + @JsonCreator + public static EnumClass fromValue(String text) { for (EnumClass b : EnumClass.values()) { if (String.valueOf(b.value).equals(text)) { @@ -40,3 +55,7 @@ public static EnumClass fromValue(String text) { } + + + + diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumTest.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumTest.java index 93e832b37b9..cde2c5d6202 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumTest.java @@ -1,8 +1,15 @@ package io.swagger.model; import io.swagger.model.OuterEnum; + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @@ -13,6 +20,8 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; + + public class EnumTest { @@ -20,7 +29,9 @@ public class EnumTest { @XmlEnum(String.class) public enum EnumStringEnum { + @XmlEnumValue("UPPER") UPPER(String.valueOf("UPPER")), @XmlEnumValue("lower") LOWER(String.valueOf("lower")), @XmlEnumValue("") EMPTY(String.valueOf("")); + private String value; @@ -48,15 +59,22 @@ public static EnumStringEnum fromValue(String v) { } } + @ApiModelProperty(value = "") + + + private EnumStringEnum enumString = null; + @XmlType(name="EnumIntegerEnum") @XmlEnum(Integer.class) public enum EnumIntegerEnum { + @XmlEnumValue("1") NUMBER_1(Integer.valueOf(1)), @XmlEnumValue("-1") NUMBER_MINUS_1(Integer.valueOf(-1)); + private Integer value; @@ -84,15 +102,22 @@ public static EnumIntegerEnum fromValue(String v) { } } + @ApiModelProperty(value = "") + + + private EnumIntegerEnum enumInteger = null; + @XmlType(name="EnumNumberEnum") @XmlEnum(Double.class) public enum EnumNumberEnum { + @XmlEnumValue("1.1") NUMBER_1_DOT_1(Double.valueOf(1.1)), @XmlEnumValue("-1.2") NUMBER_MINUS_1_DOT_2(Double.valueOf(-1.2)); + private Double value; @@ -120,16 +145,35 @@ public static EnumNumberEnum fromValue(String v) { } } + @ApiModelProperty(value = "") + + + private EnumNumberEnum enumNumber = null; + + @ApiModelProperty(value = "") + + + private OuterEnum outerEnum = null; + + + /** + + * Get enumString + + + * @return enumString **/ @JsonProperty("enum_string") + + public String getEnumString() { if (enumString == null) { return null; @@ -137,6 +181,7 @@ public String getEnumString() { return enumString.value(); } + public void setEnumString(EnumStringEnum enumString) { this.enumString = enumString; } @@ -145,12 +190,23 @@ public EnumTest enumString(EnumStringEnum enumString) { this.enumString = enumString; return this; } + + + + /** + + * Get enumInteger + + + * @return enumInteger **/ @JsonProperty("enum_integer") + + public Integer getEnumInteger() { if (enumInteger == null) { return null; @@ -158,6 +214,7 @@ public Integer getEnumInteger() { return enumInteger.value(); } + public void setEnumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; } @@ -166,12 +223,23 @@ public EnumTest enumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; return this; } + + + + /** + + * Get enumNumber + + + * @return enumNumber **/ @JsonProperty("enum_number") + + public Double getEnumNumber() { if (enumNumber == null) { return null; @@ -179,6 +247,7 @@ public Double getEnumNumber() { return enumNumber.value(); } + public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } @@ -187,16 +256,28 @@ public EnumTest enumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; return this; } + + + + /** + + * Get outerEnum + + + * @return outerEnum **/ @JsonProperty("outerEnum") + + public OuterEnum getOuterEnum() { return outerEnum; } + public void setOuterEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; } @@ -205,7 +286,11 @@ public EnumTest outerEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; return this; } + + + + @Override public String toString() { @@ -232,3 +317,6 @@ private static String toIndentedString(java.lang.Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/FormatTest.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/FormatTest.java index c9085fc2e6f..d2bff26f6b3 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/FormatTest.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/FormatTest.java @@ -4,8 +4,15 @@ import java.util.Date; import java.util.UUID; import org.joda.time.LocalDate; + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @@ -16,57 +23,136 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; + + public class FormatTest { + @ApiModelProperty(value = "") + + + private Integer integer = null; + + @ApiModelProperty(value = "") + + + private Integer int32 = null; + + @ApiModelProperty(value = "") + + + private Long int64 = null; + + @ApiModelProperty(required = true, value = "") + + + private BigDecimal number = null; + + @ApiModelProperty(value = "") + + + private Float _float = null; + + @ApiModelProperty(value = "") + + + private Double _double = null; + + @ApiModelProperty(value = "") + + + private String string = null; + + @ApiModelProperty(required = true, value = "") - private byte[] _byte = null; + + + + private String _byte = null; + + @ApiModelProperty(value = "") - private byte[] binary = null; + + + + private String binary = null; + + @ApiModelProperty(required = true, value = "") + + + private LocalDate date = null; + + @ApiModelProperty(value = "") + + + private Date dateTime = null; + + @ApiModelProperty(value = "") + + + private UUID uuid = null; + + @ApiModelProperty(required = true, value = "") + + + private String password = null; + + + /** + + * Get integer + + * minimum: 10 + + * maximum: 100 + * @return integer **/ @JsonProperty("integer") + + @Min(10) @Max(100) public Integer getInteger() { return integer; } + public void setInteger(Integer integer) { this.integer = integer; } @@ -75,18 +161,32 @@ public FormatTest integer(Integer integer) { this.integer = integer; return this; } + + + + /** + + * Get int32 + + * minimum: 20 + + * maximum: 200 + * @return int32 **/ @JsonProperty("int32") + + @Min(20) @Max(200) public Integer getInt32() { return int32; } + public void setInt32(Integer int32) { this.int32 = int32; } @@ -95,16 +195,28 @@ public FormatTest int32(Integer int32) { this.int32 = int32; return this; } + + + + /** + + * Get int64 + + + * @return int64 **/ @JsonProperty("int64") + + public Long getInt64() { return int64; } + public void setInt64(Long int64) { this.int64 = int64; } @@ -113,19 +225,30 @@ public FormatTest int64(Long int64) { this.int64 = int64; return this; } + + + + /** + + * Get number - * minimum: 32.1 - * maximum: 543.2 + + + * @return number **/ @JsonProperty("number") + + @NotNull - @DecimalMin("32.1") @DecimalMax("543.2") public BigDecimal getNumber() { + + public BigDecimal getNumber() { return number; } + public void setNumber(BigDecimal number) { this.number = number; } @@ -134,18 +257,28 @@ public FormatTest number(BigDecimal number) { this.number = number; return this; } + + + + /** + + * Get _float - * minimum: 54.3 - * maximum: 987.6 + + + * @return _float **/ @JsonProperty("float") - @DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { + + + public Float getFloat() { return _float; } + public void setFloat(Float _float) { this._float = _float; } @@ -154,18 +287,28 @@ public FormatTest _float(Float _float) { this._float = _float; return this; } + + + + /** + + * Get _double - * minimum: 67.8 - * maximum: 123.4 + + + * @return _double **/ @JsonProperty("double") - @DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { + + + public Double getDouble() { return _double; } + public void setDouble(Double _double) { this._double = _double; } @@ -174,16 +317,28 @@ public FormatTest _double(Double _double) { this._double = _double; return this; } + + + + /** + + * Get string + + + * @return string **/ @JsonProperty("string") + + @Pattern(regexp="/[a-z]/i") public String getString() { return string; } + public void setString(String string) { this.string = string; } @@ -192,54 +347,92 @@ public FormatTest string(String string) { this.string = string; return this; } + + + + /** + + * Get _byte + + + * @return _byte **/ @JsonProperty("byte") + + @NotNull - @Pattern(regexp="^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$") public byte[] getByte() { + + @Pattern(regexp="^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$") public String getByte() { return _byte; } - public void setByte(byte[] _byte) { + + public void setByte(String _byte) { this._byte = _byte; } - public FormatTest _byte(byte[] _byte) { + public FormatTest _byte(String _byte) { this._byte = _byte; return this; } + + + + /** + + * Get binary + + + * @return binary **/ @JsonProperty("binary") - public byte[] getBinary() { + + + public String getBinary() { return binary; } - public void setBinary(byte[] binary) { + + public void setBinary(String binary) { this.binary = binary; } - public FormatTest binary(byte[] binary) { + public FormatTest binary(String binary) { this.binary = binary; return this; } + + + + /** + + * Get date + + + * @return date **/ @JsonProperty("date") + + @NotNull + public LocalDate getDate() { return date; } + public void setDate(LocalDate date) { this.date = date; } @@ -248,16 +441,28 @@ public FormatTest date(LocalDate date) { this.date = date; return this; } + + + + /** + + * Get dateTime + + + * @return dateTime **/ @JsonProperty("dateTime") + + public Date getDateTime() { return dateTime; } + public void setDateTime(Date dateTime) { this.dateTime = dateTime; } @@ -266,16 +471,28 @@ public FormatTest dateTime(Date dateTime) { this.dateTime = dateTime; return this; } + + + + /** + + * Get uuid + + + * @return uuid **/ @JsonProperty("uuid") + + public UUID getUuid() { return uuid; } + public void setUuid(UUID uuid) { this.uuid = uuid; } @@ -284,17 +501,30 @@ public FormatTest uuid(UUID uuid) { this.uuid = uuid; return this; } + + + + /** + + * Get password + + + * @return password **/ @JsonProperty("password") + + @NotNull - @Size(min=10,max=64) public String getPassword() { + + public String getPassword() { return password; } + public void setPassword(String password) { this.password = password; } @@ -303,7 +533,11 @@ public FormatTest password(String password) { this.password = password; return this; } + + + + @Override public String toString() { @@ -339,3 +573,6 @@ private static String toIndentedString(java.lang.Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/HasOnlyReadOnly.java index e9ab9aadf50..856a2e66dbe 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/HasOnlyReadOnly.java @@ -1,7 +1,14 @@ package io.swagger.model; + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @@ -12,33 +19,87 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; + + public class HasOnlyReadOnly { + @ApiModelProperty(value = "") + + + private String bar = null; + + @ApiModelProperty(value = "") + + + private String foo = null; + + + /** + + * Get bar + + + * @return bar **/ @JsonProperty("bar") + + public String getBar() { return bar; } + + public void setBar(String bar) { + this.bar = bar; + } + + public HasOnlyReadOnly bar(String bar) { + this.bar = bar; + return this; + } + + + + /** + + * Get foo + + + * @return foo **/ @JsonProperty("foo") + + public String getFoo() { return foo; } + + public void setFoo(String foo) { + this.foo = foo; + } + public HasOnlyReadOnly foo(String foo) { + this.foo = foo; + return this; + } + + + + + @Override public String toString() { @@ -63,3 +124,6 @@ private static String toIndentedString(java.lang.Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/MapTest.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/MapTest.java index fa39d05a288..d5751c1b066 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/MapTest.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/MapTest.java @@ -3,8 +3,15 @@ import java.util.HashMap; import java.util.List; import java.util.Map; + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @@ -15,17 +22,26 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; + + public class MapTest { + @ApiModelProperty(value = "") + + private Map> mapMapOfString = null; + + @XmlType(name="InnerEnum") @XmlEnum(String.class) public enum InnerEnum { + @XmlEnumValue("UPPER") UPPER(String.valueOf("UPPER")), @XmlEnumValue("lower") LOWER(String.valueOf("lower")); + private String value; @@ -53,17 +69,32 @@ public static InnerEnum fromValue(String v) { } } + @ApiModelProperty(value = "") + + private Map mapOfEnumString = null; + + + + /** + + * Get mapMapOfString + + + * @return mapMapOfString **/ @JsonProperty("map_map_of_string") + + public Map> getMapMapOfString() { return mapMapOfString; } + public void setMapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; } @@ -72,21 +103,34 @@ public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; return this; } + + public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { this.mapMapOfString.put(key, mapMapOfStringItem); return this; } + + + /** + + * Get mapOfEnumString + + + * @return mapOfEnumString **/ @JsonProperty("map_of_enum_string") + + public Map getMapOfEnumString() { return mapOfEnumString; } + public void setMapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; } @@ -95,12 +139,17 @@ public MapTest mapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; return this; } + + public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; } + + + @Override public String toString() { @@ -125,3 +174,6 @@ private static String toIndentedString(java.lang.Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java index c86319b2fca..96cf069481b 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -6,8 +6,15 @@ import java.util.List; import java.util.Map; import java.util.UUID; + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @@ -18,25 +25,52 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; + + public class MixedPropertiesAndAdditionalPropertiesClass { + @ApiModelProperty(value = "") + + + private UUID uuid = null; + + @ApiModelProperty(value = "") + + + private Date dateTime = null; + + @ApiModelProperty(value = "") + + private Map map = null; + + + + /** + + * Get uuid + + + * @return uuid **/ @JsonProperty("uuid") + + public UUID getUuid() { return uuid; } + public void setUuid(UUID uuid) { this.uuid = uuid; } @@ -45,16 +79,28 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; return this; } + + + + /** + + * Get dateTime + + + * @return dateTime **/ @JsonProperty("dateTime") + + public Date getDateTime() { return dateTime; } + public void setDateTime(Date dateTime) { this.dateTime = dateTime; } @@ -63,16 +109,28 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(Date dateTime) { this.dateTime = dateTime; return this; } + + + + /** + + * Get map + + + * @return map **/ @JsonProperty("map") + + public Map getMap() { return map; } + public void setMap(Map map) { this.map = map; } @@ -81,12 +139,17 @@ public MixedPropertiesAndAdditionalPropertiesClass map(Map map) this.map = map; return this; } + + public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { this.map.put(key, mapItem); return this; } + + + @Override public String toString() { @@ -112,3 +175,6 @@ private static String toIndentedString(java.lang.Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Model200Response.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Model200Response.java index 30e12af1b47..f947dee6796 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Model200Response.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Model200Response.java @@ -1,8 +1,15 @@ package io.swagger.model; import io.swagger.annotations.ApiModel; + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @@ -13,26 +20,49 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; + + /** * Model for testing model name starting with number **/ @ApiModel(description="Model for testing model name starting with number") + public class Model200Response { + @ApiModelProperty(value = "") + + + private Integer name = null; + + @ApiModelProperty(value = "") + + + private String propertyClass = null; + + + /** + + * Get name + + + * @return name **/ @JsonProperty("name") + + public Integer getName() { return name; } + public void setName(Integer name) { this.name = name; } @@ -41,16 +71,28 @@ public Model200Response name(Integer name) { this.name = name; return this; } + + + + /** + + * Get propertyClass + + + * @return propertyClass **/ @JsonProperty("class") + + public String getPropertyClass() { return propertyClass; } + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } @@ -59,7 +101,11 @@ public Model200Response propertyClass(String propertyClass) { this.propertyClass = propertyClass; return this; } + + + + @Override public String toString() { @@ -84,3 +130,6 @@ private static String toIndentedString(java.lang.Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelApiResponse.java index 64f77fc254e..a2afc076b22 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -1,7 +1,14 @@ package io.swagger.model; + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @@ -12,25 +19,52 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; + + public class ModelApiResponse { + @ApiModelProperty(value = "") + + + private Integer code = null; + + @ApiModelProperty(value = "") + + + private String type = null; + + @ApiModelProperty(value = "") + + + private String message = null; + + + /** + + * Get code + + + * @return code **/ @JsonProperty("code") + + public Integer getCode() { return code; } + public void setCode(Integer code) { this.code = code; } @@ -39,16 +73,28 @@ public ModelApiResponse code(Integer code) { this.code = code; return this; } + + + + /** + + * Get type + + + * @return type **/ @JsonProperty("type") + + public String getType() { return type; } + public void setType(String type) { this.type = type; } @@ -57,16 +103,28 @@ public ModelApiResponse type(String type) { this.type = type; return this; } + + + + /** + + * Get message + + + * @return message **/ @JsonProperty("message") + + public String getMessage() { return message; } + public void setMessage(String message) { this.message = message; } @@ -75,7 +133,11 @@ public ModelApiResponse message(String message) { this.message = message; return this; } + + + + @Override public String toString() { @@ -101,3 +163,6 @@ private static String toIndentedString(java.lang.Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelReturn.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelReturn.java index 3d11f555a12..d4fba41dfc0 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelReturn.java @@ -1,8 +1,15 @@ package io.swagger.model; import io.swagger.annotations.ApiModel; + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @@ -13,23 +20,41 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; + + /** * Model for testing reserved words **/ @ApiModel(description="Model for testing reserved words") + public class ModelReturn { + @ApiModelProperty(value = "") + + + private Integer _return = null; + + + /** + + * Get _return + + + * @return _return **/ @JsonProperty("return") + + public Integer getReturn() { return _return; } + public void setReturn(Integer _return) { this._return = _return; } @@ -38,7 +63,11 @@ public ModelReturn _return(Integer _return) { this._return = _return; return this; } + + + + @Override public String toString() { @@ -62,3 +91,6 @@ private static String toIndentedString(java.lang.Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Name.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Name.java index 2c7e77096ed..9ed709a31a6 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Name.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Name.java @@ -1,8 +1,15 @@ package io.swagger.model; import io.swagger.annotations.ApiModel; + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @@ -13,33 +20,67 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; + + /** * Model for testing model name same as property name **/ @ApiModel(description="Model for testing model name same as property name") + public class Name { + @ApiModelProperty(required = true, value = "") + + + private Integer name = null; + + @ApiModelProperty(value = "") + + + private Integer snakeCase = null; + + @ApiModelProperty(value = "") + + + private String property = null; + + @ApiModelProperty(value = "") + + + private Integer _123Number = null; + + + /** + + * Get name + + + * @return name **/ @JsonProperty("name") + + @NotNull + public Integer getName() { return name; } + public void setName(Integer name) { this.name = name; } @@ -48,26 +89,58 @@ public Name name(Integer name) { this.name = name; return this; } + + + + /** + + * Get snakeCase + + + * @return snakeCase **/ @JsonProperty("snake_case") + + public Integer getSnakeCase() { return snakeCase; } + + public void setSnakeCase(Integer snakeCase) { + this.snakeCase = snakeCase; + } + public Name snakeCase(Integer snakeCase) { + this.snakeCase = snakeCase; + return this; + } + + + + + /** + + * Get property + + + * @return property **/ @JsonProperty("property") + + public String getProperty() { return property; } + public void setProperty(String property) { this.property = property; } @@ -76,17 +149,41 @@ public Name property(String property) { this.property = property; return this; } + + + + /** + + * Get _123Number + + + * @return _123Number **/ @JsonProperty("123Number") + + public Integer get123Number() { return _123Number; } + + public void set123Number(Integer _123Number) { + this._123Number = _123Number; + } + public Name _123Number(Integer _123Number) { + this._123Number = _123Number; + return this; + } + + + + + @Override public String toString() { @@ -113,3 +210,6 @@ private static String toIndentedString(java.lang.Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/NumberOnly.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/NumberOnly.java index 8d6e7d662ae..97b47bb4c50 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/NumberOnly.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/NumberOnly.java @@ -1,8 +1,15 @@ package io.swagger.model; import java.math.BigDecimal; + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @@ -13,19 +20,36 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; + + public class NumberOnly { + @ApiModelProperty(value = "") + + + private BigDecimal justNumber = null; + + + /** + + * Get justNumber + + + * @return justNumber **/ @JsonProperty("JustNumber") + + public BigDecimal getJustNumber() { return justNumber; } + public void setJustNumber(BigDecimal justNumber) { this.justNumber = justNumber; } @@ -34,7 +58,11 @@ public NumberOnly justNumber(BigDecimal justNumber) { this.justNumber = justNumber; return this; } + + + + @Override public String toString() { @@ -58,3 +86,6 @@ private static String toIndentedString(java.lang.Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Order.java index 4e4a7a75b65..7fa6e574122 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Order.java @@ -1,8 +1,15 @@ package io.swagger.model; import java.util.Date; + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @@ -13,26 +20,50 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; + + public class Order { + @ApiModelProperty(value = "") + + + private Long id = null; + + @ApiModelProperty(value = "") + + + private Long petId = null; + + @ApiModelProperty(value = "") + + + private Integer quantity = null; + + @ApiModelProperty(value = "") + + + private Date shipDate = null; + @XmlType(name="StatusEnum") @XmlEnum(String.class) public enum StatusEnum { + @XmlEnumValue("placed") PLACED(String.valueOf("placed")), @XmlEnumValue("approved") APPROVED(String.valueOf("approved")), @XmlEnumValue("delivered") DELIVERED(String.valueOf("delivered")); + private String value; @@ -60,23 +91,44 @@ public static StatusEnum fromValue(String v) { } } + @ApiModelProperty(value = "Order Status") + /** * Order Status **/ + + + private StatusEnum status = null; + + @ApiModelProperty(value = "") + + + private Boolean complete = false; + + + /** + + * Get id + + + * @return id **/ @JsonProperty("id") + + public Long getId() { return id; } + public void setId(Long id) { this.id = id; } @@ -85,16 +137,28 @@ public Order id(Long id) { this.id = id; return this; } + + + + /** + + * Get petId + + + * @return petId **/ @JsonProperty("petId") + + public Long getPetId() { return petId; } + public void setPetId(Long petId) { this.petId = petId; } @@ -103,16 +167,28 @@ public Order petId(Long petId) { this.petId = petId; return this; } + + + + /** + + * Get quantity + + + * @return quantity **/ @JsonProperty("quantity") + + public Integer getQuantity() { return quantity; } + public void setQuantity(Integer quantity) { this.quantity = quantity; } @@ -121,16 +197,28 @@ public Order quantity(Integer quantity) { this.quantity = quantity; return this; } + + + + /** + + * Get shipDate + + + * @return shipDate **/ @JsonProperty("shipDate") + + public Date getShipDate() { return shipDate; } + public void setShipDate(Date shipDate) { this.shipDate = shipDate; } @@ -139,12 +227,23 @@ public Order shipDate(Date shipDate) { this.shipDate = shipDate; return this; } + + + + /** + * Order Status + + + + * @return status **/ @JsonProperty("status") + + public String getStatus() { if (status == null) { return null; @@ -152,6 +251,7 @@ public String getStatus() { return status.value(); } + public void setStatus(StatusEnum status) { this.status = status; } @@ -160,16 +260,28 @@ public Order status(StatusEnum status) { this.status = status; return this; } + + + + /** + + * Get complete + + + * @return complete **/ @JsonProperty("complete") - public Boolean isComplete() { + + + public Boolean isisComplete() { return complete; } + public void setComplete(Boolean complete) { this.complete = complete; } @@ -178,7 +290,11 @@ public Order complete(Boolean complete) { this.complete = complete; return this; } + + + + @Override public String toString() { @@ -207,3 +323,6 @@ private static String toIndentedString(java.lang.Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/OuterBoolean.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/OuterBoolean.java new file mode 100644 index 00000000000..f9313f53939 --- /dev/null +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/OuterBoolean.java @@ -0,0 +1,51 @@ +package io.swagger.model; + + + +import javax.validation.constraints.*; + + + + + + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; + + + +public class OuterBoolean { + + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterBoolean {\n"); + + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + + + + diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/OuterComposite.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/OuterComposite.java index 33fd0d7c28a..d6e055d4370 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/OuterComposite.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/OuterComposite.java @@ -1,8 +1,15 @@ package io.swagger.model; import java.math.BigDecimal; + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @@ -13,25 +20,52 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; + + public class OuterComposite { + @ApiModelProperty(value = "") + + + private BigDecimal myNumber = null; + + @ApiModelProperty(value = "") + + + private String myString = null; + + @ApiModelProperty(value = "") + + + private Boolean myBoolean = null; + + + /** + + * Get myNumber + + + * @return myNumber **/ @JsonProperty("my_number") + + public BigDecimal getMyNumber() { return myNumber; } + public void setMyNumber(BigDecimal myNumber) { this.myNumber = myNumber; } @@ -40,16 +74,28 @@ public OuterComposite myNumber(BigDecimal myNumber) { this.myNumber = myNumber; return this; } + + + + /** + + * Get myString + + + * @return myString **/ @JsonProperty("my_string") + + public String getMyString() { return myString; } + public void setMyString(String myString) { this.myString = myString; } @@ -58,16 +104,28 @@ public OuterComposite myString(String myString) { this.myString = myString; return this; } + + + + /** + + * Get myBoolean + + + * @return myBoolean **/ @JsonProperty("my_boolean") + + public Boolean getMyBoolean() { return myBoolean; } + public void setMyBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; } @@ -76,7 +134,11 @@ public OuterComposite myBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; return this; } + + + + @Override public String toString() { @@ -102,3 +164,6 @@ private static String toIndentedString(java.lang.Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/OuterEnum.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/OuterEnum.java index a95e0f4f052..979fcc06842 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/OuterEnum.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/OuterEnum.java @@ -1,20 +1,31 @@ package io.swagger.model; + + import javax.validation.constraints.*; + + + + + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; + /** * Gets or Sets OuterEnum */ public enum OuterEnum { + + PLACED("placed"), APPROVED("approved"), DELIVERED("delivered"); + private String value; @@ -23,12 +34,16 @@ public enum OuterEnum { } @Override + @JsonValue + public String toString() { return String.valueOf(value); } + @JsonCreator + public static OuterEnum fromValue(String text) { for (OuterEnum b : OuterEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -40,3 +55,7 @@ public static OuterEnum fromValue(String text) { } + + + + diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/OuterNumber.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/OuterNumber.java new file mode 100644 index 00000000000..2e4a499a764 --- /dev/null +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/OuterNumber.java @@ -0,0 +1,51 @@ +package io.swagger.model; + + + +import javax.validation.constraints.*; + + + + + + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; + + + +public class OuterNumber { + + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterNumber {\n"); + + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + + + + diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/OuterString.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/OuterString.java new file mode 100644 index 00000000000..dda6c9c9d09 --- /dev/null +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/OuterString.java @@ -0,0 +1,51 @@ +package io.swagger.model; + + + +import javax.validation.constraints.*; + + + + + + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; + + + +public class OuterString { + + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterString {\n"); + + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + + + + diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Pet.java index a91ce9b1713..4fcfcae2d75 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Pet.java @@ -4,8 +4,15 @@ import io.swagger.model.Tag; import java.util.ArrayList; import java.util.List; + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @@ -16,29 +23,58 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; + + public class Pet { + @ApiModelProperty(value = "") + + + private Long id = null; + + @ApiModelProperty(value = "") + + + private Category category = null; + + @ApiModelProperty(example = "doggie", required = true, value = "") + + + private String name = null; + + @ApiModelProperty(required = true, value = "") + + private List photoUrls = new ArrayList(); + + + @ApiModelProperty(value = "") + + private List tags = null; + + @XmlType(name="StatusEnum") @XmlEnum(String.class) public enum StatusEnum { + @XmlEnumValue("available") AVAILABLE(String.valueOf("available")), @XmlEnumValue("pending") PENDING(String.valueOf("pending")), @XmlEnumValue("sold") SOLD(String.valueOf("sold")); + private String value; @@ -66,20 +102,36 @@ public static StatusEnum fromValue(String v) { } } + @ApiModelProperty(value = "pet status in the store") + /** * pet status in the store **/ + + + private StatusEnum status = null; + + + /** + + * Get id + + + * @return id **/ @JsonProperty("id") + + public Long getId() { return id; } + public void setId(Long id) { this.id = id; } @@ -88,16 +140,28 @@ public Pet id(Long id) { this.id = id; return this; } + + + + /** + + * Get category + + + * @return category **/ @JsonProperty("category") + + public Category getCategory() { return category; } + public void setCategory(Category category) { this.category = category; } @@ -106,17 +170,30 @@ public Pet category(Category category) { this.category = category; return this; } + + + + /** + + * Get name + + + * @return name **/ @JsonProperty("name") + + @NotNull + public String getName() { return name; } + public void setName(String name) { this.name = name; } @@ -125,17 +202,30 @@ public Pet name(String name) { this.name = name; return this; } + + + + /** + + * Get photoUrls + + + * @return photoUrls **/ @JsonProperty("photoUrls") + + @NotNull + public List getPhotoUrls() { return photoUrls; } + public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } @@ -144,21 +234,34 @@ public Pet photoUrls(List photoUrls) { this.photoUrls = photoUrls; return this; } + public Pet addPhotoUrlsItem(String photoUrlsItem) { this.photoUrls.add(photoUrlsItem); return this; } + + + + /** + + * Get tags + + + * @return tags **/ @JsonProperty("tags") + + public List getTags() { return tags; } + public void setTags(List tags) { this.tags = tags; } @@ -167,17 +270,29 @@ public Pet tags(List tags) { this.tags = tags; return this; } + public Pet addTagsItem(Tag tagsItem) { this.tags.add(tagsItem); return this; } + + + + /** + * pet status in the store + + + + * @return status **/ @JsonProperty("status") + + public String getStatus() { if (status == null) { return null; @@ -185,6 +300,7 @@ public String getStatus() { return status.value(); } + public void setStatus(StatusEnum status) { this.status = status; } @@ -193,7 +309,11 @@ public Pet status(StatusEnum status) { this.status = status; return this; } + + + + @Override public String toString() { @@ -222,3 +342,6 @@ private static String toIndentedString(java.lang.Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ReadOnlyFirst.java index 144819040de..aa7e733ca09 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ReadOnlyFirst.java @@ -1,7 +1,14 @@ package io.swagger.model; + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @@ -12,32 +19,74 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; + + public class ReadOnlyFirst { + @ApiModelProperty(value = "") + + + private String bar = null; + + @ApiModelProperty(value = "") + + + private String baz = null; + + + /** + + * Get bar + + + * @return bar **/ @JsonProperty("bar") + + public String getBar() { return bar; } + + public void setBar(String bar) { + this.bar = bar; + } + public ReadOnlyFirst bar(String bar) { + this.bar = bar; + return this; + } + + + + + /** + + * Get baz + + + * @return baz **/ @JsonProperty("baz") + + public String getBaz() { return baz; } + public void setBaz(String baz) { this.baz = baz; } @@ -46,7 +95,11 @@ public ReadOnlyFirst baz(String baz) { this.baz = baz; return this; } + + + + @Override public String toString() { @@ -71,3 +124,6 @@ private static String toIndentedString(java.lang.Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/SpecialModelName.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/SpecialModelName.java index ab33c276f21..96420dff725 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/SpecialModelName.java @@ -1,7 +1,14 @@ package io.swagger.model; + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @@ -12,35 +19,56 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; + + public class SpecialModelName { + @ApiModelProperty(value = "") - private Long specialPropertyName = null; + + + + private Long $specialPropertyName = null; + + + /** - * Get specialPropertyName - * @return specialPropertyName + + + * Get $specialPropertyName + + + + * @return $specialPropertyName **/ @JsonProperty("$special[property.name]") - public Long getSpecialPropertyName() { - return specialPropertyName; + + + public Long get$SpecialPropertyName() { + return $specialPropertyName; } - public void setSpecialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + + public void set$SpecialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; } - public SpecialModelName specialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; return this; } + + + + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class SpecialModelName {\n"); - sb.append(" specialPropertyName: ").append(toIndentedString(specialPropertyName)).append("\n"); + sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n"); sb.append("}"); return sb.toString(); } @@ -57,3 +85,6 @@ private static String toIndentedString(java.lang.Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Tag.java index a6497e31663..aca13945d1a 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Tag.java @@ -1,7 +1,14 @@ package io.swagger.model; + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @@ -12,22 +19,44 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; + + public class Tag { + @ApiModelProperty(value = "") + + + private Long id = null; + + @ApiModelProperty(value = "") + + + private String name = null; + + + /** + + * Get id + + + * @return id **/ @JsonProperty("id") + + public Long getId() { return id; } + public void setId(Long id) { this.id = id; } @@ -36,16 +65,28 @@ public Tag id(Long id) { this.id = id; return this; } + + + + /** + + * Get name + + + * @return name **/ @JsonProperty("name") + + public String getName() { return name; } + public void setName(String name) { this.name = name; } @@ -54,7 +95,11 @@ public Tag name(String name) { this.name = name; return this; } + + + + @Override public String toString() { @@ -79,3 +124,6 @@ private static String toIndentedString(java.lang.Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/User.java index 62643de8aa2..68be0c308c2 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/User.java @@ -1,7 +1,14 @@ package io.swagger.model; + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @@ -12,43 +19,96 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; + + public class User { + @ApiModelProperty(value = "") + + + private Long id = null; + + @ApiModelProperty(value = "") + + + private String username = null; + + @ApiModelProperty(value = "") + + + private String firstName = null; + + @ApiModelProperty(value = "") + + + private String lastName = null; + + @ApiModelProperty(value = "") + + + private String email = null; + + @ApiModelProperty(value = "") + + + private String password = null; + + @ApiModelProperty(value = "") + + + private String phone = null; + + @ApiModelProperty(value = "User Status") + /** * User Status **/ + + + private Integer userStatus = null; + + + /** + + * Get id + + + * @return id **/ @JsonProperty("id") + + public Long getId() { return id; } + public void setId(Long id) { this.id = id; } @@ -57,16 +117,28 @@ public User id(Long id) { this.id = id; return this; } + + + + /** + + * Get username + + + * @return username **/ @JsonProperty("username") + + public String getUsername() { return username; } + public void setUsername(String username) { this.username = username; } @@ -75,16 +147,28 @@ public User username(String username) { this.username = username; return this; } + + + + /** + + * Get firstName + + + * @return firstName **/ @JsonProperty("firstName") + + public String getFirstName() { return firstName; } + public void setFirstName(String firstName) { this.firstName = firstName; } @@ -93,16 +177,28 @@ public User firstName(String firstName) { this.firstName = firstName; return this; } + + + + /** + + * Get lastName + + + * @return lastName **/ @JsonProperty("lastName") + + public String getLastName() { return lastName; } + public void setLastName(String lastName) { this.lastName = lastName; } @@ -111,16 +207,28 @@ public User lastName(String lastName) { this.lastName = lastName; return this; } + + + + /** + + * Get email + + + * @return email **/ @JsonProperty("email") + + public String getEmail() { return email; } + public void setEmail(String email) { this.email = email; } @@ -129,16 +237,28 @@ public User email(String email) { this.email = email; return this; } + + + + /** + + * Get password + + + * @return password **/ @JsonProperty("password") + + public String getPassword() { return password; } + public void setPassword(String password) { this.password = password; } @@ -147,16 +267,28 @@ public User password(String password) { this.password = password; return this; } + + + + /** + + * Get phone + + + * @return phone **/ @JsonProperty("phone") + + public String getPhone() { return phone; } + public void setPhone(String phone) { this.phone = phone; } @@ -165,16 +297,28 @@ public User phone(String phone) { this.phone = phone; return this; } + + + + /** + * User Status + + + + * @return userStatus **/ @JsonProperty("userStatus") + + public Integer getUserStatus() { return userStatus; } + public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } @@ -183,7 +327,11 @@ public User userStatus(Integer userStatus) { this.userStatus = userStatus; return this; } + + + + @Override public String toString() { @@ -214,3 +362,6 @@ private static String toIndentedString(java.lang.Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-cxf/src/main/java/io/swagger/api/impl/AnotherFakeApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf/src/main/java/io/swagger/api/impl/AnotherFakeApiServiceImpl.java index a162ec64ee7..3d47980624e 100644 --- a/samples/server/petstore/jaxrs-cxf/src/main/java/io/swagger/api/impl/AnotherFakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf/src/main/java/io/swagger/api/impl/AnotherFakeApiServiceImpl.java @@ -3,6 +3,7 @@ import io.swagger.api.*; import io.swagger.model.Client; + import java.io.InputStream; import java.io.OutputStream; import java.util.List; @@ -16,24 +17,39 @@ import io.swagger.annotations.Api; + + + + /** * Swagger Petstore * + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * */ + public class AnotherFakeApiServiceImpl implements AnotherFakeApi { + + + /** * To test special tags * + * To test special tags * + */ - public Client testSpecialTags(Client body) { + + public Client testSpecialTags(Client client) { // TODO: Implement... return null; } + } + diff --git a/samples/server/petstore/jaxrs-cxf/src/main/java/io/swagger/api/impl/FakeApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf/src/main/java/io/swagger/api/impl/FakeApiServiceImpl.java index 9f0c36bd52d..60403db69fe 100644 --- a/samples/server/petstore/jaxrs-cxf/src/main/java/io/swagger/api/impl/FakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf/src/main/java/io/swagger/api/impl/FakeApiServiceImpl.java @@ -3,10 +3,9 @@ import io.swagger.api.*; import java.math.BigDecimal; import io.swagger.model.Client; -import java.util.Date; -import org.joda.time.LocalDate; import io.swagger.model.OuterComposite; + import java.io.InputStream; import java.io.OutputStream; import java.util.List; @@ -20,96 +19,133 @@ import io.swagger.annotations.Api; + + + + /** * Swagger Petstore * + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * */ + public class FakeApiServiceImpl implements FakeApi { + + + public Boolean fakeOuterBooleanSerialize(Boolean body) { // TODO: Implement... return null; } - public OuterComposite fakeOuterCompositeSerialize(OuterComposite body) { + + + public OuterComposite fakeOuterCompositeSerialize(OuterComposite outercomposite) { // TODO: Implement... return null; } + + public BigDecimal fakeOuterNumberSerialize(BigDecimal body) { // TODO: Implement... return null; } + + public String fakeOuterStringSerialize(String body) { // TODO: Implement... return null; } + + /** * To test \"client\" model * + * To test \"client\" model * + */ - public Client testClientModel(Client body) { + + public Client testClientModel(Client client) { // TODO: Implement... return null; } + + /** * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * + */ - public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, Date dateTime, String password, String paramCallback) { + + public void testEndpointParameters(Object body) { // TODO: Implement... } + + /** * To test enum parameters * + * To test enum parameters * + */ - public void testEnumParameters(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble) { + + public void testEnumParameters(Object body, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger) { // TODO: Implement... } + + /** * test inline additionalProperties * - * - * + */ - public void testInlineAdditionalProperties(Object param) { + + public void testInlineAdditionalProperties(Map body) { // TODO: Implement... } + + /** * test json serialization of form data * - * - * + */ - public void testJsonFormData(String param, String param2) { + + public void testJsonFormData(Object body) { // TODO: Implement... } + } + diff --git a/samples/server/petstore/jaxrs-cxf/src/main/java/io/swagger/api/impl/FakeClassnameTags123ApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf/src/main/java/io/swagger/api/impl/FakeClassnameTags123ApiServiceImpl.java index ad3f555af97..97bd0a430c3 100644 --- a/samples/server/petstore/jaxrs-cxf/src/main/java/io/swagger/api/impl/FakeClassnameTags123ApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf/src/main/java/io/swagger/api/impl/FakeClassnameTags123ApiServiceImpl.java @@ -3,6 +3,7 @@ import io.swagger.api.*; import io.swagger.model.Client; + import java.io.InputStream; import java.io.OutputStream; import java.util.List; @@ -16,22 +17,36 @@ import io.swagger.annotations.Api; + + + + /** * Swagger Petstore * + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * */ + public class FakeClassnameTags123ApiServiceImpl implements FakeClassnameTags123Api { + + + /** * To test class name in snake case * + */ - public Client testClassname(Client body) { + + public Client testClassname(Client client) { // TODO: Implement... return null; } + } + diff --git a/samples/server/petstore/jaxrs-cxf/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java index 439daacb1b2..9f6e6b230e4 100644 --- a/samples/server/petstore/jaxrs-cxf/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java @@ -1,10 +1,10 @@ package io.swagger.api.impl; import io.swagger.api.*; -import java.io.File; import io.swagger.model.ModelApiResponse; import io.swagger.model.Pet; + import java.io.InputStream; import java.io.OutputStream; import java.util.List; @@ -18,108 +18,143 @@ import io.swagger.annotations.Api; + + + + /** * Swagger Petstore * + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * */ + public class PetApiServiceImpl implements PetApi { + + + /** * Add a new pet to the store * - * - * + */ - public void addPet(Pet body) { + + public void addPet(Pet pet) { // TODO: Implement... } + + /** * Deletes a pet * - * - * + */ - public void deletePet(Long petId, String apiKey) { + + public void deletePet(Integer petId, String apiKey) { // TODO: Implement... } + + /** * Finds Pets by status * + * Multiple status values can be provided with comma separated strings * + */ + public List findPetsByStatus(List status) { // TODO: Implement... return null; } + + /** * Finds Pets by tags * + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * + */ + public List findPetsByTags(List tags) { // TODO: Implement... return null; } + + /** * Find pet by ID * + * Returns a single pet * + */ - public Pet getPetById(Long petId) { + + public Pet getPetById(Integer petId) { // TODO: Implement... return null; } + + /** * Update an existing pet * - * - * + */ - public void updatePet(Pet body) { + + public void updatePet(Pet pet) { // TODO: Implement... } + + /** * Updates a pet in the store with form data * - * - * + */ - public void updatePetWithForm(Long petId, String name, String status) { + + public void updatePetWithForm(Integer petId, Object body) { // TODO: Implement... } + + /** * uploads an image * - * - * + */ - public ModelApiResponse uploadFile(Long petId, String additionalMetadata, Attachment fileDetail) { + + public ModelApiResponse uploadFile(Integer petId, Object body) { // TODO: Implement... return null; } + } + diff --git a/samples/server/petstore/jaxrs-cxf/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java index 546d096399b..fd95f0a1696 100644 --- a/samples/server/petstore/jaxrs-cxf/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java @@ -4,6 +4,7 @@ import java.util.Map; import io.swagger.model.Order; + import java.io.InputStream; import java.io.OutputStream; import java.util.List; @@ -17,60 +18,87 @@ import io.swagger.annotations.Api; + + + + /** * Swagger Petstore * + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * */ + public class StoreApiServiceImpl implements StoreApi { + + + /** * Delete purchase order by ID * + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * + */ + public void deleteOrder(String orderId) { // TODO: Implement... } + + /** * Returns pet inventories by status * + * Returns a map of status codes to quantities * + */ + public Map getInventory() { // TODO: Implement... return null; } + + /** * Find purchase order by ID * + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * + */ - public Order getOrderById(Long orderId) { + + public Order getOrderById(Integer orderId) { // TODO: Implement... return null; } + + /** * Place an order for a pet * - * - * + */ - public Order placeOrder(Order body) { + + public Order placeOrder(Order order) { // TODO: Implement... return null; } + } + diff --git a/samples/server/petstore/jaxrs-cxf/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java index 363a42dad0e..5e8cb562c12 100644 --- a/samples/server/petstore/jaxrs-cxf/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java @@ -1,9 +1,9 @@ package io.swagger.api.impl; import io.swagger.api.*; -import java.util.List; import io.swagger.model.User; + import java.io.InputStream; import java.io.OutputStream; import java.util.List; @@ -17,108 +17,143 @@ import io.swagger.annotations.Api; + + + + /** * Swagger Petstore * + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * */ + public class UserApiServiceImpl implements UserApi { + + + /** * Create user * + * This can only be done by the logged in user. * + */ - public void createUser(User body) { + + public void createUser(User user) { // TODO: Implement... } + + /** * Creates list of users with given input array * - * - * + */ + public void createUsersWithArrayInput(List body) { // TODO: Implement... } + + /** * Creates list of users with given input array * - * - * + */ + public void createUsersWithListInput(List body) { // TODO: Implement... } + + /** * Delete user * + * This can only be done by the logged in user. * + */ + public void deleteUser(String username) { // TODO: Implement... } + + /** * Get user by user name * - * - * + */ + public User getUserByName(String username) { // TODO: Implement... return null; } + + /** * Logs user into the system * - * - * + */ + public String loginUser(String username, String password) { // TODO: Implement... return null; } + + /** * Logs out current logged in user session * - * - * + */ + public void logoutUser() { // TODO: Implement... } + + /** * Updated user * + * This can only be done by the logged in user. * + */ - public void updateUser(String username, User body) { + + public void updateUser(User user, String username) { // TODO: Implement... } + } + diff --git a/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/AnotherFakeApiTest.java b/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/AnotherFakeApiTest.java index 85670e19231..49a05d49a7d 100644 --- a/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/AnotherFakeApiTest.java +++ b/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/AnotherFakeApiTest.java @@ -26,6 +26,7 @@ package io.swagger.api; import io.swagger.model.Client; + import org.junit.Test; import org.junit.Before; import static org.junit.Assert.*; @@ -36,8 +37,11 @@ import org.apache.cxf.jaxrs.client.WebClient; + + import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -46,11 +50,23 @@ + + /** - * API tests for AnotherFakeApi + + * Swagger Petstore + * + + + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + + * API tests for AnotherFakeApi */ + public class AnotherFakeApiTest { + private AnotherFakeApi api; @@ -60,25 +76,36 @@ public void setup() { List providers = new ArrayList(); providers.add(provider); + + api = JAXRSClientFactory.create("http://petstore.swagger.io:80/v2", AnotherFakeApi.class, providers); + org.apache.cxf.jaxrs.client.Client client = WebClient.client(api); ClientConfiguration config = WebClient.getConfig(client); + + } /** + * To test special tags * + * To test special tags * + + * @throws ApiException * if the Api call fails */ @Test public void testSpecialTagsTest() { - Client body = null; - //Client response = api.testSpecialTags(body); + + Client client = null; + + //Client response = api.testSpecialTags(client); //assertNotNull(response); // TODO: test validations diff --git a/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/FakeApiTest.java b/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/FakeApiTest.java index 20334be9858..a79b9cfb3f7 100644 --- a/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/FakeApiTest.java +++ b/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/FakeApiTest.java @@ -27,8 +27,8 @@ import java.math.BigDecimal; import io.swagger.model.Client; -import java.util.Date; -import org.joda.time.LocalDate; +import io.swagger.model.OuterComposite; + import org.junit.Test; import org.junit.Before; import static org.junit.Assert.*; @@ -39,8 +39,11 @@ import org.apache.cxf.jaxrs.client.WebClient; + + import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -49,11 +52,23 @@ + + /** - * API tests for FakeApi + + * Swagger Petstore + * + + + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + + * API tests for FakeApi */ + public class FakeApiTest { + private FakeApi api; @@ -63,25 +78,104 @@ public void setup() { List providers = new ArrayList(); providers.add(provider); - api = JAXRSClientFactory.create("http://petstore.swagger.io/v2", FakeApi.class, providers); + + + api = JAXRSClientFactory.create("http://petstore.swagger.io:80/v2", FakeApi.class, providers); + org.apache.cxf.jaxrs.client.Client client = WebClient.client(api); ClientConfiguration config = WebClient.getConfig(client); + + } /** + + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeOuterBooleanSerializeTest() { + + Boolean body = null; + + //Boolean response = api.fakeOuterBooleanSerialize(body); + //assertNotNull(response); + // TODO: test validations + + + } + + /** + + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeOuterCompositeSerializeTest() { + + OuterComposite outercomposite = null; + + //OuterComposite response = api.fakeOuterCompositeSerialize(outercomposite); + //assertNotNull(response); + // TODO: test validations + + + } + + /** + + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeOuterNumberSerializeTest() { + + BigDecimal body = null; + + //BigDecimal response = api.fakeOuterNumberSerialize(body); + //assertNotNull(response); + // TODO: test validations + + + } + + /** + + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeOuterStringSerializeTest() { + + String body = null; + + //String response = api.fakeOuterStringSerialize(body); + //assertNotNull(response); + // TODO: test validations + + + } + + /** + * To test \"client\" model * + * To test \"client\" model * + + * @throws ApiException * if the Api call fails */ @Test public void testClientModelTest() { - Client body = null; - //Client response = api.testClientModel(body); + + Client client = null; + + //Client response = api.testClientModel(client); //assertNotNull(response); // TODO: test validations @@ -89,30 +183,23 @@ public void testClientModelTest() { } /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * + + * @throws ApiException * if the Api call fails */ @Test public void testEndpointParametersTest() { - BigDecimal number = null; - Double _double = null; - String patternWithoutDelimiter = null; - byte[] _byte = null; - Integer integer = null; - Integer int32 = null; - Long int64 = null; - Float _float = null; - String string = null; - byte[] binary = null; - LocalDate date = null; - Date dateTime = null; - String password = null; - String paramCallback = null; - //api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + + Object body = null; + + //api.testEndpointParameters(body); // TODO: test validations @@ -120,24 +207,75 @@ public void testEndpointParametersTest() { } /** + * To test enum parameters * + * To test enum parameters * + + * @throws ApiException * if the Api call fails */ @Test public void testEnumParametersTest() { - List enumFormStringArray = null; - String enumFormString = null; + + Object body = null; + List enumHeaderStringArray = null; + String enumHeaderString = null; + List enumQueryStringArray = null; + String enumQueryString = null; + Integer enumQueryInteger = null; - Double enumQueryDouble = null; - //api.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + + //api.testEnumParameters(body, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger); + + // TODO: test validations + + + } + + /** + + * test inline additionalProperties + * + + + * @throws ApiException + * if the Api call fails + */ + @Test + public void testInlineAdditionalPropertiesTest() { + + Map body = null; + + //api.testInlineAdditionalProperties(body); + + // TODO: test validations + + + } + + /** + + * test json serialization of form data + * + + + * @throws ApiException + * if the Api call fails + */ + @Test + public void testJsonFormDataTest() { + + Object body = null; + + //api.testJsonFormData(body); // TODO: test validations diff --git a/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/FakeClassnameTags123ApiTest.java b/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/FakeClassnameTags123ApiTest.java index 0cbd5df920a..f12085d8ea7 100644 --- a/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/FakeClassnameTags123ApiTest.java +++ b/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/FakeClassnameTags123ApiTest.java @@ -26,6 +26,7 @@ package io.swagger.api; import io.swagger.model.Client; + import org.junit.Test; import org.junit.Before; import static org.junit.Assert.*; @@ -36,8 +37,11 @@ import org.apache.cxf.jaxrs.client.WebClient; + + import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -46,11 +50,23 @@ + + /** - * API tests for FakeClassnameTags123Api + + * Swagger Petstore + * + + + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + + * API tests for FakeClassnameTags123Api */ + public class FakeClassnameTags123ApiTest { + private FakeClassnameTags123Api api; @@ -60,25 +76,33 @@ public void setup() { List providers = new ArrayList(); providers.add(provider); - api = JAXRSClientFactory.create("http://petstore.swagger.io/v2", FakeClassnameTags123Api.class, providers); + + + api = JAXRSClientFactory.create("http://petstore.swagger.io:80/v2", FakeClassnameTags123Api.class, providers); + org.apache.cxf.jaxrs.client.Client client = WebClient.client(api); ClientConfiguration config = WebClient.getConfig(client); + + } /** + * To test class name in snake case * - * - * + + * @throws ApiException * if the Api call fails */ @Test public void testClassnameTest() { - Client body = null; - //Client response = api.testClassname(body); + + Client client = null; + + //Client response = api.testClassname(client); //assertNotNull(response); // TODO: test validations diff --git a/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/PetApiTest.java b/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/PetApiTest.java index 444c595b78e..19ecb355882 100644 --- a/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/PetApiTest.java +++ b/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/PetApiTest.java @@ -25,9 +25,9 @@ package io.swagger.api; -import java.io.File; import io.swagger.model.ModelApiResponse; import io.swagger.model.Pet; + import org.junit.Test; import org.junit.Before; import static org.junit.Assert.*; @@ -38,8 +38,11 @@ import org.apache.cxf.jaxrs.client.WebClient; + + import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -48,11 +51,23 @@ + + /** - * API tests for PetApi + + * Swagger Petstore + * + + + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + + * API tests for PetApi */ + public class PetApiTest { + private PetApi api; @@ -62,25 +77,33 @@ public void setup() { List providers = new ArrayList(); providers.add(provider); - api = JAXRSClientFactory.create("http://petstore.swagger.io/v2", PetApi.class, providers); + + + api = JAXRSClientFactory.create("http://petstore.swagger.io:80/v2", PetApi.class, providers); + org.apache.cxf.jaxrs.client.Client client = WebClient.client(api); ClientConfiguration config = WebClient.getConfig(client); + + } /** + * Add a new pet to the store * - * - * + + * @throws ApiException * if the Api call fails */ @Test public void addPetTest() { - Pet body = null; - //api.addPet(body); + + Pet pet = null; + + //api.addPet(pet); // TODO: test validations @@ -88,18 +111,22 @@ public void addPetTest() { } /** + * Deletes a pet * - * - * + + * @throws ApiException * if the Api call fails */ @Test public void deletePetTest() { - Long petId = null; + + Integer petId = null; + String apiKey = null; - //api.deletePet(petId, apiKey); + + //api.deletePet(petId, apiKey); // TODO: test validations @@ -107,16 +134,22 @@ public void deletePetTest() { } /** + * Finds Pets by status * + * Multiple status values can be provided with comma separated strings * + + * @throws ApiException * if the Api call fails */ @Test public void findPetsByStatusTest() { + List status = null; + //List response = api.findPetsByStatus(status); //assertNotNull(response); // TODO: test validations @@ -125,16 +158,22 @@ public void findPetsByStatusTest() { } /** + * Finds Pets by tags * + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * + + * @throws ApiException * if the Api call fails */ @Test public void findPetsByTagsTest() { + List tags = null; + //List response = api.findPetsByTags(tags); //assertNotNull(response); // TODO: test validations @@ -143,17 +182,23 @@ public void findPetsByTagsTest() { } /** + * Find pet by ID * + * Returns a single pet * + + * @throws ApiException * if the Api call fails */ @Test public void getPetByIdTest() { - Long petId = null; - //Pet response = api.getPetById(petId); + + Integer petId = null; + + //Pet response = api.getPetById(petId); //assertNotNull(response); // TODO: test validations @@ -161,17 +206,20 @@ public void getPetByIdTest() { } /** + * Update an existing pet * - * - * + + * @throws ApiException * if the Api call fails */ @Test public void updatePetTest() { - Pet body = null; - //api.updatePet(body); + + Pet pet = null; + + //api.updatePet(pet); // TODO: test validations @@ -179,19 +227,22 @@ public void updatePetTest() { } /** + * Updates a pet in the store with form data * - * - * + + * @throws ApiException * if the Api call fails */ @Test public void updatePetWithFormTest() { - Long petId = null; - String name = null; - String status = null; - //api.updatePetWithForm(petId, name, status); + + Integer petId = null; + + Object body = null; + + //api.updatePetWithForm(petId, body); // TODO: test validations @@ -199,19 +250,22 @@ public void updatePetWithFormTest() { } /** + * uploads an image * - * - * + + * @throws ApiException * if the Api call fails */ @Test public void uploadFileTest() { - Long petId = null; - String additionalMetadata = null; - org.apache.cxf.jaxrs.ext.multipart.Attachment file = null; - //ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file); + + Integer petId = null; + + Object body = null; + + //ModelApiResponse response = api.uploadFile(petId, body); //assertNotNull(response); // TODO: test validations diff --git a/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/StoreApiTest.java b/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/StoreApiTest.java index c0cd10dca71..534172383f9 100644 --- a/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/StoreApiTest.java +++ b/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/StoreApiTest.java @@ -27,6 +27,7 @@ import java.util.Map; import io.swagger.model.Order; + import org.junit.Test; import org.junit.Before; import static org.junit.Assert.*; @@ -37,8 +38,11 @@ import org.apache.cxf.jaxrs.client.WebClient; + + import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -47,11 +51,23 @@ + + /** - * API tests for StoreApi + + * Swagger Petstore + * + + + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + + * API tests for StoreApi */ + public class StoreApiTest { + private StoreApi api; @@ -61,25 +77,36 @@ public void setup() { List providers = new ArrayList(); providers.add(provider); - api = JAXRSClientFactory.create("http://petstore.swagger.io/v2", StoreApi.class, providers); + + + api = JAXRSClientFactory.create("http://petstore.swagger.io:80/v2", StoreApi.class, providers); + org.apache.cxf.jaxrs.client.Client client = WebClient.client(api); ClientConfiguration config = WebClient.getConfig(client); + + } /** + * Delete purchase order by ID * + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * + + * @throws ApiException * if the Api call fails */ @Test public void deleteOrderTest() { + String orderId = null; - //api.deleteOrder(orderId); + + //api.deleteOrder(orderId); // TODO: test validations @@ -87,15 +114,20 @@ public void deleteOrderTest() { } /** + * Returns pet inventories by status * + * Returns a map of status codes to quantities * + + * @throws ApiException * if the Api call fails */ @Test public void getInventoryTest() { + //Map response = api.getInventory(); //assertNotNull(response); // TODO: test validations @@ -104,17 +136,23 @@ public void getInventoryTest() { } /** + * Find purchase order by ID * + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * + + * @throws ApiException * if the Api call fails */ @Test public void getOrderByIdTest() { - Long orderId = null; - //Order response = api.getOrderById(orderId); + + Integer orderId = null; + + //Order response = api.getOrderById(orderId); //assertNotNull(response); // TODO: test validations @@ -122,17 +160,20 @@ public void getOrderByIdTest() { } /** + * Place an order for a pet * - * - * + + * @throws ApiException * if the Api call fails */ @Test public void placeOrderTest() { - Order body = null; - //Order response = api.placeOrder(body); + + Order order = null; + + //Order response = api.placeOrder(order); //assertNotNull(response); // TODO: test validations diff --git a/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/UserApiTest.java b/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/UserApiTest.java index 2d1481bde34..06ee218039f 100644 --- a/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/UserApiTest.java +++ b/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/UserApiTest.java @@ -25,8 +25,8 @@ package io.swagger.api; -import java.util.List; import io.swagger.model.User; + import org.junit.Test; import org.junit.Before; import static org.junit.Assert.*; @@ -37,8 +37,11 @@ import org.apache.cxf.jaxrs.client.WebClient; + + import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -47,11 +50,23 @@ + + /** - * API tests for UserApi + + * Swagger Petstore + * + + + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + + * API tests for UserApi */ + public class UserApiTest { + private UserApi api; @@ -61,25 +76,36 @@ public void setup() { List providers = new ArrayList(); providers.add(provider); - api = JAXRSClientFactory.create("http://petstore.swagger.io/v2", UserApi.class, providers); + + + api = JAXRSClientFactory.create("http://petstore.swagger.io:80/v2", UserApi.class, providers); + org.apache.cxf.jaxrs.client.Client client = WebClient.client(api); ClientConfiguration config = WebClient.getConfig(client); + + } /** + * Create user * + * This can only be done by the logged in user. * + + * @throws ApiException * if the Api call fails */ @Test public void createUserTest() { - User body = null; - //api.createUser(body); + + User user = null; + + //api.createUser(user); // TODO: test validations @@ -87,17 +113,20 @@ public void createUserTest() { } /** + * Creates list of users with given input array * - * - * + + * @throws ApiException * if the Api call fails */ @Test public void createUsersWithArrayInputTest() { + List body = null; - //api.createUsersWithArrayInput(body); + + //api.createUsersWithArrayInput(body); // TODO: test validations @@ -105,17 +134,20 @@ public void createUsersWithArrayInputTest() { } /** + * Creates list of users with given input array * - * - * + + * @throws ApiException * if the Api call fails */ @Test public void createUsersWithListInputTest() { + List body = null; - //api.createUsersWithListInput(body); + + //api.createUsersWithListInput(body); // TODO: test validations @@ -123,17 +155,23 @@ public void createUsersWithListInputTest() { } /** + * Delete user * + * This can only be done by the logged in user. * + + * @throws ApiException * if the Api call fails */ @Test public void deleteUserTest() { + String username = null; - //api.deleteUser(username); + + //api.deleteUser(username); // TODO: test validations @@ -141,17 +179,20 @@ public void deleteUserTest() { } /** + * Get user by user name * - * - * + + * @throws ApiException * if the Api call fails */ @Test public void getUserByNameTest() { + String username = null; - //User response = api.getUserByName(username); + + //User response = api.getUserByName(username); //assertNotNull(response); // TODO: test validations @@ -159,18 +200,22 @@ public void getUserByNameTest() { } /** + * Logs user into the system * - * - * + + * @throws ApiException * if the Api call fails */ @Test public void loginUserTest() { + String username = null; + String password = null; - //String response = api.loginUser(username, password); + + //String response = api.loginUser(username, password); //assertNotNull(response); // TODO: test validations @@ -178,16 +223,18 @@ public void loginUserTest() { } /** + * Logs out current logged in user session * - * - * + + * @throws ApiException * if the Api call fails */ @Test public void logoutUserTest() { - //api.logoutUser(); + + //api.logoutUser(); // TODO: test validations @@ -195,18 +242,25 @@ public void logoutUserTest() { } /** + * Updated user * + * This can only be done by the logged in user. * + + * @throws ApiException * if the Api call fails */ @Test public void updateUserTest() { + + User user = null; + String username = null; - User body = null; - //api.updateUser(username, body); + + //api.updateUser(user, username); // TODO: test validations diff --git a/samples/server/petstore/jaxrs-resteasy/default/.swagger-codegen/VERSION b/samples/server/petstore/jaxrs-resteasy/default/.swagger-codegen/VERSION index 50794f17f1a..096bf47efe3 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/.swagger-codegen/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/default/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.1-SNAPSHOT \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/default/README.md b/samples/server/petstore/jaxrs-resteasy/default/README.md index cc011c37ee5..b38f859d049 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/README.md +++ b/samples/server/petstore/jaxrs-resteasy/default/README.md @@ -16,7 +16,7 @@ mvn clean package jetty:run You can then view the swagger listing here: ``` -http://localhost:8080/v2/swagger.json +http://localhost:-1/v2/swagger.json ``` Note that if you have configured the `host` to be something other than localhost, the calls through diff --git a/samples/server/petstore/jaxrs-resteasy/default/build.gradle b/samples/server/petstore/jaxrs-resteasy/default/build.gradle index a568dc86c41..33f7797f78c 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/build.gradle +++ b/samples/server/petstore/jaxrs-resteasy/default/build.gradle @@ -17,7 +17,9 @@ dependencies { providedCompile 'org.jboss.spec.javax.servlet:jboss-servlet-api_3.0_spec:1.0.0.Final' compile 'io.swagger:swagger-annotations:1.5.10' compile 'org.jboss.resteasy:resteasy-jackson2-provider:3.0.11.Final' + providedCompile 'javax.validation:validation-api:1.1.0.Final' + compile 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.4.1' compile 'joda-time:joda-time:2.7' //TODO: swaggerFeature diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/ApiException.class b/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/ApiException.class deleted file mode 100644 index 532edd306d7..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/ApiException.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/ApiOriginFilter.class b/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/ApiOriginFilter.class deleted file mode 100644 index 491891093f1..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/ApiOriginFilter.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/ApiResponseMessage.class b/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/ApiResponseMessage.class deleted file mode 100644 index 662e2e846f1..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/ApiResponseMessage.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/JacksonConfig$1$1.class b/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/JacksonConfig$1$1.class deleted file mode 100644 index 9271b6069d1..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/JacksonConfig$1$1.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/JacksonConfig$1$2.class b/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/JacksonConfig$1$2.class deleted file mode 100644 index 2260a4b19b5..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/JacksonConfig$1$2.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/JacksonConfig$1.class b/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/JacksonConfig$1.class deleted file mode 100644 index c757c04724e..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/JacksonConfig$1.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/JacksonConfig.class b/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/JacksonConfig.class deleted file mode 100644 index b4368ff2475..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/JacksonConfig.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/NotFoundException.class b/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/NotFoundException.class deleted file mode 100644 index cb773657253..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/NotFoundException.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/PetApi.class b/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/PetApi.class deleted file mode 100644 index 71f34c8625b..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/PetApi.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/PetApiService.class b/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/PetApiService.class deleted file mode 100644 index 92283312be5..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/PetApiService.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/RFC3339DateFormat.class b/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/RFC3339DateFormat.class deleted file mode 100644 index 0f5053f2a06..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/RFC3339DateFormat.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/RestApplication.class b/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/RestApplication.class deleted file mode 100644 index 1bd466b82da..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/RestApplication.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/StoreApi.class b/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/StoreApi.class deleted file mode 100644 index b132fb09089..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/StoreApi.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/StoreApiService.class b/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/StoreApiService.class deleted file mode 100644 index da4fd7608fd..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/StoreApiService.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/StringUtil.class b/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/StringUtil.class deleted file mode 100644 index 72824471def..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/StringUtil.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/UserApi.class b/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/UserApi.class deleted file mode 100644 index df0b5b337fb..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/UserApi.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/UserApiService.class b/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/UserApiService.class deleted file mode 100644 index d12b14b2337..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/UserApiService.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/impl/PetApiServiceImpl.class b/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/impl/PetApiServiceImpl.class deleted file mode 100644 index e36041a5f07..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/impl/PetApiServiceImpl.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/impl/StoreApiServiceImpl.class b/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/impl/StoreApiServiceImpl.class deleted file mode 100644 index 60fc71759c2..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/impl/StoreApiServiceImpl.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/impl/UserApiServiceImpl.class b/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/impl/UserApiServiceImpl.class deleted file mode 100644 index 86d82b1e0da..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/impl/UserApiServiceImpl.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/model/Category.class b/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/model/Category.class deleted file mode 100644 index e0d0faed108..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/model/Category.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/model/ModelApiResponse.class b/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/model/ModelApiResponse.class deleted file mode 100644 index df7bdc5bbe7..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/model/ModelApiResponse.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/model/Order$StatusEnum.class b/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/model/Order$StatusEnum.class deleted file mode 100644 index 8f111540b87..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/model/Order$StatusEnum.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/model/Order.class b/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/model/Order.class deleted file mode 100644 index 5aed19284b4..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/model/Order.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/model/Pet$StatusEnum.class b/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/model/Pet$StatusEnum.class deleted file mode 100644 index 514e6558ae8..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/model/Pet$StatusEnum.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/model/Pet.class b/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/model/Pet.class deleted file mode 100644 index 88f65946361..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/model/Pet.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/model/Tag.class b/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/model/Tag.class deleted file mode 100644 index 40027f0aeb7..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/model/Tag.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/model/User.class b/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/model/User.class deleted file mode 100644 index 253481fbd91..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/model/User.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/libs/swagger-jaxrs-resteasy-server-1.0.0.war b/samples/server/petstore/jaxrs-resteasy/default/build/libs/swagger-jaxrs-resteasy-server-1.0.0.war deleted file mode 100644 index 4d6cba4823b..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/libs/swagger-jaxrs-resteasy-server-1.0.0.war and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/tmp/war/MANIFEST.MF b/samples/server/petstore/jaxrs-resteasy/default/build/tmp/war/MANIFEST.MF deleted file mode 100644 index 59499bce4a2..00000000000 --- a/samples/server/petstore/jaxrs-resteasy/default/build/tmp/war/MANIFEST.MF +++ /dev/null @@ -1,2 +0,0 @@ -Manifest-Version: 1.0 - diff --git a/samples/server/petstore/jaxrs-resteasy/default/pom.xml b/samples/server/petstore/jaxrs-resteasy/default/pom.xml index 8cbc9358a06..a7e5efb73c5 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/pom.xml +++ b/samples/server/petstore/jaxrs-resteasy/default/pom.xml @@ -161,6 +161,7 @@ + javax.validation @@ -169,6 +170,7 @@ provided + @@ -180,7 +182,7 @@ - 1.5.15 + 1.5.18 9.2.9.v20150224 3.0.11.Final 1.6.3 diff --git a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/PetApi.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/PetApi.java index d668c71d237..99a84be948f 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/PetApi.java @@ -6,10 +6,10 @@ import io.swagger.annotations.ApiParam; import io.swagger.jaxrs.*; -import java.io.File; import io.swagger.model.ModelApiResponse; import io.swagger.model.Pet; + import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -22,60 +22,50 @@ import javax.ws.rs.*; import javax.inject.Inject; + import javax.validation.constraints.*; -import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput; + @Path("/pet") @io.swagger.annotations.Api(description = "the pet API") + public class PetApi { @Inject PetApiService service; + @POST @Consumes({ "application/json", "application/xml" }) - @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Add a new pet to the store", notes = "", response = Void.class, authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + + @io.swagger.annotations.ApiOperation(value = "Add a new pet to the store", notes = "", response = Void.class, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) - public Response addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet body,@Context SecurityContext securityContext) + public Response addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet pet,@Context SecurityContext securityContext) throws NotFoundException { - return service.addPet(body,securityContext); + return service.addPet(pet,securityContext); } + @DELETE @Path("/{petId}") - @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + + @io.swagger.annotations.ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) - public Response deletePet( @PathParam("petId") Long petId,@ApiParam(value = "" )@HeaderParam("api_key") String apiKey,@Context SecurityContext securityContext) + public Response deletePet( @PathParam("petId") Integer petId,@ApiParam(value = "" )@HeaderParam("api_key") String apiKey,@Context SecurityContext securityContext) throws NotFoundException { return service.deletePet(petId,apiKey,securityContext); } + @GET @Path("/findByStatus") @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + @io.swagger.annotations.ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @@ -84,16 +74,12 @@ public Response findPetsByStatus( @NotNull @QueryParam("status") List s throws NotFoundException { return service.findPetsByStatus(status,securityContext); } + @GET @Path("/findByTags") @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + @io.swagger.annotations.ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @@ -102,73 +88,62 @@ public Response findPetsByTags( @NotNull @QueryParam("tags") List tags, throws NotFoundException { return service.findPetsByTags(tags,securityContext); } + @GET @Path("/{petId}") @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = { - @io.swagger.annotations.Authorization(value = "api_key") - }, tags={ "pet", }) + @io.swagger.annotations.ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class) }) - public Response getPetById( @PathParam("petId") Long petId,@Context SecurityContext securityContext) + public Response getPetById( @PathParam("petId") Integer petId,@Context SecurityContext securityContext) throws NotFoundException { return service.getPetById(petId,securityContext); } + @PUT @Consumes({ "application/json", "application/xml" }) - @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + + @io.swagger.annotations.ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class), @io.swagger.annotations.ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) - public Response updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet body,@Context SecurityContext securityContext) + public Response updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet pet,@Context SecurityContext securityContext) throws NotFoundException { - return service.updatePet(body,securityContext); + return service.updatePet(pet,securityContext); } + @POST @Path("/{petId}") @Consumes({ "application/x-www-form-urlencoded" }) - @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + + @io.swagger.annotations.ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) - public Response updatePetWithForm( @PathParam("petId") Long petId,@ApiParam(value = "Updated name of the pet")@FormParam("name") String name,@ApiParam(value = "Updated status of the pet")@FormParam("status") String status,@Context SecurityContext securityContext) + public Response updatePetWithForm( @PathParam("petId") Integer petId,@ApiParam(value = "" ) Object body,@Context SecurityContext securityContext) throws NotFoundException { - return service.updatePetWithForm(petId,name,status,securityContext); + return service.updatePetWithForm(petId,body,securityContext); } + @POST @Path("/{petId}/uploadImage") @Consumes({ "multipart/form-data" }) @Produces({ "application/json" }) - @io.swagger.annotations.ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + @io.swagger.annotations.ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - public Response uploadFile(MultipartFormDataInput input, @PathParam("petId") Long petId,@Context SecurityContext securityContext) + public Response uploadFile( @PathParam("petId") Integer petId,@ApiParam(value = "" ) Object body,@Context SecurityContext securityContext) throws NotFoundException { - return service.uploadFile(input,petId,securityContext); + return service.uploadFile(petId,body,securityContext); } + } + diff --git a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/PetApiService.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/PetApiService.java index 5b44f5d18b9..d738a5e1a11 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/PetApiService.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/PetApiService.java @@ -2,13 +2,12 @@ import io.swagger.api.*; import io.swagger.model.*; -import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput; -import java.io.File; import io.swagger.model.ModelApiResponse; import io.swagger.model.Pet; + import java.util.List; import io.swagger.api.NotFoundException; @@ -18,21 +17,32 @@ import javax.ws.rs.core.SecurityContext; + public interface PetApiService { - Response addPet(Pet body,SecurityContext securityContext) + + Response addPet(Pet pet,SecurityContext securityContext) throws NotFoundException; - Response deletePet(Long petId,String apiKey,SecurityContext securityContext) + + Response deletePet(Integer petId,String apiKey,SecurityContext securityContext) throws NotFoundException; + Response findPetsByStatus(List status,SecurityContext securityContext) throws NotFoundException; + Response findPetsByTags(List tags,SecurityContext securityContext) throws NotFoundException; - Response getPetById(Long petId,SecurityContext securityContext) + + Response getPetById(Integer petId,SecurityContext securityContext) throws NotFoundException; - Response updatePet(Pet body,SecurityContext securityContext) + + Response updatePet(Pet pet,SecurityContext securityContext) throws NotFoundException; - Response updatePetWithForm(Long petId,String name,String status,SecurityContext securityContext) + + Response updatePetWithForm(Integer petId,Object body,SecurityContext securityContext) throws NotFoundException; - Response uploadFile(MultipartFormDataInput input,Long petId,SecurityContext securityContext) + + Response uploadFile(Integer petId,Object body,SecurityContext securityContext) throws NotFoundException; + } + diff --git a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/StoreApi.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/StoreApi.java index 6b3a6cc3a07..de9b83c28bb 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/StoreApi.java @@ -9,6 +9,7 @@ import java.util.Map; import io.swagger.model.Order; + import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -21,21 +22,25 @@ import javax.ws.rs.*; import javax.inject.Inject; + import javax.validation.constraints.*; + @Path("/store") @io.swagger.annotations.Api(description = "the store API") + public class StoreApi { @Inject StoreApiService service; + @DELETE @Path("/order/{orderId}") - @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = Void.class, tags={ "store", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @@ -45,19 +50,19 @@ public Response deleteOrder( @PathParam("orderId") String orderId,@Context Secur throws NotFoundException { return service.deleteOrder(orderId,securityContext); } + @GET @Path("/inventory") @Produces({ "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { - @io.swagger.annotations.Authorization(value = "api_key") - }, tags={ "store", }) + @io.swagger.annotations.ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", tags={ "store", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) public Response getInventory(@Context SecurityContext securityContext) throws NotFoundException { return service.getInventory(securityContext); } + @GET @Path("/order/{orderId}") @@ -69,21 +74,24 @@ public Response getInventory(@Context SecurityContext securityContext) @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Void.class) }) - public Response getOrderById( @Min(1) @Max(5) @PathParam("orderId") Long orderId,@Context SecurityContext securityContext) + public Response getOrderById( @DecimalMin("1") @DecimalMax("5") @PathParam("orderId") Integer orderId,@Context SecurityContext securityContext) throws NotFoundException { return service.getOrderById(orderId,securityContext); } + @POST @Path("/order") - + @Consumes({ "*/*" }) @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid Order", response = Void.class) }) - public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true) Order body,@Context SecurityContext securityContext) + public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true) Order order,@Context SecurityContext securityContext) throws NotFoundException { - return service.placeOrder(body,securityContext); + return service.placeOrder(order,securityContext); } + } + diff --git a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/StoreApiService.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/StoreApiService.java index 46958ea45c4..de964599520 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/StoreApiService.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/StoreApiService.java @@ -7,6 +7,7 @@ import java.util.Map; import io.swagger.model.Order; + import java.util.List; import io.swagger.api.NotFoundException; @@ -16,13 +17,20 @@ import javax.ws.rs.core.SecurityContext; + public interface StoreApiService { + Response deleteOrder(String orderId,SecurityContext securityContext) throws NotFoundException; + Response getInventory(SecurityContext securityContext) throws NotFoundException; - Response getOrderById(Long orderId,SecurityContext securityContext) + + Response getOrderById(Integer orderId,SecurityContext securityContext) throws NotFoundException; - Response placeOrder(Order body,SecurityContext securityContext) + + Response placeOrder(Order order,SecurityContext securityContext) throws NotFoundException; + } + diff --git a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/UserApi.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/UserApi.java index 30d8e9bae59..179c0626973 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/UserApi.java @@ -6,9 +6,9 @@ import io.swagger.annotations.ApiParam; import io.swagger.jaxrs.*; -import java.util.List; import io.swagger.model.User; + import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -21,32 +21,37 @@ import javax.ws.rs.*; import javax.inject.Inject; + import javax.validation.constraints.*; + @Path("/user") @io.swagger.annotations.Api(description = "the user API") + public class UserApi { @Inject UserApiService service; + @POST + @Consumes({ "*/*" }) - @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - public Response createUser(@ApiParam(value = "Created user object" ,required=true) User body,@Context SecurityContext securityContext) + public Response createUser(@ApiParam(value = "Created user object" ,required=true) User user,@Context SecurityContext securityContext) throws NotFoundException { - return service.createUser(body,securityContext); + return service.createUser(user,securityContext); } + @POST @Path("/createWithArray") + @Consumes({ "*/*" }) - @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) @@ -54,10 +59,11 @@ public Response createUsersWithArrayInput(@ApiParam(value = "List of user object throws NotFoundException { return service.createUsersWithArrayInput(body,securityContext); } + @POST @Path("/createWithList") + @Consumes({ "*/*" }) - @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) @@ -65,10 +71,11 @@ public Response createUsersWithListInput(@ApiParam(value = "List of user object" throws NotFoundException { return service.createUsersWithListInput(body,securityContext); } + @DELETE @Path("/{username}") - @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), @@ -78,6 +85,7 @@ public Response deleteUser( @PathParam("username") String username,@Context Secu throws NotFoundException { return service.deleteUser(username,securityContext); } + @GET @Path("/{username}") @@ -93,6 +101,7 @@ public Response getUserByName( @PathParam("username") String username,@Context S throws NotFoundException { return service.getUserByName(username,securityContext); } + @GET @Path("/login") @@ -106,10 +115,11 @@ public Response loginUser( @NotNull @QueryParam("username") String username, @N throws NotFoundException { return service.loginUser(username,password,securityContext); } + @GET @Path("/logout") - @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) @@ -117,17 +127,20 @@ public Response logoutUser(@Context SecurityContext securityContext) throws NotFoundException { return service.logoutUser(securityContext); } + @PUT @Path("/{username}") + @Consumes({ "*/*" }) - @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) - public Response updateUser( @PathParam("username") String username,@ApiParam(value = "Updated user object" ,required=true) User body,@Context SecurityContext securityContext) + public Response updateUser(@ApiParam(value = "Updated user object" ,required=true) User user, @PathParam("username") String username,@Context SecurityContext securityContext) throws NotFoundException { - return service.updateUser(username,body,securityContext); + return service.updateUser(user,username,securityContext); } + } + diff --git a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/UserApiService.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/UserApiService.java index 54f5d5c105f..f5068f387d2 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/UserApiService.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/UserApiService.java @@ -4,9 +4,9 @@ import io.swagger.model.*; -import java.util.List; import io.swagger.model.User; + import java.util.List; import io.swagger.api.NotFoundException; @@ -16,21 +16,32 @@ import javax.ws.rs.core.SecurityContext; + public interface UserApiService { - Response createUser(User body,SecurityContext securityContext) + + Response createUser(User user,SecurityContext securityContext) throws NotFoundException; + Response createUsersWithArrayInput(List body,SecurityContext securityContext) throws NotFoundException; + Response createUsersWithListInput(List body,SecurityContext securityContext) throws NotFoundException; + Response deleteUser(String username,SecurityContext securityContext) throws NotFoundException; + Response getUserByName(String username,SecurityContext securityContext) throws NotFoundException; + Response loginUser(String username,String password,SecurityContext securityContext) throws NotFoundException; + Response logoutUser(SecurityContext securityContext) throws NotFoundException; - Response updateUser(String username,User body,SecurityContext securityContext) + + Response updateUser(User user,String username,SecurityContext securityContext) throws NotFoundException; + } + diff --git a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Category.java index 85fdecdc662..6458c75a81b 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Category.java @@ -5,21 +5,35 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; + + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.*; @ApiModel(description="A category for a pet") public class Category { + private Long id = null; private String name = null; + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("id") + public Long getId() { return id; } @@ -27,11 +41,16 @@ public void setId(Long id) { this.id = id; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("name") + public String getName() { return name; } @@ -39,6 +58,7 @@ public void setName(String name) { this.name = name; } + @Override public boolean equals(java.lang.Object o) { @@ -81,3 +101,6 @@ private String toIndentedString(java.lang.Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/ModelApiResponse.java index 9a9ff0db8cd..0e5fb3475db 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -5,22 +5,36 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; + + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.*; @ApiModel(description="Describes the result of uploading an image resource") public class ModelApiResponse { + private Integer code = null; private String type = null; private String message = null; + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("code") + public Integer getCode() { return code; } @@ -28,11 +42,16 @@ public void setCode(Integer code) { this.code = code; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("type") + public String getType() { return type; } @@ -40,11 +59,16 @@ public void setType(String type) { this.type = type; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("message") + public String getMessage() { return message; } @@ -52,6 +76,7 @@ public void setMessage(String message) { this.message = message; } + @Override public boolean equals(java.lang.Object o) { @@ -96,3 +121,6 @@ private String toIndentedString(java.lang.Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Order.java index 2f62263c9d3..de4051f9fc8 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Order.java @@ -7,12 +7,21 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import java.util.Date; + + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.*; @ApiModel(description="An order for a pets from the pet store") public class Order { + private Long id = null; private Long petId = null; @@ -23,11 +32,20 @@ public class Order { * Order Status */ public enum StatusEnum { + + PLACED("placed"), - APPROVED("approved"), + + + APPROVED("approved"), - DELIVERED("delivered"); + + + DELIVERED("delivered"); + + + private String value; StatusEnum(String value) { @@ -44,11 +62,16 @@ public String toString() { private StatusEnum status = null; private Boolean complete = false; + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("id") + public Long getId() { return id; } @@ -56,11 +79,16 @@ public void setId(Long id) { this.id = id; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("petId") + public Long getPetId() { return petId; } @@ -68,11 +96,16 @@ public void setPetId(Long petId) { this.petId = petId; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("quantity") + public Integer getQuantity() { return quantity; } @@ -80,11 +113,16 @@ public void setQuantity(Integer quantity) { this.quantity = quantity; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("shipDate") + public Date getShipDate() { return shipDate; } @@ -92,12 +130,18 @@ public void setShipDate(Date shipDate) { this.shipDate = shipDate; } + /** + * Order Status + + + **/ @ApiModelProperty(value = "Order Status") @JsonProperty("status") + public StatusEnum getStatus() { return status; } @@ -105,18 +149,24 @@ public void setStatus(StatusEnum status) { this.status = status; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("complete") - public Boolean isComplete() { + + public Boolean isisComplete() { return complete; } public void setComplete(Boolean complete) { this.complete = complete; } + @Override public boolean equals(java.lang.Object o) { @@ -167,3 +217,6 @@ private String toIndentedString(java.lang.Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Pet.java index 4e48fb253b1..a6bf78bd1f7 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Pet.java @@ -9,12 +9,21 @@ import io.swagger.model.Category; import io.swagger.model.Tag; import java.util.List; + + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.*; @ApiModel(description="A pet for sale in the pet store") public class Pet { + private Long id = null; private Category category = null; @@ -26,11 +35,20 @@ public class Pet { * pet status in the store */ public enum StatusEnum { + + AVAILABLE("available"), - PENDING("pending"), + + + PENDING("pending"), - SOLD("sold"); + + + SOLD("sold"); + + + private String value; StatusEnum(String value) { @@ -46,11 +64,16 @@ public String toString() { private StatusEnum status = null; + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("id") + public Long getId() { return id; } @@ -58,11 +81,16 @@ public void setId(Long id) { this.id = id; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("category") + public Category getCategory() { return category; } @@ -70,12 +98,18 @@ public void setCategory(Category category) { this.category = category; } + /** + + + **/ @ApiModelProperty(example = "doggie", required = true, value = "") @JsonProperty("name") + @NotNull + public String getName() { return name; } @@ -83,12 +117,18 @@ public void setName(String name) { this.name = name; } + /** + + + **/ @ApiModelProperty(required = true, value = "") @JsonProperty("photoUrls") + @NotNull + public List getPhotoUrls() { return photoUrls; } @@ -96,11 +136,16 @@ public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("tags") + public List getTags() { return tags; } @@ -108,12 +153,18 @@ public void setTags(List tags) { this.tags = tags; } + /** + * pet status in the store + + + **/ @ApiModelProperty(value = "pet status in the store") @JsonProperty("status") + public StatusEnum getStatus() { return status; } @@ -121,6 +172,7 @@ public void setStatus(StatusEnum status) { this.status = status; } + @Override public boolean equals(java.lang.Object o) { @@ -171,3 +223,6 @@ private String toIndentedString(java.lang.Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Tag.java index 750e1a82b1e..8799d74474f 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/Tag.java @@ -5,21 +5,35 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; + + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.*; @ApiModel(description="A tag for a pet") public class Tag { + private Long id = null; private String name = null; + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("id") + public Long getId() { return id; } @@ -27,11 +41,16 @@ public void setId(Long id) { this.id = id; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("name") + public String getName() { return name; } @@ -39,6 +58,7 @@ public void setName(String name) { this.name = name; } + @Override public boolean equals(java.lang.Object o) { @@ -81,3 +101,6 @@ private String toIndentedString(java.lang.Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/User.java index a52524db22a..c3ef44a581a 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/model/User.java @@ -5,12 +5,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; + + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.*; @ApiModel(description="A User who is purchasing from the pet store") public class User { + private Long id = null; private String username = null; @@ -21,11 +30,16 @@ public class User { private String phone = null; private Integer userStatus = null; + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("id") + public Long getId() { return id; } @@ -33,11 +47,16 @@ public void setId(Long id) { this.id = id; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("username") + public String getUsername() { return username; } @@ -45,11 +64,16 @@ public void setUsername(String username) { this.username = username; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("firstName") + public String getFirstName() { return firstName; } @@ -57,11 +81,16 @@ public void setFirstName(String firstName) { this.firstName = firstName; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("lastName") + public String getLastName() { return lastName; } @@ -69,11 +98,16 @@ public void setLastName(String lastName) { this.lastName = lastName; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("email") + public String getEmail() { return email; } @@ -81,11 +115,16 @@ public void setEmail(String email) { this.email = email; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("password") + public String getPassword() { return password; } @@ -93,11 +132,16 @@ public void setPassword(String password) { this.password = password; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("phone") + public String getPhone() { return phone; } @@ -105,12 +149,18 @@ public void setPhone(String phone) { this.phone = phone; } + /** + * User Status + + + **/ @ApiModelProperty(value = "User Status") @JsonProperty("userStatus") + public Integer getUserStatus() { return userStatus; } @@ -118,6 +168,7 @@ public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } + @Override public boolean equals(java.lang.Object o) { @@ -172,3 +223,6 @@ private String toIndentedString(java.lang.Object o) { } } + + + 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 index d8f13b40060..616bd0a25dc 100644 --- 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 @@ -2,13 +2,12 @@ import io.swagger.api.*; import io.swagger.model.*; -import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput; -import java.io.File; import io.swagger.model.ModelApiResponse; import io.swagger.model.Pet; + import java.util.List; import io.swagger.api.NotFoundException; @@ -20,45 +19,56 @@ @RequestScoped + public class PetApiServiceImpl implements PetApiService { - public Response addPet(Pet body,SecurityContext securityContext) + + public Response addPet(Pet pet,SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } - public Response deletePet(Long petId,String apiKey,SecurityContext securityContext) + + public Response deletePet(Integer petId,String apiKey,SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + public Response findPetsByStatus(List status,SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + public Response findPetsByTags(List tags,SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } - public Response getPetById(Long petId,SecurityContext securityContext) + + public Response getPetById(Integer petId,SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } - public Response updatePet(Pet body,SecurityContext securityContext) + + public Response updatePet(Pet pet,SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } - public Response updatePetWithForm(Long petId,String name,String status,SecurityContext securityContext) + + public Response updatePetWithForm(Integer petId,Object body,SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } - public Response uploadFile(MultipartFormDataInput input,Long petId,SecurityContext securityContext) + + public Response uploadFile(Integer petId,Object 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/StoreApiServiceImpl.java b/samples/server/petstore/jaxrs-resteasy/default/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java index edbf993ef74..852ca3e6ec5 100644 --- 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 @@ -7,6 +7,7 @@ import java.util.Map; import io.swagger.model.Order; + import java.util.List; import io.swagger.api.NotFoundException; @@ -18,25 +19,32 @@ @RequestScoped + public class StoreApiServiceImpl implements StoreApiService { + public Response deleteOrder(String orderId,SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + public Response getInventory(SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } - public Response getOrderById(Long orderId,SecurityContext securityContext) + + public Response getOrderById(Integer orderId,SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } - public Response placeOrder(Order body,SecurityContext securityContext) + + public Response placeOrder(Order order,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 index a0d5982520a..0ae2e9ac794 100644 --- 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 @@ -4,9 +4,9 @@ import io.swagger.model.*; -import java.util.List; import io.swagger.model.User; + import java.util.List; import io.swagger.api.NotFoundException; @@ -18,45 +18,56 @@ @RequestScoped + public class UserApiServiceImpl implements UserApiService { - public Response createUser(User body,SecurityContext securityContext) + + public Response createUser(User user,SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + public Response createUsersWithArrayInput(List body,SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + public Response createUsersWithListInput(List body,SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + public Response deleteUser(String username,SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + public Response getUserByName(String username,SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + public Response loginUser(String username,String password,SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + public Response logoutUser(SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } - public Response updateUser(String username,User body,SecurityContext securityContext) + + public Response updateUser(User user,String username,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/eap-java8/.swagger-codegen/VERSION b/samples/server/petstore/jaxrs-resteasy/eap-java8/.swagger-codegen/VERSION index 50794f17f1a..096bf47efe3 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-java8/.swagger-codegen/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/eap-java8/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.1-SNAPSHOT \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/eap-java8/README.md b/samples/server/petstore/jaxrs-resteasy/eap-java8/README.md index 499909ec874..30bfb068a61 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-java8/README.md +++ b/samples/server/petstore/jaxrs-resteasy/eap-java8/README.md @@ -12,7 +12,7 @@ You can deploy the WAR file to Jboss EAP or any other JEE server supporting Jbos You can then view the swagger listing here: ``` -http://localhost:8080/v2/swagger.json +http://localhost:-1/v2/swagger.json ``` Note that if you have configured the `host` to be something other than localhost, the calls through diff --git a/samples/server/petstore/jaxrs-resteasy/eap-java8/build.gradle b/samples/server/petstore/jaxrs-resteasy/eap-java8/build.gradle index e189fe88dfb..cd3a7906c19 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-java8/build.gradle +++ b/samples/server/petstore/jaxrs-resteasy/eap-java8/build.gradle @@ -15,8 +15,13 @@ 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' + providedCompile 'javax.validation:validation-api:1.1.0.Final' + + + compile 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.6.3' + testCompile 'junit:junit:4.12', 'org.hamcrest:hamcrest-core:1.3' } diff --git a/samples/server/petstore/jaxrs-resteasy/eap-java8/pom.xml b/samples/server/petstore/jaxrs-resteasy/eap-java8/pom.xml index 1edeb42aa1c..35de0eae9af 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-java8/pom.xml +++ b/samples/server/petstore/jaxrs-resteasy/eap-java8/pom.xml @@ -138,6 +138,7 @@ + javax.validation @@ -145,11 +146,15 @@ 1.1.0.Final provided + + + com.fasterxml.jackson.datatype jackson-datatype-jsr310 2.6.3 + @@ -162,7 +167,7 @@ - 1.5.15 + 1.5.18 9.2.9.v20150224 3.0.11.Final 1.6.3 diff --git a/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/api/PetApi.java b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/api/PetApi.java index fafe4a5b85c..e12a0c7baf5 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/api/PetApi.java @@ -5,10 +5,10 @@ import io.swagger.annotations.ApiParam; import io.swagger.jaxrs.*; -import java.io.File; import io.swagger.model.ModelApiResponse; import io.swagger.model.Pet; + import java.util.List; import java.util.Map; @@ -18,127 +18,102 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; import javax.ws.rs.*; + import javax.validation.constraints.*; -import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput; + @Path("/pet") @io.swagger.annotations.Api(description = "the pet API") + public interface PetApi { + @POST @Consumes({ "application/json", "application/xml" }) - @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Add a new pet to the store", notes = "", response = Void.class, authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + + @io.swagger.annotations.ApiOperation(value = "Add a new pet to the store", notes = "", response = Void.class, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) - public Response addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet body,@Context SecurityContext securityContext); + public Response addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet pet,@Context SecurityContext securityContext); + @DELETE @Path("/{petId}") - @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + + @io.swagger.annotations.ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) - public Response deletePet( @PathParam("petId") Long petId,@ApiParam(value = "" )@HeaderParam("api_key") String apiKey,@Context SecurityContext securityContext); + public Response deletePet( @PathParam("petId") Integer petId,@ApiParam(value = "" )@HeaderParam("api_key") String apiKey,@Context SecurityContext securityContext); + @GET @Path("/findByStatus") @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + @io.swagger.annotations.ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid status value", response = Void.class) }) public Response findPetsByStatus( @NotNull @QueryParam("status") List status,@Context SecurityContext securityContext); + @GET @Path("/findByTags") @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + @io.swagger.annotations.ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid tag value", response = Void.class) }) public Response findPetsByTags( @NotNull @QueryParam("tags") List tags,@Context SecurityContext securityContext); + @GET @Path("/{petId}") @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = { - @io.swagger.annotations.Authorization(value = "api_key") - }, tags={ "pet", }) + @io.swagger.annotations.ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class) }) - public Response getPetById( @PathParam("petId") Long petId,@Context SecurityContext securityContext); + public Response getPetById( @PathParam("petId") Integer petId,@Context SecurityContext securityContext); + @PUT @Consumes({ "application/json", "application/xml" }) - @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + + @io.swagger.annotations.ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class), @io.swagger.annotations.ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) - public Response updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet body,@Context SecurityContext securityContext); + public Response updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet pet,@Context SecurityContext securityContext); + @POST @Path("/{petId}") @Consumes({ "application/x-www-form-urlencoded" }) - @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + + @io.swagger.annotations.ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) - public Response updatePetWithForm( @PathParam("petId") Long petId,@ApiParam(value = "Updated name of the pet")@FormParam("name") String name,@ApiParam(value = "Updated status of the pet")@FormParam("status") String status,@Context SecurityContext securityContext); + public Response updatePetWithForm( @PathParam("petId") Integer petId,@ApiParam(value = "" ) Object body,@Context SecurityContext securityContext); + @POST @Path("/{petId}/uploadImage") @Consumes({ "multipart/form-data" }) @Produces({ "application/json" }) - @io.swagger.annotations.ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + @io.swagger.annotations.ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - public Response uploadFile(MultipartFormDataInput input, @PathParam("petId") Long petId,@Context SecurityContext securityContext); + public Response uploadFile( @PathParam("petId") Integer petId,@ApiParam(value = "" ) Object body,@Context SecurityContext securityContext); + } + diff --git a/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/api/StoreApi.java b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/api/StoreApi.java index 133e801e900..0535d026b86 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/api/StoreApi.java @@ -8,6 +8,7 @@ import java.util.Map; import io.swagger.model.Order; + import java.util.List; import java.util.Map; @@ -17,35 +18,39 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; import javax.ws.rs.*; + import javax.validation.constraints.*; + @Path("/store") @io.swagger.annotations.Api(description = "the store API") + public interface StoreApi { + @DELETE @Path("/order/{orderId}") - @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = Void.class, tags={ "store", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Void.class) }) public Response deleteOrder( @PathParam("orderId") String orderId,@Context SecurityContext securityContext); + @GET @Path("/inventory") @Produces({ "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { - @io.swagger.annotations.Authorization(value = "api_key") - }, tags={ "store", }) + @io.swagger.annotations.ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", tags={ "store", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) public Response getInventory(@Context SecurityContext securityContext); + @GET @Path("/order/{orderId}") @@ -57,15 +62,18 @@ public interface StoreApi { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Void.class) }) - public Response getOrderById( @Min(1) @Max(5) @PathParam("orderId") Long orderId,@Context SecurityContext securityContext); + public Response getOrderById( @Min(1) @Max(5) @PathParam("orderId") Integer orderId,@Context SecurityContext securityContext); + @POST @Path("/order") - + @Consumes({ "*/*" }) @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid Order", response = Void.class) }) - public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true) Order body,@Context SecurityContext securityContext); + public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true) Order order,@Context SecurityContext securityContext); + } + diff --git a/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/api/UserApi.java b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/api/UserApi.java index 384aac51777..19f7c4403cd 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/api/UserApi.java @@ -5,9 +5,9 @@ import io.swagger.annotations.ApiParam; import io.swagger.jaxrs.*; -import java.util.List; import io.swagger.model.User; + import java.util.List; import java.util.Map; @@ -17,49 +17,57 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; import javax.ws.rs.*; + import javax.validation.constraints.*; + @Path("/user") @io.swagger.annotations.Api(description = "the user API") + public interface UserApi { + @POST + @Consumes({ "*/*" }) - @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - public Response createUser(@ApiParam(value = "Created user object" ,required=true) User body,@Context SecurityContext securityContext); + public Response createUser(@ApiParam(value = "Created user object" ,required=true) User user,@Context SecurityContext securityContext); + @POST @Path("/createWithArray") + @Consumes({ "*/*" }) - @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true) List body,@Context SecurityContext securityContext); + @POST @Path("/createWithList") + @Consumes({ "*/*" }) - @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true) List body,@Context SecurityContext securityContext); + @DELETE @Path("/{username}") - @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) public Response deleteUser( @PathParam("username") String username,@Context SecurityContext securityContext); + @GET @Path("/{username}") @@ -72,6 +80,7 @@ public interface UserApi { @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) public Response getUserByName( @PathParam("username") String username,@Context SecurityContext securityContext); + @GET @Path("/login") @@ -82,22 +91,26 @@ public interface UserApi { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username/password supplied", response = Void.class) }) public Response loginUser( @NotNull @QueryParam("username") String username, @NotNull @QueryParam("password") String password,@Context SecurityContext securityContext); + @GET @Path("/logout") - @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response logoutUser(@Context SecurityContext securityContext); + @PUT @Path("/{username}") + @Consumes({ "*/*" }) - @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) - public Response updateUser( @PathParam("username") String username,@ApiParam(value = "Updated user object" ,required=true) User body,@Context SecurityContext securityContext); + public Response updateUser(@ApiParam(value = "Updated user object" ,required=true) User user, @PathParam("username") String username,@Context SecurityContext securityContext); + } + diff --git a/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/model/Category.java index 833b7c04571..6f9a54651d1 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/model/Category.java @@ -5,21 +5,51 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; + + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.*; @ApiModel(description="A category for a pet") public class Category { + private Long id = null; private String name = null; + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("id") + + + + + + + + + + + + + + + + + public Long getId() { return id; } @@ -27,11 +57,32 @@ public void setId(Long id) { this.id = id; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("name") + + + + + + + + + + + + + + + + + public String getName() { return name; } @@ -39,6 +90,7 @@ public void setName(String name) { this.name = name; } + @Override public boolean equals(Object o) { @@ -81,3 +133,6 @@ private String toIndentedString(Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/model/ModelApiResponse.java index 2ec59cd9f20..69f187d63ee 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -5,22 +5,52 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; + + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.*; @ApiModel(description="Describes the result of uploading an image resource") public class ModelApiResponse { + private Integer code = null; private String type = null; private String message = null; + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("code") + + + + + + + + + + + + + + + + + public Integer getCode() { return code; } @@ -28,11 +58,32 @@ public void setCode(Integer code) { this.code = code; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("type") + + + + + + + + + + + + + + + + + public String getType() { return type; } @@ -40,11 +91,32 @@ public void setType(String type) { this.type = type; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("message") + + + + + + + + + + + + + + + + + public String getMessage() { return message; } @@ -52,6 +124,7 @@ public void setMessage(String message) { this.message = message; } + @Override public boolean equals(Object o) { @@ -96,3 +169,6 @@ private String toIndentedString(Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/model/Order.java index 3b7151b390e..c4cdccf2358 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/model/Order.java @@ -7,12 +7,21 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import java.time.OffsetDateTime; + + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.*; @ApiModel(description="An order for a pets from the pet store") public class Order { + private Long id = null; private Long petId = null; @@ -23,11 +32,20 @@ public class Order { * Order Status */ public enum StatusEnum { + + PLACED("placed"), - APPROVED("approved"), + + + APPROVED("approved"), - DELIVERED("delivered"); + + + DELIVERED("delivered"); + + + private String value; StatusEnum(String value) { @@ -44,11 +62,32 @@ public String toString() { private StatusEnum status = null; private Boolean complete = false; + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("id") + + + + + + + + + + + + + + + + + public Long getId() { return id; } @@ -56,11 +95,32 @@ public void setId(Long id) { this.id = id; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("petId") + + + + + + + + + + + + + + + + + public Long getPetId() { return petId; } @@ -68,11 +128,32 @@ public void setPetId(Long petId) { this.petId = petId; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("quantity") + + + + + + + + + + + + + + + + + public Integer getQuantity() { return quantity; } @@ -80,11 +161,32 @@ public void setQuantity(Integer quantity) { this.quantity = quantity; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("shipDate") + + + + + + + + + + + + + + + + + public OffsetDateTime getShipDate() { return shipDate; } @@ -92,12 +194,34 @@ public void setShipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; } + /** + * Order Status + + + **/ @ApiModelProperty(value = "Order Status") @JsonProperty("status") + + + + + + + + + + + + + + + + + public StatusEnum getStatus() { return status; } @@ -105,18 +229,40 @@ public void setStatus(StatusEnum status) { this.status = status; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("complete") - public Boolean isComplete() { + + + + + + + + + + + + + + + + + + public Boolean isisComplete() { return complete; } public void setComplete(Boolean complete) { this.complete = complete; } + @Override public boolean equals(Object o) { @@ -167,3 +313,6 @@ private String toIndentedString(Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/model/Pet.java index ce855066266..81ee0de9d05 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/model/Pet.java @@ -9,12 +9,21 @@ import io.swagger.model.Category; import io.swagger.model.Tag; import java.util.List; + + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.*; @ApiModel(description="A pet for sale in the pet store") public class Pet { + private Long id = null; private Category category = null; @@ -26,11 +35,20 @@ public class Pet { * pet status in the store */ public enum StatusEnum { + + AVAILABLE("available"), - PENDING("pending"), + + + PENDING("pending"), - SOLD("sold"); + + + SOLD("sold"); + + + private String value; StatusEnum(String value) { @@ -46,11 +64,32 @@ public String toString() { private StatusEnum status = null; + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("id") + + + + + + + + + + + + + + + + + public Long getId() { return id; } @@ -58,11 +97,32 @@ public void setId(Long id) { this.id = id; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("category") + + + + + + + + + + + + + + + + + public Category getCategory() { return category; } @@ -70,12 +130,34 @@ public void setCategory(Category category) { this.category = category; } + /** + + + **/ @ApiModelProperty(example = "doggie", required = true, value = "") @JsonProperty("name") + @NotNull + + + + + + + + + + + + + + + + + public String getName() { return name; } @@ -83,12 +165,34 @@ public void setName(String name) { this.name = name; } + /** + + + **/ @ApiModelProperty(required = true, value = "") @JsonProperty("photoUrls") + @NotNull + + + + + + + + + + + + + + + + + public List getPhotoUrls() { return photoUrls; } @@ -96,11 +200,32 @@ public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("tags") + + + + + + + + + + + + + + + + + public List getTags() { return tags; } @@ -108,12 +233,34 @@ public void setTags(List tags) { this.tags = tags; } + /** + * pet status in the store + + + **/ @ApiModelProperty(value = "pet status in the store") @JsonProperty("status") + + + + + + + + + + + + + + + + + public StatusEnum getStatus() { return status; } @@ -121,6 +268,7 @@ public void setStatus(StatusEnum status) { this.status = status; } + @Override public boolean equals(Object o) { @@ -171,3 +319,6 @@ private String toIndentedString(Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/model/Tag.java index 356b2abc3b0..946e64918d5 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/model/Tag.java @@ -5,21 +5,51 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; + + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.*; @ApiModel(description="A tag for a pet") public class Tag { + private Long id = null; private String name = null; + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("id") + + + + + + + + + + + + + + + + + public Long getId() { return id; } @@ -27,11 +57,32 @@ public void setId(Long id) { this.id = id; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("name") + + + + + + + + + + + + + + + + + public String getName() { return name; } @@ -39,6 +90,7 @@ public void setName(String name) { this.name = name; } + @Override public boolean equals(Object o) { @@ -81,3 +133,6 @@ private String toIndentedString(Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/model/User.java index 50b50e4551b..db3857ebd5c 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/model/User.java @@ -5,12 +5,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; + + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.*; @ApiModel(description="A User who is purchasing from the pet store") public class User { + private Long id = null; private String username = null; @@ -21,11 +30,32 @@ public class User { private String phone = null; private Integer userStatus = null; + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("id") + + + + + + + + + + + + + + + + + public Long getId() { return id; } @@ -33,11 +63,32 @@ public void setId(Long id) { this.id = id; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("username") + + + + + + + + + + + + + + + + + public String getUsername() { return username; } @@ -45,11 +96,32 @@ public void setUsername(String username) { this.username = username; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("firstName") + + + + + + + + + + + + + + + + + public String getFirstName() { return firstName; } @@ -57,11 +129,32 @@ public void setFirstName(String firstName) { this.firstName = firstName; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("lastName") + + + + + + + + + + + + + + + + + public String getLastName() { return lastName; } @@ -69,11 +162,32 @@ public void setLastName(String lastName) { this.lastName = lastName; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("email") + + + + + + + + + + + + + + + + + public String getEmail() { return email; } @@ -81,11 +195,32 @@ public void setEmail(String email) { this.email = email; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("password") + + + + + + + + + + + + + + + + + public String getPassword() { return password; } @@ -93,11 +228,32 @@ public void setPassword(String password) { this.password = password; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("phone") + + + + + + + + + + + + + + + + + public String getPhone() { return phone; } @@ -105,12 +261,34 @@ public void setPhone(String phone) { this.phone = phone; } + /** + * User Status + + + **/ @ApiModelProperty(value = "User Status") @JsonProperty("userStatus") + + + + + + + + + + + + + + + + + public Integer getUserStatus() { return userStatus; } @@ -118,6 +296,7 @@ public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } + @Override public boolean equals(Object o) { @@ -172,3 +351,6 @@ private String toIndentedString(Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-resteasy/eap-java8/src/main/java/io/swagger/api/JacksonConfig.java b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/main/java/io/swagger/api/JacksonConfig.java index 4109c5875cd..7a5e120b035 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-java8/src/main/java/io/swagger/api/JacksonConfig.java +++ b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/main/java/io/swagger/api/JacksonConfig.java @@ -9,8 +9,11 @@ import org.slf4j.LoggerFactory; import com.fasterxml.jackson.databind.ObjectMapper; + import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; + + @Provider @Produces(MediaType.APPLICATION_JSON) public class JacksonConfig implements ContextResolver { @@ -22,8 +25,11 @@ public class JacksonConfig implements ContextResolver { public JacksonConfig() throws Exception { this.objectMapper = new ObjectMapper(); + this.objectMapper.registerModule(new JavaTimeModule()); + + // sample to convert any DateTime to readable timestamps //this.objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, true); } diff --git a/samples/server/petstore/jaxrs-resteasy/eap-java8/src/main/java/io/swagger/api/RestApplication.java b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/main/java/io/swagger/api/RestApplication.java index 65184dc2f39..33c4ae2a460 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-java8/src/main/java/io/swagger/api/RestApplication.java +++ b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/main/java/io/swagger/api/RestApplication.java @@ -6,20 +6,35 @@ import java.util.Set; import java.util.HashSet; + + + import io.swagger.api.impl.PetApiServiceImpl; + import io.swagger.api.impl.StoreApiServiceImpl; + import io.swagger.api.impl.UserApiServiceImpl; + + @ApplicationPath("/") public class RestApplication extends Application { + public Set> getClasses() { Set> resources = new HashSet>(); + + resources.add(PetApiServiceImpl.class); + resources.add(StoreApiServiceImpl.class); + resources.add(UserApiServiceImpl.class); + + + return resources; } diff --git a/samples/server/petstore/jaxrs-resteasy/eap-java8/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java index eb3e35b8280..93481088c92 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-java8/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java @@ -2,13 +2,12 @@ import io.swagger.api.*; import io.swagger.model.*; -import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput; -import java.io.File; import io.swagger.model.ModelApiResponse; import io.swagger.model.Pet; + import java.util.List; import java.io.InputStream; @@ -17,37 +16,48 @@ import javax.ws.rs.core.SecurityContext; + public class PetApiServiceImpl implements PetApi { - public Response addPet(Pet body,SecurityContext securityContext) { + + public Response addPet(Pet pet,SecurityContext securityContext) { // do some magic! return Response.ok().build(); } - public Response deletePet(Long petId,String apiKey,SecurityContext securityContext) { + + public Response deletePet(Integer petId,String apiKey,SecurityContext securityContext) { // do some magic! return Response.ok().build(); } + public Response findPetsByStatus(List status,SecurityContext securityContext) { // do some magic! return Response.ok().build(); } + public Response findPetsByTags(List tags,SecurityContext securityContext) { // do some magic! return Response.ok().build(); } - public Response getPetById(Long petId,SecurityContext securityContext) { + + public Response getPetById(Integer petId,SecurityContext securityContext) { // do some magic! return Response.ok().build(); } - public Response updatePet(Pet body,SecurityContext securityContext) { + + public Response updatePet(Pet pet,SecurityContext securityContext) { // do some magic! return Response.ok().build(); } - public Response updatePetWithForm(Long petId,String name,String status,SecurityContext securityContext) { + + public Response updatePetWithForm(Integer petId,Object body,SecurityContext securityContext) { // do some magic! return Response.ok().build(); } - public Response uploadFile(MultipartFormDataInput input,Long petId,SecurityContext securityContext) { + + public Response uploadFile(Integer petId,Object body,SecurityContext securityContext) { // do some magic! return Response.ok().build(); } + } + diff --git a/samples/server/petstore/jaxrs-resteasy/eap-java8/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java index 1de821ace75..6c16fdcefa6 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-java8/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java @@ -7,6 +7,7 @@ import java.util.Map; import io.swagger.model.Order; + import java.util.List; import java.io.InputStream; @@ -15,21 +16,28 @@ import javax.ws.rs.core.SecurityContext; + public class StoreApiServiceImpl implements StoreApi { + public Response deleteOrder(String orderId,SecurityContext securityContext) { // do some magic! return Response.ok().build(); } + public Response getInventory(SecurityContext securityContext) { // do some magic! return Response.ok().build(); } - public Response getOrderById(Long orderId,SecurityContext securityContext) { + + public Response getOrderById(Integer orderId,SecurityContext securityContext) { // do some magic! return Response.ok().build(); } - public Response placeOrder(Order body,SecurityContext securityContext) { + + public Response placeOrder(Order order,SecurityContext securityContext) { // do some magic! return Response.ok().build(); } + } + diff --git a/samples/server/petstore/jaxrs-resteasy/eap-java8/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java index 67f74c66cb0..893cbc9953f 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-java8/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java @@ -4,9 +4,9 @@ import io.swagger.model.*; -import java.util.List; import io.swagger.model.User; + import java.util.List; import java.io.InputStream; @@ -15,37 +15,48 @@ import javax.ws.rs.core.SecurityContext; + public class UserApiServiceImpl implements UserApi { - public Response createUser(User body,SecurityContext securityContext) { + + public Response createUser(User user,SecurityContext securityContext) { // do some magic! return Response.ok().build(); } + public Response createUsersWithArrayInput(List body,SecurityContext securityContext) { // do some magic! return Response.ok().build(); } + public Response createUsersWithListInput(List body,SecurityContext securityContext) { // do some magic! return Response.ok().build(); } + public Response deleteUser(String username,SecurityContext securityContext) { // do some magic! return Response.ok().build(); } + public Response getUserByName(String username,SecurityContext securityContext) { // do some magic! return Response.ok().build(); } + public Response loginUser(String username,String password,SecurityContext securityContext) { // do some magic! return Response.ok().build(); } + public Response logoutUser(SecurityContext securityContext) { // do some magic! return Response.ok().build(); } - public Response updateUser(String username,User body,SecurityContext securityContext) { + + public Response updateUser(User user,String username,SecurityContext securityContext) { // do some magic! return Response.ok().build(); } + } + diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/.swagger-codegen/VERSION b/samples/server/petstore/jaxrs-resteasy/eap-joda/.swagger-codegen/VERSION index 50794f17f1a..096bf47efe3 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-joda/.swagger-codegen/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.1-SNAPSHOT \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/README.md b/samples/server/petstore/jaxrs-resteasy/eap-joda/README.md index cc011c37ee5..30bfb068a61 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-joda/README.md +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/README.md @@ -5,18 +5,14 @@ This server was generated by the [swagger-codegen](https://github.com/swagger-ap [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. +This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework for Jboss Resteasy. -To run the server, please execute the following: - -``` -mvn clean package jetty:run -``` +You can deploy the WAR file to Jboss EAP or any other JEE server supporting Jboss Resteasy. You can then view the swagger listing here: ``` -http://localhost:8080/v2/swagger.json +http://localhost:-1/v2/swagger.json ``` Note that if you have configured the `host` to be something other than localhost, the calls through diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/build.gradle b/samples/server/petstore/jaxrs-resteasy/eap-joda/build.gradle index e89fc25bec1..2d83786f7b2 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-joda/build.gradle +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/build.gradle @@ -15,9 +15,14 @@ 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' + providedCompile 'javax.validation:validation-api:1.1.0.Final' + + compile 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.6.3' 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/eap-joda/pom.xml b/samples/server/petstore/jaxrs-resteasy/eap-joda/pom.xml index ca2b969d27c..751349f4dbf 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-joda/pom.xml +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/pom.xml @@ -138,6 +138,7 @@ + javax.validation @@ -145,6 +146,8 @@ 1.1.0.Final provided + + joda-time joda-time @@ -155,6 +158,8 @@ jackson-datatype-joda 2.6.3 + + @@ -167,7 +172,7 @@ - 1.5.15 + 1.5.18 9.2.9.v20150224 3.0.11.Final 1.6.3 diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/api/PetApi.java b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/api/PetApi.java index fafe4a5b85c..e12a0c7baf5 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/api/PetApi.java @@ -5,10 +5,10 @@ import io.swagger.annotations.ApiParam; import io.swagger.jaxrs.*; -import java.io.File; import io.swagger.model.ModelApiResponse; import io.swagger.model.Pet; + import java.util.List; import java.util.Map; @@ -18,127 +18,102 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; import javax.ws.rs.*; + import javax.validation.constraints.*; -import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput; + @Path("/pet") @io.swagger.annotations.Api(description = "the pet API") + public interface PetApi { + @POST @Consumes({ "application/json", "application/xml" }) - @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Add a new pet to the store", notes = "", response = Void.class, authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + + @io.swagger.annotations.ApiOperation(value = "Add a new pet to the store", notes = "", response = Void.class, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) - public Response addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet body,@Context SecurityContext securityContext); + public Response addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet pet,@Context SecurityContext securityContext); + @DELETE @Path("/{petId}") - @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + + @io.swagger.annotations.ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) - public Response deletePet( @PathParam("petId") Long petId,@ApiParam(value = "" )@HeaderParam("api_key") String apiKey,@Context SecurityContext securityContext); + public Response deletePet( @PathParam("petId") Integer petId,@ApiParam(value = "" )@HeaderParam("api_key") String apiKey,@Context SecurityContext securityContext); + @GET @Path("/findByStatus") @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + @io.swagger.annotations.ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid status value", response = Void.class) }) public Response findPetsByStatus( @NotNull @QueryParam("status") List status,@Context SecurityContext securityContext); + @GET @Path("/findByTags") @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + @io.swagger.annotations.ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid tag value", response = Void.class) }) public Response findPetsByTags( @NotNull @QueryParam("tags") List tags,@Context SecurityContext securityContext); + @GET @Path("/{petId}") @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = { - @io.swagger.annotations.Authorization(value = "api_key") - }, tags={ "pet", }) + @io.swagger.annotations.ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class) }) - public Response getPetById( @PathParam("petId") Long petId,@Context SecurityContext securityContext); + public Response getPetById( @PathParam("petId") Integer petId,@Context SecurityContext securityContext); + @PUT @Consumes({ "application/json", "application/xml" }) - @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + + @io.swagger.annotations.ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class), @io.swagger.annotations.ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) - public Response updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet body,@Context SecurityContext securityContext); + public Response updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet pet,@Context SecurityContext securityContext); + @POST @Path("/{petId}") @Consumes({ "application/x-www-form-urlencoded" }) - @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + + @io.swagger.annotations.ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) - public Response updatePetWithForm( @PathParam("petId") Long petId,@ApiParam(value = "Updated name of the pet")@FormParam("name") String name,@ApiParam(value = "Updated status of the pet")@FormParam("status") String status,@Context SecurityContext securityContext); + public Response updatePetWithForm( @PathParam("petId") Integer petId,@ApiParam(value = "" ) Object body,@Context SecurityContext securityContext); + @POST @Path("/{petId}/uploadImage") @Consumes({ "multipart/form-data" }) @Produces({ "application/json" }) - @io.swagger.annotations.ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + @io.swagger.annotations.ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - public Response uploadFile(MultipartFormDataInput input, @PathParam("petId") Long petId,@Context SecurityContext securityContext); + public Response uploadFile( @PathParam("petId") Integer petId,@ApiParam(value = "" ) Object body,@Context SecurityContext securityContext); + } + diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/api/StoreApi.java b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/api/StoreApi.java index 133e801e900..0535d026b86 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/api/StoreApi.java @@ -8,6 +8,7 @@ import java.util.Map; import io.swagger.model.Order; + import java.util.List; import java.util.Map; @@ -17,35 +18,39 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; import javax.ws.rs.*; + import javax.validation.constraints.*; + @Path("/store") @io.swagger.annotations.Api(description = "the store API") + public interface StoreApi { + @DELETE @Path("/order/{orderId}") - @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = Void.class, tags={ "store", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Void.class) }) public Response deleteOrder( @PathParam("orderId") String orderId,@Context SecurityContext securityContext); + @GET @Path("/inventory") @Produces({ "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { - @io.swagger.annotations.Authorization(value = "api_key") - }, tags={ "store", }) + @io.swagger.annotations.ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", tags={ "store", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) public Response getInventory(@Context SecurityContext securityContext); + @GET @Path("/order/{orderId}") @@ -57,15 +62,18 @@ public interface StoreApi { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Void.class) }) - public Response getOrderById( @Min(1) @Max(5) @PathParam("orderId") Long orderId,@Context SecurityContext securityContext); + public Response getOrderById( @Min(1) @Max(5) @PathParam("orderId") Integer orderId,@Context SecurityContext securityContext); + @POST @Path("/order") - + @Consumes({ "*/*" }) @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid Order", response = Void.class) }) - public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true) Order body,@Context SecurityContext securityContext); + public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true) Order order,@Context SecurityContext securityContext); + } + diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/api/UserApi.java b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/api/UserApi.java index 384aac51777..19f7c4403cd 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/api/UserApi.java @@ -5,9 +5,9 @@ import io.swagger.annotations.ApiParam; import io.swagger.jaxrs.*; -import java.util.List; import io.swagger.model.User; + import java.util.List; import java.util.Map; @@ -17,49 +17,57 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; import javax.ws.rs.*; + import javax.validation.constraints.*; + @Path("/user") @io.swagger.annotations.Api(description = "the user API") + public interface UserApi { + @POST + @Consumes({ "*/*" }) - @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - public Response createUser(@ApiParam(value = "Created user object" ,required=true) User body,@Context SecurityContext securityContext); + public Response createUser(@ApiParam(value = "Created user object" ,required=true) User user,@Context SecurityContext securityContext); + @POST @Path("/createWithArray") + @Consumes({ "*/*" }) - @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true) List body,@Context SecurityContext securityContext); + @POST @Path("/createWithList") + @Consumes({ "*/*" }) - @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true) List body,@Context SecurityContext securityContext); + @DELETE @Path("/{username}") - @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) public Response deleteUser( @PathParam("username") String username,@Context SecurityContext securityContext); + @GET @Path("/{username}") @@ -72,6 +80,7 @@ public interface UserApi { @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) public Response getUserByName( @PathParam("username") String username,@Context SecurityContext securityContext); + @GET @Path("/login") @@ -82,22 +91,26 @@ public interface UserApi { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username/password supplied", response = Void.class) }) public Response loginUser( @NotNull @QueryParam("username") String username, @NotNull @QueryParam("password") String password,@Context SecurityContext securityContext); + @GET @Path("/logout") - @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response logoutUser(@Context SecurityContext securityContext); + @PUT @Path("/{username}") + @Consumes({ "*/*" }) - @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) - public Response updateUser( @PathParam("username") String username,@ApiParam(value = "Updated user object" ,required=true) User body,@Context SecurityContext securityContext); + public Response updateUser(@ApiParam(value = "Updated user object" ,required=true) User user, @PathParam("username") String username,@Context SecurityContext securityContext); + } + diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/Category.java index 833b7c04571..6f9a54651d1 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/Category.java @@ -5,21 +5,51 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; + + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.*; @ApiModel(description="A category for a pet") public class Category { + private Long id = null; private String name = null; + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("id") + + + + + + + + + + + + + + + + + public Long getId() { return id; } @@ -27,11 +57,32 @@ public void setId(Long id) { this.id = id; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("name") + + + + + + + + + + + + + + + + + public String getName() { return name; } @@ -39,6 +90,7 @@ public void setName(String name) { this.name = name; } + @Override public boolean equals(Object o) { @@ -81,3 +133,6 @@ private String toIndentedString(Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/ModelApiResponse.java index 2ec59cd9f20..69f187d63ee 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -5,22 +5,52 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; + + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.*; @ApiModel(description="Describes the result of uploading an image resource") public class ModelApiResponse { + private Integer code = null; private String type = null; private String message = null; + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("code") + + + + + + + + + + + + + + + + + public Integer getCode() { return code; } @@ -28,11 +58,32 @@ public void setCode(Integer code) { this.code = code; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("type") + + + + + + + + + + + + + + + + + public String getType() { return type; } @@ -40,11 +91,32 @@ public void setType(String type) { this.type = type; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("message") + + + + + + + + + + + + + + + + + public String getMessage() { return message; } @@ -52,6 +124,7 @@ public void setMessage(String message) { this.message = message; } + @Override public boolean equals(Object o) { @@ -96,3 +169,6 @@ private String toIndentedString(Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/Order.java index 7e5b9613d76..5344ec45fe4 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/Order.java @@ -7,12 +7,21 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import org.joda.time.DateTime; + + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.*; @ApiModel(description="An order for a pets from the pet store") public class Order { + private Long id = null; private Long petId = null; @@ -23,11 +32,20 @@ public class Order { * Order Status */ public enum StatusEnum { + + PLACED("placed"), - APPROVED("approved"), + + + APPROVED("approved"), - DELIVERED("delivered"); + + + DELIVERED("delivered"); + + + private String value; StatusEnum(String value) { @@ -44,11 +62,32 @@ public String toString() { private StatusEnum status = null; private Boolean complete = false; + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("id") + + + + + + + + + + + + + + + + + public Long getId() { return id; } @@ -56,11 +95,32 @@ public void setId(Long id) { this.id = id; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("petId") + + + + + + + + + + + + + + + + + public Long getPetId() { return petId; } @@ -68,11 +128,32 @@ public void setPetId(Long petId) { this.petId = petId; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("quantity") + + + + + + + + + + + + + + + + + public Integer getQuantity() { return quantity; } @@ -80,11 +161,32 @@ public void setQuantity(Integer quantity) { this.quantity = quantity; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("shipDate") + + + + + + + + + + + + + + + + + public DateTime getShipDate() { return shipDate; } @@ -92,12 +194,34 @@ public void setShipDate(DateTime shipDate) { this.shipDate = shipDate; } + /** + * Order Status + + + **/ @ApiModelProperty(value = "Order Status") @JsonProperty("status") + + + + + + + + + + + + + + + + + public StatusEnum getStatus() { return status; } @@ -105,18 +229,40 @@ public void setStatus(StatusEnum status) { this.status = status; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("complete") - public Boolean isComplete() { + + + + + + + + + + + + + + + + + + public Boolean isisComplete() { return complete; } public void setComplete(Boolean complete) { this.complete = complete; } + @Override public boolean equals(Object o) { @@ -167,3 +313,6 @@ private String toIndentedString(Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/Pet.java index 0e258641f27..3dc5d283f38 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/Pet.java @@ -9,12 +9,21 @@ import io.swagger.model.Category; import io.swagger.model.Tag; import java.util.List; + + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.*; @ApiModel(description="A pet for sale in the pet store") public class Pet { + private Long id = null; private Category category = null; @@ -26,11 +35,20 @@ public class Pet { * pet status in the store */ public enum StatusEnum { + + AVAILABLE("available"), - PENDING("pending"), + + + PENDING("pending"), - SOLD("sold"); + + + SOLD("sold"); + + + private String value; StatusEnum(String value) { @@ -46,11 +64,32 @@ public String toString() { private StatusEnum status = null; + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("id") + + + + + + + + + + + + + + + + + public Long getId() { return id; } @@ -58,11 +97,32 @@ public void setId(Long id) { this.id = id; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("category") + + + + + + + + + + + + + + + + + public Category getCategory() { return category; } @@ -70,12 +130,34 @@ public void setCategory(Category category) { this.category = category; } + /** + + + **/ @ApiModelProperty(example = "doggie", required = true, value = "") @JsonProperty("name") + @NotNull + + + + + + + + + + + + + + + + + public String getName() { return name; } @@ -83,12 +165,34 @@ public void setName(String name) { this.name = name; } + /** + + + **/ @ApiModelProperty(required = true, value = "") @JsonProperty("photoUrls") + @NotNull + + + + + + + + + + + + + + + + + public List getPhotoUrls() { return photoUrls; } @@ -96,11 +200,32 @@ public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("tags") + + + + + + + + + + + + + + + + + public List getTags() { return tags; } @@ -108,12 +233,34 @@ public void setTags(List tags) { this.tags = tags; } + /** + * pet status in the store + + + **/ @ApiModelProperty(value = "pet status in the store") @JsonProperty("status") + + + + + + + + + + + + + + + + + public StatusEnum getStatus() { return status; } @@ -121,6 +268,7 @@ public void setStatus(StatusEnum status) { this.status = status; } + @Override public boolean equals(Object o) { @@ -171,3 +319,6 @@ private String toIndentedString(Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/Tag.java index 356b2abc3b0..946e64918d5 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/Tag.java @@ -5,21 +5,51 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; + + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.*; @ApiModel(description="A tag for a pet") public class Tag { + private Long id = null; private String name = null; + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("id") + + + + + + + + + + + + + + + + + public Long getId() { return id; } @@ -27,11 +57,32 @@ public void setId(Long id) { this.id = id; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("name") + + + + + + + + + + + + + + + + + public String getName() { return name; } @@ -39,6 +90,7 @@ public void setName(String name) { this.name = name; } + @Override public boolean equals(Object o) { @@ -81,3 +133,6 @@ private String toIndentedString(Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/User.java index 50b50e4551b..db3857ebd5c 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/io/swagger/model/User.java @@ -5,12 +5,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; + + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.*; @ApiModel(description="A User who is purchasing from the pet store") public class User { + private Long id = null; private String username = null; @@ -21,11 +30,32 @@ public class User { private String phone = null; private Integer userStatus = null; + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("id") + + + + + + + + + + + + + + + + + public Long getId() { return id; } @@ -33,11 +63,32 @@ public void setId(Long id) { this.id = id; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("username") + + + + + + + + + + + + + + + + + public String getUsername() { return username; } @@ -45,11 +96,32 @@ public void setUsername(String username) { this.username = username; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("firstName") + + + + + + + + + + + + + + + + + public String getFirstName() { return firstName; } @@ -57,11 +129,32 @@ public void setFirstName(String firstName) { this.firstName = firstName; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("lastName") + + + + + + + + + + + + + + + + + public String getLastName() { return lastName; } @@ -69,11 +162,32 @@ public void setLastName(String lastName) { this.lastName = lastName; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("email") + + + + + + + + + + + + + + + + + public String getEmail() { return email; } @@ -81,11 +195,32 @@ public void setEmail(String email) { this.email = email; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("password") + + + + + + + + + + + + + + + + + public String getPassword() { return password; } @@ -93,11 +228,32 @@ public void setPassword(String password) { this.password = password; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("phone") + + + + + + + + + + + + + + + + + public String getPhone() { return phone; } @@ -105,12 +261,34 @@ public void setPhone(String phone) { this.phone = phone; } + /** + * User Status + + + **/ @ApiModelProperty(value = "User Status") @JsonProperty("userStatus") + + + + + + + + + + + + + + + + + public Integer getUserStatus() { return userStatus; } @@ -118,6 +296,7 @@ public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } + @Override public boolean equals(Object o) { @@ -172,3 +351,6 @@ private String toIndentedString(Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/io/swagger/api/JacksonConfig.java b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/io/swagger/api/JacksonConfig.java index 2cf35d3d1e6..425c5789cd3 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/io/swagger/api/JacksonConfig.java +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/io/swagger/api/JacksonConfig.java @@ -9,8 +9,11 @@ import org.slf4j.LoggerFactory; import com.fasterxml.jackson.databind.ObjectMapper; + + import com.fasterxml.jackson.datatype.joda.JodaModule; + @Provider @Produces(MediaType.APPLICATION_JSON) public class JacksonConfig implements ContextResolver { @@ -22,8 +25,11 @@ public class JacksonConfig implements ContextResolver { public JacksonConfig() throws Exception { this.objectMapper = new ObjectMapper(); + + this.objectMapper.registerModule(new JodaModule()); + // sample to convert any DateTime to readable timestamps //this.objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, true); } diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/io/swagger/api/RestApplication.java b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/io/swagger/api/RestApplication.java index 65184dc2f39..33c4ae2a460 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/io/swagger/api/RestApplication.java +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/io/swagger/api/RestApplication.java @@ -6,20 +6,35 @@ import java.util.Set; import java.util.HashSet; + + + import io.swagger.api.impl.PetApiServiceImpl; + import io.swagger.api.impl.StoreApiServiceImpl; + import io.swagger.api.impl.UserApiServiceImpl; + + @ApplicationPath("/") public class RestApplication extends Application { + public Set> getClasses() { Set> resources = new HashSet>(); + + resources.add(PetApiServiceImpl.class); + resources.add(StoreApiServiceImpl.class); + resources.add(UserApiServiceImpl.class); + + + return resources; } diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java index eb3e35b8280..93481088c92 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java @@ -2,13 +2,12 @@ import io.swagger.api.*; import io.swagger.model.*; -import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput; -import java.io.File; import io.swagger.model.ModelApiResponse; import io.swagger.model.Pet; + import java.util.List; import java.io.InputStream; @@ -17,37 +16,48 @@ import javax.ws.rs.core.SecurityContext; + public class PetApiServiceImpl implements PetApi { - public Response addPet(Pet body,SecurityContext securityContext) { + + public Response addPet(Pet pet,SecurityContext securityContext) { // do some magic! return Response.ok().build(); } - public Response deletePet(Long petId,String apiKey,SecurityContext securityContext) { + + public Response deletePet(Integer petId,String apiKey,SecurityContext securityContext) { // do some magic! return Response.ok().build(); } + public Response findPetsByStatus(List status,SecurityContext securityContext) { // do some magic! return Response.ok().build(); } + public Response findPetsByTags(List tags,SecurityContext securityContext) { // do some magic! return Response.ok().build(); } - public Response getPetById(Long petId,SecurityContext securityContext) { + + public Response getPetById(Integer petId,SecurityContext securityContext) { // do some magic! return Response.ok().build(); } - public Response updatePet(Pet body,SecurityContext securityContext) { + + public Response updatePet(Pet pet,SecurityContext securityContext) { // do some magic! return Response.ok().build(); } - public Response updatePetWithForm(Long petId,String name,String status,SecurityContext securityContext) { + + public Response updatePetWithForm(Integer petId,Object body,SecurityContext securityContext) { // do some magic! return Response.ok().build(); } - public Response uploadFile(MultipartFormDataInput input,Long petId,SecurityContext securityContext) { + + public Response uploadFile(Integer petId,Object body,SecurityContext securityContext) { // do some magic! return Response.ok().build(); } + } + diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java index 1de821ace75..6c16fdcefa6 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java @@ -7,6 +7,7 @@ import java.util.Map; import io.swagger.model.Order; + import java.util.List; import java.io.InputStream; @@ -15,21 +16,28 @@ import javax.ws.rs.core.SecurityContext; + public class StoreApiServiceImpl implements StoreApi { + public Response deleteOrder(String orderId,SecurityContext securityContext) { // do some magic! return Response.ok().build(); } + public Response getInventory(SecurityContext securityContext) { // do some magic! return Response.ok().build(); } - public Response getOrderById(Long orderId,SecurityContext securityContext) { + + public Response getOrderById(Integer orderId,SecurityContext securityContext) { // do some magic! return Response.ok().build(); } - public Response placeOrder(Order body,SecurityContext securityContext) { + + public Response placeOrder(Order order,SecurityContext securityContext) { // do some magic! return Response.ok().build(); } + } + diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java index 67f74c66cb0..893cbc9953f 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java @@ -4,9 +4,9 @@ import io.swagger.model.*; -import java.util.List; import io.swagger.model.User; + import java.util.List; import java.io.InputStream; @@ -15,37 +15,48 @@ import javax.ws.rs.core.SecurityContext; + public class UserApiServiceImpl implements UserApi { - public Response createUser(User body,SecurityContext securityContext) { + + public Response createUser(User user,SecurityContext securityContext) { // do some magic! return Response.ok().build(); } + public Response createUsersWithArrayInput(List body,SecurityContext securityContext) { // do some magic! return Response.ok().build(); } + public Response createUsersWithListInput(List body,SecurityContext securityContext) { // do some magic! return Response.ok().build(); } + public Response deleteUser(String username,SecurityContext securityContext) { // do some magic! return Response.ok().build(); } + public Response getUserByName(String username,SecurityContext securityContext) { // do some magic! return Response.ok().build(); } + public Response loginUser(String username,String password,SecurityContext securityContext) { // do some magic! return Response.ok().build(); } + public Response logoutUser(SecurityContext securityContext) { // do some magic! return Response.ok().build(); } - public Response updateUser(String username,User body,SecurityContext securityContext) { + + public Response updateUser(User user,String username,SecurityContext securityContext) { // do some magic! return Response.ok().build(); } + } + diff --git a/samples/server/petstore/jaxrs-resteasy/eap/.swagger-codegen/VERSION b/samples/server/petstore/jaxrs-resteasy/eap/.swagger-codegen/VERSION index 50794f17f1a..096bf47efe3 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap/.swagger-codegen/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/eap/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.1-SNAPSHOT \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/eap/README.md b/samples/server/petstore/jaxrs-resteasy/eap/README.md index cc011c37ee5..30bfb068a61 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap/README.md +++ b/samples/server/petstore/jaxrs-resteasy/eap/README.md @@ -5,18 +5,14 @@ This server was generated by the [swagger-codegen](https://github.com/swagger-ap [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. +This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework for Jboss Resteasy. -To run the server, please execute the following: - -``` -mvn clean package jetty:run -``` +You can deploy the WAR file to Jboss EAP or any other JEE server supporting Jboss Resteasy. You can then view the swagger listing here: ``` -http://localhost:8080/v2/swagger.json +http://localhost:-1/v2/swagger.json ``` Note that if you have configured the `host` to be something other than localhost, the calls through diff --git a/samples/server/petstore/jaxrs-resteasy/eap/build.gradle b/samples/server/petstore/jaxrs-resteasy/eap/build.gradle index e89fc25bec1..2d83786f7b2 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap/build.gradle +++ b/samples/server/petstore/jaxrs-resteasy/eap/build.gradle @@ -15,9 +15,14 @@ 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' + providedCompile 'javax.validation:validation-api:1.1.0.Final' + + compile 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.6.3' 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/eap/pom.xml b/samples/server/petstore/jaxrs-resteasy/eap/pom.xml index 0fd778a0928..d6544c506e0 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap/pom.xml +++ b/samples/server/petstore/jaxrs-resteasy/eap/pom.xml @@ -138,6 +138,7 @@ + javax.validation @@ -145,6 +146,8 @@ 1.1.0.Final provided + + joda-time joda-time @@ -155,6 +158,8 @@ jackson-datatype-joda 2.6.3 + + @@ -167,7 +172,7 @@ - 1.5.15 + 1.5.18 9.2.9.v20150224 3.0.11.Final 1.6.3 diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/api/PetApi.java b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/api/PetApi.java index fafe4a5b85c..e12a0c7baf5 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/api/PetApi.java @@ -5,10 +5,10 @@ import io.swagger.annotations.ApiParam; import io.swagger.jaxrs.*; -import java.io.File; import io.swagger.model.ModelApiResponse; import io.swagger.model.Pet; + import java.util.List; import java.util.Map; @@ -18,127 +18,102 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; import javax.ws.rs.*; + import javax.validation.constraints.*; -import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput; + @Path("/pet") @io.swagger.annotations.Api(description = "the pet API") + public interface PetApi { + @POST @Consumes({ "application/json", "application/xml" }) - @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Add a new pet to the store", notes = "", response = Void.class, authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + + @io.swagger.annotations.ApiOperation(value = "Add a new pet to the store", notes = "", response = Void.class, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) - public Response addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet body,@Context SecurityContext securityContext); + public Response addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet pet,@Context SecurityContext securityContext); + @DELETE @Path("/{petId}") - @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + + @io.swagger.annotations.ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) - public Response deletePet( @PathParam("petId") Long petId,@ApiParam(value = "" )@HeaderParam("api_key") String apiKey,@Context SecurityContext securityContext); + public Response deletePet( @PathParam("petId") Integer petId,@ApiParam(value = "" )@HeaderParam("api_key") String apiKey,@Context SecurityContext securityContext); + @GET @Path("/findByStatus") @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + @io.swagger.annotations.ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid status value", response = Void.class) }) public Response findPetsByStatus( @NotNull @QueryParam("status") List status,@Context SecurityContext securityContext); + @GET @Path("/findByTags") @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + @io.swagger.annotations.ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid tag value", response = Void.class) }) public Response findPetsByTags( @NotNull @QueryParam("tags") List tags,@Context SecurityContext securityContext); + @GET @Path("/{petId}") @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = { - @io.swagger.annotations.Authorization(value = "api_key") - }, tags={ "pet", }) + @io.swagger.annotations.ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class) }) - public Response getPetById( @PathParam("petId") Long petId,@Context SecurityContext securityContext); + public Response getPetById( @PathParam("petId") Integer petId,@Context SecurityContext securityContext); + @PUT @Consumes({ "application/json", "application/xml" }) - @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + + @io.swagger.annotations.ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class), @io.swagger.annotations.ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) - public Response updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet body,@Context SecurityContext securityContext); + public Response updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet pet,@Context SecurityContext securityContext); + @POST @Path("/{petId}") @Consumes({ "application/x-www-form-urlencoded" }) - @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + + @io.swagger.annotations.ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) - public Response updatePetWithForm( @PathParam("petId") Long petId,@ApiParam(value = "Updated name of the pet")@FormParam("name") String name,@ApiParam(value = "Updated status of the pet")@FormParam("status") String status,@Context SecurityContext securityContext); + public Response updatePetWithForm( @PathParam("petId") Integer petId,@ApiParam(value = "" ) Object body,@Context SecurityContext securityContext); + @POST @Path("/{petId}/uploadImage") @Consumes({ "multipart/form-data" }) @Produces({ "application/json" }) - @io.swagger.annotations.ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + @io.swagger.annotations.ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - public Response uploadFile(MultipartFormDataInput input, @PathParam("petId") Long petId,@Context SecurityContext securityContext); + public Response uploadFile( @PathParam("petId") Integer petId,@ApiParam(value = "" ) Object body,@Context SecurityContext securityContext); + } + diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/api/StoreApi.java b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/api/StoreApi.java index 133e801e900..0535d026b86 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/api/StoreApi.java @@ -8,6 +8,7 @@ import java.util.Map; import io.swagger.model.Order; + import java.util.List; import java.util.Map; @@ -17,35 +18,39 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; import javax.ws.rs.*; + import javax.validation.constraints.*; + @Path("/store") @io.swagger.annotations.Api(description = "the store API") + public interface StoreApi { + @DELETE @Path("/order/{orderId}") - @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = Void.class, tags={ "store", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Void.class) }) public Response deleteOrder( @PathParam("orderId") String orderId,@Context SecurityContext securityContext); + @GET @Path("/inventory") @Produces({ "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { - @io.swagger.annotations.Authorization(value = "api_key") - }, tags={ "store", }) + @io.swagger.annotations.ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", tags={ "store", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) public Response getInventory(@Context SecurityContext securityContext); + @GET @Path("/order/{orderId}") @@ -57,15 +62,18 @@ public interface StoreApi { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Void.class) }) - public Response getOrderById( @Min(1) @Max(5) @PathParam("orderId") Long orderId,@Context SecurityContext securityContext); + public Response getOrderById( @Min(1) @Max(5) @PathParam("orderId") Integer orderId,@Context SecurityContext securityContext); + @POST @Path("/order") - + @Consumes({ "*/*" }) @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid Order", response = Void.class) }) - public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true) Order body,@Context SecurityContext securityContext); + public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true) Order order,@Context SecurityContext securityContext); + } + diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/api/UserApi.java b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/api/UserApi.java index 384aac51777..19f7c4403cd 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/api/UserApi.java @@ -5,9 +5,9 @@ import io.swagger.annotations.ApiParam; import io.swagger.jaxrs.*; -import java.util.List; import io.swagger.model.User; + import java.util.List; import java.util.Map; @@ -17,49 +17,57 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; import javax.ws.rs.*; + import javax.validation.constraints.*; + @Path("/user") @io.swagger.annotations.Api(description = "the user API") + public interface UserApi { + @POST + @Consumes({ "*/*" }) - @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - public Response createUser(@ApiParam(value = "Created user object" ,required=true) User body,@Context SecurityContext securityContext); + public Response createUser(@ApiParam(value = "Created user object" ,required=true) User user,@Context SecurityContext securityContext); + @POST @Path("/createWithArray") + @Consumes({ "*/*" }) - @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true) List body,@Context SecurityContext securityContext); + @POST @Path("/createWithList") + @Consumes({ "*/*" }) - @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true) List body,@Context SecurityContext securityContext); + @DELETE @Path("/{username}") - @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) public Response deleteUser( @PathParam("username") String username,@Context SecurityContext securityContext); + @GET @Path("/{username}") @@ -72,6 +80,7 @@ public interface UserApi { @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) public Response getUserByName( @PathParam("username") String username,@Context SecurityContext securityContext); + @GET @Path("/login") @@ -82,22 +91,26 @@ public interface UserApi { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username/password supplied", response = Void.class) }) public Response loginUser( @NotNull @QueryParam("username") String username, @NotNull @QueryParam("password") String password,@Context SecurityContext securityContext); + @GET @Path("/logout") - @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response logoutUser(@Context SecurityContext securityContext); + @PUT @Path("/{username}") + @Consumes({ "*/*" }) - @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) - public Response updateUser( @PathParam("username") String username,@ApiParam(value = "Updated user object" ,required=true) User body,@Context SecurityContext securityContext); + public Response updateUser(@ApiParam(value = "Updated user object" ,required=true) User user, @PathParam("username") String username,@Context SecurityContext securityContext); + } + diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/Category.java index 833b7c04571..6f9a54651d1 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/Category.java @@ -5,21 +5,51 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; + + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.*; @ApiModel(description="A category for a pet") public class Category { + private Long id = null; private String name = null; + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("id") + + + + + + + + + + + + + + + + + public Long getId() { return id; } @@ -27,11 +57,32 @@ public void setId(Long id) { this.id = id; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("name") + + + + + + + + + + + + + + + + + public String getName() { return name; } @@ -39,6 +90,7 @@ public void setName(String name) { this.name = name; } + @Override public boolean equals(Object o) { @@ -81,3 +133,6 @@ private String toIndentedString(Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/ModelApiResponse.java index 2ec59cd9f20..69f187d63ee 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -5,22 +5,52 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; + + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.*; @ApiModel(description="Describes the result of uploading an image resource") public class ModelApiResponse { + private Integer code = null; private String type = null; private String message = null; + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("code") + + + + + + + + + + + + + + + + + public Integer getCode() { return code; } @@ -28,11 +58,32 @@ public void setCode(Integer code) { this.code = code; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("type") + + + + + + + + + + + + + + + + + public String getType() { return type; } @@ -40,11 +91,32 @@ public void setType(String type) { this.type = type; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("message") + + + + + + + + + + + + + + + + + public String getMessage() { return message; } @@ -52,6 +124,7 @@ public void setMessage(String message) { this.message = message; } + @Override public boolean equals(Object o) { @@ -96,3 +169,6 @@ private String toIndentedString(Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/Order.java index a88a6ca70f6..2f99073be12 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/Order.java @@ -7,12 +7,21 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import java.util.Date; + + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.*; @ApiModel(description="An order for a pets from the pet store") public class Order { + private Long id = null; private Long petId = null; @@ -23,11 +32,20 @@ public class Order { * Order Status */ public enum StatusEnum { + + PLACED("placed"), - APPROVED("approved"), + + + APPROVED("approved"), - DELIVERED("delivered"); + + + DELIVERED("delivered"); + + + private String value; StatusEnum(String value) { @@ -44,11 +62,32 @@ public String toString() { private StatusEnum status = null; private Boolean complete = false; + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("id") + + + + + + + + + + + + + + + + + public Long getId() { return id; } @@ -56,11 +95,32 @@ public void setId(Long id) { this.id = id; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("petId") + + + + + + + + + + + + + + + + + public Long getPetId() { return petId; } @@ -68,11 +128,32 @@ public void setPetId(Long petId) { this.petId = petId; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("quantity") + + + + + + + + + + + + + + + + + public Integer getQuantity() { return quantity; } @@ -80,11 +161,32 @@ public void setQuantity(Integer quantity) { this.quantity = quantity; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("shipDate") + + + + + + + + + + + + + + + + + public Date getShipDate() { return shipDate; } @@ -92,12 +194,34 @@ public void setShipDate(Date shipDate) { this.shipDate = shipDate; } + /** + * Order Status + + + **/ @ApiModelProperty(value = "Order Status") @JsonProperty("status") + + + + + + + + + + + + + + + + + public StatusEnum getStatus() { return status; } @@ -105,18 +229,40 @@ public void setStatus(StatusEnum status) { this.status = status; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("complete") - public Boolean isComplete() { + + + + + + + + + + + + + + + + + + public Boolean isisComplete() { return complete; } public void setComplete(Boolean complete) { this.complete = complete; } + @Override public boolean equals(Object o) { @@ -167,3 +313,6 @@ private String toIndentedString(Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/Pet.java index 0e258641f27..3dc5d283f38 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/Pet.java @@ -9,12 +9,21 @@ import io.swagger.model.Category; import io.swagger.model.Tag; import java.util.List; + + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.*; @ApiModel(description="A pet for sale in the pet store") public class Pet { + private Long id = null; private Category category = null; @@ -26,11 +35,20 @@ public class Pet { * pet status in the store */ public enum StatusEnum { + + AVAILABLE("available"), - PENDING("pending"), + + + PENDING("pending"), - SOLD("sold"); + + + SOLD("sold"); + + + private String value; StatusEnum(String value) { @@ -46,11 +64,32 @@ public String toString() { private StatusEnum status = null; + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("id") + + + + + + + + + + + + + + + + + public Long getId() { return id; } @@ -58,11 +97,32 @@ public void setId(Long id) { this.id = id; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("category") + + + + + + + + + + + + + + + + + public Category getCategory() { return category; } @@ -70,12 +130,34 @@ public void setCategory(Category category) { this.category = category; } + /** + + + **/ @ApiModelProperty(example = "doggie", required = true, value = "") @JsonProperty("name") + @NotNull + + + + + + + + + + + + + + + + + public String getName() { return name; } @@ -83,12 +165,34 @@ public void setName(String name) { this.name = name; } + /** + + + **/ @ApiModelProperty(required = true, value = "") @JsonProperty("photoUrls") + @NotNull + + + + + + + + + + + + + + + + + public List getPhotoUrls() { return photoUrls; } @@ -96,11 +200,32 @@ public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("tags") + + + + + + + + + + + + + + + + + public List getTags() { return tags; } @@ -108,12 +233,34 @@ public void setTags(List tags) { this.tags = tags; } + /** + * pet status in the store + + + **/ @ApiModelProperty(value = "pet status in the store") @JsonProperty("status") + + + + + + + + + + + + + + + + + public StatusEnum getStatus() { return status; } @@ -121,6 +268,7 @@ public void setStatus(StatusEnum status) { this.status = status; } + @Override public boolean equals(Object o) { @@ -171,3 +319,6 @@ private String toIndentedString(Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/Tag.java index 356b2abc3b0..946e64918d5 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/Tag.java @@ -5,21 +5,51 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; + + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.*; @ApiModel(description="A tag for a pet") public class Tag { + private Long id = null; private String name = null; + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("id") + + + + + + + + + + + + + + + + + public Long getId() { return id; } @@ -27,11 +57,32 @@ public void setId(Long id) { this.id = id; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("name") + + + + + + + + + + + + + + + + + public String getName() { return name; } @@ -39,6 +90,7 @@ public void setName(String name) { this.name = name; } + @Override public boolean equals(Object o) { @@ -81,3 +133,6 @@ private String toIndentedString(Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/User.java index 50b50e4551b..db3857ebd5c 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/io/swagger/model/User.java @@ -5,12 +5,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; + + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.*; @ApiModel(description="A User who is purchasing from the pet store") public class User { + private Long id = null; private String username = null; @@ -21,11 +30,32 @@ public class User { private String phone = null; private Integer userStatus = null; + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("id") + + + + + + + + + + + + + + + + + public Long getId() { return id; } @@ -33,11 +63,32 @@ public void setId(Long id) { this.id = id; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("username") + + + + + + + + + + + + + + + + + public String getUsername() { return username; } @@ -45,11 +96,32 @@ public void setUsername(String username) { this.username = username; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("firstName") + + + + + + + + + + + + + + + + + public String getFirstName() { return firstName; } @@ -57,11 +129,32 @@ public void setFirstName(String firstName) { this.firstName = firstName; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("lastName") + + + + + + + + + + + + + + + + + public String getLastName() { return lastName; } @@ -69,11 +162,32 @@ public void setLastName(String lastName) { this.lastName = lastName; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("email") + + + + + + + + + + + + + + + + + public String getEmail() { return email; } @@ -81,11 +195,32 @@ public void setEmail(String email) { this.email = email; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("password") + + + + + + + + + + + + + + + + + public String getPassword() { return password; } @@ -93,11 +228,32 @@ public void setPassword(String password) { this.password = password; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("phone") + + + + + + + + + + + + + + + + + public String getPhone() { return phone; } @@ -105,12 +261,34 @@ public void setPhone(String phone) { this.phone = phone; } + /** + * User Status + + + **/ @ApiModelProperty(value = "User Status") @JsonProperty("userStatus") + + + + + + + + + + + + + + + + + public Integer getUserStatus() { return userStatus; } @@ -118,6 +296,7 @@ public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } + @Override public boolean equals(Object o) { @@ -172,3 +351,6 @@ private String toIndentedString(Object o) { } } + + + diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/io/swagger/api/JacksonConfig.java b/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/io/swagger/api/JacksonConfig.java index 2cf35d3d1e6..425c5789cd3 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/io/swagger/api/JacksonConfig.java +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/io/swagger/api/JacksonConfig.java @@ -9,8 +9,11 @@ import org.slf4j.LoggerFactory; import com.fasterxml.jackson.databind.ObjectMapper; + + import com.fasterxml.jackson.datatype.joda.JodaModule; + @Provider @Produces(MediaType.APPLICATION_JSON) public class JacksonConfig implements ContextResolver { @@ -22,8 +25,11 @@ public class JacksonConfig implements ContextResolver { public JacksonConfig() throws Exception { this.objectMapper = new ObjectMapper(); + + this.objectMapper.registerModule(new JodaModule()); + // sample to convert any DateTime to readable timestamps //this.objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, true); } diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/io/swagger/api/RestApplication.java b/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/io/swagger/api/RestApplication.java index 65184dc2f39..33c4ae2a460 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/io/swagger/api/RestApplication.java +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/io/swagger/api/RestApplication.java @@ -6,20 +6,35 @@ import java.util.Set; import java.util.HashSet; + + + import io.swagger.api.impl.PetApiServiceImpl; + import io.swagger.api.impl.StoreApiServiceImpl; + import io.swagger.api.impl.UserApiServiceImpl; + + @ApplicationPath("/") public class RestApplication extends Application { + public Set> getClasses() { Set> resources = new HashSet>(); + + resources.add(PetApiServiceImpl.class); + resources.add(StoreApiServiceImpl.class); + resources.add(UserApiServiceImpl.class); + + + return resources; } diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java b/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java index eb3e35b8280..93481088c92 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java @@ -2,13 +2,12 @@ import io.swagger.api.*; import io.swagger.model.*; -import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput; -import java.io.File; import io.swagger.model.ModelApiResponse; import io.swagger.model.Pet; + import java.util.List; import java.io.InputStream; @@ -17,37 +16,48 @@ import javax.ws.rs.core.SecurityContext; + public class PetApiServiceImpl implements PetApi { - public Response addPet(Pet body,SecurityContext securityContext) { + + public Response addPet(Pet pet,SecurityContext securityContext) { // do some magic! return Response.ok().build(); } - public Response deletePet(Long petId,String apiKey,SecurityContext securityContext) { + + public Response deletePet(Integer petId,String apiKey,SecurityContext securityContext) { // do some magic! return Response.ok().build(); } + public Response findPetsByStatus(List status,SecurityContext securityContext) { // do some magic! return Response.ok().build(); } + public Response findPetsByTags(List tags,SecurityContext securityContext) { // do some magic! return Response.ok().build(); } - public Response getPetById(Long petId,SecurityContext securityContext) { + + public Response getPetById(Integer petId,SecurityContext securityContext) { // do some magic! return Response.ok().build(); } - public Response updatePet(Pet body,SecurityContext securityContext) { + + public Response updatePet(Pet pet,SecurityContext securityContext) { // do some magic! return Response.ok().build(); } - public Response updatePetWithForm(Long petId,String name,String status,SecurityContext securityContext) { + + public Response updatePetWithForm(Integer petId,Object body,SecurityContext securityContext) { // do some magic! return Response.ok().build(); } - public Response uploadFile(MultipartFormDataInput input,Long petId,SecurityContext securityContext) { + + public Response uploadFile(Integer petId,Object body,SecurityContext securityContext) { // do some magic! return Response.ok().build(); } + } + diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java b/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java index 1de821ace75..6c16fdcefa6 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java @@ -7,6 +7,7 @@ import java.util.Map; import io.swagger.model.Order; + import java.util.List; import java.io.InputStream; @@ -15,21 +16,28 @@ import javax.ws.rs.core.SecurityContext; + public class StoreApiServiceImpl implements StoreApi { + public Response deleteOrder(String orderId,SecurityContext securityContext) { // do some magic! return Response.ok().build(); } + public Response getInventory(SecurityContext securityContext) { // do some magic! return Response.ok().build(); } - public Response getOrderById(Long orderId,SecurityContext securityContext) { + + public Response getOrderById(Integer orderId,SecurityContext securityContext) { // do some magic! return Response.ok().build(); } - public Response placeOrder(Order body,SecurityContext securityContext) { + + public Response placeOrder(Order order,SecurityContext securityContext) { // do some magic! return Response.ok().build(); } + } + diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java index 67f74c66cb0..893cbc9953f 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java @@ -4,9 +4,9 @@ import io.swagger.model.*; -import java.util.List; import io.swagger.model.User; + import java.util.List; import java.io.InputStream; @@ -15,37 +15,48 @@ import javax.ws.rs.core.SecurityContext; + public class UserApiServiceImpl implements UserApi { - public Response createUser(User body,SecurityContext securityContext) { + + public Response createUser(User user,SecurityContext securityContext) { // do some magic! return Response.ok().build(); } + public Response createUsersWithArrayInput(List body,SecurityContext securityContext) { // do some magic! return Response.ok().build(); } + public Response createUsersWithListInput(List body,SecurityContext securityContext) { // do some magic! return Response.ok().build(); } + public Response deleteUser(String username,SecurityContext securityContext) { // do some magic! return Response.ok().build(); } + public Response getUserByName(String username,SecurityContext securityContext) { // do some magic! return Response.ok().build(); } + public Response loginUser(String username,String password,SecurityContext securityContext) { // do some magic! return Response.ok().build(); } + public Response logoutUser(SecurityContext securityContext) { // do some magic! return Response.ok().build(); } - public Response updateUser(String username,User body,SecurityContext securityContext) { + + public Response updateUser(User user,String username,SecurityContext securityContext) { // do some magic! return Response.ok().build(); } + } + diff --git a/samples/server/petstore/jaxrs-resteasy/joda/.swagger-codegen/VERSION b/samples/server/petstore/jaxrs-resteasy/joda/.swagger-codegen/VERSION index 50794f17f1a..096bf47efe3 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/.swagger-codegen/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/joda/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.1-SNAPSHOT \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/joda/README.md b/samples/server/petstore/jaxrs-resteasy/joda/README.md index cc011c37ee5..b38f859d049 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/README.md +++ b/samples/server/petstore/jaxrs-resteasy/joda/README.md @@ -16,7 +16,7 @@ mvn clean package jetty:run You can then view the swagger listing here: ``` -http://localhost:8080/v2/swagger.json +http://localhost:-1/v2/swagger.json ``` Note that if you have configured the `host` to be something other than localhost, the calls through diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build.gradle b/samples/server/petstore/jaxrs-resteasy/joda/build.gradle index d170c7a0ace..33f7797f78c 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/build.gradle +++ b/samples/server/petstore/jaxrs-resteasy/joda/build.gradle @@ -13,11 +13,18 @@ dependencies { 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 'javax:javaee-api:7.0' providedCompile 'org.jboss.spec.javax.servlet:jboss-servlet-api_3.0_spec:1.0.0.Final' compile 'io.swagger:swagger-annotations:1.5.10' compile 'org.jboss.resteasy:resteasy-jackson2-provider:3.0.11.Final' + + providedCompile 'javax.validation:validation-api:1.1.0.Final' + compile 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.4.1' compile 'joda-time:joda-time:2.7' + //TODO: swaggerFeature + compile 'io.swagger:swagger-jaxrs:1.5.12' + testCompile 'junit:junit:4.12', 'org.hamcrest:hamcrest-core:1.3' } diff --git a/samples/server/petstore/jaxrs-resteasy/joda/pom.xml b/samples/server/petstore/jaxrs-resteasy/joda/pom.xml index 86047c8d1a4..fd76af947f2 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/pom.xml +++ b/samples/server/petstore/jaxrs-resteasy/joda/pom.xml @@ -161,6 +161,7 @@ + javax.validation @@ -169,6 +170,7 @@ provided + @@ -180,7 +182,7 @@ - 1.5.15 + 1.5.18 9.2.9.v20150224 3.0.11.Final 1.6.3 diff --git a/samples/server/petstore/jaxrs-resteasy/joda/settings.gradle b/samples/server/petstore/jaxrs-resteasy/joda/settings.gradle index 6392b5011e0..d4513c5f7ff 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/settings.gradle +++ b/samples/server/petstore/jaxrs-resteasy/joda/settings.gradle @@ -1 +1 @@ -rootProject.name = "swagger-jaxrs-resteasy-server" \ No newline at end of file +rootProject.name = "swagger-jaxrs-resteasy-joda-server" \ No newline at end of file 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 index d668c71d237..99a84be948f 100644 --- 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 @@ -6,10 +6,10 @@ import io.swagger.annotations.ApiParam; import io.swagger.jaxrs.*; -import java.io.File; import io.swagger.model.ModelApiResponse; import io.swagger.model.Pet; + import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -22,60 +22,50 @@ import javax.ws.rs.*; import javax.inject.Inject; + import javax.validation.constraints.*; -import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput; + @Path("/pet") @io.swagger.annotations.Api(description = "the pet API") + public class PetApi { @Inject PetApiService service; + @POST @Consumes({ "application/json", "application/xml" }) - @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Add a new pet to the store", notes = "", response = Void.class, authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + + @io.swagger.annotations.ApiOperation(value = "Add a new pet to the store", notes = "", response = Void.class, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) - public Response addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet body,@Context SecurityContext securityContext) + public Response addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet pet,@Context SecurityContext securityContext) throws NotFoundException { - return service.addPet(body,securityContext); + return service.addPet(pet,securityContext); } + @DELETE @Path("/{petId}") - @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + + @io.swagger.annotations.ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) - public Response deletePet( @PathParam("petId") Long petId,@ApiParam(value = "" )@HeaderParam("api_key") String apiKey,@Context SecurityContext securityContext) + public Response deletePet( @PathParam("petId") Integer petId,@ApiParam(value = "" )@HeaderParam("api_key") String apiKey,@Context SecurityContext securityContext) throws NotFoundException { return service.deletePet(petId,apiKey,securityContext); } + @GET @Path("/findByStatus") @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + @io.swagger.annotations.ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @@ -84,16 +74,12 @@ public Response findPetsByStatus( @NotNull @QueryParam("status") List s throws NotFoundException { return service.findPetsByStatus(status,securityContext); } + @GET @Path("/findByTags") @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + @io.swagger.annotations.ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @@ -102,73 +88,62 @@ public Response findPetsByTags( @NotNull @QueryParam("tags") List tags, throws NotFoundException { return service.findPetsByTags(tags,securityContext); } + @GET @Path("/{petId}") @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = { - @io.swagger.annotations.Authorization(value = "api_key") - }, tags={ "pet", }) + @io.swagger.annotations.ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class) }) - public Response getPetById( @PathParam("petId") Long petId,@Context SecurityContext securityContext) + public Response getPetById( @PathParam("petId") Integer petId,@Context SecurityContext securityContext) throws NotFoundException { return service.getPetById(petId,securityContext); } + @PUT @Consumes({ "application/json", "application/xml" }) - @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + + @io.swagger.annotations.ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class), @io.swagger.annotations.ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) - public Response updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet body,@Context SecurityContext securityContext) + public Response updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet pet,@Context SecurityContext securityContext) throws NotFoundException { - return service.updatePet(body,securityContext); + return service.updatePet(pet,securityContext); } + @POST @Path("/{petId}") @Consumes({ "application/x-www-form-urlencoded" }) - @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + + @io.swagger.annotations.ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) - public Response updatePetWithForm( @PathParam("petId") Long petId,@ApiParam(value = "Updated name of the pet")@FormParam("name") String name,@ApiParam(value = "Updated status of the pet")@FormParam("status") String status,@Context SecurityContext securityContext) + public Response updatePetWithForm( @PathParam("petId") Integer petId,@ApiParam(value = "" ) Object body,@Context SecurityContext securityContext) throws NotFoundException { - return service.updatePetWithForm(petId,name,status,securityContext); + return service.updatePetWithForm(petId,body,securityContext); } + @POST @Path("/{petId}/uploadImage") @Consumes({ "multipart/form-data" }) @Produces({ "application/json" }) - @io.swagger.annotations.ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + @io.swagger.annotations.ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - public Response uploadFile(MultipartFormDataInput input, @PathParam("petId") Long petId,@Context SecurityContext securityContext) + public Response uploadFile( @PathParam("petId") Integer petId,@ApiParam(value = "" ) Object body,@Context SecurityContext securityContext) throws NotFoundException { - return service.uploadFile(input,petId,securityContext); + return service.uploadFile(petId,body,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 index 5b44f5d18b9..d738a5e1a11 100644 --- 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 @@ -2,13 +2,12 @@ import io.swagger.api.*; import io.swagger.model.*; -import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput; -import java.io.File; import io.swagger.model.ModelApiResponse; import io.swagger.model.Pet; + import java.util.List; import io.swagger.api.NotFoundException; @@ -18,21 +17,32 @@ import javax.ws.rs.core.SecurityContext; + public interface PetApiService { - Response addPet(Pet body,SecurityContext securityContext) + + Response addPet(Pet pet,SecurityContext securityContext) throws NotFoundException; - Response deletePet(Long petId,String apiKey,SecurityContext securityContext) + + Response deletePet(Integer petId,String apiKey,SecurityContext securityContext) throws NotFoundException; + Response findPetsByStatus(List status,SecurityContext securityContext) throws NotFoundException; + Response findPetsByTags(List tags,SecurityContext securityContext) throws NotFoundException; - Response getPetById(Long petId,SecurityContext securityContext) + + Response getPetById(Integer petId,SecurityContext securityContext) throws NotFoundException; - Response updatePet(Pet body,SecurityContext securityContext) + + Response updatePet(Pet pet,SecurityContext securityContext) throws NotFoundException; - Response updatePetWithForm(Long petId,String name,String status,SecurityContext securityContext) + + Response updatePetWithForm(Integer petId,Object body,SecurityContext securityContext) throws NotFoundException; - Response uploadFile(MultipartFormDataInput input,Long petId,SecurityContext securityContext) + + Response uploadFile(Integer petId,Object body,SecurityContext securityContext) throws NotFoundException; + } + 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 index 6b3a6cc3a07..de9b83c28bb 100644 --- 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 @@ -9,6 +9,7 @@ import java.util.Map; import io.swagger.model.Order; + import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -21,21 +22,25 @@ import javax.ws.rs.*; import javax.inject.Inject; + import javax.validation.constraints.*; + @Path("/store") @io.swagger.annotations.Api(description = "the store API") + public class StoreApi { @Inject StoreApiService service; + @DELETE @Path("/order/{orderId}") - @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = Void.class, tags={ "store", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @@ -45,19 +50,19 @@ public Response deleteOrder( @PathParam("orderId") String orderId,@Context Secur throws NotFoundException { return service.deleteOrder(orderId,securityContext); } + @GET @Path("/inventory") @Produces({ "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { - @io.swagger.annotations.Authorization(value = "api_key") - }, tags={ "store", }) + @io.swagger.annotations.ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", tags={ "store", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) public Response getInventory(@Context SecurityContext securityContext) throws NotFoundException { return service.getInventory(securityContext); } + @GET @Path("/order/{orderId}") @@ -69,21 +74,24 @@ public Response getInventory(@Context SecurityContext securityContext) @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Void.class) }) - public Response getOrderById( @Min(1) @Max(5) @PathParam("orderId") Long orderId,@Context SecurityContext securityContext) + public Response getOrderById( @DecimalMin("1") @DecimalMax("5") @PathParam("orderId") Integer orderId,@Context SecurityContext securityContext) throws NotFoundException { return service.getOrderById(orderId,securityContext); } + @POST @Path("/order") - + @Consumes({ "*/*" }) @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid Order", response = Void.class) }) - public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true) Order body,@Context SecurityContext securityContext) + public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true) Order order,@Context SecurityContext securityContext) throws NotFoundException { - return service.placeOrder(body,securityContext); + return service.placeOrder(order,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 index 46958ea45c4..de964599520 100644 --- 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 @@ -7,6 +7,7 @@ import java.util.Map; import io.swagger.model.Order; + import java.util.List; import io.swagger.api.NotFoundException; @@ -16,13 +17,20 @@ import javax.ws.rs.core.SecurityContext; + public interface StoreApiService { + Response deleteOrder(String orderId,SecurityContext securityContext) throws NotFoundException; + Response getInventory(SecurityContext securityContext) throws NotFoundException; - Response getOrderById(Long orderId,SecurityContext securityContext) + + Response getOrderById(Integer orderId,SecurityContext securityContext) throws NotFoundException; - Response placeOrder(Order body,SecurityContext securityContext) + + Response placeOrder(Order order,SecurityContext securityContext) throws NotFoundException; + } + 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 index 30d8e9bae59..179c0626973 100644 --- 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 @@ -6,9 +6,9 @@ import io.swagger.annotations.ApiParam; import io.swagger.jaxrs.*; -import java.util.List; import io.swagger.model.User; + import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -21,32 +21,37 @@ import javax.ws.rs.*; import javax.inject.Inject; + import javax.validation.constraints.*; + @Path("/user") @io.swagger.annotations.Api(description = "the user API") + public class UserApi { @Inject UserApiService service; + @POST + @Consumes({ "*/*" }) - @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - public Response createUser(@ApiParam(value = "Created user object" ,required=true) User body,@Context SecurityContext securityContext) + public Response createUser(@ApiParam(value = "Created user object" ,required=true) User user,@Context SecurityContext securityContext) throws NotFoundException { - return service.createUser(body,securityContext); + return service.createUser(user,securityContext); } + @POST @Path("/createWithArray") + @Consumes({ "*/*" }) - @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) @@ -54,10 +59,11 @@ public Response createUsersWithArrayInput(@ApiParam(value = "List of user object throws NotFoundException { return service.createUsersWithArrayInput(body,securityContext); } + @POST @Path("/createWithList") + @Consumes({ "*/*" }) - @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) @@ -65,10 +71,11 @@ public Response createUsersWithListInput(@ApiParam(value = "List of user object" throws NotFoundException { return service.createUsersWithListInput(body,securityContext); } + @DELETE @Path("/{username}") - @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), @@ -78,6 +85,7 @@ public Response deleteUser( @PathParam("username") String username,@Context Secu throws NotFoundException { return service.deleteUser(username,securityContext); } + @GET @Path("/{username}") @@ -93,6 +101,7 @@ public Response getUserByName( @PathParam("username") String username,@Context S throws NotFoundException { return service.getUserByName(username,securityContext); } + @GET @Path("/login") @@ -106,10 +115,11 @@ public Response loginUser( @NotNull @QueryParam("username") String username, @N throws NotFoundException { return service.loginUser(username,password,securityContext); } + @GET @Path("/logout") - @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) @@ -117,17 +127,20 @@ public Response logoutUser(@Context SecurityContext securityContext) throws NotFoundException { return service.logoutUser(securityContext); } + @PUT @Path("/{username}") + @Consumes({ "*/*" }) - @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) - public Response updateUser( @PathParam("username") String username,@ApiParam(value = "Updated user object" ,required=true) User body,@Context SecurityContext securityContext) + public Response updateUser(@ApiParam(value = "Updated user object" ,required=true) User user, @PathParam("username") String username,@Context SecurityContext securityContext) throws NotFoundException { - return service.updateUser(username,body,securityContext); + return service.updateUser(user,username,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 index 54f5d5c105f..f5068f387d2 100644 --- 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 @@ -4,9 +4,9 @@ import io.swagger.model.*; -import java.util.List; import io.swagger.model.User; + import java.util.List; import io.swagger.api.NotFoundException; @@ -16,21 +16,32 @@ import javax.ws.rs.core.SecurityContext; + public interface UserApiService { - Response createUser(User body,SecurityContext securityContext) + + Response createUser(User user,SecurityContext securityContext) throws NotFoundException; + Response createUsersWithArrayInput(List body,SecurityContext securityContext) throws NotFoundException; + Response createUsersWithListInput(List body,SecurityContext securityContext) throws NotFoundException; + Response deleteUser(String username,SecurityContext securityContext) throws NotFoundException; + Response getUserByName(String username,SecurityContext securityContext) throws NotFoundException; + Response loginUser(String username,String password,SecurityContext securityContext) throws NotFoundException; + Response logoutUser(SecurityContext securityContext) throws NotFoundException; - Response updateUser(String username,User body,SecurityContext securityContext) + + Response updateUser(User user,String username,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 index 85fdecdc662..6458c75a81b 100644 --- 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 @@ -5,21 +5,35 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; + + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.*; @ApiModel(description="A category for a pet") public class Category { + private Long id = null; private String name = null; + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("id") + public Long getId() { return id; } @@ -27,11 +41,16 @@ public void setId(Long id) { this.id = id; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("name") + public String getName() { return name; } @@ -39,6 +58,7 @@ public void setName(String name) { this.name = name; } + @Override public boolean equals(java.lang.Object o) { @@ -81,3 +101,6 @@ private String toIndentedString(java.lang.Object o) { } } + + + 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 index 9a9ff0db8cd..0e5fb3475db 100644 --- 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 @@ -5,22 +5,36 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; + + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.*; @ApiModel(description="Describes the result of uploading an image resource") public class ModelApiResponse { + private Integer code = null; private String type = null; private String message = null; + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("code") + public Integer getCode() { return code; } @@ -28,11 +42,16 @@ public void setCode(Integer code) { this.code = code; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("type") + public String getType() { return type; } @@ -40,11 +59,16 @@ public void setType(String type) { this.type = type; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("message") + public String getMessage() { return message; } @@ -52,6 +76,7 @@ public void setMessage(String message) { this.message = message; } + @Override public boolean equals(java.lang.Object o) { @@ -96,3 +121,6 @@ private String toIndentedString(java.lang.Object o) { } } + + + 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 index cfdf85d655d..77fcd282698 100644 --- 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 @@ -7,12 +7,21 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import org.joda.time.DateTime; + + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.*; @ApiModel(description="An order for a pets from the pet store") public class Order { + private Long id = null; private Long petId = null; @@ -23,11 +32,20 @@ public class Order { * Order Status */ public enum StatusEnum { + + PLACED("placed"), - APPROVED("approved"), + + + APPROVED("approved"), - DELIVERED("delivered"); + + + DELIVERED("delivered"); + + + private String value; StatusEnum(String value) { @@ -44,11 +62,16 @@ public String toString() { private StatusEnum status = null; private Boolean complete = false; + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("id") + public Long getId() { return id; } @@ -56,11 +79,16 @@ public void setId(Long id) { this.id = id; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("petId") + public Long getPetId() { return petId; } @@ -68,11 +96,16 @@ public void setPetId(Long petId) { this.petId = petId; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("quantity") + public Integer getQuantity() { return quantity; } @@ -80,11 +113,16 @@ public void setQuantity(Integer quantity) { this.quantity = quantity; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("shipDate") + public DateTime getShipDate() { return shipDate; } @@ -92,12 +130,18 @@ public void setShipDate(DateTime shipDate) { this.shipDate = shipDate; } + /** + * Order Status + + + **/ @ApiModelProperty(value = "Order Status") @JsonProperty("status") + public StatusEnum getStatus() { return status; } @@ -105,18 +149,24 @@ public void setStatus(StatusEnum status) { this.status = status; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("complete") - public Boolean isComplete() { + + public Boolean isisComplete() { return complete; } public void setComplete(Boolean complete) { this.complete = complete; } + @Override public boolean equals(java.lang.Object o) { @@ -167,3 +217,6 @@ private String toIndentedString(java.lang.Object o) { } } + + + 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 index 4e48fb253b1..a6bf78bd1f7 100644 --- 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 @@ -9,12 +9,21 @@ import io.swagger.model.Category; import io.swagger.model.Tag; import java.util.List; + + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.*; @ApiModel(description="A pet for sale in the pet store") public class Pet { + private Long id = null; private Category category = null; @@ -26,11 +35,20 @@ public class Pet { * pet status in the store */ public enum StatusEnum { + + AVAILABLE("available"), - PENDING("pending"), + + + PENDING("pending"), - SOLD("sold"); + + + SOLD("sold"); + + + private String value; StatusEnum(String value) { @@ -46,11 +64,16 @@ public String toString() { private StatusEnum status = null; + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("id") + public Long getId() { return id; } @@ -58,11 +81,16 @@ public void setId(Long id) { this.id = id; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("category") + public Category getCategory() { return category; } @@ -70,12 +98,18 @@ public void setCategory(Category category) { this.category = category; } + /** + + + **/ @ApiModelProperty(example = "doggie", required = true, value = "") @JsonProperty("name") + @NotNull + public String getName() { return name; } @@ -83,12 +117,18 @@ public void setName(String name) { this.name = name; } + /** + + + **/ @ApiModelProperty(required = true, value = "") @JsonProperty("photoUrls") + @NotNull + public List getPhotoUrls() { return photoUrls; } @@ -96,11 +136,16 @@ public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("tags") + public List getTags() { return tags; } @@ -108,12 +153,18 @@ public void setTags(List tags) { this.tags = tags; } + /** + * pet status in the store + + + **/ @ApiModelProperty(value = "pet status in the store") @JsonProperty("status") + public StatusEnum getStatus() { return status; } @@ -121,6 +172,7 @@ public void setStatus(StatusEnum status) { this.status = status; } + @Override public boolean equals(java.lang.Object o) { @@ -171,3 +223,6 @@ private String toIndentedString(java.lang.Object o) { } } + + + 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 index 750e1a82b1e..8799d74474f 100644 --- 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 @@ -5,21 +5,35 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; + + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.*; @ApiModel(description="A tag for a pet") public class Tag { + private Long id = null; private String name = null; + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("id") + public Long getId() { return id; } @@ -27,11 +41,16 @@ public void setId(Long id) { this.id = id; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("name") + public String getName() { return name; } @@ -39,6 +58,7 @@ public void setName(String name) { this.name = name; } + @Override public boolean equals(java.lang.Object o) { @@ -81,3 +101,6 @@ private String toIndentedString(java.lang.Object o) { } } + + + 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 index a52524db22a..c3ef44a581a 100644 --- 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 @@ -5,12 +5,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; + + + import javax.validation.constraints.*; + + + + + import io.swagger.annotations.*; @ApiModel(description="A User who is purchasing from the pet store") public class User { + private Long id = null; private String username = null; @@ -21,11 +30,16 @@ public class User { private String phone = null; private Integer userStatus = null; + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("id") + public Long getId() { return id; } @@ -33,11 +47,16 @@ public void setId(Long id) { this.id = id; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("username") + public String getUsername() { return username; } @@ -45,11 +64,16 @@ public void setUsername(String username) { this.username = username; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("firstName") + public String getFirstName() { return firstName; } @@ -57,11 +81,16 @@ public void setFirstName(String firstName) { this.firstName = firstName; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("lastName") + public String getLastName() { return lastName; } @@ -69,11 +98,16 @@ public void setLastName(String lastName) { this.lastName = lastName; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("email") + public String getEmail() { return email; } @@ -81,11 +115,16 @@ public void setEmail(String email) { this.email = email; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("password") + public String getPassword() { return password; } @@ -93,11 +132,16 @@ public void setPassword(String password) { this.password = password; } + /** + + + **/ @ApiModelProperty(value = "") @JsonProperty("phone") + public String getPhone() { return phone; } @@ -105,12 +149,18 @@ public void setPhone(String phone) { this.phone = phone; } + /** + * User Status + + + **/ @ApiModelProperty(value = "User Status") @JsonProperty("userStatus") + public Integer getUserStatus() { return userStatus; } @@ -118,6 +168,7 @@ public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } + @Override public boolean equals(java.lang.Object o) { @@ -172,3 +223,6 @@ private String toIndentedString(java.lang.Object o) { } } + + + 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 deleted file mode 100644 index 54ae4b48435..00000000000 --- a/samples/server/petstore/jaxrs-resteasy/joda/src/main/java/io/swagger/api/factories/PetApiServiceFactory.java +++ /dev/null @@ -1,15 +0,0 @@ -package io.swagger.api.factories; - -import io.swagger.api.PetApiService; -import io.swagger.api.impl.PetApiServiceImpl; - - -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 deleted file mode 100644 index 79a403fee06..00000000000 --- a/samples/server/petstore/jaxrs-resteasy/joda/src/main/java/io/swagger/api/factories/StoreApiServiceFactory.java +++ /dev/null @@ -1,15 +0,0 @@ -package io.swagger.api.factories; - -import io.swagger.api.StoreApiService; -import io.swagger.api.impl.StoreApiServiceImpl; - - -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 deleted file mode 100644 index 2f1ae542f1b..00000000000 --- a/samples/server/petstore/jaxrs-resteasy/joda/src/main/java/io/swagger/api/factories/UserApiServiceFactory.java +++ /dev/null @@ -1,15 +0,0 @@ -package io.swagger.api.factories; - -import io.swagger.api.UserApiService; -import io.swagger.api.impl.UserApiServiceImpl; - - -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 index d8f13b40060..616bd0a25dc 100644 --- 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 @@ -2,13 +2,12 @@ import io.swagger.api.*; import io.swagger.model.*; -import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput; -import java.io.File; import io.swagger.model.ModelApiResponse; import io.swagger.model.Pet; + import java.util.List; import io.swagger.api.NotFoundException; @@ -20,45 +19,56 @@ @RequestScoped + public class PetApiServiceImpl implements PetApiService { - public Response addPet(Pet body,SecurityContext securityContext) + + public Response addPet(Pet pet,SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } - public Response deletePet(Long petId,String apiKey,SecurityContext securityContext) + + public Response deletePet(Integer petId,String apiKey,SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + public Response findPetsByStatus(List status,SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + public Response findPetsByTags(List tags,SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } - public Response getPetById(Long petId,SecurityContext securityContext) + + public Response getPetById(Integer petId,SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } - public Response updatePet(Pet body,SecurityContext securityContext) + + public Response updatePet(Pet pet,SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } - public Response updatePetWithForm(Long petId,String name,String status,SecurityContext securityContext) + + public Response updatePetWithForm(Integer petId,Object body,SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } - public Response uploadFile(MultipartFormDataInput input,Long petId,SecurityContext securityContext) + + public Response uploadFile(Integer petId,Object 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/StoreApiServiceImpl.java b/samples/server/petstore/jaxrs-resteasy/joda/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java index edbf993ef74..852ca3e6ec5 100644 --- 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 @@ -7,6 +7,7 @@ import java.util.Map; import io.swagger.model.Order; + import java.util.List; import io.swagger.api.NotFoundException; @@ -18,25 +19,32 @@ @RequestScoped + public class StoreApiServiceImpl implements StoreApiService { + public Response deleteOrder(String orderId,SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + public Response getInventory(SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } - public Response getOrderById(Long orderId,SecurityContext securityContext) + + public Response getOrderById(Integer orderId,SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } - public Response placeOrder(Order body,SecurityContext securityContext) + + public Response placeOrder(Order order,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 index a0d5982520a..0ae2e9ac794 100644 --- 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 @@ -4,9 +4,9 @@ import io.swagger.model.*; -import java.util.List; import io.swagger.model.User; + import java.util.List; import io.swagger.api.NotFoundException; @@ -18,45 +18,56 @@ @RequestScoped + public class UserApiServiceImpl implements UserApiService { - public Response createUser(User body,SecurityContext securityContext) + + public Response createUser(User user,SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + public Response createUsersWithArrayInput(List body,SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + public Response createUsersWithListInput(List body,SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + public Response deleteUser(String username,SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + public Response getUserByName(String username,SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + public Response loginUser(String username,String password,SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + public Response logoutUser(SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } - public Response updateUser(String username,User body,SecurityContext securityContext) + + public Response updateUser(User user,String username,SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + } + diff --git a/samples/server/petstore/jaxrs-spec-interface/.swagger-codegen/VERSION b/samples/server/petstore/jaxrs-spec-interface/.swagger-codegen/VERSION index 50794f17f1a..096bf47efe3 100644 --- a/samples/server/petstore/jaxrs-spec-interface/.swagger-codegen/VERSION +++ b/samples/server/petstore/jaxrs-spec-interface/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.1-SNAPSHOT \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-spec-interface/pom.xml b/samples/server/petstore/jaxrs-spec-interface/pom.xml index a32dafce9ee..2c8eb99737b 100644 --- a/samples/server/petstore/jaxrs-spec-interface/pom.xml +++ b/samples/server/petstore/jaxrs-spec-interface/pom.xml @@ -34,6 +34,7 @@ ${junit-version} test + javax.validation @@ -41,6 +42,7 @@ 1.1.0.Final provided + 4.8.1 diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/AnotherFakeApi.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/AnotherFakeApi.java index 9cf02d621bc..01ca905a4ec 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/AnotherFakeApi.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/AnotherFakeApi.java @@ -2,6 +2,7 @@ import io.swagger.model.Client; + import javax.ws.rs.*; import javax.ws.rs.core.Response; @@ -14,14 +15,17 @@ @Path("/another-fake") @Api(description = "the another-fake API") + +@javax.annotation.Generated(value = "io.swagger.codegen.languages.java.JavaJAXRSSpecServerCodegen", date = "2018-03-15T06:28:22.549+01:00[Europe/Zurich]") public interface AnotherFakeApi { + + @PATCH @Path("/dummy") - @Consumes({ "application/json" }) - @Produces({ "application/json" }) @ApiOperation(value = "To test special tags", notes = "To test special tags", tags={ "$another-fake?" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - Client testSpecialTags(@Valid Client body) throws Exception; + Client testSpecialTags(@Valid Client client); + } diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/FakeApi.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/FakeApi.java index 1c9903022bd..0283d0a420e 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/FakeApi.java @@ -2,10 +2,9 @@ import java.math.BigDecimal; import io.swagger.model.Client; -import java.util.Date; -import org.joda.time.LocalDate; import io.swagger.model.OuterComposite; + import javax.ws.rs.*; import javax.ws.rs.core.Response; @@ -18,77 +17,80 @@ @Path("/fake") @Api(description = "the fake API") + +@javax.annotation.Generated(value = "io.swagger.codegen.languages.java.JavaJAXRSSpecServerCodegen", date = "2018-03-15T06:28:22.549+01:00[Europe/Zurich]") public interface FakeApi { + + @POST @Path("/outer/boolean") - @ApiOperation(value = "", notes = "Test serialization of outer boolean types", tags={ "fake", }) + @ApiOperation(value = "", notes = "Test serialization of outer boolean types", tags={ "fake" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) - Boolean fakeOuterBooleanSerialize(@Valid Boolean body) throws Exception; + Boolean fakeOuterBooleanSerialize(@Valid Boolean body); + @POST @Path("/outer/composite") - @ApiOperation(value = "", notes = "Test serialization of object with outer number type", tags={ "fake", }) + @ApiOperation(value = "", notes = "Test serialization of object with outer number type", tags={ "fake" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) - OuterComposite fakeOuterCompositeSerialize(@Valid OuterComposite body) throws Exception; + OuterComposite fakeOuterCompositeSerialize(@Valid OuterComposite outercomposite); + @POST @Path("/outer/number") - @ApiOperation(value = "", notes = "Test serialization of outer number types", tags={ "fake", }) + @ApiOperation(value = "", notes = "Test serialization of outer number types", tags={ "fake" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) - BigDecimal fakeOuterNumberSerialize(@Valid BigDecimal body) throws Exception; + BigDecimal fakeOuterNumberSerialize(@Valid BigDecimal body); + @POST @Path("/outer/string") - @ApiOperation(value = "", notes = "Test serialization of outer string types", tags={ "fake", }) + @ApiOperation(value = "", notes = "Test serialization of outer string types", tags={ "fake" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output string", response = String.class) }) - String fakeOuterStringSerialize(@Valid String body) throws Exception; + String fakeOuterStringSerialize(@Valid String body); + @PATCH - @Consumes({ "application/json" }) - @Produces({ "application/json" }) - @ApiOperation(value = "To test \"client\" model", notes = "To test \"client\" model", tags={ "fake", }) + @ApiOperation(value = "To test \"client\" model", notes = "To test \"client\" model", tags={ "fake" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - Client testClientModel(@Valid Client body) throws Exception; + Client testClientModel(@Valid Client client); + @POST - @Consumes({ "application/xml; charset=utf-8", "application/json; charset=utf-8" }) - @Produces({ "application/xml; charset=utf-8", "application/json; charset=utf-8" }) - @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", authorizations = { - @Authorization(value = "http_basic_test") - }, tags={ "fake", }) + @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", tags={ "fake" }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) - void testEndpointParameters(@FormParam(value = "number") BigDecimal number,@FormParam(value = "double") Double _double,@FormParam(value = "pattern_without_delimiter") String patternWithoutDelimiter,@FormParam(value = "byte") byte[] _byte,@FormParam(value = "integer") Integer integer,@FormParam(value = "int32") Integer int32,@FormParam(value = "int64") Long int64,@FormParam(value = "float") Float _float,@FormParam(value = "string") String string,@FormParam(value = "binary") byte[] binary,@FormParam(value = "date") LocalDate date,@FormParam(value = "dateTime") Date dateTime,@FormParam(value = "password") String password,@FormParam(value = "callback") String paramCallback) throws Exception; + void testEndpointParameters(@Valid Object body); + @GET - @Consumes({ "*/*" }) - @Produces({ "*/*" }) - @ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", tags={ "fake", }) + @ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", tags={ "fake" }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request", response = Void.class), @ApiResponse(code = 404, message = "Not found", response = Void.class) }) - void testEnumParameters(@FormParam(value = "enum_form_string_array") List enumFormStringArray,@FormParam(value = "enum_form_string") String enumFormString,@HeaderParam("enum_header_string_array") @ApiParam("Header parameter enum test (string array)") List enumHeaderStringArray,@HeaderParam("enum_header_string") @DefaultValue("-efg") @ApiParam("Header parameter enum test (string)") String enumHeaderString,@QueryParam("enum_query_string_array") @ApiParam("Query parameter enum test (string array)") List enumQueryStringArray,@QueryParam("enum_query_string") @DefaultValue("-efg") @ApiParam("Query parameter enum test (string)") String enumQueryString,@QueryParam("enum_query_integer") @ApiParam("Query parameter enum test (double)") Integer enumQueryInteger,@FormParam(value = "enum_query_double") Double enumQueryDouble) throws Exception; + void testEnumParameters(@Valid Object body,@HeaderParam("enum_header_string_array") @ApiParam("Header parameter enum test (string array)") List enumHeaderStringArray,@HeaderParam("enum_header_string") @ApiParam("Header parameter enum test (string)") String enumHeaderString,@QueryParam("enum_query_string_array") @ApiParam("Query parameter enum test (string array)") List enumQueryStringArray,@QueryParam("enum_query_string") @ApiParam("Query parameter enum test (string)") String enumQueryString,@QueryParam("enum_query_integer") @ApiParam("Query parameter enum test (double)") Integer enumQueryInteger); + @POST @Path("/inline-additionalProperties") - @Consumes({ "application/json" }) - @ApiOperation(value = "test inline additionalProperties", notes = "", tags={ "fake", }) + @ApiOperation(value = "test inline additionalProperties", notes = "", tags={ "fake" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - void testInlineAdditionalProperties(@Valid Object param) throws Exception; + void testInlineAdditionalProperties(@Valid Map body); + @GET @Path("/jsonFormData") - @Consumes({ "application/json" }) @ApiOperation(value = "test json serialization of form data", notes = "", tags={ "fake" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - void testJsonFormData(@FormParam(value = "param") String param,@FormParam(value = "param2") String param2) throws Exception; + void testJsonFormData(@Valid Object body); + } diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/FakeClassnameTestApi.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/FakeClassnameTestApi.java index 7a1df7ea2e2..e917de4e620 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/FakeClassnameTestApi.java @@ -2,6 +2,7 @@ import io.swagger.model.Client; + import javax.ws.rs.*; import javax.ws.rs.core.Response; @@ -14,15 +15,16 @@ @Path("/fake_classname_test") @Api(description = "the fake_classname_test API") + +@javax.annotation.Generated(value = "io.swagger.codegen.languages.java.JavaJAXRSSpecServerCodegen", date = "2018-03-15T06:28:22.549+01:00[Europe/Zurich]") public interface FakeClassnameTestApi { + + @PATCH - @Consumes({ "application/json" }) - @Produces({ "application/json" }) - @ApiOperation(value = "To test class name in snake case", notes = "", authorizations = { - @Authorization(value = "api_key_query") - }, tags={ "fake_classname_tags 123#$%^" }) + @ApiOperation(value = "To test class name in snake case", notes = "", tags={ "fake_classname_tags 123#$%^" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - Client testClassname(@Valid Client body) throws Exception; + Client testClassname(@Valid Client client); + } diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/PetApi.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/PetApi.java index 271d68edbdc..5817cd5f5df 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/PetApi.java @@ -1,9 +1,9 @@ package io.swagger.api; -import java.io.File; import io.swagger.model.ModelApiResponse; import io.swagger.model.Pet; + import javax.ws.rs.*; import javax.ws.rs.core.Response; @@ -16,115 +16,77 @@ @Path("/pet") @Api(description = "the pet API") + +@javax.annotation.Generated(value = "io.swagger.codegen.languages.java.JavaJAXRSSpecServerCodegen", date = "2018-03-15T06:28:22.549+01:00[Europe/Zurich]") public interface PetApi { + + @POST - @Consumes({ "application/json", "application/xml" }) - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Add a new pet to the store", notes = "", authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + @ApiOperation(value = "Add a new pet to the store", notes = "", tags={ "pet" }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) - void addPet(@Valid Pet body) throws Exception; + void addPet(@Valid Pet pet); + @DELETE @Path("/{petId}") - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Deletes a pet", notes = "", authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + @ApiOperation(value = "Deletes a pet", notes = "", tags={ "pet" }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) - void deletePet(@PathParam("petId") @ApiParam("Pet id to delete") Long petId,@HeaderParam("api_key") String apiKey) throws Exception; + void deletePet(@PathParam("petId") @ApiParam("Pet id to delete") Integer petId,@HeaderParam("api_key") String apiKey); + @GET @Path("/findByStatus") - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + @ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", tags={ "pet" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid status value", response = Void.class, responseContainer = "List") }) - List findPetsByStatus(@QueryParam("status") @NotNull @ApiParam("Status values that need to be considered for filter") List status) throws Exception; + List findPetsByStatus(@QueryParam("status") @NotNull @ApiParam("Status values that need to be considered for filter") List status); + @GET @Path("/findByTags") - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + @ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", tags={ "pet" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid tag value", response = Void.class, responseContainer = "List") }) - List findPetsByTags(@QueryParam("tags") @NotNull @ApiParam("Tags to filter by") List tags) throws Exception; + List findPetsByTags(@QueryParam("tags") @NotNull @ApiParam("Tags to filter by") List tags); + @GET @Path("/{petId}") - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", authorizations = { - @Authorization(value = "api_key") - }, tags={ "pet", }) + @ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", tags={ "pet" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Pet not found", response = Void.class) }) - Pet getPetById(@PathParam("petId") @ApiParam("ID of pet to return") Long petId) throws Exception; + Pet getPetById(@PathParam("petId") @ApiParam("ID of pet to return") Integer petId); + @PUT - @Consumes({ "application/json", "application/xml" }) - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Update an existing pet", notes = "", authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + @ApiOperation(value = "Update an existing pet", notes = "", tags={ "pet" }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Pet not found", response = Void.class), @ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) - void updatePet(@Valid Pet body) throws Exception; + void updatePet(@Valid Pet pet); + @POST @Path("/{petId}") - @Consumes({ "application/x-www-form-urlencoded" }) - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Updates a pet in the store with form data", notes = "", authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + @ApiOperation(value = "Updates a pet in the store with form data", notes = "", tags={ "pet" }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) - void updatePetWithForm(@PathParam("petId") @ApiParam("ID of pet that needs to be updated") Long petId,@FormParam(value = "name") String name,@FormParam(value = "status") String status) throws Exception; + void updatePetWithForm(@PathParam("petId") @ApiParam("ID of pet that needs to be updated") Integer petId,@Valid Object body); + @POST @Path("/{petId}/uploadImage") - @Consumes({ "multipart/form-data" }) - @Produces({ "application/json" }) - @ApiOperation(value = "uploads an image", notes = "", authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet" }) + @ApiOperation(value = "uploads an image", notes = "", tags={ "pet" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - ModelApiResponse uploadFile(@PathParam("petId") @ApiParam("ID of pet to update") Long petId,@FormParam(value = "additionalMetadata") String additionalMetadata, @FormParam(value = "file") InputStream fileInputStream, - @FormParam(value = "file") Attachment fileDetail) throws Exception; + ModelApiResponse uploadFile(@PathParam("petId") @ApiParam("ID of pet to update") Integer petId,@Valid Object body); + } diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/RestApplication.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/RestApplication.java deleted file mode 100644 index 2561172aea9..00000000000 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/RestApplication.java +++ /dev/null @@ -1,9 +0,0 @@ -package io.swagger.api; - -import javax.ws.rs.ApplicationPath; -import javax.ws.rs.core.Application; - -@ApplicationPath("/") -public class RestApplication extends Application { - -} diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/StoreApi.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/StoreApi.java index 194e30dd955..5b25815fda5 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/StoreApi.java @@ -3,6 +3,7 @@ import java.util.Map; import io.swagger.model.Order; + import javax.ws.rs.*; import javax.ws.rs.core.Response; @@ -15,43 +16,45 @@ @Path("/store") @Api(description = "the store API") + +@javax.annotation.Generated(value = "io.swagger.codegen.languages.java.JavaJAXRSSpecServerCodegen", date = "2018-03-15T06:28:22.549+01:00[Europe/Zurich]") public interface StoreApi { + + @DELETE @Path("/order/{order_id}") - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", tags={ "store", }) + @ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", tags={ "store" }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Order not found", response = Void.class) }) - void deleteOrder(@PathParam("order_id") @ApiParam("ID of the order that needs to be deleted") String orderId) throws Exception; + void deleteOrder(@PathParam("order_id") @ApiParam("ID of the order that needs to be deleted") String orderId); + @GET @Path("/inventory") - @Produces({ "application/json" }) - @ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", authorizations = { - @Authorization(value = "api_key") - }, tags={ "store", }) + @ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", tags={ "store" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) - Map getInventory() throws Exception; + Map getInventory(); + @GET @Path("/order/{order_id}") - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Find purchase order by ID", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", tags={ "store", }) + @ApiOperation(value = "Find purchase order by ID", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", tags={ "store" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Order not found", response = Void.class) }) - Order getOrderById(@PathParam("order_id") @Min(1) @Max(5) @ApiParam("ID of pet that needs to be fetched") Long orderId) throws Exception; + Order getOrderById(@PathParam("order_id") @DecimalMin("1") @DecimalMax("5") @ApiParam("ID of pet that needs to be fetched") Integer orderId); + @POST @Path("/order") - @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Place an order for a pet", notes = "", tags={ "store" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order", response = Void.class) }) - Order placeOrder(@Valid Order body) throws Exception; + Order placeOrder(@Valid Order order); + } diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/UserApi.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/UserApi.java index 0619dbc57cd..8e2e182535e 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/UserApi.java @@ -1,8 +1,8 @@ package io.swagger.api; -import java.util.List; import io.swagger.model.User; + import javax.ws.rs.*; import javax.ws.rs.core.Response; @@ -15,73 +15,77 @@ @Path("/user") @Api(description = "the user API") + +@javax.annotation.Generated(value = "io.swagger.codegen.languages.java.JavaJAXRSSpecServerCodegen", date = "2018-03-15T06:28:22.549+01:00[Europe/Zurich]") public interface UserApi { + + @POST - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", tags={ "user", }) + @ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - void createUser(@Valid User body) throws Exception; + void createUser(@Valid User user); + @POST @Path("/createWithArray") - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Creates list of users with given input array", notes = "", tags={ "user", }) + @ApiOperation(value = "Creates list of users with given input array", notes = "", tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - void createUsersWithArrayInput(@Valid List body) throws Exception; + void createUsersWithArrayInput(@Valid List body); + @POST @Path("/createWithList") - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Creates list of users with given input array", notes = "", tags={ "user", }) + @ApiOperation(value = "Creates list of users with given input array", notes = "", tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - void createUsersWithListInput(@Valid List body) throws Exception; + void createUsersWithListInput(@Valid List body); + @DELETE @Path("/{username}") - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", tags={ "user", }) + @ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) - void deleteUser(@PathParam("username") @ApiParam("The name that needs to be deleted") String username) throws Exception; + void deleteUser(@PathParam("username") @ApiParam("The name that needs to be deleted") String username); + @GET @Path("/{username}") - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Get user by user name", notes = "", tags={ "user", }) + @ApiOperation(value = "Get user by user name", notes = "", tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) - User getUserByName(@PathParam("username") @ApiParam("The name that needs to be fetched. Use user1 for testing. ") String username) throws Exception; + User getUserByName(@PathParam("username") @ApiParam("The name that needs to be fetched. Use user1 for testing. ") String username); + @GET @Path("/login") - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Logs user into the system", notes = "", tags={ "user", }) + @ApiOperation(value = "Logs user into the system", notes = "", tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied", response = Void.class) }) - String loginUser(@QueryParam("username") @NotNull @ApiParam("The user name for login") String username,@QueryParam("password") @NotNull @ApiParam("The password for login in clear text") String password) throws Exception; + String loginUser(@QueryParam("username") @NotNull @ApiParam("The user name for login") String username,@QueryParam("password") @NotNull @ApiParam("The password for login in clear text") String password); + @GET @Path("/logout") - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Logs out current logged in user session", notes = "", tags={ "user", }) + @ApiOperation(value = "Logs out current logged in user session", notes = "", tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - void logoutUser() throws Exception; + void logoutUser(); + @PUT @Path("/{username}") - @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) - void updateUser(@PathParam("username") @ApiParam("name that need to be deleted") String username,@Valid User body) throws Exception; + void updateUser(@Valid User user,@PathParam("username") @ApiParam("name that need to be deleted") String username); + } diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java index 6aa5fc2b980..aa449d1c1c0 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java @@ -3,22 +3,31 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import java.io.Serializable; + + + import javax.validation.constraints.*; import javax.validation.Valid; + + + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; -public class AdditionalPropertiesClass implements Serializable { +public class AdditionalPropertiesClass { private @Valid Map mapProperty = new HashMap(); private @Valid Map> mapOfMapProperty = new HashMap>(); + /** + + + **/ public AdditionalPropertiesClass mapProperty(Map mapProperty) { this.mapProperty = mapProperty; @@ -28,6 +37,7 @@ public AdditionalPropertiesClass mapProperty(Map mapProperty) { @ApiModelProperty(value = "") @JsonProperty("map_property") + public Map getMapProperty() { return mapProperty; } @@ -35,7 +45,11 @@ public void setMapProperty(Map mapProperty) { this.mapProperty = mapProperty; } + /** + + + **/ public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { this.mapOfMapProperty = mapOfMapProperty; @@ -45,6 +59,7 @@ public AdditionalPropertiesClass mapOfMapProperty(Map> getMapOfMapProperty() { return mapOfMapProperty; } @@ -52,6 +67,7 @@ public void setMapOfMapProperty(Map> mapOfMapPropert this.mapOfMapProperty = mapOfMapProperty; } + @Override public boolean equals(java.lang.Object o) { @@ -94,3 +110,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Animal.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Animal.java index bb54e9cad22..d0a937601ed 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Animal.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Animal.java @@ -2,22 +2,31 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; -import java.io.Serializable; + + + import javax.validation.constraints.*; import javax.validation.Valid; + + + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; -public class Animal implements Serializable { +public class Animal { private @Valid String className = null; private @Valid String color = "red"; + /** + + + **/ public Animal className(String className) { this.className = className; @@ -27,7 +36,9 @@ public Animal className(String className) { @ApiModelProperty(required = true, value = "") @JsonProperty("className") + @NotNull + public String getClassName() { return className; } @@ -35,7 +46,11 @@ public void setClassName(String className) { this.className = className; } + /** + + + **/ public Animal color(String color) { this.color = color; @@ -45,6 +60,7 @@ public Animal color(String color) { @ApiModelProperty(value = "") @JsonProperty("color") + public String getColor() { return color; } @@ -52,6 +68,7 @@ public void setColor(String color) { this.color = color; } + @Override public boolean equals(java.lang.Object o) { @@ -94,3 +111,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/AnimalFarm.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/AnimalFarm.java index f14a33d343e..a35594797d1 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/AnimalFarm.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/AnimalFarm.java @@ -3,19 +3,25 @@ import io.swagger.model.Animal; import java.util.ArrayList; import java.util.List; -import java.io.Serializable; + + + import javax.validation.constraints.*; import javax.validation.Valid; + + + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; -public class AnimalFarm extends ArrayList implements Serializable { +public class AnimalFarm extends ArrayList { + @Override public boolean equals(java.lang.Object o) { @@ -55,3 +61,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java index 0be06450317..0af8b515dcc 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java @@ -3,21 +3,30 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; -import java.io.Serializable; + + + import javax.validation.constraints.*; import javax.validation.Valid; + + + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; -public class ArrayOfArrayOfNumberOnly implements Serializable { +public class ArrayOfArrayOfNumberOnly { private @Valid List> arrayArrayNumber = new ArrayList>(); + /** + + + **/ public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; @@ -27,6 +36,7 @@ public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArr @ApiModelProperty(value = "") @JsonProperty("ArrayArrayNumber") + public List> getArrayArrayNumber() { return arrayArrayNumber; } @@ -34,6 +44,7 @@ public void setArrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; } + @Override public boolean equals(java.lang.Object o) { @@ -74,3 +85,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java index c131d2c633a..948506f5562 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java @@ -3,21 +3,30 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; -import java.io.Serializable; + + + import javax.validation.constraints.*; import javax.validation.Valid; + + + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; -public class ArrayOfNumberOnly implements Serializable { +public class ArrayOfNumberOnly { private @Valid List arrayNumber = new ArrayList(); + /** + + + **/ public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; @@ -27,6 +36,7 @@ public ArrayOfNumberOnly arrayNumber(List arrayNumber) { @ApiModelProperty(value = "") @JsonProperty("ArrayNumber") + public List getArrayNumber() { return arrayNumber; } @@ -34,6 +44,7 @@ public void setArrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; } + @Override public boolean equals(java.lang.Object o) { @@ -74,3 +85,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ArrayTest.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ArrayTest.java index 1720cde126c..72198182024 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ArrayTest.java @@ -3,23 +3,32 @@ import io.swagger.model.ReadOnlyFirst; import java.util.ArrayList; import java.util.List; -import java.io.Serializable; + + + import javax.validation.constraints.*; import javax.validation.Valid; + + + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; -public class ArrayTest implements Serializable { +public class ArrayTest { private @Valid List arrayOfString = new ArrayList(); private @Valid List> arrayArrayOfInteger = new ArrayList>(); private @Valid List> arrayArrayOfModel = new ArrayList>(); + /** + + + **/ public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; @@ -29,6 +38,7 @@ public ArrayTest arrayOfString(List arrayOfString) { @ApiModelProperty(value = "") @JsonProperty("array_of_string") + public List getArrayOfString() { return arrayOfString; } @@ -36,7 +46,11 @@ public void setArrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; } + /** + + + **/ public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; @@ -46,6 +60,7 @@ public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { @ApiModelProperty(value = "") @JsonProperty("array_array_of_integer") + public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -53,7 +68,11 @@ public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; } + /** + + + **/ public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; @@ -63,6 +82,7 @@ public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) @ApiModelProperty(value = "") @JsonProperty("array_array_of_model") + public List> getArrayArrayOfModel() { return arrayArrayOfModel; } @@ -70,6 +90,7 @@ public void setArrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } + @Override public boolean equals(java.lang.Object o) { @@ -114,3 +135,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Capitalization.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Capitalization.java index 00402e4788a..012d060295c 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Capitalization.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Capitalization.java @@ -1,16 +1,21 @@ package io.swagger.model; -import java.io.Serializable; + + + import javax.validation.constraints.*; import javax.validation.Valid; + + + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; -public class Capitalization implements Serializable { +public class Capitalization { private @Valid String smallCamel = null; private @Valid String capitalCamel = null; @@ -19,7 +24,11 @@ public class Capitalization implements Serializable { private @Valid String scAETHFlowPoints = null; private @Valid String ATT_NAME = null; + /** + + + **/ public Capitalization smallCamel(String smallCamel) { this.smallCamel = smallCamel; @@ -29,6 +38,7 @@ public Capitalization smallCamel(String smallCamel) { @ApiModelProperty(value = "") @JsonProperty("smallCamel") + public String getSmallCamel() { return smallCamel; } @@ -36,7 +46,11 @@ public void setSmallCamel(String smallCamel) { this.smallCamel = smallCamel; } + /** + + + **/ public Capitalization capitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; @@ -46,6 +60,7 @@ public Capitalization capitalCamel(String capitalCamel) { @ApiModelProperty(value = "") @JsonProperty("CapitalCamel") + public String getCapitalCamel() { return capitalCamel; } @@ -53,7 +68,11 @@ public void setCapitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; } + /** + + + **/ public Capitalization smallSnake(String smallSnake) { this.smallSnake = smallSnake; @@ -63,6 +82,7 @@ public Capitalization smallSnake(String smallSnake) { @ApiModelProperty(value = "") @JsonProperty("small_Snake") + public String getSmallSnake() { return smallSnake; } @@ -70,7 +90,11 @@ public void setSmallSnake(String smallSnake) { this.smallSnake = smallSnake; } + /** + + + **/ public Capitalization capitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; @@ -80,6 +104,7 @@ public Capitalization capitalSnake(String capitalSnake) { @ApiModelProperty(value = "") @JsonProperty("Capital_Snake") + public String getCapitalSnake() { return capitalSnake; } @@ -87,7 +112,11 @@ public void setCapitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; } + /** + + + **/ public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; @@ -97,6 +126,7 @@ public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { @ApiModelProperty(value = "") @JsonProperty("SCA_ETH_Flow_Points") + public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -104,8 +134,13 @@ public void setScAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; } + /** + * Name of the pet + + + **/ public Capitalization ATT_NAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; @@ -115,6 +150,7 @@ public Capitalization ATT_NAME(String ATT_NAME) { @ApiModelProperty(value = "Name of the pet ") @JsonProperty("ATT_NAME") + public String getATTNAME() { return ATT_NAME; } @@ -122,6 +158,7 @@ public void setATTNAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; } + @Override public boolean equals(java.lang.Object o) { @@ -172,3 +209,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Cat.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Cat.java index 086c6462d8e..ba0a3c132cf 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Cat.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Cat.java @@ -1,21 +1,78 @@ package io.swagger.model; import io.swagger.model.Animal; -import java.io.Serializable; + + + import javax.validation.constraints.*; import javax.validation.Valid; + + + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; -public class Cat extends Animal implements Serializable { +public class Cat extends Animal { + private @Valid String className = null; + private @Valid String color = "red"; private @Valid Boolean declawed = null; + /** + + + + **/ + public Cat className(String className) { + this.className = className; + return this; + } + + + @ApiModelProperty(required = true, value = "") + @JsonProperty("className") + + @NotNull + + public String getClassName() { + return className; + } + public void setClassName(String className) { + this.className = className; + } + + + /** + + + + **/ + public Cat color(String color) { + this.color = color; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("color") + + public String getColor() { + return color; + } + public void setColor(String color) { + this.color = color; + } + + + /** + + + **/ public Cat declawed(Boolean declawed) { this.declawed = declawed; @@ -25,13 +82,15 @@ public Cat declawed(Boolean declawed) { @ApiModelProperty(value = "") @JsonProperty("declawed") - public Boolean isDeclawed() { + + public Boolean isisDeclawed() { return declawed; } public void setDeclawed(Boolean declawed) { this.declawed = declawed; } + @Override public boolean equals(java.lang.Object o) { @@ -42,12 +101,14 @@ public boolean equals(java.lang.Object o) { return false; } Cat cat = (Cat) o; - return Objects.equals(declawed, cat.declawed); + return Objects.equals(className, cat.className) && + Objects.equals(color, cat.color) && + Objects.equals(declawed, cat.declawed); } @Override public int hashCode() { - return Objects.hash(declawed); + return Objects.hash(className, color, declawed); } @Override @@ -55,6 +116,8 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Cat {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); sb.append("}"); return sb.toString(); @@ -72,3 +135,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Category.java index 1e5c20bf730..f5f68500631 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Category.java @@ -1,21 +1,30 @@ package io.swagger.model; -import java.io.Serializable; + + + import javax.validation.constraints.*; import javax.validation.Valid; + + + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; -public class Category implements Serializable { +public class Category { private @Valid Long id = null; private @Valid String name = null; + /** + + + **/ public Category id(Long id) { this.id = id; @@ -25,6 +34,7 @@ public Category id(Long id) { @ApiModelProperty(value = "") @JsonProperty("id") + public Long getId() { return id; } @@ -32,7 +42,11 @@ public void setId(Long id) { this.id = id; } + /** + + + **/ public Category name(String name) { this.name = name; @@ -42,6 +56,7 @@ public Category name(String name) { @ApiModelProperty(value = "") @JsonProperty("name") + public String getName() { return name; } @@ -49,6 +64,7 @@ public void setName(String name) { this.name = name; } + @Override public boolean equals(java.lang.Object o) { @@ -91,3 +107,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ClassModel.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ClassModel.java index c05c7b4a9b6..8d0347d3cb6 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ClassModel.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ClassModel.java @@ -1,24 +1,33 @@ package io.swagger.model; import io.swagger.annotations.ApiModel; -import java.io.Serializable; + + + import javax.validation.constraints.*; import javax.validation.Valid; + + /** * Model for testing model with \"_class\" property **/ + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; @ApiModel(description = "Model for testing model with \"_class\" property") -public class ClassModel implements Serializable { +public class ClassModel { private @Valid String propertyClass = null; + /** + + + **/ public ClassModel propertyClass(String propertyClass) { this.propertyClass = propertyClass; @@ -28,6 +37,7 @@ public ClassModel propertyClass(String propertyClass) { @ApiModelProperty(value = "") @JsonProperty("_class") + public String getPropertyClass() { return propertyClass; } @@ -35,6 +45,7 @@ public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } + @Override public boolean equals(java.lang.Object o) { @@ -75,3 +86,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Client.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Client.java index 61c2aef0512..62176de7566 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Client.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Client.java @@ -1,20 +1,29 @@ package io.swagger.model; -import java.io.Serializable; + + + import javax.validation.constraints.*; import javax.validation.Valid; + + + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; -public class Client implements Serializable { +public class Client { private @Valid String client = null; + /** + + + **/ public Client client(String client) { this.client = client; @@ -24,6 +33,7 @@ public Client client(String client) { @ApiModelProperty(value = "") @JsonProperty("client") + public String getClient() { return client; } @@ -31,6 +41,7 @@ public void setClient(String client) { this.client = client; } + @Override public boolean equals(java.lang.Object o) { @@ -71,3 +82,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Dog.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Dog.java index 8c1d2c3f85b..fad8e5daed8 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Dog.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Dog.java @@ -1,21 +1,78 @@ package io.swagger.model; import io.swagger.model.Animal; -import java.io.Serializable; + + + import javax.validation.constraints.*; import javax.validation.Valid; + + + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; -public class Dog extends Animal implements Serializable { +public class Dog extends Animal { + private @Valid String className = null; + private @Valid String color = "red"; private @Valid String breed = null; + /** + + + + **/ + public Dog className(String className) { + this.className = className; + return this; + } + + + @ApiModelProperty(required = true, value = "") + @JsonProperty("className") + + @NotNull + + public String getClassName() { + return className; + } + public void setClassName(String className) { + this.className = className; + } + + + /** + + + + **/ + public Dog color(String color) { + this.color = color; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("color") + + public String getColor() { + return color; + } + public void setColor(String color) { + this.color = color; + } + + + /** + + + **/ public Dog breed(String breed) { this.breed = breed; @@ -25,6 +82,7 @@ public Dog breed(String breed) { @ApiModelProperty(value = "") @JsonProperty("breed") + public String getBreed() { return breed; } @@ -32,6 +90,7 @@ public void setBreed(String breed) { this.breed = breed; } + @Override public boolean equals(java.lang.Object o) { @@ -42,12 +101,14 @@ public boolean equals(java.lang.Object o) { return false; } Dog dog = (Dog) o; - return Objects.equals(breed, dog.breed); + return Objects.equals(className, dog.className) && + Objects.equals(color, dog.color) && + Objects.equals(breed, dog.breed); } @Override public int hashCode() { - return Objects.hash(breed); + return Objects.hash(className, color, breed); } @Override @@ -55,6 +116,8 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Dog {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); sb.append("}"); return sb.toString(); @@ -72,3 +135,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/EnumArrays.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/EnumArrays.java index 595f687217d..bde754ec1b5 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/EnumArrays.java @@ -2,22 +2,29 @@ import java.util.ArrayList; import java.util.List; -import java.io.Serializable; + + + import javax.validation.constraints.*; import javax.validation.Valid; + + + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; -public class EnumArrays implements Serializable { +public class EnumArrays { public enum JustSymbolEnum { + GREATER_THAN_OR_EQUAL_TO(String.valueOf(">=")), DOLLAR(String.valueOf("$")); + private String value; @@ -31,10 +38,12 @@ public String value() { } @Override + @JsonValue public String toString() { return String.valueOf(value); } + @JsonCreator public static JustSymbolEnum fromValue(String v) { for (JustSymbolEnum b : JustSymbolEnum.values()) { if (String.valueOf(b.value).equals(v)) { @@ -49,7 +58,9 @@ public static JustSymbolEnum fromValue(String v) { public enum ArrayEnumEnum { + FISH(String.valueOf("fish")), CRAB(String.valueOf("crab")); + private String value; @@ -63,10 +74,12 @@ public String value() { } @Override + @JsonValue public String toString() { return String.valueOf(value); } + @JsonCreator public static ArrayEnumEnum fromValue(String v) { for (ArrayEnumEnum b : ArrayEnumEnum.values()) { if (String.valueOf(b.value).equals(v)) { @@ -79,7 +92,11 @@ public static ArrayEnumEnum fromValue(String v) { private @Valid List arrayEnum = new ArrayList(); + /** + + + **/ public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; @@ -89,6 +106,7 @@ public EnumArrays justSymbol(JustSymbolEnum justSymbol) { @ApiModelProperty(value = "") @JsonProperty("just_symbol") + public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -96,7 +114,11 @@ public void setJustSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; } + /** + + + **/ public EnumArrays arrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; @@ -106,6 +128,7 @@ public EnumArrays arrayEnum(List arrayEnum) { @ApiModelProperty(value = "") @JsonProperty("array_enum") + public List getArrayEnum() { return arrayEnum; } @@ -113,6 +136,7 @@ public void setArrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; } + @Override public boolean equals(java.lang.Object o) { @@ -155,3 +179,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/EnumClass.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/EnumClass.java index 13cf0a338e7..81c8ba370b4 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/EnumClass.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/EnumClass.java @@ -1,23 +1,33 @@ package io.swagger.model; -import java.io.Serializable; + + + import javax.validation.constraints.*; import javax.validation.Valid; + + + + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; + /** * Gets or Sets EnumClass */ public enum EnumClass { + + _ABC("_abc"), _EFG("-efg"), _XYZ_("(xyz)"); + private String value; @@ -43,3 +53,6 @@ public static EnumClass fromValue(String text) { } + + + diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/EnumTest.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/EnumTest.java index d704287dd95..767def46214 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/EnumTest.java @@ -1,22 +1,29 @@ package io.swagger.model; import io.swagger.model.OuterEnum; -import java.io.Serializable; + + + import javax.validation.constraints.*; import javax.validation.Valid; + + + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; -public class EnumTest implements Serializable { +public class EnumTest { public enum EnumStringEnum { + UPPER(String.valueOf("UPPER")), LOWER(String.valueOf("lower")), EMPTY(String.valueOf("")); + private String value; @@ -30,10 +37,12 @@ public String value() { } @Override + @JsonValue public String toString() { return String.valueOf(value); } + @JsonCreator public static EnumStringEnum fromValue(String v) { for (EnumStringEnum b : EnumStringEnum.values()) { if (String.valueOf(b.value).equals(v)) { @@ -48,7 +57,9 @@ public static EnumStringEnum fromValue(String v) { public enum EnumIntegerEnum { + NUMBER_1(Integer.valueOf(1)), NUMBER_MINUS_1(Integer.valueOf(-1)); + private Integer value; @@ -62,10 +73,12 @@ public String value() { } @Override + @JsonValue public String toString() { return String.valueOf(value); } + @JsonCreator public static EnumIntegerEnum fromValue(String v) { for (EnumIntegerEnum b : EnumIntegerEnum.values()) { if (String.valueOf(b.value).equals(v)) { @@ -80,7 +93,9 @@ public static EnumIntegerEnum fromValue(String v) { public enum EnumNumberEnum { + NUMBER_1_DOT_1(Double.valueOf(1.1)), NUMBER_MINUS_1_DOT_2(Double.valueOf(-1.2)); + private Double value; @@ -94,10 +109,12 @@ public String value() { } @Override + @JsonValue public String toString() { return String.valueOf(value); } + @JsonCreator public static EnumNumberEnum fromValue(String v) { for (EnumNumberEnum b : EnumNumberEnum.values()) { if (String.valueOf(b.value).equals(v)) { @@ -111,7 +128,11 @@ public static EnumNumberEnum fromValue(String v) { private @Valid EnumNumberEnum enumNumber = null; private @Valid OuterEnum outerEnum = null; + /** + + + **/ public EnumTest enumString(EnumStringEnum enumString) { this.enumString = enumString; @@ -121,6 +142,7 @@ public EnumTest enumString(EnumStringEnum enumString) { @ApiModelProperty(value = "") @JsonProperty("enum_string") + public EnumStringEnum getEnumString() { return enumString; } @@ -128,7 +150,11 @@ public void setEnumString(EnumStringEnum enumString) { this.enumString = enumString; } + /** + + + **/ public EnumTest enumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; @@ -138,6 +164,7 @@ public EnumTest enumInteger(EnumIntegerEnum enumInteger) { @ApiModelProperty(value = "") @JsonProperty("enum_integer") + public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -145,7 +172,11 @@ public void setEnumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; } + /** + + + **/ public EnumTest enumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; @@ -155,6 +186,7 @@ public EnumTest enumNumber(EnumNumberEnum enumNumber) { @ApiModelProperty(value = "") @JsonProperty("enum_number") + public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -162,7 +194,11 @@ public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } + /** + + + **/ public EnumTest outerEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; @@ -172,6 +208,7 @@ public EnumTest outerEnum(OuterEnum outerEnum) { @ApiModelProperty(value = "") @JsonProperty("outerEnum") + public OuterEnum getOuterEnum() { return outerEnum; } @@ -179,6 +216,7 @@ public void setOuterEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; } + @Override public boolean equals(java.lang.Object o) { @@ -225,3 +263,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/FormatTest.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/FormatTest.java index bb3072fe1e9..ede0770723d 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/FormatTest.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/FormatTest.java @@ -4,17 +4,22 @@ import java.util.Date; import java.util.UUID; import org.joda.time.LocalDate; -import java.io.Serializable; + + + import javax.validation.constraints.*; import javax.validation.Valid; + + + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; -public class FormatTest implements Serializable { +public class FormatTest { private @Valid Integer integer = null; private @Valid Integer int32 = null; @@ -23,16 +28,22 @@ public class FormatTest implements Serializable { private @Valid Float _float = null; private @Valid Double _double = null; private @Valid String string = null; - private @Valid byte[] _byte = null; - private @Valid byte[] binary = null; + private @Valid String _byte = null; + private @Valid String binary = null; private @Valid LocalDate date = null; private @Valid Date dateTime = null; private @Valid UUID uuid = null; private @Valid String password = null; + /** + + * minimum: 10 + + * maximum: 100 + **/ public FormatTest integer(Integer integer) { this.integer = integer; @@ -42,6 +53,7 @@ public FormatTest integer(Integer integer) { @ApiModelProperty(value = "") @JsonProperty("integer") + @Min(10) @Max(100) public Integer getInteger() { return integer; } @@ -49,9 +61,15 @@ public void setInteger(Integer integer) { this.integer = integer; } + /** + + * minimum: 20 + + * maximum: 200 + **/ public FormatTest int32(Integer int32) { this.int32 = int32; @@ -61,6 +79,7 @@ public FormatTest int32(Integer int32) { @ApiModelProperty(value = "") @JsonProperty("int32") + @Min(20) @Max(200) public Integer getInt32() { return int32; } @@ -68,7 +87,11 @@ public void setInt32(Integer int32) { this.int32 = int32; } + /** + + + **/ public FormatTest int64(Long int64) { this.int64 = int64; @@ -78,6 +101,7 @@ public FormatTest int64(Long int64) { @ApiModelProperty(value = "") @JsonProperty("int64") + public Long getInt64() { return int64; } @@ -85,9 +109,11 @@ public void setInt64(Long int64) { this.int64 = int64; } + /** - * minimum: 32.1 - * maximum: 543.2 + + + **/ public FormatTest number(BigDecimal number) { this.number = number; @@ -97,17 +123,21 @@ public FormatTest number(BigDecimal number) { @ApiModelProperty(required = true, value = "") @JsonProperty("number") + @NotNull - @DecimalMin("32.1") @DecimalMax("543.2") public BigDecimal getNumber() { + + public BigDecimal getNumber() { return number; } public void setNumber(BigDecimal number) { this.number = number; } + /** - * minimum: 54.3 - * maximum: 987.6 + + + **/ public FormatTest _float(Float _float) { this._float = _float; @@ -117,16 +147,19 @@ public FormatTest _float(Float _float) { @ApiModelProperty(value = "") @JsonProperty("float") - @DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { + + public Float getFloat() { return _float; } public void setFloat(Float _float) { this._float = _float; } + /** - * minimum: 67.8 - * maximum: 123.4 + + + **/ public FormatTest _double(Double _double) { this._double = _double; @@ -136,14 +169,19 @@ public FormatTest _double(Double _double) { @ApiModelProperty(value = "") @JsonProperty("double") - @DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { + + public Double getDouble() { return _double; } public void setDouble(Double _double) { this._double = _double; } + /** + + + **/ public FormatTest string(String string) { this.string = string; @@ -153,6 +191,7 @@ public FormatTest string(String string) { @ApiModelProperty(value = "") @JsonProperty("string") + @Pattern(regexp="/[a-z]/i") public String getString() { return string; } @@ -160,9 +199,13 @@ public void setString(String string) { this.string = string; } + /** + + + **/ - public FormatTest _byte(byte[] _byte) { + public FormatTest _byte(String _byte) { this._byte = _byte; return this; } @@ -170,17 +213,23 @@ public FormatTest _byte(byte[] _byte) { @ApiModelProperty(required = true, value = "") @JsonProperty("byte") + @NotNull - @Pattern(regexp="^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$") public byte[] getByte() { + + @Pattern(regexp="^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$") public String getByte() { return _byte; } - public void setByte(byte[] _byte) { + public void setByte(String _byte) { this._byte = _byte; } + /** + + + **/ - public FormatTest binary(byte[] binary) { + public FormatTest binary(String binary) { this.binary = binary; return this; } @@ -188,14 +237,19 @@ public FormatTest binary(byte[] binary) { @ApiModelProperty(value = "") @JsonProperty("binary") - public byte[] getBinary() { + + public String getBinary() { return binary; } - public void setBinary(byte[] binary) { + public void setBinary(String binary) { this.binary = binary; } + /** + + + **/ public FormatTest date(LocalDate date) { this.date = date; @@ -205,7 +259,9 @@ public FormatTest date(LocalDate date) { @ApiModelProperty(required = true, value = "") @JsonProperty("date") + @NotNull + public LocalDate getDate() { return date; } @@ -213,7 +269,11 @@ public void setDate(LocalDate date) { this.date = date; } + /** + + + **/ public FormatTest dateTime(Date dateTime) { this.dateTime = dateTime; @@ -223,6 +283,7 @@ public FormatTest dateTime(Date dateTime) { @ApiModelProperty(value = "") @JsonProperty("dateTime") + public Date getDateTime() { return dateTime; } @@ -230,7 +291,11 @@ public void setDateTime(Date dateTime) { this.dateTime = dateTime; } + /** + + + **/ public FormatTest uuid(UUID uuid) { this.uuid = uuid; @@ -240,6 +305,7 @@ public FormatTest uuid(UUID uuid) { @ApiModelProperty(value = "") @JsonProperty("uuid") + public UUID getUuid() { return uuid; } @@ -247,7 +313,11 @@ public void setUuid(UUID uuid) { this.uuid = uuid; } + /** + + + **/ public FormatTest password(String password) { this.password = password; @@ -257,14 +327,17 @@ public FormatTest password(String password) { @ApiModelProperty(required = true, value = "") @JsonProperty("password") + @NotNull - @Size(min=10,max=64) public String getPassword() { + + public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } + @Override public boolean equals(java.lang.Object o) { @@ -329,3 +402,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/HasOnlyReadOnly.java index ef9c2728846..251fb6e3ca7 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/HasOnlyReadOnly.java @@ -1,21 +1,30 @@ package io.swagger.model; -import java.io.Serializable; + + + import javax.validation.constraints.*; import javax.validation.Valid; + + + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; -public class HasOnlyReadOnly implements Serializable { +public class HasOnlyReadOnly { private @Valid String bar = null; private @Valid String foo = null; + /** + + + **/ public HasOnlyReadOnly bar(String bar) { this.bar = bar; @@ -25,6 +34,7 @@ public HasOnlyReadOnly bar(String bar) { @ApiModelProperty(value = "") @JsonProperty("bar") + public String getBar() { return bar; } @@ -32,7 +42,11 @@ public void setBar(String bar) { this.bar = bar; } + /** + + + **/ public HasOnlyReadOnly foo(String foo) { this.foo = foo; @@ -42,6 +56,7 @@ public HasOnlyReadOnly foo(String foo) { @ApiModelProperty(value = "") @JsonProperty("foo") + public String getFoo() { return foo; } @@ -49,6 +64,7 @@ public void setFoo(String foo) { this.foo = foo; } + @Override public boolean equals(java.lang.Object o) { @@ -91,3 +107,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/MapTest.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/MapTest.java index 54abae05490..5662cb2f447 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/MapTest.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/MapTest.java @@ -3,23 +3,30 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import java.io.Serializable; + + + import javax.validation.constraints.*; import javax.validation.Valid; + + + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; -public class MapTest implements Serializable { +public class MapTest { private @Valid Map> mapMapOfString = new HashMap>(); public enum InnerEnum { + UPPER(String.valueOf("UPPER")), LOWER(String.valueOf("lower")); + private String value; @@ -33,10 +40,12 @@ public String value() { } @Override + @JsonValue public String toString() { return String.valueOf(value); } + @JsonCreator public static InnerEnum fromValue(String v) { for (InnerEnum b : InnerEnum.values()) { if (String.valueOf(b.value).equals(v)) { @@ -49,7 +58,11 @@ public static InnerEnum fromValue(String v) { private @Valid Map mapOfEnumString = new HashMap(); + /** + + + **/ public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -59,6 +72,7 @@ public MapTest mapMapOfString(Map> mapMapOfString) { @ApiModelProperty(value = "") @JsonProperty("map_map_of_string") + public Map> getMapMapOfString() { return mapMapOfString; } @@ -66,7 +80,11 @@ public void setMapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; } + /** + + + **/ public MapTest mapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; @@ -76,6 +94,7 @@ public MapTest mapOfEnumString(Map mapOfEnumString) { @ApiModelProperty(value = "") @JsonProperty("map_of_enum_string") + public Map getMapOfEnumString() { return mapOfEnumString; } @@ -83,6 +102,7 @@ public void setMapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; } + @Override public boolean equals(java.lang.Object o) { @@ -125,3 +145,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java index 673adda125e..fb73fe6a318 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -6,23 +6,32 @@ import java.util.List; import java.util.Map; import java.util.UUID; -import java.io.Serializable; + + + import javax.validation.constraints.*; import javax.validation.Valid; + + + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; -public class MixedPropertiesAndAdditionalPropertiesClass implements Serializable { +public class MixedPropertiesAndAdditionalPropertiesClass { private @Valid UUID uuid = null; private @Valid Date dateTime = null; private @Valid Map map = new HashMap(); + /** + + + **/ public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; @@ -32,6 +41,7 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { @ApiModelProperty(value = "") @JsonProperty("uuid") + public UUID getUuid() { return uuid; } @@ -39,7 +49,11 @@ public void setUuid(UUID uuid) { this.uuid = uuid; } + /** + + + **/ public MixedPropertiesAndAdditionalPropertiesClass dateTime(Date dateTime) { this.dateTime = dateTime; @@ -49,6 +63,7 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(Date dateTime) { @ApiModelProperty(value = "") @JsonProperty("dateTime") + public Date getDateTime() { return dateTime; } @@ -56,7 +71,11 @@ public void setDateTime(Date dateTime) { this.dateTime = dateTime; } + /** + + + **/ public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { this.map = map; @@ -66,6 +85,7 @@ public MixedPropertiesAndAdditionalPropertiesClass map(Map map) @ApiModelProperty(value = "") @JsonProperty("map") + public Map getMap() { return map; } @@ -73,6 +93,7 @@ public void setMap(Map map) { this.map = map; } + @Override public boolean equals(java.lang.Object o) { @@ -117,3 +138,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Model200Response.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Model200Response.java index eeb8e7547cf..2cb16de45d2 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Model200Response.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Model200Response.java @@ -1,25 +1,34 @@ package io.swagger.model; import io.swagger.annotations.ApiModel; -import java.io.Serializable; + + + import javax.validation.constraints.*; import javax.validation.Valid; + + /** * Model for testing model name starting with number **/ + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; @ApiModel(description = "Model for testing model name starting with number") -public class Model200Response implements Serializable { +public class Model200Response { private @Valid Integer name = null; private @Valid String propertyClass = null; + /** + + + **/ public Model200Response name(Integer name) { this.name = name; @@ -29,6 +38,7 @@ public Model200Response name(Integer name) { @ApiModelProperty(value = "") @JsonProperty("name") + public Integer getName() { return name; } @@ -36,7 +46,11 @@ public void setName(Integer name) { this.name = name; } + /** + + + **/ public Model200Response propertyClass(String propertyClass) { this.propertyClass = propertyClass; @@ -46,6 +60,7 @@ public Model200Response propertyClass(String propertyClass) { @ApiModelProperty(value = "") @JsonProperty("class") + public String getPropertyClass() { return propertyClass; } @@ -53,6 +68,7 @@ public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } + @Override public boolean equals(java.lang.Object o) { @@ -95,3 +111,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ModelApiResponse.java index e97b1fdfd8b..602d5e93976 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -1,22 +1,31 @@ package io.swagger.model; -import java.io.Serializable; + + + import javax.validation.constraints.*; import javax.validation.Valid; + + + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; -public class ModelApiResponse implements Serializable { +public class ModelApiResponse { private @Valid Integer code = null; private @Valid String type = null; private @Valid String message = null; + /** + + + **/ public ModelApiResponse code(Integer code) { this.code = code; @@ -26,6 +35,7 @@ public ModelApiResponse code(Integer code) { @ApiModelProperty(value = "") @JsonProperty("code") + public Integer getCode() { return code; } @@ -33,7 +43,11 @@ public void setCode(Integer code) { this.code = code; } + /** + + + **/ public ModelApiResponse type(String type) { this.type = type; @@ -43,6 +57,7 @@ public ModelApiResponse type(String type) { @ApiModelProperty(value = "") @JsonProperty("type") + public String getType() { return type; } @@ -50,7 +65,11 @@ public void setType(String type) { this.type = type; } + /** + + + **/ public ModelApiResponse message(String message) { this.message = message; @@ -60,6 +79,7 @@ public ModelApiResponse message(String message) { @ApiModelProperty(value = "") @JsonProperty("message") + public String getMessage() { return message; } @@ -67,6 +87,7 @@ public void setMessage(String message) { this.message = message; } + @Override public boolean equals(java.lang.Object o) { @@ -111,3 +132,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ModelReturn.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ModelReturn.java index 72a677f7ab0..f07c0d985e8 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ModelReturn.java @@ -1,24 +1,33 @@ package io.swagger.model; import io.swagger.annotations.ApiModel; -import java.io.Serializable; + + + import javax.validation.constraints.*; import javax.validation.Valid; + + /** * Model for testing reserved words **/ + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; @ApiModel(description = "Model for testing reserved words") -public class ModelReturn implements Serializable { +public class ModelReturn { private @Valid Integer _return = null; + /** + + + **/ public ModelReturn _return(Integer _return) { this._return = _return; @@ -28,6 +37,7 @@ public ModelReturn _return(Integer _return) { @ApiModelProperty(value = "") @JsonProperty("return") + public Integer getReturn() { return _return; } @@ -35,6 +45,7 @@ public void setReturn(Integer _return) { this._return = _return; } + @Override public boolean equals(java.lang.Object o) { @@ -75,3 +86,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Name.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Name.java index 5460ff8a9b9..3ca7b6cbe0e 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Name.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Name.java @@ -1,27 +1,36 @@ package io.swagger.model; import io.swagger.annotations.ApiModel; -import java.io.Serializable; + + + import javax.validation.constraints.*; import javax.validation.Valid; + + /** * Model for testing model name same as property name **/ + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; @ApiModel(description = "Model for testing model name same as property name") -public class Name implements Serializable { +public class Name { private @Valid Integer name = null; private @Valid Integer snakeCase = null; private @Valid String property = null; private @Valid Integer _123Number = null; + /** + + + **/ public Name name(Integer name) { this.name = name; @@ -31,7 +40,9 @@ public Name name(Integer name) { @ApiModelProperty(required = true, value = "") @JsonProperty("name") + @NotNull + public Integer getName() { return name; } @@ -39,7 +50,11 @@ public void setName(Integer name) { this.name = name; } + /** + + + **/ public Name snakeCase(Integer snakeCase) { this.snakeCase = snakeCase; @@ -49,6 +64,7 @@ public Name snakeCase(Integer snakeCase) { @ApiModelProperty(value = "") @JsonProperty("snake_case") + public Integer getSnakeCase() { return snakeCase; } @@ -56,7 +72,11 @@ public void setSnakeCase(Integer snakeCase) { this.snakeCase = snakeCase; } + /** + + + **/ public Name property(String property) { this.property = property; @@ -66,6 +86,7 @@ public Name property(String property) { @ApiModelProperty(value = "") @JsonProperty("property") + public String getProperty() { return property; } @@ -73,7 +94,11 @@ public void setProperty(String property) { this.property = property; } + /** + + + **/ public Name _123Number(Integer _123Number) { this._123Number = _123Number; @@ -83,6 +108,7 @@ public Name _123Number(Integer _123Number) { @ApiModelProperty(value = "") @JsonProperty("123Number") + public Integer get123Number() { return _123Number; } @@ -90,6 +116,7 @@ public void set123Number(Integer _123Number) { this._123Number = _123Number; } + @Override public boolean equals(java.lang.Object o) { @@ -136,3 +163,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/NumberOnly.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/NumberOnly.java index 5f02fd0649a..94457653ea8 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/NumberOnly.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/NumberOnly.java @@ -1,21 +1,30 @@ package io.swagger.model; import java.math.BigDecimal; -import java.io.Serializable; + + + import javax.validation.constraints.*; import javax.validation.Valid; + + + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; -public class NumberOnly implements Serializable { +public class NumberOnly { private @Valid BigDecimal justNumber = null; + /** + + + **/ public NumberOnly justNumber(BigDecimal justNumber) { this.justNumber = justNumber; @@ -25,6 +34,7 @@ public NumberOnly justNumber(BigDecimal justNumber) { @ApiModelProperty(value = "") @JsonProperty("JustNumber") + public BigDecimal getJustNumber() { return justNumber; } @@ -32,6 +42,7 @@ public void setJustNumber(BigDecimal justNumber) { this.justNumber = justNumber; } + @Override public boolean equals(java.lang.Object o) { @@ -72,3 +83,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Order.java index f7665f15a54..c9664a8231b 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Order.java @@ -1,17 +1,22 @@ package io.swagger.model; import java.util.Date; -import java.io.Serializable; + + + import javax.validation.constraints.*; import javax.validation.Valid; + + + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; -public class Order implements Serializable { +public class Order { private @Valid Long id = null; private @Valid Long petId = null; @@ -20,7 +25,9 @@ public class Order implements Serializable { public enum StatusEnum { + PLACED(String.valueOf("placed")), APPROVED(String.valueOf("approved")), DELIVERED(String.valueOf("delivered")); + private String value; @@ -34,10 +41,12 @@ public String value() { } @Override + @JsonValue public String toString() { return String.valueOf(value); } + @JsonCreator public static StatusEnum fromValue(String v) { for (StatusEnum b : StatusEnum.values()) { if (String.valueOf(b.value).equals(v)) { @@ -51,7 +60,11 @@ public static StatusEnum fromValue(String v) { private @Valid StatusEnum status = null; private @Valid Boolean complete = false; + /** + + + **/ public Order id(Long id) { this.id = id; @@ -61,6 +74,7 @@ public Order id(Long id) { @ApiModelProperty(value = "") @JsonProperty("id") + public Long getId() { return id; } @@ -68,7 +82,11 @@ public void setId(Long id) { this.id = id; } + /** + + + **/ public Order petId(Long petId) { this.petId = petId; @@ -78,6 +96,7 @@ public Order petId(Long petId) { @ApiModelProperty(value = "") @JsonProperty("petId") + public Long getPetId() { return petId; } @@ -85,7 +104,11 @@ public void setPetId(Long petId) { this.petId = petId; } + /** + + + **/ public Order quantity(Integer quantity) { this.quantity = quantity; @@ -95,6 +118,7 @@ public Order quantity(Integer quantity) { @ApiModelProperty(value = "") @JsonProperty("quantity") + public Integer getQuantity() { return quantity; } @@ -102,7 +126,11 @@ public void setQuantity(Integer quantity) { this.quantity = quantity; } + /** + + + **/ public Order shipDate(Date shipDate) { this.shipDate = shipDate; @@ -112,6 +140,7 @@ public Order shipDate(Date shipDate) { @ApiModelProperty(value = "") @JsonProperty("shipDate") + public Date getShipDate() { return shipDate; } @@ -119,8 +148,13 @@ public void setShipDate(Date shipDate) { this.shipDate = shipDate; } + /** + * Order Status + + + **/ public Order status(StatusEnum status) { this.status = status; @@ -130,6 +164,7 @@ public Order status(StatusEnum status) { @ApiModelProperty(value = "Order Status") @JsonProperty("status") + public StatusEnum getStatus() { return status; } @@ -137,7 +172,11 @@ public void setStatus(StatusEnum status) { this.status = status; } + /** + + + **/ public Order complete(Boolean complete) { this.complete = complete; @@ -147,13 +186,15 @@ public Order complete(Boolean complete) { @ApiModelProperty(value = "") @JsonProperty("complete") - public Boolean isComplete() { + + public Boolean isisComplete() { return complete; } public void setComplete(Boolean complete) { this.complete = complete; } + @Override public boolean equals(java.lang.Object o) { @@ -204,3 +245,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/OuterBoolean.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/OuterBoolean.java new file mode 100644 index 00000000000..2208e2922c2 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/OuterBoolean.java @@ -0,0 +1,62 @@ +package io.swagger.model; + + + + +import javax.validation.constraints.*; +import javax.validation.Valid; + + + + + +import io.swagger.annotations.*; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class OuterBoolean { + + + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OuterBoolean outerBoolean = (OuterBoolean) o; + return true; + } + + @Override + public int hashCode() { + return Objects.hash(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterBoolean {\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(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + + + diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/OuterComposite.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/OuterComposite.java index bfe8211b654..8a9e60ff809 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/OuterComposite.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/OuterComposite.java @@ -1,23 +1,32 @@ package io.swagger.model; import java.math.BigDecimal; -import java.io.Serializable; + + + import javax.validation.constraints.*; import javax.validation.Valid; + + + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; -public class OuterComposite implements Serializable { +public class OuterComposite { private @Valid BigDecimal myNumber = null; private @Valid String myString = null; private @Valid Boolean myBoolean = null; + /** + + + **/ public OuterComposite myNumber(BigDecimal myNumber) { this.myNumber = myNumber; @@ -27,6 +36,7 @@ public OuterComposite myNumber(BigDecimal myNumber) { @ApiModelProperty(value = "") @JsonProperty("my_number") + public BigDecimal getMyNumber() { return myNumber; } @@ -34,7 +44,11 @@ public void setMyNumber(BigDecimal myNumber) { this.myNumber = myNumber; } + /** + + + **/ public OuterComposite myString(String myString) { this.myString = myString; @@ -44,6 +58,7 @@ public OuterComposite myString(String myString) { @ApiModelProperty(value = "") @JsonProperty("my_string") + public String getMyString() { return myString; } @@ -51,7 +66,11 @@ public void setMyString(String myString) { this.myString = myString; } + /** + + + **/ public OuterComposite myBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; @@ -61,6 +80,7 @@ public OuterComposite myBoolean(Boolean myBoolean) { @ApiModelProperty(value = "") @JsonProperty("my_boolean") + public Boolean getMyBoolean() { return myBoolean; } @@ -68,6 +88,7 @@ public void setMyBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; } + @Override public boolean equals(java.lang.Object o) { @@ -112,3 +133,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/OuterEnum.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/OuterEnum.java index d682c3f5080..dfdd5fa124b 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/OuterEnum.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/OuterEnum.java @@ -1,23 +1,33 @@ package io.swagger.model; -import java.io.Serializable; + + + import javax.validation.constraints.*; import javax.validation.Valid; + + + + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; + /** * Gets or Sets OuterEnum */ public enum OuterEnum { + + PLACED("placed"), APPROVED("approved"), DELIVERED("delivered"); + private String value; @@ -43,3 +53,6 @@ public static OuterEnum fromValue(String text) { } + + + diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/OuterNumber.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/OuterNumber.java new file mode 100644 index 00000000000..29de130255f --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/OuterNumber.java @@ -0,0 +1,62 @@ +package io.swagger.model; + + + + +import javax.validation.constraints.*; +import javax.validation.Valid; + + + + + +import io.swagger.annotations.*; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class OuterNumber { + + + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OuterNumber outerNumber = (OuterNumber) o; + return true; + } + + @Override + public int hashCode() { + return Objects.hash(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterNumber {\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(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + + + diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/OuterString.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/OuterString.java new file mode 100644 index 00000000000..ce7cf4b9272 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/OuterString.java @@ -0,0 +1,62 @@ +package io.swagger.model; + + + + +import javax.validation.constraints.*; +import javax.validation.Valid; + + + + + +import io.swagger.annotations.*; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class OuterString { + + + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OuterString outerString = (OuterString) o; + return true; + } + + @Override + public int hashCode() { + return Objects.hash(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterString {\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(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + + + diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Pet.java index fc8a6796b79..34abb1f6d7a 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Pet.java @@ -4,17 +4,22 @@ import io.swagger.model.Tag; import java.util.ArrayList; import java.util.List; -import java.io.Serializable; + + + import javax.validation.constraints.*; import javax.validation.Valid; + + + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; -public class Pet implements Serializable { +public class Pet { private @Valid Long id = null; private @Valid Category category = null; @@ -24,7 +29,9 @@ public class Pet implements Serializable { public enum StatusEnum { + AVAILABLE(String.valueOf("available")), PENDING(String.valueOf("pending")), SOLD(String.valueOf("sold")); + private String value; @@ -38,10 +45,12 @@ public String value() { } @Override + @JsonValue public String toString() { return String.valueOf(value); } + @JsonCreator public static StatusEnum fromValue(String v) { for (StatusEnum b : StatusEnum.values()) { if (String.valueOf(b.value).equals(v)) { @@ -54,7 +63,11 @@ public static StatusEnum fromValue(String v) { private @Valid StatusEnum status = null; + /** + + + **/ public Pet id(Long id) { this.id = id; @@ -64,6 +77,7 @@ public Pet id(Long id) { @ApiModelProperty(value = "") @JsonProperty("id") + public Long getId() { return id; } @@ -71,7 +85,11 @@ public void setId(Long id) { this.id = id; } + /** + + + **/ public Pet category(Category category) { this.category = category; @@ -81,6 +99,7 @@ public Pet category(Category category) { @ApiModelProperty(value = "") @JsonProperty("category") + public Category getCategory() { return category; } @@ -88,7 +107,11 @@ public void setCategory(Category category) { this.category = category; } + /** + + + **/ public Pet name(String name) { this.name = name; @@ -98,7 +121,9 @@ public Pet name(String name) { @ApiModelProperty(example = "doggie", required = true, value = "") @JsonProperty("name") + @NotNull + public String getName() { return name; } @@ -106,7 +131,11 @@ public void setName(String name) { this.name = name; } + /** + + + **/ public Pet photoUrls(List photoUrls) { this.photoUrls = photoUrls; @@ -116,7 +145,9 @@ public Pet photoUrls(List photoUrls) { @ApiModelProperty(required = true, value = "") @JsonProperty("photoUrls") + @NotNull + public List getPhotoUrls() { return photoUrls; } @@ -124,7 +155,11 @@ public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } + /** + + + **/ public Pet tags(List tags) { this.tags = tags; @@ -134,6 +169,7 @@ public Pet tags(List tags) { @ApiModelProperty(value = "") @JsonProperty("tags") + public List getTags() { return tags; } @@ -141,8 +177,13 @@ public void setTags(List tags) { this.tags = tags; } + /** + * pet status in the store + + + **/ public Pet status(StatusEnum status) { this.status = status; @@ -152,6 +193,7 @@ public Pet status(StatusEnum status) { @ApiModelProperty(value = "pet status in the store") @JsonProperty("status") + public StatusEnum getStatus() { return status; } @@ -159,6 +201,7 @@ public void setStatus(StatusEnum status) { this.status = status; } + @Override public boolean equals(java.lang.Object o) { @@ -209,3 +252,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ReadOnlyFirst.java index bd4ee7e1cb1..268da376bfa 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ReadOnlyFirst.java @@ -1,21 +1,30 @@ package io.swagger.model; -import java.io.Serializable; + + + import javax.validation.constraints.*; import javax.validation.Valid; + + + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; -public class ReadOnlyFirst implements Serializable { +public class ReadOnlyFirst { private @Valid String bar = null; private @Valid String baz = null; + /** + + + **/ public ReadOnlyFirst bar(String bar) { this.bar = bar; @@ -25,6 +34,7 @@ public ReadOnlyFirst bar(String bar) { @ApiModelProperty(value = "") @JsonProperty("bar") + public String getBar() { return bar; } @@ -32,7 +42,11 @@ public void setBar(String bar) { this.bar = bar; } + /** + + + **/ public ReadOnlyFirst baz(String baz) { this.baz = baz; @@ -42,6 +56,7 @@ public ReadOnlyFirst baz(String baz) { @ApiModelProperty(value = "") @JsonProperty("baz") + public String getBaz() { return baz; } @@ -49,6 +64,7 @@ public void setBaz(String baz) { this.baz = baz; } + @Override public boolean equals(java.lang.Object o) { @@ -91,3 +107,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/SpecialModelName.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/SpecialModelName.java index b8144314b82..9607f858716 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/SpecialModelName.java @@ -1,36 +1,47 @@ package io.swagger.model; -import java.io.Serializable; + + + import javax.validation.constraints.*; import javax.validation.Valid; + + + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; -public class SpecialModelName implements Serializable { +public class SpecialModelName { - private @Valid Long specialPropertyName = null; + private @Valid Long $specialPropertyName = null; + /** + + + **/ - public SpecialModelName specialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; return this; } @ApiModelProperty(value = "") @JsonProperty("$special[property.name]") - public Long getSpecialPropertyName() { - return specialPropertyName; + + public Long get$SpecialPropertyName() { + return $specialPropertyName; } - public void setSpecialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + public void set$SpecialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; } + @Override public boolean equals(java.lang.Object o) { @@ -40,13 +51,13 @@ public boolean equals(java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName specialModelName = (SpecialModelName) o; - return Objects.equals(specialPropertyName, specialModelName.specialPropertyName); + SpecialModelName $specialModelName = (SpecialModelName) o; + return Objects.equals($specialPropertyName, $specialModelName.$specialPropertyName); } @Override public int hashCode() { - return Objects.hash(specialPropertyName); + return Objects.hash($specialPropertyName); } @Override @@ -54,7 +65,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class SpecialModelName {\n"); - sb.append(" specialPropertyName: ").append(toIndentedString(specialPropertyName)).append("\n"); + sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n"); sb.append("}"); return sb.toString(); } @@ -71,3 +82,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Tag.java index 10a7ffc7c57..75ab9628b03 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Tag.java @@ -1,21 +1,30 @@ package io.swagger.model; -import java.io.Serializable; + + + import javax.validation.constraints.*; import javax.validation.Valid; + + + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; -public class Tag implements Serializable { +public class Tag { private @Valid Long id = null; private @Valid String name = null; + /** + + + **/ public Tag id(Long id) { this.id = id; @@ -25,6 +34,7 @@ public Tag id(Long id) { @ApiModelProperty(value = "") @JsonProperty("id") + public Long getId() { return id; } @@ -32,7 +42,11 @@ public void setId(Long id) { this.id = id; } + /** + + + **/ public Tag name(String name) { this.name = name; @@ -42,6 +56,7 @@ public Tag name(String name) { @ApiModelProperty(value = "") @JsonProperty("name") + public String getName() { return name; } @@ -49,6 +64,7 @@ public void setName(String name) { this.name = name; } + @Override public boolean equals(java.lang.Object o) { @@ -91,3 +107,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/User.java index a86f0eae070..b4c6e0f0467 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/User.java @@ -1,16 +1,21 @@ package io.swagger.model; -import java.io.Serializable; + + + import javax.validation.constraints.*; import javax.validation.Valid; + + + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; -public class User implements Serializable { +public class User { private @Valid Long id = null; private @Valid String username = null; @@ -21,7 +26,11 @@ public class User implements Serializable { private @Valid String phone = null; private @Valid Integer userStatus = null; + /** + + + **/ public User id(Long id) { this.id = id; @@ -31,6 +40,7 @@ public User id(Long id) { @ApiModelProperty(value = "") @JsonProperty("id") + public Long getId() { return id; } @@ -38,7 +48,11 @@ public void setId(Long id) { this.id = id; } + /** + + + **/ public User username(String username) { this.username = username; @@ -48,6 +62,7 @@ public User username(String username) { @ApiModelProperty(value = "") @JsonProperty("username") + public String getUsername() { return username; } @@ -55,7 +70,11 @@ public void setUsername(String username) { this.username = username; } + /** + + + **/ public User firstName(String firstName) { this.firstName = firstName; @@ -65,6 +84,7 @@ public User firstName(String firstName) { @ApiModelProperty(value = "") @JsonProperty("firstName") + public String getFirstName() { return firstName; } @@ -72,7 +92,11 @@ public void setFirstName(String firstName) { this.firstName = firstName; } + /** + + + **/ public User lastName(String lastName) { this.lastName = lastName; @@ -82,6 +106,7 @@ public User lastName(String lastName) { @ApiModelProperty(value = "") @JsonProperty("lastName") + public String getLastName() { return lastName; } @@ -89,7 +114,11 @@ public void setLastName(String lastName) { this.lastName = lastName; } + /** + + + **/ public User email(String email) { this.email = email; @@ -99,6 +128,7 @@ public User email(String email) { @ApiModelProperty(value = "") @JsonProperty("email") + public String getEmail() { return email; } @@ -106,7 +136,11 @@ public void setEmail(String email) { this.email = email; } + /** + + + **/ public User password(String password) { this.password = password; @@ -116,6 +150,7 @@ public User password(String password) { @ApiModelProperty(value = "") @JsonProperty("password") + public String getPassword() { return password; } @@ -123,7 +158,11 @@ public void setPassword(String password) { this.password = password; } + /** + + + **/ public User phone(String phone) { this.phone = phone; @@ -133,6 +172,7 @@ public User phone(String phone) { @ApiModelProperty(value = "") @JsonProperty("phone") + public String getPhone() { return phone; } @@ -140,8 +180,13 @@ public void setPhone(String phone) { this.phone = phone; } + /** + * User Status + + + **/ public User userStatus(Integer userStatus) { this.userStatus = userStatus; @@ -151,6 +196,7 @@ public User userStatus(Integer userStatus) { @ApiModelProperty(value = "User Status") @JsonProperty("userStatus") + public Integer getUserStatus() { return userStatus; } @@ -158,6 +204,7 @@ public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } + @Override public boolean equals(java.lang.Object o) { @@ -212,3 +259,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec-interface/swagger.json b/samples/server/petstore/jaxrs-spec-interface/swagger.json index 318ac581fce..0ed9c9103d3 100644 --- a/samples/server/petstore/jaxrs-spec-interface/swagger.json +++ b/samples/server/petstore/jaxrs-spec-interface/swagger.json @@ -1,9 +1,8 @@ { - "swagger" : "2.0", + "openapi" : "3.0.1", "info" : { - "description" : "This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\", - "version" : "1.0.0", "title" : "Swagger Petstore", + "description" : "This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\", "termsOfService" : "http://swagger.io/terms/", "contact" : { "email" : "apiteam@swagger.io" @@ -11,10 +10,16 @@ "license" : { "name" : "Apache-2.0", "url" : "http://www.apache.org/licenses/LICENSE-2.0.html" - } + }, + "version" : "1.0.0" + }, + "externalDocs" : { + "description" : "Find out more about Swagger", + "url" : "http://swagger.io" }, - "host" : "petstore.swagger.io:80", - "basePath" : "/v2", + "servers" : [ { + "url" : "http://petstore.swagger.io:80/v2" + } ], "tags" : [ { "name" : "pet", "description" : "Everything about your Pets", @@ -33,59 +38,70 @@ "url" : "http://swagger.io" } } ], - "schemes" : [ "http" ], "paths" : { "/pet" : { - "post" : { + "put" : { "tags" : [ "pet" ], - "summary" : "Add a new pet to the store", - "description" : "", - "operationId" : "addPet", - "consumes" : [ "application/json", "application/xml" ], - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", + "summary" : "Update an existing pet", + "operationId" : "updatePet", + "requestBody" : { "description" : "Pet object that needs to be added to the store", - "required" : true, - "schema" : { - "$ref" : "#/definitions/Pet" - } - } ], + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + }, + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + } + }, + "required" : true + }, "responses" : { + "400" : { + "description" : "Invalid ID supplied", + "content" : { } + }, + "404" : { + "description" : "Pet not found", + "content" : { } + }, "405" : { - "description" : "Invalid input" + "description" : "Validation exception", + "content" : { } } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ] }, - "put" : { + "post" : { "tags" : [ "pet" ], - "summary" : "Update an existing pet", - "description" : "", - "operationId" : "updatePet", - "consumes" : [ "application/json", "application/xml" ], - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", + "summary" : "Add a new pet to the store", + "operationId" : "addPet", + "requestBody" : { "description" : "Pet object that needs to be added to the store", - "required" : true, - "schema" : { - "$ref" : "#/definitions/Pet" - } - } ], - "responses" : { - "400" : { - "description" : "Invalid ID supplied" - }, - "404" : { - "description" : "Pet not found" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + }, + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + } }, + "required" : true + }, + "responses" : { "405" : { - "description" : "Validation exception" + "description" : "Invalid input", + "content" : { } } }, "security" : [ { @@ -99,32 +115,46 @@ "summary" : "Finds Pets by status", "description" : "Multiple status values can be provided with comma separated strings", "operationId" : "findPetsByStatus", - "produces" : [ "application/xml", "application/json" ], "parameters" : [ { "name" : "status", "in" : "query", "description" : "Status values that need to be considered for filter", "required" : true, - "type" : "array", - "items" : { - "type" : "string", - "default" : "available", - "enum" : [ "available", "pending", "sold" ] - }, - "collectionFormat" : "csv" + "explode" : false, + "schema" : { + "type" : "array", + "items" : { + "type" : "string", + "default" : "available", + "enum" : [ "available", "pending", "sold" ] + } + } } ], "responses" : { "200" : { "description" : "successful operation", - "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/Pet" + "content" : { + "application/xml" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Pet" + } + } + }, + "application/json" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Pet" + } + } } } }, "400" : { - "description" : "Invalid status value" + "description" : "Invalid status value", + "content" : { } } }, "security" : [ { @@ -138,36 +168,50 @@ "summary" : "Finds Pets by tags", "description" : "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", "operationId" : "findPetsByTags", - "produces" : [ "application/xml", "application/json" ], "parameters" : [ { "name" : "tags", "in" : "query", "description" : "Tags to filter by", "required" : true, - "type" : "array", - "items" : { - "type" : "string" - }, - "collectionFormat" : "csv" + "explode" : false, + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } } ], "responses" : { "200" : { "description" : "successful operation", - "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/Pet" + "content" : { + "application/xml" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Pet" + } + } + }, + "application/json" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Pet" + } + } } } }, "400" : { - "description" : "Invalid tag value" + "description" : "Invalid tag value", + "content" : { } } }, + "deprecated" : true, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] - } ], - "deprecated" : true + } ] } }, "/pet/{petId}" : { @@ -176,27 +220,39 @@ "summary" : "Find pet by ID", "description" : "Returns a single pet", "operationId" : "getPetById", - "produces" : [ "application/xml", "application/json" ], "parameters" : [ { "name" : "petId", "in" : "path", "description" : "ID of pet to return", "required" : true, - "type" : "integer", - "format" : "int64" + "schema" : { + "type" : "integer", + "format" : "int64" + } } ], "responses" : { "200" : { "description" : "successful operation", - "schema" : { - "$ref" : "#/definitions/Pet" + "content" : { + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + }, + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + } } }, "400" : { - "description" : "Invalid ID supplied" + "description" : "Invalid ID supplied", + "content" : { } }, "404" : { - "description" : "Pet not found" + "description" : "Pet not found", + "content" : { } } }, "security" : [ { @@ -206,33 +262,39 @@ "post" : { "tags" : [ "pet" ], "summary" : "Updates a pet in the store with form data", - "description" : "", "operationId" : "updatePetWithForm", - "consumes" : [ "application/x-www-form-urlencoded" ], - "produces" : [ "application/xml", "application/json" ], "parameters" : [ { "name" : "petId", "in" : "path", "description" : "ID of pet that needs to be updated", "required" : true, - "type" : "integer", - "format" : "int64" - }, { - "name" : "name", - "in" : "formData", - "description" : "Updated name of the pet", - "required" : false, - "type" : "string" - }, { - "name" : "status", - "in" : "formData", - "description" : "Updated status of the pet", - "required" : false, - "type" : "string" + "schema" : { + "type" : "integer", + "format" : "int64" + } } ], + "requestBody" : { + "content" : { + "application/x-www-form-urlencoded" : { + "schema" : { + "properties" : { + "name" : { + "type" : "string", + "description" : "Updated name of the pet" + }, + "status" : { + "type" : "string", + "description" : "Updated status of the pet" + } + } + } + } + } + }, "responses" : { "405" : { - "description" : "Invalid input" + "description" : "Invalid input", + "content" : { } } }, "security" : [ { @@ -242,25 +304,27 @@ "delete" : { "tags" : [ "pet" ], "summary" : "Deletes a pet", - "description" : "", "operationId" : "deletePet", - "produces" : [ "application/xml", "application/json" ], "parameters" : [ { "name" : "api_key", "in" : "header", - "required" : false, - "type" : "string" + "schema" : { + "type" : "string" + } }, { "name" : "petId", "in" : "path", "description" : "Pet id to delete", "required" : true, - "type" : "integer", - "format" : "int64" + "schema" : { + "type" : "integer", + "format" : "int64" + } } ], "responses" : { "400" : { - "description" : "Invalid pet value" + "description" : "Invalid pet value", + "content" : { } } }, "security" : [ { @@ -272,35 +336,45 @@ "post" : { "tags" : [ "pet" ], "summary" : "uploads an image", - "description" : "", "operationId" : "uploadFile", - "consumes" : [ "multipart/form-data" ], - "produces" : [ "application/json" ], "parameters" : [ { "name" : "petId", "in" : "path", "description" : "ID of pet to update", "required" : true, - "type" : "integer", - "format" : "int64" - }, { - "name" : "additionalMetadata", - "in" : "formData", - "description" : "Additional data to pass to server", - "required" : false, - "type" : "string" - }, { - "name" : "file", - "in" : "formData", - "description" : "file to upload", - "required" : false, - "type" : "file" + "schema" : { + "type" : "integer", + "format" : "int64" + } } ], + "requestBody" : { + "content" : { + "multipart/form-data" : { + "schema" : { + "properties" : { + "additionalMetadata" : { + "type" : "string", + "description" : "Additional data to pass to server" + }, + "file" : { + "type" : "string", + "description" : "file to upload", + "format" : "binary" + } + } + } + } + } + }, "responses" : { "200" : { "description" : "successful operation", - "schema" : { - "$ref" : "#/definitions/ApiResponse" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ApiResponse" + } + } } } }, @@ -315,16 +389,18 @@ "summary" : "Returns pet inventories by status", "description" : "Returns a map of status codes to quantities", "operationId" : "getInventory", - "produces" : [ "application/json" ], - "parameters" : [ ], "responses" : { "200" : { "description" : "successful operation", - "schema" : { - "type" : "object", - "additionalProperties" : { - "type" : "integer", - "format" : "int32" + "content" : { + "application/json" : { + "schema" : { + "type" : "object", + "additionalProperties" : { + "type" : "integer", + "format" : "int32" + } + } } } } @@ -338,27 +414,37 @@ "post" : { "tags" : [ "store" ], "summary" : "Place an order for a pet", - "description" : "", "operationId" : "placeOrder", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", + "requestBody" : { "description" : "order placed for purchasing the pet", - "required" : true, - "schema" : { - "$ref" : "#/definitions/Order" - } - } ], + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/Order" + } + } + }, + "required" : true + }, "responses" : { "200" : { "description" : "successful operation", - "schema" : { - "$ref" : "#/definitions/Order" + "content" : { + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/Order" + } + }, + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Order" + } + } } }, "400" : { - "description" : "Invalid Order" + "description" : "Invalid Order", + "content" : { } } } } @@ -369,29 +455,41 @@ "summary" : "Find purchase order by ID", "description" : "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", "operationId" : "getOrderById", - "produces" : [ "application/xml", "application/json" ], "parameters" : [ { "name" : "order_id", "in" : "path", "description" : "ID of pet that needs to be fetched", "required" : true, - "type" : "integer", - "maximum" : 5, - "minimum" : 1, - "format" : "int64" + "schema" : { + "maximum" : 5, + "minimum" : 1, + "type" : "integer", + "format" : "int64" + } } ], "responses" : { "200" : { "description" : "successful operation", - "schema" : { - "$ref" : "#/definitions/Order" + "content" : { + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/Order" + } + }, + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Order" + } + } } }, "400" : { - "description" : "Invalid ID supplied" + "description" : "Invalid ID supplied", + "content" : { } }, "404" : { - "description" : "Order not found" + "description" : "Order not found", + "content" : { } } } }, @@ -400,20 +498,23 @@ "summary" : "Delete purchase order by ID", "description" : "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", "operationId" : "deleteOrder", - "produces" : [ "application/xml", "application/json" ], "parameters" : [ { "name" : "order_id", "in" : "path", "description" : "ID of the order that needs to be deleted", "required" : true, - "type" : "string" + "schema" : { + "type" : "string" + } } ], "responses" : { "400" : { - "description" : "Invalid ID supplied" + "description" : "Invalid ID supplied", + "content" : { } }, "404" : { - "description" : "Order not found" + "description" : "Order not found", + "content" : { } } } } @@ -424,19 +525,21 @@ "summary" : "Create user", "description" : "This can only be done by the logged in user.", "operationId" : "createUser", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", + "requestBody" : { "description" : "Created user object", - "required" : true, - "schema" : { - "$ref" : "#/definitions/User" - } - } ], + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/User" + } + } + }, + "required" : true + }, "responses" : { "default" : { - "description" : "successful operation" + "description" : "successful operation", + "content" : { } } } } @@ -445,24 +548,25 @@ "post" : { "tags" : [ "user" ], "summary" : "Creates list of users with given input array", - "description" : "", "operationId" : "createUsersWithArrayInput", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", + "requestBody" : { "description" : "List of user object", - "required" : true, - "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/User" + "content" : { + "*/*" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/User" + } + } } - } - } ], + }, + "required" : true + }, "responses" : { "default" : { - "description" : "successful operation" + "description" : "successful operation", + "content" : { } } } } @@ -471,24 +575,25 @@ "post" : { "tags" : [ "user" ], "summary" : "Creates list of users with given input array", - "description" : "", "operationId" : "createUsersWithListInput", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", + "requestBody" : { "description" : "List of user object", - "required" : true, - "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/User" + "content" : { + "*/*" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/User" + } + } } - } - } ], + }, + "required" : true + }, "responses" : { "default" : { - "description" : "successful operation" + "description" : "successful operation", + "content" : { } } } } @@ -497,43 +602,59 @@ "get" : { "tags" : [ "user" ], "summary" : "Logs user into the system", - "description" : "", "operationId" : "loginUser", - "produces" : [ "application/xml", "application/json" ], "parameters" : [ { "name" : "username", "in" : "query", "description" : "The user name for login", "required" : true, - "type" : "string" + "schema" : { + "type" : "string" + } }, { "name" : "password", "in" : "query", "description" : "The password for login in clear text", "required" : true, - "type" : "string" + "schema" : { + "type" : "string" + } } ], "responses" : { "200" : { "description" : "successful operation", - "schema" : { - "type" : "string" - }, "headers" : { "X-Rate-Limit" : { - "type" : "integer", - "format" : "int32", - "description" : "calls per hour allowed by the user" + "description" : "calls per hour allowed by the user", + "schema" : { + "type" : "integer", + "format" : "int32" + } }, "X-Expires-After" : { - "type" : "string", - "format" : "date-time", - "description" : "date in UTC when toekn expires" + "description" : "date in UTC when toekn expires", + "schema" : { + "type" : "string", + "format" : "date-time" + } + } + }, + "content" : { + "application/xml" : { + "schema" : { + "type" : "string" + } + }, + "application/json" : { + "schema" : { + "type" : "string" + } } } }, "400" : { - "description" : "Invalid username/password supplied" + "description" : "Invalid username/password supplied", + "content" : { } } } } @@ -542,13 +663,11 @@ "get" : { "tags" : [ "user" ], "summary" : "Logs out current logged in user session", - "description" : "", "operationId" : "logoutUser", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ ], "responses" : { "default" : { - "description" : "successful operation" + "description" : "successful operation", + "content" : { } } } } @@ -557,28 +676,39 @@ "get" : { "tags" : [ "user" ], "summary" : "Get user by user name", - "description" : "", "operationId" : "getUserByName", - "produces" : [ "application/xml", "application/json" ], "parameters" : [ { "name" : "username", "in" : "path", "description" : "The name that needs to be fetched. Use user1 for testing. ", "required" : true, - "type" : "string" + "schema" : { + "type" : "string" + } } ], "responses" : { "200" : { "description" : "successful operation", - "schema" : { - "$ref" : "#/definitions/User" + "content" : { + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/User" + } + }, + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/User" + } + } } }, "400" : { - "description" : "Invalid username supplied" + "description" : "Invalid username supplied", + "content" : { } }, "404" : { - "description" : "User not found" + "description" : "User not found", + "content" : { } } } }, @@ -587,28 +717,34 @@ "summary" : "Updated user", "description" : "This can only be done by the logged in user.", "operationId" : "updateUser", - "produces" : [ "application/xml", "application/json" ], "parameters" : [ { "name" : "username", "in" : "path", "description" : "name that need to be deleted", "required" : true, - "type" : "string" - }, { - "in" : "body", - "name" : "body", - "description" : "Updated user object", - "required" : true, "schema" : { - "$ref" : "#/definitions/User" + "type" : "string" } } ], + "requestBody" : { + "description" : "Updated user object", + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/User" + } + } + }, + "required" : true + }, "responses" : { "400" : { - "description" : "Invalid user supplied" + "description" : "Invalid user supplied", + "content" : { } }, "404" : { - "description" : "User not found" + "description" : "User not found", + "content" : { } } } }, @@ -617,20 +753,23 @@ "summary" : "Delete user", "description" : "This can only be done by the logged in user.", "operationId" : "deleteUser", - "produces" : [ "application/xml", "application/json" ], "parameters" : [ { "name" : "username", "in" : "path", "description" : "The name that needs to be deleted", "required" : true, - "type" : "string" + "schema" : { + "type" : "string" + } } ], "responses" : { "400" : { - "description" : "Invalid username supplied" + "description" : "Invalid username supplied", + "content" : { } }, "404" : { - "description" : "User not found" + "description" : "User not found", + "content" : { } } } } @@ -640,22 +779,26 @@ "tags" : [ "fake_classname_tags 123#$%^" ], "summary" : "To test class name in snake case", "operationId" : "testClassname", - "consumes" : [ "application/json" ], - "produces" : [ "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", + "requestBody" : { "description" : "client model", - "required" : true, - "schema" : { - "$ref" : "#/definitions/Client" - } - } ], + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Client" + } + } + }, + "required" : true + }, "responses" : { "200" : { "description" : "successful operation", - "schema" : { - "$ref" : "#/definitions/Client" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Client" + } + } } } }, @@ -670,88 +813,98 @@ "summary" : "To test enum parameters", "description" : "To test enum parameters", "operationId" : "testEnumParameters", - "consumes" : [ "*/*" ], - "produces" : [ "*/*" ], "parameters" : [ { - "name" : "enum_form_string_array", - "in" : "formData", - "description" : "Form parameter enum test (string array)", - "required" : false, - "type" : "array", - "items" : { - "type" : "string", - "default" : "$", - "enum" : [ ">", "$" ] - } - }, { - "name" : "enum_form_string", - "in" : "formData", - "description" : "Form parameter enum test (string)", - "required" : false, - "type" : "string", - "default" : "-efg", - "enum" : [ "_abc", "-efg", "(xyz)" ] - }, { "name" : "enum_header_string_array", "in" : "header", "description" : "Header parameter enum test (string array)", - "required" : false, - "type" : "array", - "items" : { - "type" : "string", - "default" : "$", - "enum" : [ ">", "$" ] + "schema" : { + "type" : "array", + "items" : { + "type" : "string", + "default" : "$", + "enum" : [ ">", "$" ] + } } }, { "name" : "enum_header_string", "in" : "header", "description" : "Header parameter enum test (string)", - "required" : false, - "type" : "string", - "default" : "-efg", - "enum" : [ "_abc", "-efg", "(xyz)" ] + "schema" : { + "type" : "string", + "default" : "-efg", + "enum" : [ "_abc", "-efg", "(xyz)" ] + } }, { "name" : "enum_query_string_array", "in" : "query", "description" : "Query parameter enum test (string array)", - "required" : false, - "type" : "array", - "items" : { - "type" : "string", - "default" : "$", - "enum" : [ ">", "$" ] + "explode" : false, + "schema" : { + "type" : "array", + "items" : { + "type" : "string", + "default" : "$", + "enum" : [ ">", "$" ] + } } }, { "name" : "enum_query_string", "in" : "query", "description" : "Query parameter enum test (string)", - "required" : false, - "type" : "string", - "default" : "-efg", - "enum" : [ "_abc", "-efg", "(xyz)" ] + "schema" : { + "type" : "string", + "default" : "-efg", + "enum" : [ "_abc", "-efg", "(xyz)" ] + } }, { "name" : "enum_query_integer", "in" : "query", "description" : "Query parameter enum test (double)", - "required" : false, - "type" : "integer", - "format" : "int32", - "enum" : [ 1, -2 ] - }, { - "name" : "enum_query_double", - "in" : "formData", - "description" : "Query parameter enum test (double)", - "required" : false, - "type" : "number", - "format" : "double", - "enum" : [ 1.1, -1.2 ] + "schema" : { + "type" : "integer", + "format" : "int32", + "enum" : [ "1", "-2" ] + } } ], + "requestBody" : { + "content" : { + "*/*" : { + "schema" : { + "properties" : { + "enum_form_string_array" : { + "type" : "array", + "description" : "Form parameter enum test (string array)", + "items" : { + "type" : "string", + "default" : "$", + "enum" : [ ">", "$" ] + } + }, + "enum_form_string" : { + "type" : "string", + "description" : "Form parameter enum test (string)", + "default" : "-efg", + "enum" : [ "_abc", "-efg", "(xyz)" ] + }, + "enum_query_double" : { + "type" : "number", + "description" : "Query parameter enum test (double)", + "format" : "double", + "enum" : [ "1.1", "-1.2" ] + } + } + } + } + } + }, "responses" : { "400" : { - "description" : "Invalid request" + "description" : "Invalid request", + "content" : { } }, "404" : { - "description" : "Not found" + "description" : "Not found", + "content" : { } } } }, @@ -760,121 +913,189 @@ "summary" : "Fake endpoint for testing various parameters\n假端點\n偽のエンドポイント\n가짜 엔드 포인트\n", "description" : "Fake endpoint for testing various parameters\n假端點\n偽のエンドポイント\n가짜 엔드 포인트\n", "operationId" : "testEndpointParameters", - "consumes" : [ "application/xml; charset=utf-8", "application/json; charset=utf-8" ], - "produces" : [ "application/xml; charset=utf-8", "application/json; charset=utf-8" ], - "parameters" : [ { - "name" : "integer", - "in" : "formData", - "description" : "None", - "required" : false, - "type" : "integer", - "maximum" : 100, - "minimum" : 10 - }, { - "name" : "int32", - "in" : "formData", - "description" : "None", - "required" : false, - "type" : "integer", - "maximum" : 200, - "minimum" : 20, - "format" : "int32" - }, { - "name" : "int64", - "in" : "formData", - "description" : "None", - "required" : false, - "type" : "integer", - "format" : "int64" - }, { - "name" : "number", - "in" : "formData", - "description" : "None", - "required" : true, - "type" : "number", - "maximum" : 543.2, - "minimum" : 32.1 - }, { - "name" : "float", - "in" : "formData", - "description" : "None", - "required" : false, - "type" : "number", - "maximum" : 987.6, - "format" : "float" - }, { - "name" : "double", - "in" : "formData", - "description" : "None", - "required" : true, - "type" : "number", - "maximum" : 123.4, - "minimum" : 67.8, - "format" : "double" - }, { - "name" : "string", - "in" : "formData", - "description" : "None", - "required" : false, - "type" : "string", - "pattern" : "/[a-z]/i" - }, { - "name" : "pattern_without_delimiter", - "in" : "formData", - "description" : "None", - "required" : true, - "type" : "string", - "pattern" : "^[A-Z].*" - }, { - "name" : "byte", - "in" : "formData", - "description" : "None", - "required" : true, - "type" : "string", - "format" : "byte" - }, { - "name" : "binary", - "in" : "formData", - "description" : "None", - "required" : false, - "type" : "string", - "format" : "binary" - }, { - "name" : "date", - "in" : "formData", - "description" : "None", - "required" : false, - "type" : "string", - "format" : "date" - }, { - "name" : "dateTime", - "in" : "formData", - "description" : "None", - "required" : false, - "type" : "string", - "format" : "date-time" - }, { - "name" : "password", - "in" : "formData", - "description" : "None", - "required" : false, - "type" : "string", - "maxLength" : 64, - "minLength" : 10, - "format" : "password" - }, { - "name" : "callback", - "in" : "formData", - "description" : "None", - "required" : false, - "type" : "string" - } ], + "requestBody" : { + "content" : { + "application/xml; charset=utf-8" : { + "schema" : { + "required" : [ "byte", "double", "number", "pattern_without_delimiter" ], + "properties" : { + "integer" : { + "maximum" : 100, + "minimum" : 10, + "type" : "integer", + "description" : "None" + }, + "int32" : { + "maximum" : 200, + "minimum" : 20, + "type" : "integer", + "description" : "None", + "format" : "int32" + }, + "int64" : { + "type" : "integer", + "description" : "None", + "format" : "int64" + }, + "number" : { + "maximum" : 543.2, + "minimum" : 32.1, + "type" : "number", + "description" : "None" + }, + "float" : { + "maximum" : 987.6, + "type" : "number", + "description" : "None", + "format" : "float" + }, + "double" : { + "maximum" : 123.4, + "minimum" : 67.8, + "type" : "number", + "description" : "None", + "format" : "double" + }, + "string" : { + "pattern" : "/[a-z]/i", + "type" : "string", + "description" : "None" + }, + "pattern_without_delimiter" : { + "pattern" : "^[A-Z].*", + "type" : "string", + "description" : "None" + }, + "byte" : { + "type" : "string", + "description" : "None", + "format" : "byte" + }, + "binary" : { + "type" : "string", + "description" : "None", + "format" : "binary" + }, + "date" : { + "type" : "string", + "description" : "None", + "format" : "date" + }, + "dateTime" : { + "type" : "string", + "description" : "None", + "format" : "date-time" + }, + "password" : { + "maxLength" : 64, + "minLength" : 10, + "type" : "string", + "description" : "None", + "format" : "password" + }, + "callback" : { + "type" : "string", + "description" : "None" + } + } + } + }, + "application/json; charset=utf-8" : { + "schema" : { + "required" : [ "byte", "double", "number", "pattern_without_delimiter" ], + "properties" : { + "integer" : { + "maximum" : 100, + "minimum" : 10, + "type" : "integer", + "description" : "None" + }, + "int32" : { + "maximum" : 200, + "minimum" : 20, + "type" : "integer", + "description" : "None", + "format" : "int32" + }, + "int64" : { + "type" : "integer", + "description" : "None", + "format" : "int64" + }, + "number" : { + "maximum" : 543.2, + "minimum" : 32.1, + "type" : "number", + "description" : "None" + }, + "float" : { + "maximum" : 987.6, + "type" : "number", + "description" : "None", + "format" : "float" + }, + "double" : { + "maximum" : 123.4, + "minimum" : 67.8, + "type" : "number", + "description" : "None", + "format" : "double" + }, + "string" : { + "pattern" : "/[a-z]/i", + "type" : "string", + "description" : "None" + }, + "pattern_without_delimiter" : { + "pattern" : "^[A-Z].*", + "type" : "string", + "description" : "None" + }, + "byte" : { + "type" : "string", + "description" : "None", + "format" : "byte" + }, + "binary" : { + "type" : "string", + "description" : "None", + "format" : "binary" + }, + "date" : { + "type" : "string", + "description" : "None", + "format" : "date" + }, + "dateTime" : { + "type" : "string", + "description" : "None", + "format" : "date-time" + }, + "password" : { + "maxLength" : 64, + "minLength" : 10, + "type" : "string", + "description" : "None", + "format" : "password" + }, + "callback" : { + "type" : "string", + "description" : "None" + } + } + } + } + }, + "required" : true + }, "responses" : { "400" : { - "description" : "Invalid username supplied" + "description" : "Invalid username supplied", + "content" : { } }, "404" : { - "description" : "User not found" + "description" : "User not found", + "content" : { } } }, "security" : [ { @@ -886,22 +1107,26 @@ "summary" : "To test \"client\" model", "description" : "To test \"client\" model", "operationId" : "testClientModel", - "consumes" : [ "application/json" ], - "produces" : [ "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", + "requestBody" : { "description" : "client model", - "required" : true, - "schema" : { - "$ref" : "#/definitions/Client" - } - } ], - "responses" : { - "200" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Client" + } + } + }, + "required" : true + }, + "responses" : { + "200" : { "description" : "successful operation", - "schema" : { - "$ref" : "#/definitions/Client" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Client" + } + } } } } @@ -912,20 +1137,26 @@ "tags" : [ "fake" ], "description" : "Test serialization of outer number types", "operationId" : "fakeOuterNumberSerialize", - "parameters" : [ { - "in" : "body", - "name" : "body", + "requestBody" : { "description" : "Input number as post body", - "required" : false, - "schema" : { - "$ref" : "#/definitions/OuterNumber" - } - } ], + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/OuterNumber" + } + } + }, + "required" : false + }, "responses" : { "200" : { "description" : "Output number", - "schema" : { - "$ref" : "#/definitions/OuterNumber" + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/OuterNumber" + } + } } } } @@ -936,20 +1167,26 @@ "tags" : [ "fake" ], "description" : "Test serialization of outer string types", "operationId" : "fakeOuterStringSerialize", - "parameters" : [ { - "in" : "body", - "name" : "body", + "requestBody" : { "description" : "Input string as post body", - "required" : false, - "schema" : { - "$ref" : "#/definitions/OuterString" - } - } ], + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/OuterString" + } + } + }, + "required" : false + }, "responses" : { "200" : { "description" : "Output string", - "schema" : { - "$ref" : "#/definitions/OuterString" + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/OuterString" + } + } } } } @@ -960,20 +1197,26 @@ "tags" : [ "fake" ], "description" : "Test serialization of outer boolean types", "operationId" : "fakeOuterBooleanSerialize", - "parameters" : [ { - "in" : "body", - "name" : "body", + "requestBody" : { "description" : "Input boolean as post body", - "required" : false, - "schema" : { - "$ref" : "#/definitions/OuterBoolean" - } - } ], + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/OuterBoolean" + } + } + }, + "required" : false + }, "responses" : { "200" : { "description" : "Output boolean", - "schema" : { - "$ref" : "#/definitions/OuterBoolean" + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/OuterBoolean" + } + } } } } @@ -984,20 +1227,26 @@ "tags" : [ "fake" ], "description" : "Test serialization of object with outer number type", "operationId" : "fakeOuterCompositeSerialize", - "parameters" : [ { - "in" : "body", - "name" : "body", + "requestBody" : { "description" : "Input composite as post body", - "required" : false, - "schema" : { - "$ref" : "#/definitions/OuterComposite" - } - } ], + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/OuterComposite" + } + } + }, + "required" : false + }, "responses" : { "200" : { "description" : "Output composite", - "schema" : { - "$ref" : "#/definitions/OuterComposite" + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/OuterComposite" + } + } } } } @@ -1007,25 +1256,31 @@ "get" : { "tags" : [ "fake" ], "summary" : "test json serialization of form data", - "description" : "", "operationId" : "testJsonFormData", - "consumes" : [ "application/json" ], - "parameters" : [ { - "name" : "param", - "in" : "formData", - "description" : "field1", - "required" : true, - "type" : "string" - }, { - "name" : "param2", - "in" : "formData", - "description" : "field2", - "required" : true, - "type" : "string" - } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "required" : [ "param", "param2" ], + "properties" : { + "param" : { + "type" : "string", + "description" : "field1" + }, + "param2" : { + "type" : "string", + "description" : "field2" + } + } + } + } + }, + "required" : true + }, "responses" : { "200" : { - "description" : "successful operation" + "description" : "successful operation", + "content" : { } } } } @@ -1034,24 +1289,25 @@ "post" : { "tags" : [ "fake" ], "summary" : "test inline additionalProperties", - "description" : "", "operationId" : "testInlineAdditionalProperties", - "consumes" : [ "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "param", + "requestBody" : { "description" : "request body", - "required" : true, - "schema" : { - "type" : "object", - "additionalProperties" : { - "type" : "string" + "content" : { + "application/json" : { + "schema" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" + } + } } - } - } ], + }, + "required" : true + }, "responses" : { "200" : { - "description" : "successful operation" + "description" : "successful operation", + "content" : { } } } } @@ -1062,658 +1318,671 @@ "summary" : "To test special tags", "description" : "To test special tags", "operationId" : "test_special_tags", - "consumes" : [ "application/json" ], - "produces" : [ "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", + "requestBody" : { "description" : "client model", - "required" : true, - "schema" : { - "$ref" : "#/definitions/Client" - } - } ], + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Client" + } + } + }, + "required" : true + }, "responses" : { "200" : { "description" : "successful operation", - "schema" : { - "$ref" : "#/definitions/Client" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Client" + } + } } } } } } }, - "securityDefinitions" : { - "petstore_auth" : { - "type" : "oauth2", - "authorizationUrl" : "http://petstore.swagger.io/api/oauth/dialog", - "flow" : "implicit", - "scopes" : { - "write:pets" : "modify pets in your account", - "read:pets" : "read your pets" - } - }, - "api_key" : { - "type" : "apiKey", - "name" : "api_key", - "in" : "header" - }, - "api_key_query" : { - "type" : "apiKey", - "name" : "api_key_query", - "in" : "query" - }, - "http_basic_test" : { - "type" : "basic" - } - }, - "definitions" : { - "Order" : { - "type" : "object", - "properties" : { - "id" : { - "type" : "integer", - "format" : "int64" - }, - "petId" : { - "type" : "integer", - "format" : "int64" - }, - "quantity" : { - "type" : "integer", - "format" : "int32" - }, - "shipDate" : { - "type" : "string", - "format" : "date-time" - }, - "status" : { - "type" : "string", - "description" : "Order Status", - "enum" : [ "placed", "approved", "delivered" ] + "components" : { + "schemas" : { + "Category" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64" + }, + "name" : { + "type" : "string" + } }, - "complete" : { - "type" : "boolean", - "default" : false + "xml" : { + "name" : "Category" } }, - "xml" : { - "name" : "Order" - } - }, - "Category" : { - "type" : "object", - "properties" : { - "id" : { - "type" : "integer", - "format" : "int64" + "User" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64", + "x-is-unique" : true + }, + "username" : { + "type" : "string" + }, + "firstName" : { + "type" : "string" + }, + "lastName" : { + "type" : "string" + }, + "email" : { + "type" : "string" + }, + "password" : { + "type" : "string" + }, + "phone" : { + "type" : "string" + }, + "userStatus" : { + "type" : "integer", + "description" : "User Status", + "format" : "int32" + } }, - "name" : { - "type" : "string" + "xml" : { + "name" : "User" } }, - "xml" : { - "name" : "Category" - } - }, - "User" : { - "type" : "object", - "properties" : { - "id" : { - "type" : "integer", - "format" : "int64", - "x-is-unique" : true - }, - "username" : { - "type" : "string" - }, - "firstName" : { - "type" : "string" - }, - "lastName" : { - "type" : "string" - }, - "email" : { - "type" : "string" - }, - "password" : { - "type" : "string" - }, - "phone" : { - "type" : "string" - }, - "userStatus" : { - "type" : "integer", - "format" : "int32", - "description" : "User Status" - } + "OuterNumber" : { + "type" : "number" }, - "xml" : { - "name" : "User" - } - }, - "Tag" : { - "type" : "object", - "properties" : { - "id" : { - "type" : "integer", - "format" : "int64" - }, - "name" : { - "type" : "string" + "ArrayOfNumberOnly" : { + "type" : "object", + "properties" : { + "ArrayNumber" : { + "type" : "array", + "items" : { + "type" : "number" + } + } } }, - "xml" : { - "name" : "Tag" - } - }, - "Pet" : { - "type" : "object", - "required" : [ "name", "photoUrls" ], - "properties" : { - "id" : { - "type" : "integer", - "format" : "int64", - "x-is-unique" : true - }, - "category" : { - "$ref" : "#/definitions/Category" - }, - "name" : { - "type" : "string", - "example" : "doggie" - }, - "photoUrls" : { - "type" : "array", - "xml" : { - "name" : "photoUrl", - "wrapped" : true + "Capitalization" : { + "type" : "object", + "properties" : { + "smallCamel" : { + "type" : "string" }, - "items" : { + "CapitalCamel" : { + "type" : "string" + }, + "small_Snake" : { + "type" : "string" + }, + "Capital_Snake" : { "type" : "string" - } - }, - "tags" : { - "type" : "array", - "xml" : { - "name" : "tag", - "wrapped" : true }, - "items" : { - "$ref" : "#/definitions/Tag" + "SCA_ETH_Flow_Points" : { + "type" : "string" + }, + "ATT_NAME" : { + "type" : "string", + "description" : "Name of the pet\n" } - }, - "status" : { - "type" : "string", - "description" : "pet status in the store", - "enum" : [ "available", "pending", "sold" ] - } - }, - "xml" : { - "name" : "Pet" - } - }, - "ApiResponse" : { - "type" : "object", - "properties" : { - "code" : { - "type" : "integer", - "format" : "int32" - }, - "type" : { - "type" : "string" - }, - "message" : { - "type" : "string" - } - } - }, - "$special[model.name]" : { - "properties" : { - "$special[property.name]" : { - "type" : "integer", - "format" : "int64" } }, - "xml" : { - "name" : "$special[model.name]" - } - }, - "Return" : { - "properties" : { - "return" : { - "type" : "integer", - "format" : "int32" + "MixedPropertiesAndAdditionalPropertiesClass" : { + "type" : "object", + "properties" : { + "uuid" : { + "type" : "string", + "format" : "uuid" + }, + "dateTime" : { + "type" : "string", + "format" : "date-time" + }, + "map" : { + "type" : "object", + "additionalProperties" : { + "$ref" : "#/components/schemas/Animal" + } + } } }, - "description" : "Model for testing reserved words", - "xml" : { - "name" : "Return" - } - }, - "Name" : { - "required" : [ "name" ], - "properties" : { - "name" : { - "type" : "integer", - "format" : "int32" - }, - "snake_case" : { - "type" : "integer", - "format" : "int32", - "readOnly" : true - }, - "property" : { - "type" : "string" - }, - "123Number" : { - "type" : "integer", - "readOnly" : true + "ApiResponse" : { + "type" : "object", + "properties" : { + "code" : { + "type" : "integer", + "format" : "int32" + }, + "type" : { + "type" : "string" + }, + "message" : { + "type" : "string" + } } }, - "description" : "Model for testing model name same as property name", - "xml" : { - "name" : "Name" - } - }, - "200_response" : { - "properties" : { - "name" : { - "type" : "integer", - "format" : "int32" + "Name" : { + "required" : [ "name" ], + "type" : "object", + "properties" : { + "name" : { + "type" : "integer", + "format" : "int32" + }, + "snake_case" : { + "type" : "integer", + "format" : "int32", + "readOnly" : true + }, + "property" : { + "type" : "string" + }, + "123Number" : { + "type" : "integer", + "readOnly" : true + } }, - "class" : { - "type" : "string" + "description" : "Model for testing model name same as property name", + "xml" : { + "name" : "Name" } }, - "description" : "Model for testing model name starting with number", - "xml" : { - "name" : "Name" - } - }, - "ClassModel" : { - "properties" : { - "_class" : { - "type" : "string" - } + "EnumClass" : { + "type" : "string", + "default" : "-efg", + "enum" : [ "_abc", "-efg", "(xyz)" ] }, - "description" : "Model for testing model with \"_class\" property" - }, - "Dog" : { - "allOf" : [ { - "$ref" : "#/definitions/Animal" - }, { + "List" : { "type" : "object", "properties" : { - "breed" : { + "123-list" : { "type" : "string" } } - } ] - }, - "Cat" : { - "allOf" : [ { - "$ref" : "#/definitions/Animal" - }, { + }, + "NumberOnly" : { "type" : "object", "properties" : { - "declawed" : { - "type" : "boolean" + "JustNumber" : { + "type" : "number" } } - } ] - }, - "Animal" : { - "type" : "object", - "required" : [ "className" ], - "discriminator" : "className", - "properties" : { - "className" : { - "type" : "string" - }, - "color" : { - "type" : "string", - "default" : "red" - } - } - }, - "AnimalFarm" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/Animal" - } - }, - "format_test" : { - "type" : "object", - "required" : [ "byte", "date", "number", "password" ], - "properties" : { - "integer" : { - "type" : "integer", - "minimum" : 10, - "maximum" : 100 - }, - "int32" : { - "type" : "integer", - "format" : "int32", - "minimum" : 20, - "maximum" : 200 - }, - "int64" : { - "type" : "integer", - "format" : "int64" - }, - "number" : { - "type" : "number", - "minimum" : 32.1, - "maximum" : 543.2 - }, - "float" : { - "type" : "number", - "format" : "float", - "minimum" : 54.3, - "maximum" : 987.6 - }, - "double" : { - "type" : "number", - "format" : "double", - "minimum" : 67.8, - "maximum" : 123.4 - }, - "string" : { - "type" : "string", - "pattern" : "/[a-z]/i" - }, - "byte" : { - "type" : "string", - "format" : "byte", - "pattern" : "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" - }, - "binary" : { - "type" : "string", - "format" : "binary" - }, - "date" : { - "type" : "string", - "format" : "date" - }, - "dateTime" : { - "type" : "string", - "format" : "date-time" - }, - "uuid" : { - "type" : "string", - "format" : "uuid" - }, - "password" : { - "type" : "string", - "format" : "password", - "minLength" : 10, - "maxLength" : 64 - } - } - }, - "EnumClass" : { - "type" : "string", - "enum" : [ "_abc", "-efg", "(xyz)" ], - "default" : "-efg" - }, - "Enum_Test" : { - "type" : "object", - "properties" : { - "enum_string" : { - "type" : "string", - "enum" : [ "UPPER", "lower", "" ] - }, - "enum_integer" : { - "type" : "integer", - "format" : "int32", - "enum" : [ 1, -1 ] - }, - "enum_number" : { - "type" : "number", - "format" : "double", - "enum" : [ 1.1, -1.2 ] + }, + "200_response" : { + "type" : "object", + "properties" : { + "name" : { + "type" : "integer", + "format" : "int32" + }, + "class" : { + "type" : "string" + } }, - "outerEnum" : { - "$ref" : "#/definitions/OuterEnum" + "description" : "Model for testing model name starting with number", + "xml" : { + "name" : "Name" } - } - }, - "AdditionalPropertiesClass" : { - "type" : "object", - "properties" : { - "map_property" : { - "type" : "object", - "additionalProperties" : { + }, + "Client" : { + "type" : "object", + "properties" : { + "client" : { "type" : "string" } - }, - "map_of_map_property" : { + } + }, + "Dog" : { + "allOf" : [ { + "$ref" : "#/components/schemas/Animal" + }, { "type" : "object", - "additionalProperties" : { - "type" : "object", - "additionalProperties" : { + "properties" : { + "breed" : { "type" : "string" } } - } - } - }, - "MixedPropertiesAndAdditionalPropertiesClass" : { - "type" : "object", - "properties" : { - "uuid" : { - "type" : "string", - "format" : "uuid" - }, - "dateTime" : { - "type" : "string", - "format" : "date-time" - }, - "map" : { - "type" : "object", - "additionalProperties" : { - "$ref" : "#/definitions/Animal" + } ] + }, + "Enum_Test" : { + "type" : "object", + "properties" : { + "enum_string" : { + "type" : "string", + "enum" : [ "UPPER", "lower", "" ] + }, + "enum_integer" : { + "type" : "integer", + "format" : "int32", + "enum" : [ 1, -1 ] + }, + "enum_number" : { + "type" : "number", + "format" : "double", + "enum" : [ 1.1, -1.2 ] + }, + "outerEnum" : { + "$ref" : "#/components/schemas/OuterEnum" } } - } - }, - "List" : { - "type" : "object", - "properties" : { - "123-list" : { - "type" : "string" - } - } - }, - "Client" : { - "type" : "object", - "properties" : { - "client" : { - "type" : "string" - } - } - }, - "ReadOnlyFirst" : { - "type" : "object", - "properties" : { - "bar" : { - "type" : "string", - "readOnly" : true - }, - "baz" : { - "type" : "string" - } - } - }, - "hasOnlyReadOnly" : { - "type" : "object", - "properties" : { - "bar" : { - "type" : "string", - "readOnly" : true - }, - "foo" : { - "type" : "string", - "readOnly" : true - } - } - }, - "Capitalization" : { - "type" : "object", - "properties" : { - "smallCamel" : { - "type" : "string" - }, - "CapitalCamel" : { - "type" : "string" - }, - "small_Snake" : { - "type" : "string" - }, - "Capital_Snake" : { - "type" : "string" - }, - "SCA_ETH_Flow_Points" : { - "type" : "string" + }, + "Order" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64" + }, + "petId" : { + "type" : "integer", + "format" : "int64" + }, + "quantity" : { + "type" : "integer", + "format" : "int32" + }, + "shipDate" : { + "type" : "string", + "format" : "date-time" + }, + "status" : { + "type" : "string", + "description" : "Order Status", + "enum" : [ "placed", "approved", "delivered" ] + }, + "complete" : { + "type" : "boolean", + "default" : false + } }, - "ATT_NAME" : { - "type" : "string", - "description" : "Name of the pet\n" + "xml" : { + "name" : "Order" } - } - }, - "MapTest" : { - "type" : "object", - "properties" : { - "map_map_of_string" : { - "type" : "object", - "additionalProperties" : { + }, + "AdditionalPropertiesClass" : { + "type" : "object", + "properties" : { + "map_property" : { "type" : "object", "additionalProperties" : { "type" : "string" } + }, + "map_of_map_property" : { + "type" : "object", + "additionalProperties" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" + } + } + } + } + }, + "$special[model.name]" : { + "type" : "object", + "properties" : { + "$special[property.name]" : { + "type" : "integer", + "format" : "int64" } }, - "map_of_enum_string" : { - "type" : "object", - "additionalProperties" : { - "type" : "string", - "enum" : [ "UPPER", "lower" ] + "xml" : { + "name" : "$special[model.name]" + } + }, + "Return" : { + "type" : "object", + "properties" : { + "return" : { + "type" : "integer", + "format" : "int32" } + }, + "description" : "Model for testing reserved words", + "xml" : { + "name" : "Return" } - } - }, - "ArrayTest" : { - "type" : "object", - "properties" : { - "array_of_string" : { - "type" : "array", - "items" : { + }, + "ReadOnlyFirst" : { + "type" : "object", + "properties" : { + "bar" : { + "type" : "string", + "readOnly" : true + }, + "baz" : { "type" : "string" } - }, - "array_array_of_integer" : { - "type" : "array", - "items" : { + } + }, + "ArrayOfArrayOfNumberOnly" : { + "type" : "object", + "properties" : { + "ArrayArrayNumber" : { "type" : "array", "items" : { - "type" : "integer", - "format" : "int64" + "type" : "array", + "items" : { + "type" : "number" + } } } - }, - "array_array_of_model" : { - "type" : "array", - "items" : { + } + }, + "OuterEnum" : { + "type" : "string", + "enum" : [ "placed", "approved", "delivered" ] + }, + "ArrayTest" : { + "type" : "object", + "properties" : { + "array_of_string" : { "type" : "array", "items" : { - "$ref" : "#/definitions/ReadOnlyFirst" + "type" : "string" + } + }, + "array_array_of_integer" : { + "type" : "array", + "items" : { + "type" : "array", + "items" : { + "type" : "integer", + "format" : "int64" + } + } + }, + "array_array_of_model" : { + "type" : "array", + "items" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/ReadOnlyFirst" + } } } } - } - }, - "NumberOnly" : { - "type" : "object", - "properties" : { - "JustNumber" : { - "type" : "number" + }, + "OuterComposite" : { + "type" : "object", + "properties" : { + "my_number" : { + "$ref" : "#/components/schemas/OuterNumber" + }, + "my_string" : { + "$ref" : "#/components/schemas/OuterString" + }, + "my_boolean" : { + "$ref" : "#/components/schemas/OuterBoolean" + } } - } - }, - "ArrayOfNumberOnly" : { - "type" : "object", - "properties" : { - "ArrayNumber" : { - "type" : "array", - "items" : { + }, + "format_test" : { + "required" : [ "byte", "date", "number", "password" ], + "type" : "object", + "properties" : { + "integer" : { + "maximum" : 1E+2, + "minimum" : 1E+1, + "type" : "integer" + }, + "int32" : { + "maximum" : 2E+2, + "minimum" : 2E+1, + "type" : "integer", + "format" : "int32" + }, + "int64" : { + "type" : "integer", + "format" : "int64" + }, + "number" : { + "maximum" : 543.2, + "minimum" : 32.1, "type" : "number" + }, + "float" : { + "maximum" : 987.6, + "minimum" : 54.3, + "type" : "number", + "format" : "float" + }, + "double" : { + "maximum" : 123.4, + "minimum" : 67.8, + "type" : "number", + "format" : "double" + }, + "string" : { + "pattern" : "/[a-z]/i", + "type" : "string" + }, + "byte" : { + "pattern" : "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$", + "type" : "string", + "format" : "byte" + }, + "binary" : { + "type" : "string", + "format" : "binary" + }, + "date" : { + "type" : "string", + "format" : "date" + }, + "dateTime" : { + "type" : "string", + "format" : "date-time" + }, + "uuid" : { + "type" : "string", + "format" : "uuid" + }, + "password" : { + "maxLength" : 64, + "minLength" : 10, + "type" : "string", + "format" : "password" } } - } - }, - "ArrayOfArrayOfNumberOnly" : { - "type" : "object", - "properties" : { - "ArrayArrayNumber" : { - "type" : "array", - "items" : { + }, + "EnumArrays" : { + "type" : "object", + "properties" : { + "just_symbol" : { + "type" : "string", + "enum" : [ ">=", "$" ] + }, + "array_enum" : { "type" : "array", "items" : { - "type" : "number" + "type" : "string", + "enum" : [ "fish", "crab" ] } } } - } - }, - "EnumArrays" : { - "type" : "object", - "properties" : { - "just_symbol" : { - "type" : "string", - "enum" : [ ">=", "$" ] + }, + "OuterString" : { + "type" : "string" + }, + "ClassModel" : { + "type" : "object", + "properties" : { + "_class" : { + "type" : "string" + } }, - "array_enum" : { - "type" : "array", - "items" : { + "description" : "Model for testing model with \"_class\" property" + }, + "OuterBoolean" : { + "type" : "boolean" + }, + "Animal" : { + "required" : [ "className" ], + "type" : "object", + "properties" : { + "className" : { + "type" : "string" + }, + "color" : { "type" : "string", - "enum" : [ "fish", "crab" ] + "default" : "red" } + }, + "discriminator" : { + "propertyName" : "className" } - } - }, - "OuterEnum" : { - "type" : "string", - "enum" : [ "placed", "approved", "delivered" ] - }, - "OuterComposite" : { - "type" : "object", - "properties" : { - "my_number" : { - "$ref" : "#/definitions/OuterNumber" + }, + "Cat" : { + "allOf" : [ { + "$ref" : "#/components/schemas/Animal" + }, { + "type" : "object", + "properties" : { + "declawed" : { + "type" : "boolean" + } + } + } ] + }, + "MapTest" : { + "type" : "object", + "properties" : { + "map_map_of_string" : { + "type" : "object", + "additionalProperties" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" + } + } + }, + "map_of_enum_string" : { + "type" : "object", + "additionalProperties" : { + "type" : "string", + "enum" : [ "UPPER", "lower" ] + } + } + } + }, + "Tag" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64" + }, + "name" : { + "type" : "string" + } }, - "my_string" : { - "$ref" : "#/definitions/OuterString" + "xml" : { + "name" : "Tag" + } + }, + "AnimalFarm" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Animal" + } + }, + "Pet" : { + "required" : [ "name", "photoUrls" ], + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64", + "x-is-unique" : true + }, + "category" : { + "$ref" : "#/components/schemas/Category" + }, + "name" : { + "type" : "string", + "example" : "doggie" + }, + "photoUrls" : { + "type" : "array", + "xml" : { + "name" : "photoUrl", + "wrapped" : true + }, + "items" : { + "type" : "string" + } + }, + "tags" : { + "type" : "array", + "xml" : { + "name" : "tag", + "wrapped" : true + }, + "items" : { + "$ref" : "#/components/schemas/Tag" + } + }, + "status" : { + "type" : "string", + "description" : "pet status in the store", + "enum" : [ "available", "pending", "sold" ] + } }, - "my_boolean" : { - "$ref" : "#/definitions/OuterBoolean" + "xml" : { + "name" : "Pet" + } + }, + "hasOnlyReadOnly" : { + "type" : "object", + "properties" : { + "bar" : { + "type" : "string", + "readOnly" : true + }, + "foo" : { + "type" : "string", + "readOnly" : true + } } } }, - "OuterNumber" : { - "type" : "number" - }, - "OuterString" : { - "type" : "string" - }, - "OuterBoolean" : { - "type" : "boolean" + "securitySchemes" : { + "petstore_auth" : { + "type" : "oauth2", + "flows" : { + "implicit" : { + "authorizationUrl" : "http://petstore.swagger.io/api/oauth/dialog", + "scopes" : { + "write:pets" : "modify pets in your account", + "read:pets" : "read your pets" + } + } + } + }, + "http_basic_test" : { + "type" : "http", + "scheme" : "basic" + }, + "api_key" : { + "type" : "apiKey", + "name" : "api_key", + "in" : "header" + }, + "api_key_query" : { + "type" : "apiKey", + "name" : "api_key_query", + "in" : "query" + } } - }, - "externalDocs" : { - "description" : "Find out more about Swagger", - "url" : "http://swagger.io" } } \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-spec/.swagger-codegen/VERSION b/samples/server/petstore/jaxrs-spec/.swagger-codegen/VERSION index 50794f17f1a..096bf47efe3 100644 --- a/samples/server/petstore/jaxrs-spec/.swagger-codegen/VERSION +++ b/samples/server/petstore/jaxrs-spec/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.1-SNAPSHOT \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-spec/pom.xml b/samples/server/petstore/jaxrs-spec/pom.xml index 17d7b2328ef..14d2f7a7404 100644 --- a/samples/server/petstore/jaxrs-spec/pom.xml +++ b/samples/server/petstore/jaxrs-spec/pom.xml @@ -69,6 +69,7 @@ + javax.validation @@ -76,6 +77,7 @@ 1.1.0.Final provided + 4.8.1 diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/AnotherFakeApi.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/AnotherFakeApi.java index a1853b368d5..de4d57104fb 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/AnotherFakeApi.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/AnotherFakeApi.java @@ -2,6 +2,7 @@ import io.swagger.model.Client; + import javax.ws.rs.*; import javax.ws.rs.core.Response; @@ -14,16 +15,20 @@ @Path("/another-fake") @Api(description = "the another-fake API") + +@javax.annotation.Generated(value = "io.swagger.codegen.languages.java.JavaJAXRSSpecServerCodegen", date = "2018-03-15T06:28:26.585+01:00[Europe/Zurich]") public class AnotherFakeApi { + + @PATCH @Path("/dummy") - @Consumes({ "application/json" }) - @Produces({ "application/json" }) @ApiOperation(value = "To test special tags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?" }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - public Response testSpecialTags(@Valid Client body) { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) + }) + public Response testSpecialTags(@Valid Client client) { return Response.ok().entity("magic!").build(); } + } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/FakeApi.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/FakeApi.java index 8c345d48cb6..24f830bf81c 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/FakeApi.java @@ -2,10 +2,9 @@ import java.math.BigDecimal; import io.swagger.model.Client; -import java.util.Date; -import org.joda.time.LocalDate; import io.swagger.model.OuterComposite; + import javax.ws.rs.*; import javax.ws.rs.core.Response; @@ -18,95 +17,107 @@ @Path("/fake") @Api(description = "the fake API") + +@javax.annotation.Generated(value = "io.swagger.codegen.languages.java.JavaJAXRSSpecServerCodegen", date = "2018-03-15T06:28:26.585+01:00[Europe/Zurich]") public class FakeApi { + + @POST @Path("/outer/boolean") - @ApiOperation(value = "", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) + @ApiOperation(value = "", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake" }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) + @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) + }) public Response fakeOuterBooleanSerialize(@Valid Boolean body) { return Response.ok().entity("magic!").build(); } + @POST @Path("/outer/composite") - @ApiOperation(value = "", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) + @ApiOperation(value = "", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake" }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) - public Response fakeOuterCompositeSerialize(@Valid OuterComposite body) { + @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) + }) + public Response fakeOuterCompositeSerialize(@Valid OuterComposite outercomposite) { return Response.ok().entity("magic!").build(); } + @POST @Path("/outer/number") - @ApiOperation(value = "", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) + @ApiOperation(value = "", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake" }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) + @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) + }) public Response fakeOuterNumberSerialize(@Valid BigDecimal body) { return Response.ok().entity("magic!").build(); } + @POST @Path("/outer/string") - @ApiOperation(value = "", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) + @ApiOperation(value = "", notes = "Test serialization of outer string types", response = String.class, tags={ "fake" }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "Output string", response = String.class) }) + @ApiResponse(code = 200, message = "Output string", response = String.class) + }) public Response fakeOuterStringSerialize(@Valid String body) { return Response.ok().entity("magic!").build(); } + @PATCH - @Consumes({ "application/json" }) - @Produces({ "application/json" }) - @ApiOperation(value = "To test \"client\" model", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) + @ApiOperation(value = "To test \"client\" model", notes = "To test \"client\" model", response = Client.class, tags={ "fake" }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - public Response testClientModel(@Valid Client body) { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) + }) + public Response testClientModel(@Valid Client client) { return Response.ok().entity("magic!").build(); } + @POST - @Consumes({ "application/xml; charset=utf-8", "application/json; charset=utf-8" }) - @Produces({ "application/xml; charset=utf-8", "application/json; charset=utf-8" }) - @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = Void.class, authorizations = { - @Authorization(value = "http_basic_test") - }, tags={ "fake", }) + @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = Void.class, tags={ "fake" }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), - @ApiResponse(code = 404, message = "User not found", response = Void.class) }) - public Response testEndpointParameters(@FormParam(value = "number") BigDecimal number,@FormParam(value = "double") Double _double,@FormParam(value = "pattern_without_delimiter") String patternWithoutDelimiter,@FormParam(value = "byte") byte[] _byte,@FormParam(value = "integer") Integer integer,@FormParam(value = "int32") Integer int32,@FormParam(value = "int64") Long int64,@FormParam(value = "float") Float _float,@FormParam(value = "string") String string,@FormParam(value = "binary") byte[] binary,@FormParam(value = "date") LocalDate date,@FormParam(value = "dateTime") Date dateTime,@FormParam(value = "password") String password,@FormParam(value = "callback") String paramCallback) { + @ApiResponse(code = 404, message = "User not found", response = Void.class) + }) + public Response testEndpointParameters(@Valid Object body) { return Response.ok().entity("magic!").build(); } + @GET - @Consumes({ "*/*" }) - @Produces({ "*/*" }) - @ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", response = Void.class, tags={ "fake", }) + @ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", response = Void.class, tags={ "fake" }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request", response = Void.class), - @ApiResponse(code = 404, message = "Not found", response = Void.class) }) - public Response testEnumParameters(@FormParam(value = "enum_form_string_array") List enumFormStringArray,@FormParam(value = "enum_form_string") String enumFormString,@HeaderParam("enum_header_string_array") @ApiParam("Header parameter enum test (string array)") List enumHeaderStringArray,@HeaderParam("enum_header_string") @DefaultValue("-efg") @ApiParam("Header parameter enum test (string)") String enumHeaderString,@QueryParam("enum_query_string_array") @ApiParam("Query parameter enum test (string array)") List enumQueryStringArray,@QueryParam("enum_query_string") @DefaultValue("-efg") @ApiParam("Query parameter enum test (string)") String enumQueryString,@QueryParam("enum_query_integer") @ApiParam("Query parameter enum test (double)") Integer enumQueryInteger,@FormParam(value = "enum_query_double") Double enumQueryDouble) { + @ApiResponse(code = 404, message = "Not found", response = Void.class) + }) + public Response testEnumParameters(@Valid Object body,@HeaderParam("enum_header_string_array") @ApiParam("Header parameter enum test (string array)") List enumHeaderStringArray,@HeaderParam("enum_header_string") @ApiParam("Header parameter enum test (string)") String enumHeaderString,@QueryParam("enum_query_string_array") @ApiParam("Query parameter enum test (string array)") List enumQueryStringArray,@QueryParam("enum_query_string") @ApiParam("Query parameter enum test (string)") String enumQueryString,@QueryParam("enum_query_integer") @ApiParam("Query parameter enum test (double)") Integer enumQueryInteger) { return Response.ok().entity("magic!").build(); } + @POST @Path("/inline-additionalProperties") - @Consumes({ "application/json" }) - @ApiOperation(value = "test inline additionalProperties", notes = "", response = Void.class, tags={ "fake", }) + @ApiOperation(value = "test inline additionalProperties", notes = "", response = Void.class, tags={ "fake" }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - public Response testInlineAdditionalProperties(@Valid Object param) { + @ApiResponse(code = 200, message = "successful operation", response = Void.class) + }) + public Response testInlineAdditionalProperties(@Valid Map body) { return Response.ok().entity("magic!").build(); } + @GET @Path("/jsonFormData") - @Consumes({ "application/json" }) @ApiOperation(value = "test json serialization of form data", notes = "", response = Void.class, tags={ "fake" }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - public Response testJsonFormData(@FormParam(value = "param") String param,@FormParam(value = "param2") String param2) { + @ApiResponse(code = 200, message = "successful operation", response = Void.class) + }) + public Response testJsonFormData(@Valid Object body) { return Response.ok().entity("magic!").build(); } + } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/FakeClassnameTestApi.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/FakeClassnameTestApi.java index 73a17df8e68..a4f0e130054 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/FakeClassnameTestApi.java @@ -2,6 +2,7 @@ import io.swagger.model.Client; + import javax.ws.rs.*; import javax.ws.rs.core.Response; @@ -14,17 +15,19 @@ @Path("/fake_classname_test") @Api(description = "the fake_classname_test API") + +@javax.annotation.Generated(value = "io.swagger.codegen.languages.java.JavaJAXRSSpecServerCodegen", date = "2018-03-15T06:28:26.585+01:00[Europe/Zurich]") public class FakeClassnameTestApi { + + @PATCH - @Consumes({ "application/json" }) - @Produces({ "application/json" }) - @ApiOperation(value = "To test class name in snake case", notes = "", response = Client.class, authorizations = { - @Authorization(value = "api_key_query") - }, tags={ "fake_classname_tags 123#$%^" }) + @ApiOperation(value = "To test class name in snake case", notes = "", response = Client.class, tags={ "fake_classname_tags 123#$%^" }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - public Response testClassname(@Valid Client body) { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) + }) + public Response testClassname(@Valid Client client) { return Response.ok().entity("magic!").build(); } + } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/PetApi.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/PetApi.java index 2315ee854a6..683d11f9d2d 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/PetApi.java @@ -1,9 +1,9 @@ package io.swagger.api; -import java.io.File; import io.swagger.model.ModelApiResponse; import io.swagger.model.Pet; + import javax.ws.rs.*; import javax.ws.rs.core.Response; @@ -16,131 +16,101 @@ @Path("/pet") @Api(description = "the pet API") + +@javax.annotation.Generated(value = "io.swagger.codegen.languages.java.JavaJAXRSSpecServerCodegen", date = "2018-03-15T06:28:26.585+01:00[Europe/Zurich]") public class PetApi { + + @POST - @Consumes({ "application/json", "application/xml" }) - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Add a new pet to the store", notes = "", response = Void.class, authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + @ApiOperation(value = "Add a new pet to the store", notes = "", response = Void.class, tags={ "pet" }) @ApiResponses(value = { - @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) - public Response addPet(@Valid Pet body) { + @ApiResponse(code = 405, message = "Invalid input", response = Void.class) + }) + public Response addPet(@Valid Pet pet) { return Response.ok().entity("magic!").build(); } + @DELETE @Path("/{petId}") - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + @ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, tags={ "pet" }) @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) - public Response deletePet(@PathParam("petId") @ApiParam("Pet id to delete") Long petId,@HeaderParam("api_key") String apiKey) { + @ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) + }) + public Response deletePet(@PathParam("petId") @ApiParam("Pet id to delete") Integer petId,@HeaderParam("api_key") String apiKey) { return Response.ok().entity("magic!").build(); } + @GET @Path("/findByStatus") - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + @ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", tags={ "pet" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @ApiResponse(code = 400, message = "Invalid status value", response = Void.class) }) + @ApiResponse(code = 400, message = "Invalid status value", response = Void.class) + }) public Response findPetsByStatus(@QueryParam("status") @NotNull @ApiParam("Status values that need to be considered for filter") List status) { return Response.ok().entity("magic!").build(); } + @GET @Path("/findByTags") - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + @ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", tags={ "pet" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @ApiResponse(code = 400, message = "Invalid tag value", response = Void.class) }) + @ApiResponse(code = 400, message = "Invalid tag value", response = Void.class) + }) public Response findPetsByTags(@QueryParam("tags") @NotNull @ApiParam("Tags to filter by") List tags) { return Response.ok().entity("magic!").build(); } + @GET @Path("/{petId}") - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = { - @Authorization(value = "api_key") - }, tags={ "pet", }) + @ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, tags={ "pet" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), - @ApiResponse(code = 404, message = "Pet not found", response = Void.class) }) - public Response getPetById(@PathParam("petId") @ApiParam("ID of pet to return") Long petId) { + @ApiResponse(code = 404, message = "Pet not found", response = Void.class) + }) + public Response getPetById(@PathParam("petId") @ApiParam("ID of pet to return") Integer petId) { return Response.ok().entity("magic!").build(); } + @PUT - @Consumes({ "application/json", "application/xml" }) - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + @ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, tags={ "pet" }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Pet not found", response = Void.class), - @ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) - public Response updatePet(@Valid Pet body) { + @ApiResponse(code = 405, message = "Validation exception", response = Void.class) + }) + public Response updatePet(@Valid Pet pet) { return Response.ok().entity("magic!").build(); } + @POST @Path("/{petId}") - @Consumes({ "application/x-www-form-urlencoded" }) - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + @ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, tags={ "pet" }) @ApiResponses(value = { - @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) - public Response updatePetWithForm(@PathParam("petId") @ApiParam("ID of pet that needs to be updated") Long petId,@FormParam(value = "name") String name,@FormParam(value = "status") String status) { + @ApiResponse(code = 405, message = "Invalid input", response = Void.class) + }) + public Response updatePetWithForm(@PathParam("petId") @ApiParam("ID of pet that needs to be updated") Integer petId,@Valid Object body) { return Response.ok().entity("magic!").build(); } + @POST @Path("/{petId}/uploadImage") - @Consumes({ "multipart/form-data" }) - @Produces({ "application/json" }) - @ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet" }) + @ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, tags={ "pet" }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - public Response uploadFile(@PathParam("petId") @ApiParam("ID of pet to update") Long petId,@FormParam(value = "additionalMetadata") String additionalMetadata, @FormParam(value = "file") InputStream fileInputStream, - @FormParam(value = "file") Attachment fileDetail) { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) + }) + public Response uploadFile(@PathParam("petId") @ApiParam("ID of pet to update") Integer petId,@Valid Object body) { return Response.ok().entity("magic!").build(); } + } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/RestApplication.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/RestApplication.java index 56e801bbf5f..2561172aea9 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/RestApplication.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/RestApplication.java @@ -5,5 +5,5 @@ @ApplicationPath("/") public class RestApplication extends Application { - -} \ No newline at end of file + +} diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/StoreApi.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/StoreApi.java index f2de22abfce..375fcea7d3f 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/StoreApi.java @@ -3,6 +3,7 @@ import java.util.Map; import io.swagger.model.Order; + import javax.ws.rs.*; import javax.ws.rs.core.Response; @@ -15,51 +16,57 @@ @Path("/store") @Api(description = "the store API") + +@javax.annotation.Generated(value = "io.swagger.codegen.languages.java.JavaJAXRSSpecServerCodegen", date = "2018-03-15T06:28:26.585+01:00[Europe/Zurich]") public class StoreApi { + + @DELETE @Path("/order/{order_id}") - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = Void.class, tags={ "store", }) + @ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = Void.class, tags={ "store" }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), - @ApiResponse(code = 404, message = "Order not found", response = Void.class) }) + @ApiResponse(code = 404, message = "Order not found", response = Void.class) + }) public Response deleteOrder(@PathParam("order_id") @ApiParam("ID of the order that needs to be deleted") String orderId) { return Response.ok().entity("magic!").build(); } + @GET @Path("/inventory") - @Produces({ "application/json" }) - @ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { - @Authorization(value = "api_key") - }, tags={ "store", }) + @ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", tags={ "store" }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) + @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") + }) public Response getInventory() { return Response.ok().entity("magic!").build(); } + @GET @Path("/order/{order_id}") - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Find purchase order by ID", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) + @ApiOperation(value = "Find purchase order by ID", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), - @ApiResponse(code = 404, message = "Order not found", response = Void.class) }) - public Response getOrderById(@PathParam("order_id") @Min(1) @Max(5) @ApiParam("ID of pet that needs to be fetched") Long orderId) { + @ApiResponse(code = 404, message = "Order not found", response = Void.class) + }) + public Response getOrderById(@PathParam("order_id") @DecimalMin("1") @DecimalMax("5") @ApiParam("ID of pet that needs to be fetched") Integer orderId) { return Response.ok().entity("magic!").build(); } + @POST @Path("/order") - @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid Order", response = Void.class) }) - public Response placeOrder(@Valid Order body) { + @ApiResponse(code = 400, message = "Invalid Order", response = Void.class) + }) + public Response placeOrder(@Valid Order order) { return Response.ok().entity("magic!").build(); } + } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/UserApi.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/UserApi.java index 63ab0965998..cb347d9cf9a 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/UserApi.java @@ -1,8 +1,8 @@ package io.swagger.api; -import java.util.List; import io.swagger.model.User; + import javax.ws.rs.*; import javax.ws.rs.core.Response; @@ -15,89 +15,101 @@ @Path("/user") @Api(description = "the user API") + +@javax.annotation.Generated(value = "io.swagger.codegen.languages.java.JavaJAXRSSpecServerCodegen", date = "2018-03-15T06:28:26.585+01:00[Europe/Zurich]") public class UserApi { + + @POST - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user" }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - public Response createUser(@Valid User body) { + @ApiResponse(code = 200, message = "successful operation", response = Void.class) + }) + public Response createUser(@Valid User user) { return Response.ok().entity("magic!").build(); } + @POST @Path("/createWithArray") - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user" }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @ApiResponse(code = 200, message = "successful operation", response = Void.class) + }) public Response createUsersWithArrayInput(@Valid List body) { return Response.ok().entity("magic!").build(); } + @POST @Path("/createWithList") - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user" }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @ApiResponse(code = 200, message = "successful operation", response = Void.class) + }) public Response createUsersWithListInput(@Valid List body) { return Response.ok().entity("magic!").build(); } + @DELETE @Path("/{username}") - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), - @ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @ApiResponse(code = 404, message = "User not found", response = Void.class) + }) public Response deleteUser(@PathParam("username") @ApiParam("The name that needs to be deleted") String username) { return Response.ok().entity("magic!").build(); } + @GET @Path("/{username}") - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user", }) + @ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), - @ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @ApiResponse(code = 404, message = "User not found", response = Void.class) + }) public Response getUserByName(@PathParam("username") @ApiParam("The name that needs to be fetched. Use user1 for testing. ") String username) { return Response.ok().entity("magic!").build(); } + @GET @Path("/login") - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user", }) + @ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), - @ApiResponse(code = 400, message = "Invalid username/password supplied", response = Void.class) }) + @ApiResponse(code = 400, message = "Invalid username/password supplied", response = Void.class) + }) public Response loginUser(@QueryParam("username") @NotNull @ApiParam("The user name for login") String username,@QueryParam("password") @NotNull @ApiParam("The password for login in clear text") String password) { return Response.ok().entity("magic!").build(); } + @GET @Path("/logout") - @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user" }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @ApiResponse(code = 200, message = "successful operation", response = Void.class) + }) public Response logoutUser() { return Response.ok().entity("magic!").build(); } + @PUT @Path("/{username}") - @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class), - @ApiResponse(code = 404, message = "User not found", response = Void.class) }) - public Response updateUser(@PathParam("username") @ApiParam("name that need to be deleted") String username,@Valid User body) { + @ApiResponse(code = 404, message = "User not found", response = Void.class) + }) + public Response updateUser(@Valid User user,@PathParam("username") @ApiParam("name that need to be deleted") String username) { return Response.ok().entity("magic!").build(); } + } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java index 6aa5fc2b980..e53fb6ef03f 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java @@ -3,11 +3,18 @@ import java.util.HashMap; import java.util.List; import java.util.Map; + + import java.io.Serializable; + + import javax.validation.constraints.*; import javax.validation.Valid; + + + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; @@ -18,7 +25,11 @@ public class AdditionalPropertiesClass implements Serializable { private @Valid Map mapProperty = new HashMap(); private @Valid Map> mapOfMapProperty = new HashMap>(); + /** + + + **/ public AdditionalPropertiesClass mapProperty(Map mapProperty) { this.mapProperty = mapProperty; @@ -28,6 +39,7 @@ public AdditionalPropertiesClass mapProperty(Map mapProperty) { @ApiModelProperty(value = "") @JsonProperty("map_property") + public Map getMapProperty() { return mapProperty; } @@ -35,7 +47,11 @@ public void setMapProperty(Map mapProperty) { this.mapProperty = mapProperty; } + /** + + + **/ public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { this.mapOfMapProperty = mapOfMapProperty; @@ -45,6 +61,7 @@ public AdditionalPropertiesClass mapOfMapProperty(Map> getMapOfMapProperty() { return mapOfMapProperty; } @@ -52,6 +69,7 @@ public void setMapOfMapProperty(Map> mapOfMapPropert this.mapOfMapProperty = mapOfMapProperty; } + @Override public boolean equals(java.lang.Object o) { @@ -94,3 +112,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Animal.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Animal.java index bb54e9cad22..522dff60d3f 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Animal.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Animal.java @@ -2,11 +2,18 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; + + import java.io.Serializable; + + import javax.validation.constraints.*; import javax.validation.Valid; + + + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; @@ -17,7 +24,11 @@ public class Animal implements Serializable { private @Valid String className = null; private @Valid String color = "red"; + /** + + + **/ public Animal className(String className) { this.className = className; @@ -27,7 +38,9 @@ public Animal className(String className) { @ApiModelProperty(required = true, value = "") @JsonProperty("className") + @NotNull + public String getClassName() { return className; } @@ -35,7 +48,11 @@ public void setClassName(String className) { this.className = className; } + /** + + + **/ public Animal color(String color) { this.color = color; @@ -45,6 +62,7 @@ public Animal color(String color) { @ApiModelProperty(value = "") @JsonProperty("color") + public String getColor() { return color; } @@ -52,6 +70,7 @@ public void setColor(String color) { this.color = color; } + @Override public boolean equals(java.lang.Object o) { @@ -94,3 +113,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/AnimalFarm.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/AnimalFarm.java index f14a33d343e..a1dcc27df12 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/AnimalFarm.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/AnimalFarm.java @@ -3,11 +3,18 @@ import io.swagger.model.Animal; import java.util.ArrayList; import java.util.List; + + import java.io.Serializable; + + import javax.validation.constraints.*; import javax.validation.Valid; + + + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; @@ -16,6 +23,7 @@ public class AnimalFarm extends ArrayList implements Serializable { + @Override public boolean equals(java.lang.Object o) { @@ -55,3 +63,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java index 0be06450317..0c31196861a 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java @@ -3,11 +3,18 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; + + import java.io.Serializable; + + import javax.validation.constraints.*; import javax.validation.Valid; + + + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; @@ -17,7 +24,11 @@ public class ArrayOfArrayOfNumberOnly implements Serializable { private @Valid List> arrayArrayNumber = new ArrayList>(); + /** + + + **/ public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; @@ -27,6 +38,7 @@ public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArr @ApiModelProperty(value = "") @JsonProperty("ArrayArrayNumber") + public List> getArrayArrayNumber() { return arrayArrayNumber; } @@ -34,6 +46,7 @@ public void setArrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; } + @Override public boolean equals(java.lang.Object o) { @@ -74,3 +87,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java index c131d2c633a..f754a4a88ab 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java @@ -3,11 +3,18 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; + + import java.io.Serializable; + + import javax.validation.constraints.*; import javax.validation.Valid; + + + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; @@ -17,7 +24,11 @@ public class ArrayOfNumberOnly implements Serializable { private @Valid List arrayNumber = new ArrayList(); + /** + + + **/ public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; @@ -27,6 +38,7 @@ public ArrayOfNumberOnly arrayNumber(List arrayNumber) { @ApiModelProperty(value = "") @JsonProperty("ArrayNumber") + public List getArrayNumber() { return arrayNumber; } @@ -34,6 +46,7 @@ public void setArrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; } + @Override public boolean equals(java.lang.Object o) { @@ -74,3 +87,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayTest.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayTest.java index 1720cde126c..cd5dbe5b35f 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayTest.java @@ -3,11 +3,18 @@ import io.swagger.model.ReadOnlyFirst; import java.util.ArrayList; import java.util.List; + + import java.io.Serializable; + + import javax.validation.constraints.*; import javax.validation.Valid; + + + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; @@ -19,7 +26,11 @@ public class ArrayTest implements Serializable { private @Valid List> arrayArrayOfInteger = new ArrayList>(); private @Valid List> arrayArrayOfModel = new ArrayList>(); + /** + + + **/ public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; @@ -29,6 +40,7 @@ public ArrayTest arrayOfString(List arrayOfString) { @ApiModelProperty(value = "") @JsonProperty("array_of_string") + public List getArrayOfString() { return arrayOfString; } @@ -36,7 +48,11 @@ public void setArrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; } + /** + + + **/ public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; @@ -46,6 +62,7 @@ public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { @ApiModelProperty(value = "") @JsonProperty("array_array_of_integer") + public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -53,7 +70,11 @@ public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; } + /** + + + **/ public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; @@ -63,6 +84,7 @@ public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) @ApiModelProperty(value = "") @JsonProperty("array_array_of_model") + public List> getArrayArrayOfModel() { return arrayArrayOfModel; } @@ -70,6 +92,7 @@ public void setArrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } + @Override public boolean equals(java.lang.Object o) { @@ -114,3 +137,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Capitalization.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Capitalization.java index 00402e4788a..5dcea5a553b 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Capitalization.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Capitalization.java @@ -1,10 +1,17 @@ package io.swagger.model; + + import java.io.Serializable; + + import javax.validation.constraints.*; import javax.validation.Valid; + + + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; @@ -19,7 +26,11 @@ public class Capitalization implements Serializable { private @Valid String scAETHFlowPoints = null; private @Valid String ATT_NAME = null; + /** + + + **/ public Capitalization smallCamel(String smallCamel) { this.smallCamel = smallCamel; @@ -29,6 +40,7 @@ public Capitalization smallCamel(String smallCamel) { @ApiModelProperty(value = "") @JsonProperty("smallCamel") + public String getSmallCamel() { return smallCamel; } @@ -36,7 +48,11 @@ public void setSmallCamel(String smallCamel) { this.smallCamel = smallCamel; } + /** + + + **/ public Capitalization capitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; @@ -46,6 +62,7 @@ public Capitalization capitalCamel(String capitalCamel) { @ApiModelProperty(value = "") @JsonProperty("CapitalCamel") + public String getCapitalCamel() { return capitalCamel; } @@ -53,7 +70,11 @@ public void setCapitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; } + /** + + + **/ public Capitalization smallSnake(String smallSnake) { this.smallSnake = smallSnake; @@ -63,6 +84,7 @@ public Capitalization smallSnake(String smallSnake) { @ApiModelProperty(value = "") @JsonProperty("small_Snake") + public String getSmallSnake() { return smallSnake; } @@ -70,7 +92,11 @@ public void setSmallSnake(String smallSnake) { this.smallSnake = smallSnake; } + /** + + + **/ public Capitalization capitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; @@ -80,6 +106,7 @@ public Capitalization capitalSnake(String capitalSnake) { @ApiModelProperty(value = "") @JsonProperty("Capital_Snake") + public String getCapitalSnake() { return capitalSnake; } @@ -87,7 +114,11 @@ public void setCapitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; } + /** + + + **/ public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; @@ -97,6 +128,7 @@ public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { @ApiModelProperty(value = "") @JsonProperty("SCA_ETH_Flow_Points") + public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -104,8 +136,13 @@ public void setScAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; } + /** + * Name of the pet + + + **/ public Capitalization ATT_NAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; @@ -115,6 +152,7 @@ public Capitalization ATT_NAME(String ATT_NAME) { @ApiModelProperty(value = "Name of the pet ") @JsonProperty("ATT_NAME") + public String getATTNAME() { return ATT_NAME; } @@ -122,6 +160,7 @@ public void setATTNAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; } + @Override public boolean equals(java.lang.Object o) { @@ -172,3 +211,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Cat.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Cat.java index 086c6462d8e..267fe8e4501 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Cat.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Cat.java @@ -1,11 +1,18 @@ package io.swagger.model; import io.swagger.model.Animal; + + import java.io.Serializable; + + import javax.validation.constraints.*; import javax.validation.Valid; + + + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; @@ -13,9 +20,61 @@ public class Cat extends Animal implements Serializable { + private @Valid String className = null; + private @Valid String color = "red"; private @Valid Boolean declawed = null; + + /** + + + + **/ + public Cat className(String className) { + this.className = className; + return this; + } + + + @ApiModelProperty(required = true, value = "") + @JsonProperty("className") + + @NotNull + + public String getClassName() { + return className; + } + public void setClassName(String className) { + this.className = className; + } + + + /** + + + + **/ + public Cat color(String color) { + this.color = color; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("color") + + public String getColor() { + return color; + } + public void setColor(String color) { + this.color = color; + } + + /** + + + **/ public Cat declawed(Boolean declawed) { this.declawed = declawed; @@ -25,13 +84,15 @@ public Cat declawed(Boolean declawed) { @ApiModelProperty(value = "") @JsonProperty("declawed") - public Boolean isDeclawed() { + + public Boolean isisDeclawed() { return declawed; } public void setDeclawed(Boolean declawed) { this.declawed = declawed; } + @Override public boolean equals(java.lang.Object o) { @@ -42,12 +103,14 @@ public boolean equals(java.lang.Object o) { return false; } Cat cat = (Cat) o; - return Objects.equals(declawed, cat.declawed); + return Objects.equals(className, cat.className) && + Objects.equals(color, cat.color) && + Objects.equals(declawed, cat.declawed); } @Override public int hashCode() { - return Objects.hash(declawed); + return Objects.hash(className, color, declawed); } @Override @@ -55,6 +118,8 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Cat {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); sb.append("}"); return sb.toString(); @@ -72,3 +137,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Category.java index 1e5c20bf730..870f345814c 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Category.java @@ -1,10 +1,17 @@ package io.swagger.model; + + import java.io.Serializable; + + import javax.validation.constraints.*; import javax.validation.Valid; + + + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; @@ -15,7 +22,11 @@ public class Category implements Serializable { private @Valid Long id = null; private @Valid String name = null; + /** + + + **/ public Category id(Long id) { this.id = id; @@ -25,6 +36,7 @@ public Category id(Long id) { @ApiModelProperty(value = "") @JsonProperty("id") + public Long getId() { return id; } @@ -32,7 +44,11 @@ public void setId(Long id) { this.id = id; } + /** + + + **/ public Category name(String name) { this.name = name; @@ -42,6 +58,7 @@ public Category name(String name) { @ApiModelProperty(value = "") @JsonProperty("name") + public String getName() { return name; } @@ -49,6 +66,7 @@ public void setName(String name) { this.name = name; } + @Override public boolean equals(java.lang.Object o) { @@ -91,3 +109,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ClassModel.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ClassModel.java index c05c7b4a9b6..6aedb2ded48 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ClassModel.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ClassModel.java @@ -1,14 +1,21 @@ package io.swagger.model; import io.swagger.annotations.ApiModel; + + import java.io.Serializable; + + import javax.validation.constraints.*; import javax.validation.Valid; + + /** * Model for testing model with \"_class\" property **/ + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; @@ -18,7 +25,11 @@ public class ClassModel implements Serializable { private @Valid String propertyClass = null; + /** + + + **/ public ClassModel propertyClass(String propertyClass) { this.propertyClass = propertyClass; @@ -28,6 +39,7 @@ public ClassModel propertyClass(String propertyClass) { @ApiModelProperty(value = "") @JsonProperty("_class") + public String getPropertyClass() { return propertyClass; } @@ -35,6 +47,7 @@ public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } + @Override public boolean equals(java.lang.Object o) { @@ -75,3 +88,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Client.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Client.java index 61c2aef0512..58f7fe75d27 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Client.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Client.java @@ -1,10 +1,17 @@ package io.swagger.model; + + import java.io.Serializable; + + import javax.validation.constraints.*; import javax.validation.Valid; + + + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; @@ -14,7 +21,11 @@ public class Client implements Serializable { private @Valid String client = null; + /** + + + **/ public Client client(String client) { this.client = client; @@ -24,6 +35,7 @@ public Client client(String client) { @ApiModelProperty(value = "") @JsonProperty("client") + public String getClient() { return client; } @@ -31,6 +43,7 @@ public void setClient(String client) { this.client = client; } + @Override public boolean equals(java.lang.Object o) { @@ -71,3 +84,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Dog.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Dog.java index 8c1d2c3f85b..b205f82d909 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Dog.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Dog.java @@ -1,11 +1,18 @@ package io.swagger.model; import io.swagger.model.Animal; + + import java.io.Serializable; + + import javax.validation.constraints.*; import javax.validation.Valid; + + + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; @@ -13,9 +20,61 @@ public class Dog extends Animal implements Serializable { + private @Valid String className = null; + private @Valid String color = "red"; private @Valid String breed = null; + + /** + + + + **/ + public Dog className(String className) { + this.className = className; + return this; + } + + + @ApiModelProperty(required = true, value = "") + @JsonProperty("className") + + @NotNull + + public String getClassName() { + return className; + } + public void setClassName(String className) { + this.className = className; + } + + + /** + + + + **/ + public Dog color(String color) { + this.color = color; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("color") + + public String getColor() { + return color; + } + public void setColor(String color) { + this.color = color; + } + + /** + + + **/ public Dog breed(String breed) { this.breed = breed; @@ -25,6 +84,7 @@ public Dog breed(String breed) { @ApiModelProperty(value = "") @JsonProperty("breed") + public String getBreed() { return breed; } @@ -32,6 +92,7 @@ public void setBreed(String breed) { this.breed = breed; } + @Override public boolean equals(java.lang.Object o) { @@ -42,12 +103,14 @@ public boolean equals(java.lang.Object o) { return false; } Dog dog = (Dog) o; - return Objects.equals(breed, dog.breed); + return Objects.equals(className, dog.className) && + Objects.equals(color, dog.color) && + Objects.equals(breed, dog.breed); } @Override public int hashCode() { - return Objects.hash(breed); + return Objects.hash(className, color, breed); } @Override @@ -55,6 +118,8 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Dog {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); sb.append("}"); return sb.toString(); @@ -72,3 +137,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumArrays.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumArrays.java index 595f687217d..e3806c8608f 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumArrays.java @@ -2,11 +2,18 @@ import java.util.ArrayList; import java.util.List; + + import java.io.Serializable; + + import javax.validation.constraints.*; import javax.validation.Valid; + + + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; @@ -17,7 +24,9 @@ public class EnumArrays implements Serializable { public enum JustSymbolEnum { + GREATER_THAN_OR_EQUAL_TO(String.valueOf(">=")), DOLLAR(String.valueOf("$")); + private String value; @@ -31,10 +40,12 @@ public String value() { } @Override + @JsonValue public String toString() { return String.valueOf(value); } + @JsonCreator public static JustSymbolEnum fromValue(String v) { for (JustSymbolEnum b : JustSymbolEnum.values()) { if (String.valueOf(b.value).equals(v)) { @@ -49,7 +60,9 @@ public static JustSymbolEnum fromValue(String v) { public enum ArrayEnumEnum { + FISH(String.valueOf("fish")), CRAB(String.valueOf("crab")); + private String value; @@ -63,10 +76,12 @@ public String value() { } @Override + @JsonValue public String toString() { return String.valueOf(value); } + @JsonCreator public static ArrayEnumEnum fromValue(String v) { for (ArrayEnumEnum b : ArrayEnumEnum.values()) { if (String.valueOf(b.value).equals(v)) { @@ -79,7 +94,11 @@ public static ArrayEnumEnum fromValue(String v) { private @Valid List arrayEnum = new ArrayList(); + /** + + + **/ public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; @@ -89,6 +108,7 @@ public EnumArrays justSymbol(JustSymbolEnum justSymbol) { @ApiModelProperty(value = "") @JsonProperty("just_symbol") + public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -96,7 +116,11 @@ public void setJustSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; } + /** + + + **/ public EnumArrays arrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; @@ -106,6 +130,7 @@ public EnumArrays arrayEnum(List arrayEnum) { @ApiModelProperty(value = "") @JsonProperty("array_enum") + public List getArrayEnum() { return arrayEnum; } @@ -113,6 +138,7 @@ public void setArrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; } + @Override public boolean equals(java.lang.Object o) { @@ -155,3 +181,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumClass.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumClass.java index 13cf0a338e7..4c0ebf11345 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumClass.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumClass.java @@ -1,23 +1,35 @@ package io.swagger.model; + + import java.io.Serializable; + + import javax.validation.constraints.*; import javax.validation.Valid; + + + + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; + /** * Gets or Sets EnumClass */ public enum EnumClass { + + _ABC("_abc"), _EFG("-efg"), _XYZ_("(xyz)"); + private String value; @@ -43,3 +55,6 @@ public static EnumClass fromValue(String text) { } + + + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumTest.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumTest.java index d704287dd95..e99a960ca16 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumTest.java @@ -1,11 +1,18 @@ package io.swagger.model; import io.swagger.model.OuterEnum; + + import java.io.Serializable; + + import javax.validation.constraints.*; import javax.validation.Valid; + + + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; @@ -16,7 +23,9 @@ public class EnumTest implements Serializable { public enum EnumStringEnum { + UPPER(String.valueOf("UPPER")), LOWER(String.valueOf("lower")), EMPTY(String.valueOf("")); + private String value; @@ -30,10 +39,12 @@ public String value() { } @Override + @JsonValue public String toString() { return String.valueOf(value); } + @JsonCreator public static EnumStringEnum fromValue(String v) { for (EnumStringEnum b : EnumStringEnum.values()) { if (String.valueOf(b.value).equals(v)) { @@ -48,7 +59,9 @@ public static EnumStringEnum fromValue(String v) { public enum EnumIntegerEnum { + NUMBER_1(Integer.valueOf(1)), NUMBER_MINUS_1(Integer.valueOf(-1)); + private Integer value; @@ -62,10 +75,12 @@ public String value() { } @Override + @JsonValue public String toString() { return String.valueOf(value); } + @JsonCreator public static EnumIntegerEnum fromValue(String v) { for (EnumIntegerEnum b : EnumIntegerEnum.values()) { if (String.valueOf(b.value).equals(v)) { @@ -80,7 +95,9 @@ public static EnumIntegerEnum fromValue(String v) { public enum EnumNumberEnum { + NUMBER_1_DOT_1(Double.valueOf(1.1)), NUMBER_MINUS_1_DOT_2(Double.valueOf(-1.2)); + private Double value; @@ -94,10 +111,12 @@ public String value() { } @Override + @JsonValue public String toString() { return String.valueOf(value); } + @JsonCreator public static EnumNumberEnum fromValue(String v) { for (EnumNumberEnum b : EnumNumberEnum.values()) { if (String.valueOf(b.value).equals(v)) { @@ -111,7 +130,11 @@ public static EnumNumberEnum fromValue(String v) { private @Valid EnumNumberEnum enumNumber = null; private @Valid OuterEnum outerEnum = null; + /** + + + **/ public EnumTest enumString(EnumStringEnum enumString) { this.enumString = enumString; @@ -121,6 +144,7 @@ public EnumTest enumString(EnumStringEnum enumString) { @ApiModelProperty(value = "") @JsonProperty("enum_string") + public EnumStringEnum getEnumString() { return enumString; } @@ -128,7 +152,11 @@ public void setEnumString(EnumStringEnum enumString) { this.enumString = enumString; } + /** + + + **/ public EnumTest enumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; @@ -138,6 +166,7 @@ public EnumTest enumInteger(EnumIntegerEnum enumInteger) { @ApiModelProperty(value = "") @JsonProperty("enum_integer") + public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -145,7 +174,11 @@ public void setEnumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; } + /** + + + **/ public EnumTest enumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; @@ -155,6 +188,7 @@ public EnumTest enumNumber(EnumNumberEnum enumNumber) { @ApiModelProperty(value = "") @JsonProperty("enum_number") + public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -162,7 +196,11 @@ public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } + /** + + + **/ public EnumTest outerEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; @@ -172,6 +210,7 @@ public EnumTest outerEnum(OuterEnum outerEnum) { @ApiModelProperty(value = "") @JsonProperty("outerEnum") + public OuterEnum getOuterEnum() { return outerEnum; } @@ -179,6 +218,7 @@ public void setOuterEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; } + @Override public boolean equals(java.lang.Object o) { @@ -225,3 +265,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/FormatTest.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/FormatTest.java index bb3072fe1e9..c6584b52fd5 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/FormatTest.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/FormatTest.java @@ -4,11 +4,18 @@ import java.util.Date; import java.util.UUID; import org.joda.time.LocalDate; + + import java.io.Serializable; + + import javax.validation.constraints.*; import javax.validation.Valid; + + + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; @@ -23,16 +30,22 @@ public class FormatTest implements Serializable { private @Valid Float _float = null; private @Valid Double _double = null; private @Valid String string = null; - private @Valid byte[] _byte = null; - private @Valid byte[] binary = null; + private @Valid String _byte = null; + private @Valid String binary = null; private @Valid LocalDate date = null; private @Valid Date dateTime = null; private @Valid UUID uuid = null; private @Valid String password = null; + /** + + * minimum: 10 + + * maximum: 100 + **/ public FormatTest integer(Integer integer) { this.integer = integer; @@ -42,6 +55,7 @@ public FormatTest integer(Integer integer) { @ApiModelProperty(value = "") @JsonProperty("integer") + @Min(10) @Max(100) public Integer getInteger() { return integer; } @@ -49,9 +63,15 @@ public void setInteger(Integer integer) { this.integer = integer; } + /** + + * minimum: 20 + + * maximum: 200 + **/ public FormatTest int32(Integer int32) { this.int32 = int32; @@ -61,6 +81,7 @@ public FormatTest int32(Integer int32) { @ApiModelProperty(value = "") @JsonProperty("int32") + @Min(20) @Max(200) public Integer getInt32() { return int32; } @@ -68,7 +89,11 @@ public void setInt32(Integer int32) { this.int32 = int32; } + /** + + + **/ public FormatTest int64(Long int64) { this.int64 = int64; @@ -78,6 +103,7 @@ public FormatTest int64(Long int64) { @ApiModelProperty(value = "") @JsonProperty("int64") + public Long getInt64() { return int64; } @@ -85,9 +111,11 @@ public void setInt64(Long int64) { this.int64 = int64; } + /** - * minimum: 32.1 - * maximum: 543.2 + + + **/ public FormatTest number(BigDecimal number) { this.number = number; @@ -97,17 +125,21 @@ public FormatTest number(BigDecimal number) { @ApiModelProperty(required = true, value = "") @JsonProperty("number") + @NotNull - @DecimalMin("32.1") @DecimalMax("543.2") public BigDecimal getNumber() { + + public BigDecimal getNumber() { return number; } public void setNumber(BigDecimal number) { this.number = number; } + /** - * minimum: 54.3 - * maximum: 987.6 + + + **/ public FormatTest _float(Float _float) { this._float = _float; @@ -117,16 +149,19 @@ public FormatTest _float(Float _float) { @ApiModelProperty(value = "") @JsonProperty("float") - @DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { + + public Float getFloat() { return _float; } public void setFloat(Float _float) { this._float = _float; } + /** - * minimum: 67.8 - * maximum: 123.4 + + + **/ public FormatTest _double(Double _double) { this._double = _double; @@ -136,14 +171,19 @@ public FormatTest _double(Double _double) { @ApiModelProperty(value = "") @JsonProperty("double") - @DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { + + public Double getDouble() { return _double; } public void setDouble(Double _double) { this._double = _double; } + /** + + + **/ public FormatTest string(String string) { this.string = string; @@ -153,6 +193,7 @@ public FormatTest string(String string) { @ApiModelProperty(value = "") @JsonProperty("string") + @Pattern(regexp="/[a-z]/i") public String getString() { return string; } @@ -160,9 +201,13 @@ public void setString(String string) { this.string = string; } + /** + + + **/ - public FormatTest _byte(byte[] _byte) { + public FormatTest _byte(String _byte) { this._byte = _byte; return this; } @@ -170,17 +215,23 @@ public FormatTest _byte(byte[] _byte) { @ApiModelProperty(required = true, value = "") @JsonProperty("byte") + @NotNull - @Pattern(regexp="^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$") public byte[] getByte() { + + @Pattern(regexp="^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$") public String getByte() { return _byte; } - public void setByte(byte[] _byte) { + public void setByte(String _byte) { this._byte = _byte; } + /** + + + **/ - public FormatTest binary(byte[] binary) { + public FormatTest binary(String binary) { this.binary = binary; return this; } @@ -188,14 +239,19 @@ public FormatTest binary(byte[] binary) { @ApiModelProperty(value = "") @JsonProperty("binary") - public byte[] getBinary() { + + public String getBinary() { return binary; } - public void setBinary(byte[] binary) { + public void setBinary(String binary) { this.binary = binary; } + /** + + + **/ public FormatTest date(LocalDate date) { this.date = date; @@ -205,7 +261,9 @@ public FormatTest date(LocalDate date) { @ApiModelProperty(required = true, value = "") @JsonProperty("date") + @NotNull + public LocalDate getDate() { return date; } @@ -213,7 +271,11 @@ public void setDate(LocalDate date) { this.date = date; } + /** + + + **/ public FormatTest dateTime(Date dateTime) { this.dateTime = dateTime; @@ -223,6 +285,7 @@ public FormatTest dateTime(Date dateTime) { @ApiModelProperty(value = "") @JsonProperty("dateTime") + public Date getDateTime() { return dateTime; } @@ -230,7 +293,11 @@ public void setDateTime(Date dateTime) { this.dateTime = dateTime; } + /** + + + **/ public FormatTest uuid(UUID uuid) { this.uuid = uuid; @@ -240,6 +307,7 @@ public FormatTest uuid(UUID uuid) { @ApiModelProperty(value = "") @JsonProperty("uuid") + public UUID getUuid() { return uuid; } @@ -247,7 +315,11 @@ public void setUuid(UUID uuid) { this.uuid = uuid; } + /** + + + **/ public FormatTest password(String password) { this.password = password; @@ -257,14 +329,17 @@ public FormatTest password(String password) { @ApiModelProperty(required = true, value = "") @JsonProperty("password") + @NotNull - @Size(min=10,max=64) public String getPassword() { + + public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } + @Override public boolean equals(java.lang.Object o) { @@ -329,3 +404,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/HasOnlyReadOnly.java index ef9c2728846..a0048e683c3 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/HasOnlyReadOnly.java @@ -1,10 +1,17 @@ package io.swagger.model; + + import java.io.Serializable; + + import javax.validation.constraints.*; import javax.validation.Valid; + + + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; @@ -15,7 +22,11 @@ public class HasOnlyReadOnly implements Serializable { private @Valid String bar = null; private @Valid String foo = null; + /** + + + **/ public HasOnlyReadOnly bar(String bar) { this.bar = bar; @@ -25,6 +36,7 @@ public HasOnlyReadOnly bar(String bar) { @ApiModelProperty(value = "") @JsonProperty("bar") + public String getBar() { return bar; } @@ -32,7 +44,11 @@ public void setBar(String bar) { this.bar = bar; } + /** + + + **/ public HasOnlyReadOnly foo(String foo) { this.foo = foo; @@ -42,6 +58,7 @@ public HasOnlyReadOnly foo(String foo) { @ApiModelProperty(value = "") @JsonProperty("foo") + public String getFoo() { return foo; } @@ -49,6 +66,7 @@ public void setFoo(String foo) { this.foo = foo; } + @Override public boolean equals(java.lang.Object o) { @@ -91,3 +109,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MapTest.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MapTest.java index 54abae05490..533bfe7640f 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MapTest.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MapTest.java @@ -3,11 +3,18 @@ import java.util.HashMap; import java.util.List; import java.util.Map; + + import java.io.Serializable; + + import javax.validation.constraints.*; import javax.validation.Valid; + + + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; @@ -19,7 +26,9 @@ public class MapTest implements Serializable { public enum InnerEnum { + UPPER(String.valueOf("UPPER")), LOWER(String.valueOf("lower")); + private String value; @@ -33,10 +42,12 @@ public String value() { } @Override + @JsonValue public String toString() { return String.valueOf(value); } + @JsonCreator public static InnerEnum fromValue(String v) { for (InnerEnum b : InnerEnum.values()) { if (String.valueOf(b.value).equals(v)) { @@ -49,7 +60,11 @@ public static InnerEnum fromValue(String v) { private @Valid Map mapOfEnumString = new HashMap(); + /** + + + **/ public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -59,6 +74,7 @@ public MapTest mapMapOfString(Map> mapMapOfString) { @ApiModelProperty(value = "") @JsonProperty("map_map_of_string") + public Map> getMapMapOfString() { return mapMapOfString; } @@ -66,7 +82,11 @@ public void setMapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; } + /** + + + **/ public MapTest mapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; @@ -76,6 +96,7 @@ public MapTest mapOfEnumString(Map mapOfEnumString) { @ApiModelProperty(value = "") @JsonProperty("map_of_enum_string") + public Map getMapOfEnumString() { return mapOfEnumString; } @@ -83,6 +104,7 @@ public void setMapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; } + @Override public boolean equals(java.lang.Object o) { @@ -125,3 +147,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java index 673adda125e..cfe92606237 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -6,11 +6,18 @@ import java.util.List; import java.util.Map; import java.util.UUID; + + import java.io.Serializable; + + import javax.validation.constraints.*; import javax.validation.Valid; + + + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; @@ -22,7 +29,11 @@ public class MixedPropertiesAndAdditionalPropertiesClass implements Serializabl private @Valid Date dateTime = null; private @Valid Map map = new HashMap(); + /** + + + **/ public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; @@ -32,6 +43,7 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { @ApiModelProperty(value = "") @JsonProperty("uuid") + public UUID getUuid() { return uuid; } @@ -39,7 +51,11 @@ public void setUuid(UUID uuid) { this.uuid = uuid; } + /** + + + **/ public MixedPropertiesAndAdditionalPropertiesClass dateTime(Date dateTime) { this.dateTime = dateTime; @@ -49,6 +65,7 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(Date dateTime) { @ApiModelProperty(value = "") @JsonProperty("dateTime") + public Date getDateTime() { return dateTime; } @@ -56,7 +73,11 @@ public void setDateTime(Date dateTime) { this.dateTime = dateTime; } + /** + + + **/ public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { this.map = map; @@ -66,6 +87,7 @@ public MixedPropertiesAndAdditionalPropertiesClass map(Map map) @ApiModelProperty(value = "") @JsonProperty("map") + public Map getMap() { return map; } @@ -73,6 +95,7 @@ public void setMap(Map map) { this.map = map; } + @Override public boolean equals(java.lang.Object o) { @@ -117,3 +140,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Model200Response.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Model200Response.java index eeb8e7547cf..39b85dae637 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Model200Response.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Model200Response.java @@ -1,14 +1,21 @@ package io.swagger.model; import io.swagger.annotations.ApiModel; + + import java.io.Serializable; + + import javax.validation.constraints.*; import javax.validation.Valid; + + /** * Model for testing model name starting with number **/ + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; @@ -19,7 +26,11 @@ public class Model200Response implements Serializable { private @Valid Integer name = null; private @Valid String propertyClass = null; + /** + + + **/ public Model200Response name(Integer name) { this.name = name; @@ -29,6 +40,7 @@ public Model200Response name(Integer name) { @ApiModelProperty(value = "") @JsonProperty("name") + public Integer getName() { return name; } @@ -36,7 +48,11 @@ public void setName(Integer name) { this.name = name; } + /** + + + **/ public Model200Response propertyClass(String propertyClass) { this.propertyClass = propertyClass; @@ -46,6 +62,7 @@ public Model200Response propertyClass(String propertyClass) { @ApiModelProperty(value = "") @JsonProperty("class") + public String getPropertyClass() { return propertyClass; } @@ -53,6 +70,7 @@ public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } + @Override public boolean equals(java.lang.Object o) { @@ -95,3 +113,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ModelApiResponse.java index e97b1fdfd8b..57040f2909e 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -1,10 +1,17 @@ package io.swagger.model; + + import java.io.Serializable; + + import javax.validation.constraints.*; import javax.validation.Valid; + + + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; @@ -16,7 +23,11 @@ public class ModelApiResponse implements Serializable { private @Valid String type = null; private @Valid String message = null; + /** + + + **/ public ModelApiResponse code(Integer code) { this.code = code; @@ -26,6 +37,7 @@ public ModelApiResponse code(Integer code) { @ApiModelProperty(value = "") @JsonProperty("code") + public Integer getCode() { return code; } @@ -33,7 +45,11 @@ public void setCode(Integer code) { this.code = code; } + /** + + + **/ public ModelApiResponse type(String type) { this.type = type; @@ -43,6 +59,7 @@ public ModelApiResponse type(String type) { @ApiModelProperty(value = "") @JsonProperty("type") + public String getType() { return type; } @@ -50,7 +67,11 @@ public void setType(String type) { this.type = type; } + /** + + + **/ public ModelApiResponse message(String message) { this.message = message; @@ -60,6 +81,7 @@ public ModelApiResponse message(String message) { @ApiModelProperty(value = "") @JsonProperty("message") + public String getMessage() { return message; } @@ -67,6 +89,7 @@ public void setMessage(String message) { this.message = message; } + @Override public boolean equals(java.lang.Object o) { @@ -111,3 +134,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ModelReturn.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ModelReturn.java index 72a677f7ab0..0d847445a72 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ModelReturn.java @@ -1,14 +1,21 @@ package io.swagger.model; import io.swagger.annotations.ApiModel; + + import java.io.Serializable; + + import javax.validation.constraints.*; import javax.validation.Valid; + + /** * Model for testing reserved words **/ + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; @@ -18,7 +25,11 @@ public class ModelReturn implements Serializable { private @Valid Integer _return = null; + /** + + + **/ public ModelReturn _return(Integer _return) { this._return = _return; @@ -28,6 +39,7 @@ public ModelReturn _return(Integer _return) { @ApiModelProperty(value = "") @JsonProperty("return") + public Integer getReturn() { return _return; } @@ -35,6 +47,7 @@ public void setReturn(Integer _return) { this._return = _return; } + @Override public boolean equals(java.lang.Object o) { @@ -75,3 +88,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Name.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Name.java index 5460ff8a9b9..f98d24204cf 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Name.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Name.java @@ -1,14 +1,21 @@ package io.swagger.model; import io.swagger.annotations.ApiModel; + + import java.io.Serializable; + + import javax.validation.constraints.*; import javax.validation.Valid; + + /** * Model for testing model name same as property name **/ + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; @@ -21,7 +28,11 @@ public class Name implements Serializable { private @Valid String property = null; private @Valid Integer _123Number = null; + /** + + + **/ public Name name(Integer name) { this.name = name; @@ -31,7 +42,9 @@ public Name name(Integer name) { @ApiModelProperty(required = true, value = "") @JsonProperty("name") + @NotNull + public Integer getName() { return name; } @@ -39,7 +52,11 @@ public void setName(Integer name) { this.name = name; } + /** + + + **/ public Name snakeCase(Integer snakeCase) { this.snakeCase = snakeCase; @@ -49,6 +66,7 @@ public Name snakeCase(Integer snakeCase) { @ApiModelProperty(value = "") @JsonProperty("snake_case") + public Integer getSnakeCase() { return snakeCase; } @@ -56,7 +74,11 @@ public void setSnakeCase(Integer snakeCase) { this.snakeCase = snakeCase; } + /** + + + **/ public Name property(String property) { this.property = property; @@ -66,6 +88,7 @@ public Name property(String property) { @ApiModelProperty(value = "") @JsonProperty("property") + public String getProperty() { return property; } @@ -73,7 +96,11 @@ public void setProperty(String property) { this.property = property; } + /** + + + **/ public Name _123Number(Integer _123Number) { this._123Number = _123Number; @@ -83,6 +110,7 @@ public Name _123Number(Integer _123Number) { @ApiModelProperty(value = "") @JsonProperty("123Number") + public Integer get123Number() { return _123Number; } @@ -90,6 +118,7 @@ public void set123Number(Integer _123Number) { this._123Number = _123Number; } + @Override public boolean equals(java.lang.Object o) { @@ -136,3 +165,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/NumberOnly.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/NumberOnly.java index 5f02fd0649a..cc36c69926c 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/NumberOnly.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/NumberOnly.java @@ -1,11 +1,18 @@ package io.swagger.model; import java.math.BigDecimal; + + import java.io.Serializable; + + import javax.validation.constraints.*; import javax.validation.Valid; + + + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; @@ -15,7 +22,11 @@ public class NumberOnly implements Serializable { private @Valid BigDecimal justNumber = null; + /** + + + **/ public NumberOnly justNumber(BigDecimal justNumber) { this.justNumber = justNumber; @@ -25,6 +36,7 @@ public NumberOnly justNumber(BigDecimal justNumber) { @ApiModelProperty(value = "") @JsonProperty("JustNumber") + public BigDecimal getJustNumber() { return justNumber; } @@ -32,6 +44,7 @@ public void setJustNumber(BigDecimal justNumber) { this.justNumber = justNumber; } + @Override public boolean equals(java.lang.Object o) { @@ -72,3 +85,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Order.java index f7665f15a54..3dd23621498 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Order.java @@ -1,11 +1,18 @@ package io.swagger.model; import java.util.Date; + + import java.io.Serializable; + + import javax.validation.constraints.*; import javax.validation.Valid; + + + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; @@ -20,7 +27,9 @@ public class Order implements Serializable { public enum StatusEnum { + PLACED(String.valueOf("placed")), APPROVED(String.valueOf("approved")), DELIVERED(String.valueOf("delivered")); + private String value; @@ -34,10 +43,12 @@ public String value() { } @Override + @JsonValue public String toString() { return String.valueOf(value); } + @JsonCreator public static StatusEnum fromValue(String v) { for (StatusEnum b : StatusEnum.values()) { if (String.valueOf(b.value).equals(v)) { @@ -51,7 +62,11 @@ public static StatusEnum fromValue(String v) { private @Valid StatusEnum status = null; private @Valid Boolean complete = false; + /** + + + **/ public Order id(Long id) { this.id = id; @@ -61,6 +76,7 @@ public Order id(Long id) { @ApiModelProperty(value = "") @JsonProperty("id") + public Long getId() { return id; } @@ -68,7 +84,11 @@ public void setId(Long id) { this.id = id; } + /** + + + **/ public Order petId(Long petId) { this.petId = petId; @@ -78,6 +98,7 @@ public Order petId(Long petId) { @ApiModelProperty(value = "") @JsonProperty("petId") + public Long getPetId() { return petId; } @@ -85,7 +106,11 @@ public void setPetId(Long petId) { this.petId = petId; } + /** + + + **/ public Order quantity(Integer quantity) { this.quantity = quantity; @@ -95,6 +120,7 @@ public Order quantity(Integer quantity) { @ApiModelProperty(value = "") @JsonProperty("quantity") + public Integer getQuantity() { return quantity; } @@ -102,7 +128,11 @@ public void setQuantity(Integer quantity) { this.quantity = quantity; } + /** + + + **/ public Order shipDate(Date shipDate) { this.shipDate = shipDate; @@ -112,6 +142,7 @@ public Order shipDate(Date shipDate) { @ApiModelProperty(value = "") @JsonProperty("shipDate") + public Date getShipDate() { return shipDate; } @@ -119,8 +150,13 @@ public void setShipDate(Date shipDate) { this.shipDate = shipDate; } + /** + * Order Status + + + **/ public Order status(StatusEnum status) { this.status = status; @@ -130,6 +166,7 @@ public Order status(StatusEnum status) { @ApiModelProperty(value = "Order Status") @JsonProperty("status") + public StatusEnum getStatus() { return status; } @@ -137,7 +174,11 @@ public void setStatus(StatusEnum status) { this.status = status; } + /** + + + **/ public Order complete(Boolean complete) { this.complete = complete; @@ -147,13 +188,15 @@ public Order complete(Boolean complete) { @ApiModelProperty(value = "") @JsonProperty("complete") - public Boolean isComplete() { + + public Boolean isisComplete() { return complete; } public void setComplete(Boolean complete) { this.complete = complete; } + @Override public boolean equals(java.lang.Object o) { @@ -204,3 +247,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/OuterBoolean.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/OuterBoolean.java new file mode 100644 index 00000000000..dde14ed943a --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/OuterBoolean.java @@ -0,0 +1,64 @@ +package io.swagger.model; + + + +import java.io.Serializable; + + +import javax.validation.constraints.*; +import javax.validation.Valid; + + + + + +import io.swagger.annotations.*; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class OuterBoolean implements Serializable { + + + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OuterBoolean outerBoolean = (OuterBoolean) o; + return true; + } + + @Override + public int hashCode() { + return Objects.hash(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterBoolean {\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(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + + + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/OuterComposite.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/OuterComposite.java index bfe8211b654..d7aac44511a 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/OuterComposite.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/OuterComposite.java @@ -1,11 +1,18 @@ package io.swagger.model; import java.math.BigDecimal; + + import java.io.Serializable; + + import javax.validation.constraints.*; import javax.validation.Valid; + + + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; @@ -17,7 +24,11 @@ public class OuterComposite implements Serializable { private @Valid String myString = null; private @Valid Boolean myBoolean = null; + /** + + + **/ public OuterComposite myNumber(BigDecimal myNumber) { this.myNumber = myNumber; @@ -27,6 +38,7 @@ public OuterComposite myNumber(BigDecimal myNumber) { @ApiModelProperty(value = "") @JsonProperty("my_number") + public BigDecimal getMyNumber() { return myNumber; } @@ -34,7 +46,11 @@ public void setMyNumber(BigDecimal myNumber) { this.myNumber = myNumber; } + /** + + + **/ public OuterComposite myString(String myString) { this.myString = myString; @@ -44,6 +60,7 @@ public OuterComposite myString(String myString) { @ApiModelProperty(value = "") @JsonProperty("my_string") + public String getMyString() { return myString; } @@ -51,7 +68,11 @@ public void setMyString(String myString) { this.myString = myString; } + /** + + + **/ public OuterComposite myBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; @@ -61,6 +82,7 @@ public OuterComposite myBoolean(Boolean myBoolean) { @ApiModelProperty(value = "") @JsonProperty("my_boolean") + public Boolean getMyBoolean() { return myBoolean; } @@ -68,6 +90,7 @@ public void setMyBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; } + @Override public boolean equals(java.lang.Object o) { @@ -112,3 +135,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/OuterEnum.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/OuterEnum.java index d682c3f5080..f107b269f9b 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/OuterEnum.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/OuterEnum.java @@ -1,23 +1,35 @@ package io.swagger.model; + + import java.io.Serializable; + + import javax.validation.constraints.*; import javax.validation.Valid; + + + + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; + /** * Gets or Sets OuterEnum */ public enum OuterEnum { + + PLACED("placed"), APPROVED("approved"), DELIVERED("delivered"); + private String value; @@ -43,3 +55,6 @@ public static OuterEnum fromValue(String text) { } + + + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/OuterNumber.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/OuterNumber.java new file mode 100644 index 00000000000..f3d42e762d9 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/OuterNumber.java @@ -0,0 +1,64 @@ +package io.swagger.model; + + + +import java.io.Serializable; + + +import javax.validation.constraints.*; +import javax.validation.Valid; + + + + + +import io.swagger.annotations.*; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class OuterNumber implements Serializable { + + + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OuterNumber outerNumber = (OuterNumber) o; + return true; + } + + @Override + public int hashCode() { + return Objects.hash(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterNumber {\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(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + + + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/OuterString.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/OuterString.java new file mode 100644 index 00000000000..ce1d0ca8ad3 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/OuterString.java @@ -0,0 +1,64 @@ +package io.swagger.model; + + + +import java.io.Serializable; + + +import javax.validation.constraints.*; +import javax.validation.Valid; + + + + + +import io.swagger.annotations.*; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class OuterString implements Serializable { + + + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OuterString outerString = (OuterString) o; + return true; + } + + @Override + public int hashCode() { + return Objects.hash(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterString {\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(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + + + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Pet.java index fc8a6796b79..62fe70a7515 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Pet.java @@ -4,11 +4,18 @@ import io.swagger.model.Tag; import java.util.ArrayList; import java.util.List; + + import java.io.Serializable; + + import javax.validation.constraints.*; import javax.validation.Valid; + + + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; @@ -24,7 +31,9 @@ public class Pet implements Serializable { public enum StatusEnum { + AVAILABLE(String.valueOf("available")), PENDING(String.valueOf("pending")), SOLD(String.valueOf("sold")); + private String value; @@ -38,10 +47,12 @@ public String value() { } @Override + @JsonValue public String toString() { return String.valueOf(value); } + @JsonCreator public static StatusEnum fromValue(String v) { for (StatusEnum b : StatusEnum.values()) { if (String.valueOf(b.value).equals(v)) { @@ -54,7 +65,11 @@ public static StatusEnum fromValue(String v) { private @Valid StatusEnum status = null; + /** + + + **/ public Pet id(Long id) { this.id = id; @@ -64,6 +79,7 @@ public Pet id(Long id) { @ApiModelProperty(value = "") @JsonProperty("id") + public Long getId() { return id; } @@ -71,7 +87,11 @@ public void setId(Long id) { this.id = id; } + /** + + + **/ public Pet category(Category category) { this.category = category; @@ -81,6 +101,7 @@ public Pet category(Category category) { @ApiModelProperty(value = "") @JsonProperty("category") + public Category getCategory() { return category; } @@ -88,7 +109,11 @@ public void setCategory(Category category) { this.category = category; } + /** + + + **/ public Pet name(String name) { this.name = name; @@ -98,7 +123,9 @@ public Pet name(String name) { @ApiModelProperty(example = "doggie", required = true, value = "") @JsonProperty("name") + @NotNull + public String getName() { return name; } @@ -106,7 +133,11 @@ public void setName(String name) { this.name = name; } + /** + + + **/ public Pet photoUrls(List photoUrls) { this.photoUrls = photoUrls; @@ -116,7 +147,9 @@ public Pet photoUrls(List photoUrls) { @ApiModelProperty(required = true, value = "") @JsonProperty("photoUrls") + @NotNull + public List getPhotoUrls() { return photoUrls; } @@ -124,7 +157,11 @@ public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } + /** + + + **/ public Pet tags(List tags) { this.tags = tags; @@ -134,6 +171,7 @@ public Pet tags(List tags) { @ApiModelProperty(value = "") @JsonProperty("tags") + public List getTags() { return tags; } @@ -141,8 +179,13 @@ public void setTags(List tags) { this.tags = tags; } + /** + * pet status in the store + + + **/ public Pet status(StatusEnum status) { this.status = status; @@ -152,6 +195,7 @@ public Pet status(StatusEnum status) { @ApiModelProperty(value = "pet status in the store") @JsonProperty("status") + public StatusEnum getStatus() { return status; } @@ -159,6 +203,7 @@ public void setStatus(StatusEnum status) { this.status = status; } + @Override public boolean equals(java.lang.Object o) { @@ -209,3 +254,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ReadOnlyFirst.java index bd4ee7e1cb1..4b0f7fcfabb 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ReadOnlyFirst.java @@ -1,10 +1,17 @@ package io.swagger.model; + + import java.io.Serializable; + + import javax.validation.constraints.*; import javax.validation.Valid; + + + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; @@ -15,7 +22,11 @@ public class ReadOnlyFirst implements Serializable { private @Valid String bar = null; private @Valid String baz = null; + /** + + + **/ public ReadOnlyFirst bar(String bar) { this.bar = bar; @@ -25,6 +36,7 @@ public ReadOnlyFirst bar(String bar) { @ApiModelProperty(value = "") @JsonProperty("bar") + public String getBar() { return bar; } @@ -32,7 +44,11 @@ public void setBar(String bar) { this.bar = bar; } + /** + + + **/ public ReadOnlyFirst baz(String baz) { this.baz = baz; @@ -42,6 +58,7 @@ public ReadOnlyFirst baz(String baz) { @ApiModelProperty(value = "") @JsonProperty("baz") + public String getBaz() { return baz; } @@ -49,6 +66,7 @@ public void setBaz(String baz) { this.baz = baz; } + @Override public boolean equals(java.lang.Object o) { @@ -91,3 +109,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/SpecialModelName.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/SpecialModelName.java index b8144314b82..821a3b01ec5 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/SpecialModelName.java @@ -1,10 +1,17 @@ package io.swagger.model; + + import java.io.Serializable; + + import javax.validation.constraints.*; import javax.validation.Valid; + + + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,25 +19,31 @@ public class SpecialModelName implements Serializable { - private @Valid Long specialPropertyName = null; + private @Valid Long $specialPropertyName = null; + /** + + + **/ - public SpecialModelName specialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; return this; } @ApiModelProperty(value = "") @JsonProperty("$special[property.name]") - public Long getSpecialPropertyName() { - return specialPropertyName; + + public Long get$SpecialPropertyName() { + return $specialPropertyName; } - public void setSpecialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + public void set$SpecialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; } + @Override public boolean equals(java.lang.Object o) { @@ -40,13 +53,13 @@ public boolean equals(java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName specialModelName = (SpecialModelName) o; - return Objects.equals(specialPropertyName, specialModelName.specialPropertyName); + SpecialModelName $specialModelName = (SpecialModelName) o; + return Objects.equals($specialPropertyName, $specialModelName.$specialPropertyName); } @Override public int hashCode() { - return Objects.hash(specialPropertyName); + return Objects.hash($specialPropertyName); } @Override @@ -54,7 +67,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class SpecialModelName {\n"); - sb.append(" specialPropertyName: ").append(toIndentedString(specialPropertyName)).append("\n"); + sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n"); sb.append("}"); return sb.toString(); } @@ -71,3 +84,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Tag.java index 10a7ffc7c57..1fbbbfc8a5c 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Tag.java @@ -1,10 +1,17 @@ package io.swagger.model; + + import java.io.Serializable; + + import javax.validation.constraints.*; import javax.validation.Valid; + + + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; @@ -15,7 +22,11 @@ public class Tag implements Serializable { private @Valid Long id = null; private @Valid String name = null; + /** + + + **/ public Tag id(Long id) { this.id = id; @@ -25,6 +36,7 @@ public Tag id(Long id) { @ApiModelProperty(value = "") @JsonProperty("id") + public Long getId() { return id; } @@ -32,7 +44,11 @@ public void setId(Long id) { this.id = id; } + /** + + + **/ public Tag name(String name) { this.name = name; @@ -42,6 +58,7 @@ public Tag name(String name) { @ApiModelProperty(value = "") @JsonProperty("name") + public String getName() { return name; } @@ -49,6 +66,7 @@ public void setName(String name) { this.name = name; } + @Override public boolean equals(java.lang.Object o) { @@ -91,3 +109,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/User.java index a86f0eae070..ea67a8a1a31 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/User.java @@ -1,10 +1,17 @@ package io.swagger.model; + + import java.io.Serializable; + + import javax.validation.constraints.*; import javax.validation.Valid; + + + import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; @@ -21,7 +28,11 @@ public class User implements Serializable { private @Valid String phone = null; private @Valid Integer userStatus = null; + /** + + + **/ public User id(Long id) { this.id = id; @@ -31,6 +42,7 @@ public User id(Long id) { @ApiModelProperty(value = "") @JsonProperty("id") + public Long getId() { return id; } @@ -38,7 +50,11 @@ public void setId(Long id) { this.id = id; } + /** + + + **/ public User username(String username) { this.username = username; @@ -48,6 +64,7 @@ public User username(String username) { @ApiModelProperty(value = "") @JsonProperty("username") + public String getUsername() { return username; } @@ -55,7 +72,11 @@ public void setUsername(String username) { this.username = username; } + /** + + + **/ public User firstName(String firstName) { this.firstName = firstName; @@ -65,6 +86,7 @@ public User firstName(String firstName) { @ApiModelProperty(value = "") @JsonProperty("firstName") + public String getFirstName() { return firstName; } @@ -72,7 +94,11 @@ public void setFirstName(String firstName) { this.firstName = firstName; } + /** + + + **/ public User lastName(String lastName) { this.lastName = lastName; @@ -82,6 +108,7 @@ public User lastName(String lastName) { @ApiModelProperty(value = "") @JsonProperty("lastName") + public String getLastName() { return lastName; } @@ -89,7 +116,11 @@ public void setLastName(String lastName) { this.lastName = lastName; } + /** + + + **/ public User email(String email) { this.email = email; @@ -99,6 +130,7 @@ public User email(String email) { @ApiModelProperty(value = "") @JsonProperty("email") + public String getEmail() { return email; } @@ -106,7 +138,11 @@ public void setEmail(String email) { this.email = email; } + /** + + + **/ public User password(String password) { this.password = password; @@ -116,6 +152,7 @@ public User password(String password) { @ApiModelProperty(value = "") @JsonProperty("password") + public String getPassword() { return password; } @@ -123,7 +160,11 @@ public void setPassword(String password) { this.password = password; } + /** + + + **/ public User phone(String phone) { this.phone = phone; @@ -133,6 +174,7 @@ public User phone(String phone) { @ApiModelProperty(value = "") @JsonProperty("phone") + public String getPhone() { return phone; } @@ -140,8 +182,13 @@ public void setPhone(String phone) { this.phone = phone; } + /** + * User Status + + + **/ public User userStatus(Integer userStatus) { this.userStatus = userStatus; @@ -151,6 +198,7 @@ public User userStatus(Integer userStatus) { @ApiModelProperty(value = "User Status") @JsonProperty("userStatus") + public Integer getUserStatus() { return userStatus; } @@ -158,6 +206,7 @@ public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } + @Override public boolean equals(java.lang.Object o) { @@ -212,3 +261,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs-spec/swagger.json b/samples/server/petstore/jaxrs-spec/swagger.json index 318ac581fce..0ed9c9103d3 100644 --- a/samples/server/petstore/jaxrs-spec/swagger.json +++ b/samples/server/petstore/jaxrs-spec/swagger.json @@ -1,9 +1,8 @@ { - "swagger" : "2.0", + "openapi" : "3.0.1", "info" : { - "description" : "This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\", - "version" : "1.0.0", "title" : "Swagger Petstore", + "description" : "This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\", "termsOfService" : "http://swagger.io/terms/", "contact" : { "email" : "apiteam@swagger.io" @@ -11,10 +10,16 @@ "license" : { "name" : "Apache-2.0", "url" : "http://www.apache.org/licenses/LICENSE-2.0.html" - } + }, + "version" : "1.0.0" + }, + "externalDocs" : { + "description" : "Find out more about Swagger", + "url" : "http://swagger.io" }, - "host" : "petstore.swagger.io:80", - "basePath" : "/v2", + "servers" : [ { + "url" : "http://petstore.swagger.io:80/v2" + } ], "tags" : [ { "name" : "pet", "description" : "Everything about your Pets", @@ -33,59 +38,70 @@ "url" : "http://swagger.io" } } ], - "schemes" : [ "http" ], "paths" : { "/pet" : { - "post" : { + "put" : { "tags" : [ "pet" ], - "summary" : "Add a new pet to the store", - "description" : "", - "operationId" : "addPet", - "consumes" : [ "application/json", "application/xml" ], - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", + "summary" : "Update an existing pet", + "operationId" : "updatePet", + "requestBody" : { "description" : "Pet object that needs to be added to the store", - "required" : true, - "schema" : { - "$ref" : "#/definitions/Pet" - } - } ], + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + }, + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + } + }, + "required" : true + }, "responses" : { + "400" : { + "description" : "Invalid ID supplied", + "content" : { } + }, + "404" : { + "description" : "Pet not found", + "content" : { } + }, "405" : { - "description" : "Invalid input" + "description" : "Validation exception", + "content" : { } } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ] }, - "put" : { + "post" : { "tags" : [ "pet" ], - "summary" : "Update an existing pet", - "description" : "", - "operationId" : "updatePet", - "consumes" : [ "application/json", "application/xml" ], - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", + "summary" : "Add a new pet to the store", + "operationId" : "addPet", + "requestBody" : { "description" : "Pet object that needs to be added to the store", - "required" : true, - "schema" : { - "$ref" : "#/definitions/Pet" - } - } ], - "responses" : { - "400" : { - "description" : "Invalid ID supplied" - }, - "404" : { - "description" : "Pet not found" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + }, + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + } }, + "required" : true + }, + "responses" : { "405" : { - "description" : "Validation exception" + "description" : "Invalid input", + "content" : { } } }, "security" : [ { @@ -99,32 +115,46 @@ "summary" : "Finds Pets by status", "description" : "Multiple status values can be provided with comma separated strings", "operationId" : "findPetsByStatus", - "produces" : [ "application/xml", "application/json" ], "parameters" : [ { "name" : "status", "in" : "query", "description" : "Status values that need to be considered for filter", "required" : true, - "type" : "array", - "items" : { - "type" : "string", - "default" : "available", - "enum" : [ "available", "pending", "sold" ] - }, - "collectionFormat" : "csv" + "explode" : false, + "schema" : { + "type" : "array", + "items" : { + "type" : "string", + "default" : "available", + "enum" : [ "available", "pending", "sold" ] + } + } } ], "responses" : { "200" : { "description" : "successful operation", - "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/Pet" + "content" : { + "application/xml" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Pet" + } + } + }, + "application/json" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Pet" + } + } } } }, "400" : { - "description" : "Invalid status value" + "description" : "Invalid status value", + "content" : { } } }, "security" : [ { @@ -138,36 +168,50 @@ "summary" : "Finds Pets by tags", "description" : "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", "operationId" : "findPetsByTags", - "produces" : [ "application/xml", "application/json" ], "parameters" : [ { "name" : "tags", "in" : "query", "description" : "Tags to filter by", "required" : true, - "type" : "array", - "items" : { - "type" : "string" - }, - "collectionFormat" : "csv" + "explode" : false, + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } } ], "responses" : { "200" : { "description" : "successful operation", - "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/Pet" + "content" : { + "application/xml" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Pet" + } + } + }, + "application/json" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Pet" + } + } } } }, "400" : { - "description" : "Invalid tag value" + "description" : "Invalid tag value", + "content" : { } } }, + "deprecated" : true, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] - } ], - "deprecated" : true + } ] } }, "/pet/{petId}" : { @@ -176,27 +220,39 @@ "summary" : "Find pet by ID", "description" : "Returns a single pet", "operationId" : "getPetById", - "produces" : [ "application/xml", "application/json" ], "parameters" : [ { "name" : "petId", "in" : "path", "description" : "ID of pet to return", "required" : true, - "type" : "integer", - "format" : "int64" + "schema" : { + "type" : "integer", + "format" : "int64" + } } ], "responses" : { "200" : { "description" : "successful operation", - "schema" : { - "$ref" : "#/definitions/Pet" + "content" : { + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + }, + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + } } }, "400" : { - "description" : "Invalid ID supplied" + "description" : "Invalid ID supplied", + "content" : { } }, "404" : { - "description" : "Pet not found" + "description" : "Pet not found", + "content" : { } } }, "security" : [ { @@ -206,33 +262,39 @@ "post" : { "tags" : [ "pet" ], "summary" : "Updates a pet in the store with form data", - "description" : "", "operationId" : "updatePetWithForm", - "consumes" : [ "application/x-www-form-urlencoded" ], - "produces" : [ "application/xml", "application/json" ], "parameters" : [ { "name" : "petId", "in" : "path", "description" : "ID of pet that needs to be updated", "required" : true, - "type" : "integer", - "format" : "int64" - }, { - "name" : "name", - "in" : "formData", - "description" : "Updated name of the pet", - "required" : false, - "type" : "string" - }, { - "name" : "status", - "in" : "formData", - "description" : "Updated status of the pet", - "required" : false, - "type" : "string" + "schema" : { + "type" : "integer", + "format" : "int64" + } } ], + "requestBody" : { + "content" : { + "application/x-www-form-urlencoded" : { + "schema" : { + "properties" : { + "name" : { + "type" : "string", + "description" : "Updated name of the pet" + }, + "status" : { + "type" : "string", + "description" : "Updated status of the pet" + } + } + } + } + } + }, "responses" : { "405" : { - "description" : "Invalid input" + "description" : "Invalid input", + "content" : { } } }, "security" : [ { @@ -242,25 +304,27 @@ "delete" : { "tags" : [ "pet" ], "summary" : "Deletes a pet", - "description" : "", "operationId" : "deletePet", - "produces" : [ "application/xml", "application/json" ], "parameters" : [ { "name" : "api_key", "in" : "header", - "required" : false, - "type" : "string" + "schema" : { + "type" : "string" + } }, { "name" : "petId", "in" : "path", "description" : "Pet id to delete", "required" : true, - "type" : "integer", - "format" : "int64" + "schema" : { + "type" : "integer", + "format" : "int64" + } } ], "responses" : { "400" : { - "description" : "Invalid pet value" + "description" : "Invalid pet value", + "content" : { } } }, "security" : [ { @@ -272,35 +336,45 @@ "post" : { "tags" : [ "pet" ], "summary" : "uploads an image", - "description" : "", "operationId" : "uploadFile", - "consumes" : [ "multipart/form-data" ], - "produces" : [ "application/json" ], "parameters" : [ { "name" : "petId", "in" : "path", "description" : "ID of pet to update", "required" : true, - "type" : "integer", - "format" : "int64" - }, { - "name" : "additionalMetadata", - "in" : "formData", - "description" : "Additional data to pass to server", - "required" : false, - "type" : "string" - }, { - "name" : "file", - "in" : "formData", - "description" : "file to upload", - "required" : false, - "type" : "file" + "schema" : { + "type" : "integer", + "format" : "int64" + } } ], + "requestBody" : { + "content" : { + "multipart/form-data" : { + "schema" : { + "properties" : { + "additionalMetadata" : { + "type" : "string", + "description" : "Additional data to pass to server" + }, + "file" : { + "type" : "string", + "description" : "file to upload", + "format" : "binary" + } + } + } + } + } + }, "responses" : { "200" : { "description" : "successful operation", - "schema" : { - "$ref" : "#/definitions/ApiResponse" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ApiResponse" + } + } } } }, @@ -315,16 +389,18 @@ "summary" : "Returns pet inventories by status", "description" : "Returns a map of status codes to quantities", "operationId" : "getInventory", - "produces" : [ "application/json" ], - "parameters" : [ ], "responses" : { "200" : { "description" : "successful operation", - "schema" : { - "type" : "object", - "additionalProperties" : { - "type" : "integer", - "format" : "int32" + "content" : { + "application/json" : { + "schema" : { + "type" : "object", + "additionalProperties" : { + "type" : "integer", + "format" : "int32" + } + } } } } @@ -338,27 +414,37 @@ "post" : { "tags" : [ "store" ], "summary" : "Place an order for a pet", - "description" : "", "operationId" : "placeOrder", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", + "requestBody" : { "description" : "order placed for purchasing the pet", - "required" : true, - "schema" : { - "$ref" : "#/definitions/Order" - } - } ], + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/Order" + } + } + }, + "required" : true + }, "responses" : { "200" : { "description" : "successful operation", - "schema" : { - "$ref" : "#/definitions/Order" + "content" : { + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/Order" + } + }, + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Order" + } + } } }, "400" : { - "description" : "Invalid Order" + "description" : "Invalid Order", + "content" : { } } } } @@ -369,29 +455,41 @@ "summary" : "Find purchase order by ID", "description" : "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", "operationId" : "getOrderById", - "produces" : [ "application/xml", "application/json" ], "parameters" : [ { "name" : "order_id", "in" : "path", "description" : "ID of pet that needs to be fetched", "required" : true, - "type" : "integer", - "maximum" : 5, - "minimum" : 1, - "format" : "int64" + "schema" : { + "maximum" : 5, + "minimum" : 1, + "type" : "integer", + "format" : "int64" + } } ], "responses" : { "200" : { "description" : "successful operation", - "schema" : { - "$ref" : "#/definitions/Order" + "content" : { + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/Order" + } + }, + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Order" + } + } } }, "400" : { - "description" : "Invalid ID supplied" + "description" : "Invalid ID supplied", + "content" : { } }, "404" : { - "description" : "Order not found" + "description" : "Order not found", + "content" : { } } } }, @@ -400,20 +498,23 @@ "summary" : "Delete purchase order by ID", "description" : "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", "operationId" : "deleteOrder", - "produces" : [ "application/xml", "application/json" ], "parameters" : [ { "name" : "order_id", "in" : "path", "description" : "ID of the order that needs to be deleted", "required" : true, - "type" : "string" + "schema" : { + "type" : "string" + } } ], "responses" : { "400" : { - "description" : "Invalid ID supplied" + "description" : "Invalid ID supplied", + "content" : { } }, "404" : { - "description" : "Order not found" + "description" : "Order not found", + "content" : { } } } } @@ -424,19 +525,21 @@ "summary" : "Create user", "description" : "This can only be done by the logged in user.", "operationId" : "createUser", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", + "requestBody" : { "description" : "Created user object", - "required" : true, - "schema" : { - "$ref" : "#/definitions/User" - } - } ], + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/User" + } + } + }, + "required" : true + }, "responses" : { "default" : { - "description" : "successful operation" + "description" : "successful operation", + "content" : { } } } } @@ -445,24 +548,25 @@ "post" : { "tags" : [ "user" ], "summary" : "Creates list of users with given input array", - "description" : "", "operationId" : "createUsersWithArrayInput", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", + "requestBody" : { "description" : "List of user object", - "required" : true, - "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/User" + "content" : { + "*/*" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/User" + } + } } - } - } ], + }, + "required" : true + }, "responses" : { "default" : { - "description" : "successful operation" + "description" : "successful operation", + "content" : { } } } } @@ -471,24 +575,25 @@ "post" : { "tags" : [ "user" ], "summary" : "Creates list of users with given input array", - "description" : "", "operationId" : "createUsersWithListInput", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", + "requestBody" : { "description" : "List of user object", - "required" : true, - "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/User" + "content" : { + "*/*" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/User" + } + } } - } - } ], + }, + "required" : true + }, "responses" : { "default" : { - "description" : "successful operation" + "description" : "successful operation", + "content" : { } } } } @@ -497,43 +602,59 @@ "get" : { "tags" : [ "user" ], "summary" : "Logs user into the system", - "description" : "", "operationId" : "loginUser", - "produces" : [ "application/xml", "application/json" ], "parameters" : [ { "name" : "username", "in" : "query", "description" : "The user name for login", "required" : true, - "type" : "string" + "schema" : { + "type" : "string" + } }, { "name" : "password", "in" : "query", "description" : "The password for login in clear text", "required" : true, - "type" : "string" + "schema" : { + "type" : "string" + } } ], "responses" : { "200" : { "description" : "successful operation", - "schema" : { - "type" : "string" - }, "headers" : { "X-Rate-Limit" : { - "type" : "integer", - "format" : "int32", - "description" : "calls per hour allowed by the user" + "description" : "calls per hour allowed by the user", + "schema" : { + "type" : "integer", + "format" : "int32" + } }, "X-Expires-After" : { - "type" : "string", - "format" : "date-time", - "description" : "date in UTC when toekn expires" + "description" : "date in UTC when toekn expires", + "schema" : { + "type" : "string", + "format" : "date-time" + } + } + }, + "content" : { + "application/xml" : { + "schema" : { + "type" : "string" + } + }, + "application/json" : { + "schema" : { + "type" : "string" + } } } }, "400" : { - "description" : "Invalid username/password supplied" + "description" : "Invalid username/password supplied", + "content" : { } } } } @@ -542,13 +663,11 @@ "get" : { "tags" : [ "user" ], "summary" : "Logs out current logged in user session", - "description" : "", "operationId" : "logoutUser", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ ], "responses" : { "default" : { - "description" : "successful operation" + "description" : "successful operation", + "content" : { } } } } @@ -557,28 +676,39 @@ "get" : { "tags" : [ "user" ], "summary" : "Get user by user name", - "description" : "", "operationId" : "getUserByName", - "produces" : [ "application/xml", "application/json" ], "parameters" : [ { "name" : "username", "in" : "path", "description" : "The name that needs to be fetched. Use user1 for testing. ", "required" : true, - "type" : "string" + "schema" : { + "type" : "string" + } } ], "responses" : { "200" : { "description" : "successful operation", - "schema" : { - "$ref" : "#/definitions/User" + "content" : { + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/User" + } + }, + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/User" + } + } } }, "400" : { - "description" : "Invalid username supplied" + "description" : "Invalid username supplied", + "content" : { } }, "404" : { - "description" : "User not found" + "description" : "User not found", + "content" : { } } } }, @@ -587,28 +717,34 @@ "summary" : "Updated user", "description" : "This can only be done by the logged in user.", "operationId" : "updateUser", - "produces" : [ "application/xml", "application/json" ], "parameters" : [ { "name" : "username", "in" : "path", "description" : "name that need to be deleted", "required" : true, - "type" : "string" - }, { - "in" : "body", - "name" : "body", - "description" : "Updated user object", - "required" : true, "schema" : { - "$ref" : "#/definitions/User" + "type" : "string" } } ], + "requestBody" : { + "description" : "Updated user object", + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/User" + } + } + }, + "required" : true + }, "responses" : { "400" : { - "description" : "Invalid user supplied" + "description" : "Invalid user supplied", + "content" : { } }, "404" : { - "description" : "User not found" + "description" : "User not found", + "content" : { } } } }, @@ -617,20 +753,23 @@ "summary" : "Delete user", "description" : "This can only be done by the logged in user.", "operationId" : "deleteUser", - "produces" : [ "application/xml", "application/json" ], "parameters" : [ { "name" : "username", "in" : "path", "description" : "The name that needs to be deleted", "required" : true, - "type" : "string" + "schema" : { + "type" : "string" + } } ], "responses" : { "400" : { - "description" : "Invalid username supplied" + "description" : "Invalid username supplied", + "content" : { } }, "404" : { - "description" : "User not found" + "description" : "User not found", + "content" : { } } } } @@ -640,22 +779,26 @@ "tags" : [ "fake_classname_tags 123#$%^" ], "summary" : "To test class name in snake case", "operationId" : "testClassname", - "consumes" : [ "application/json" ], - "produces" : [ "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", + "requestBody" : { "description" : "client model", - "required" : true, - "schema" : { - "$ref" : "#/definitions/Client" - } - } ], + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Client" + } + } + }, + "required" : true + }, "responses" : { "200" : { "description" : "successful operation", - "schema" : { - "$ref" : "#/definitions/Client" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Client" + } + } } } }, @@ -670,88 +813,98 @@ "summary" : "To test enum parameters", "description" : "To test enum parameters", "operationId" : "testEnumParameters", - "consumes" : [ "*/*" ], - "produces" : [ "*/*" ], "parameters" : [ { - "name" : "enum_form_string_array", - "in" : "formData", - "description" : "Form parameter enum test (string array)", - "required" : false, - "type" : "array", - "items" : { - "type" : "string", - "default" : "$", - "enum" : [ ">", "$" ] - } - }, { - "name" : "enum_form_string", - "in" : "formData", - "description" : "Form parameter enum test (string)", - "required" : false, - "type" : "string", - "default" : "-efg", - "enum" : [ "_abc", "-efg", "(xyz)" ] - }, { "name" : "enum_header_string_array", "in" : "header", "description" : "Header parameter enum test (string array)", - "required" : false, - "type" : "array", - "items" : { - "type" : "string", - "default" : "$", - "enum" : [ ">", "$" ] + "schema" : { + "type" : "array", + "items" : { + "type" : "string", + "default" : "$", + "enum" : [ ">", "$" ] + } } }, { "name" : "enum_header_string", "in" : "header", "description" : "Header parameter enum test (string)", - "required" : false, - "type" : "string", - "default" : "-efg", - "enum" : [ "_abc", "-efg", "(xyz)" ] + "schema" : { + "type" : "string", + "default" : "-efg", + "enum" : [ "_abc", "-efg", "(xyz)" ] + } }, { "name" : "enum_query_string_array", "in" : "query", "description" : "Query parameter enum test (string array)", - "required" : false, - "type" : "array", - "items" : { - "type" : "string", - "default" : "$", - "enum" : [ ">", "$" ] + "explode" : false, + "schema" : { + "type" : "array", + "items" : { + "type" : "string", + "default" : "$", + "enum" : [ ">", "$" ] + } } }, { "name" : "enum_query_string", "in" : "query", "description" : "Query parameter enum test (string)", - "required" : false, - "type" : "string", - "default" : "-efg", - "enum" : [ "_abc", "-efg", "(xyz)" ] + "schema" : { + "type" : "string", + "default" : "-efg", + "enum" : [ "_abc", "-efg", "(xyz)" ] + } }, { "name" : "enum_query_integer", "in" : "query", "description" : "Query parameter enum test (double)", - "required" : false, - "type" : "integer", - "format" : "int32", - "enum" : [ 1, -2 ] - }, { - "name" : "enum_query_double", - "in" : "formData", - "description" : "Query parameter enum test (double)", - "required" : false, - "type" : "number", - "format" : "double", - "enum" : [ 1.1, -1.2 ] + "schema" : { + "type" : "integer", + "format" : "int32", + "enum" : [ "1", "-2" ] + } } ], + "requestBody" : { + "content" : { + "*/*" : { + "schema" : { + "properties" : { + "enum_form_string_array" : { + "type" : "array", + "description" : "Form parameter enum test (string array)", + "items" : { + "type" : "string", + "default" : "$", + "enum" : [ ">", "$" ] + } + }, + "enum_form_string" : { + "type" : "string", + "description" : "Form parameter enum test (string)", + "default" : "-efg", + "enum" : [ "_abc", "-efg", "(xyz)" ] + }, + "enum_query_double" : { + "type" : "number", + "description" : "Query parameter enum test (double)", + "format" : "double", + "enum" : [ "1.1", "-1.2" ] + } + } + } + } + } + }, "responses" : { "400" : { - "description" : "Invalid request" + "description" : "Invalid request", + "content" : { } }, "404" : { - "description" : "Not found" + "description" : "Not found", + "content" : { } } } }, @@ -760,121 +913,189 @@ "summary" : "Fake endpoint for testing various parameters\n假端點\n偽のエンドポイント\n가짜 엔드 포인트\n", "description" : "Fake endpoint for testing various parameters\n假端點\n偽のエンドポイント\n가짜 엔드 포인트\n", "operationId" : "testEndpointParameters", - "consumes" : [ "application/xml; charset=utf-8", "application/json; charset=utf-8" ], - "produces" : [ "application/xml; charset=utf-8", "application/json; charset=utf-8" ], - "parameters" : [ { - "name" : "integer", - "in" : "formData", - "description" : "None", - "required" : false, - "type" : "integer", - "maximum" : 100, - "minimum" : 10 - }, { - "name" : "int32", - "in" : "formData", - "description" : "None", - "required" : false, - "type" : "integer", - "maximum" : 200, - "minimum" : 20, - "format" : "int32" - }, { - "name" : "int64", - "in" : "formData", - "description" : "None", - "required" : false, - "type" : "integer", - "format" : "int64" - }, { - "name" : "number", - "in" : "formData", - "description" : "None", - "required" : true, - "type" : "number", - "maximum" : 543.2, - "minimum" : 32.1 - }, { - "name" : "float", - "in" : "formData", - "description" : "None", - "required" : false, - "type" : "number", - "maximum" : 987.6, - "format" : "float" - }, { - "name" : "double", - "in" : "formData", - "description" : "None", - "required" : true, - "type" : "number", - "maximum" : 123.4, - "minimum" : 67.8, - "format" : "double" - }, { - "name" : "string", - "in" : "formData", - "description" : "None", - "required" : false, - "type" : "string", - "pattern" : "/[a-z]/i" - }, { - "name" : "pattern_without_delimiter", - "in" : "formData", - "description" : "None", - "required" : true, - "type" : "string", - "pattern" : "^[A-Z].*" - }, { - "name" : "byte", - "in" : "formData", - "description" : "None", - "required" : true, - "type" : "string", - "format" : "byte" - }, { - "name" : "binary", - "in" : "formData", - "description" : "None", - "required" : false, - "type" : "string", - "format" : "binary" - }, { - "name" : "date", - "in" : "formData", - "description" : "None", - "required" : false, - "type" : "string", - "format" : "date" - }, { - "name" : "dateTime", - "in" : "formData", - "description" : "None", - "required" : false, - "type" : "string", - "format" : "date-time" - }, { - "name" : "password", - "in" : "formData", - "description" : "None", - "required" : false, - "type" : "string", - "maxLength" : 64, - "minLength" : 10, - "format" : "password" - }, { - "name" : "callback", - "in" : "formData", - "description" : "None", - "required" : false, - "type" : "string" - } ], + "requestBody" : { + "content" : { + "application/xml; charset=utf-8" : { + "schema" : { + "required" : [ "byte", "double", "number", "pattern_without_delimiter" ], + "properties" : { + "integer" : { + "maximum" : 100, + "minimum" : 10, + "type" : "integer", + "description" : "None" + }, + "int32" : { + "maximum" : 200, + "minimum" : 20, + "type" : "integer", + "description" : "None", + "format" : "int32" + }, + "int64" : { + "type" : "integer", + "description" : "None", + "format" : "int64" + }, + "number" : { + "maximum" : 543.2, + "minimum" : 32.1, + "type" : "number", + "description" : "None" + }, + "float" : { + "maximum" : 987.6, + "type" : "number", + "description" : "None", + "format" : "float" + }, + "double" : { + "maximum" : 123.4, + "minimum" : 67.8, + "type" : "number", + "description" : "None", + "format" : "double" + }, + "string" : { + "pattern" : "/[a-z]/i", + "type" : "string", + "description" : "None" + }, + "pattern_without_delimiter" : { + "pattern" : "^[A-Z].*", + "type" : "string", + "description" : "None" + }, + "byte" : { + "type" : "string", + "description" : "None", + "format" : "byte" + }, + "binary" : { + "type" : "string", + "description" : "None", + "format" : "binary" + }, + "date" : { + "type" : "string", + "description" : "None", + "format" : "date" + }, + "dateTime" : { + "type" : "string", + "description" : "None", + "format" : "date-time" + }, + "password" : { + "maxLength" : 64, + "minLength" : 10, + "type" : "string", + "description" : "None", + "format" : "password" + }, + "callback" : { + "type" : "string", + "description" : "None" + } + } + } + }, + "application/json; charset=utf-8" : { + "schema" : { + "required" : [ "byte", "double", "number", "pattern_without_delimiter" ], + "properties" : { + "integer" : { + "maximum" : 100, + "minimum" : 10, + "type" : "integer", + "description" : "None" + }, + "int32" : { + "maximum" : 200, + "minimum" : 20, + "type" : "integer", + "description" : "None", + "format" : "int32" + }, + "int64" : { + "type" : "integer", + "description" : "None", + "format" : "int64" + }, + "number" : { + "maximum" : 543.2, + "minimum" : 32.1, + "type" : "number", + "description" : "None" + }, + "float" : { + "maximum" : 987.6, + "type" : "number", + "description" : "None", + "format" : "float" + }, + "double" : { + "maximum" : 123.4, + "minimum" : 67.8, + "type" : "number", + "description" : "None", + "format" : "double" + }, + "string" : { + "pattern" : "/[a-z]/i", + "type" : "string", + "description" : "None" + }, + "pattern_without_delimiter" : { + "pattern" : "^[A-Z].*", + "type" : "string", + "description" : "None" + }, + "byte" : { + "type" : "string", + "description" : "None", + "format" : "byte" + }, + "binary" : { + "type" : "string", + "description" : "None", + "format" : "binary" + }, + "date" : { + "type" : "string", + "description" : "None", + "format" : "date" + }, + "dateTime" : { + "type" : "string", + "description" : "None", + "format" : "date-time" + }, + "password" : { + "maxLength" : 64, + "minLength" : 10, + "type" : "string", + "description" : "None", + "format" : "password" + }, + "callback" : { + "type" : "string", + "description" : "None" + } + } + } + } + }, + "required" : true + }, "responses" : { "400" : { - "description" : "Invalid username supplied" + "description" : "Invalid username supplied", + "content" : { } }, "404" : { - "description" : "User not found" + "description" : "User not found", + "content" : { } } }, "security" : [ { @@ -886,22 +1107,26 @@ "summary" : "To test \"client\" model", "description" : "To test \"client\" model", "operationId" : "testClientModel", - "consumes" : [ "application/json" ], - "produces" : [ "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", + "requestBody" : { "description" : "client model", - "required" : true, - "schema" : { - "$ref" : "#/definitions/Client" - } - } ], - "responses" : { - "200" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Client" + } + } + }, + "required" : true + }, + "responses" : { + "200" : { "description" : "successful operation", - "schema" : { - "$ref" : "#/definitions/Client" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Client" + } + } } } } @@ -912,20 +1137,26 @@ "tags" : [ "fake" ], "description" : "Test serialization of outer number types", "operationId" : "fakeOuterNumberSerialize", - "parameters" : [ { - "in" : "body", - "name" : "body", + "requestBody" : { "description" : "Input number as post body", - "required" : false, - "schema" : { - "$ref" : "#/definitions/OuterNumber" - } - } ], + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/OuterNumber" + } + } + }, + "required" : false + }, "responses" : { "200" : { "description" : "Output number", - "schema" : { - "$ref" : "#/definitions/OuterNumber" + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/OuterNumber" + } + } } } } @@ -936,20 +1167,26 @@ "tags" : [ "fake" ], "description" : "Test serialization of outer string types", "operationId" : "fakeOuterStringSerialize", - "parameters" : [ { - "in" : "body", - "name" : "body", + "requestBody" : { "description" : "Input string as post body", - "required" : false, - "schema" : { - "$ref" : "#/definitions/OuterString" - } - } ], + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/OuterString" + } + } + }, + "required" : false + }, "responses" : { "200" : { "description" : "Output string", - "schema" : { - "$ref" : "#/definitions/OuterString" + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/OuterString" + } + } } } } @@ -960,20 +1197,26 @@ "tags" : [ "fake" ], "description" : "Test serialization of outer boolean types", "operationId" : "fakeOuterBooleanSerialize", - "parameters" : [ { - "in" : "body", - "name" : "body", + "requestBody" : { "description" : "Input boolean as post body", - "required" : false, - "schema" : { - "$ref" : "#/definitions/OuterBoolean" - } - } ], + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/OuterBoolean" + } + } + }, + "required" : false + }, "responses" : { "200" : { "description" : "Output boolean", - "schema" : { - "$ref" : "#/definitions/OuterBoolean" + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/OuterBoolean" + } + } } } } @@ -984,20 +1227,26 @@ "tags" : [ "fake" ], "description" : "Test serialization of object with outer number type", "operationId" : "fakeOuterCompositeSerialize", - "parameters" : [ { - "in" : "body", - "name" : "body", + "requestBody" : { "description" : "Input composite as post body", - "required" : false, - "schema" : { - "$ref" : "#/definitions/OuterComposite" - } - } ], + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/OuterComposite" + } + } + }, + "required" : false + }, "responses" : { "200" : { "description" : "Output composite", - "schema" : { - "$ref" : "#/definitions/OuterComposite" + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/OuterComposite" + } + } } } } @@ -1007,25 +1256,31 @@ "get" : { "tags" : [ "fake" ], "summary" : "test json serialization of form data", - "description" : "", "operationId" : "testJsonFormData", - "consumes" : [ "application/json" ], - "parameters" : [ { - "name" : "param", - "in" : "formData", - "description" : "field1", - "required" : true, - "type" : "string" - }, { - "name" : "param2", - "in" : "formData", - "description" : "field2", - "required" : true, - "type" : "string" - } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "required" : [ "param", "param2" ], + "properties" : { + "param" : { + "type" : "string", + "description" : "field1" + }, + "param2" : { + "type" : "string", + "description" : "field2" + } + } + } + } + }, + "required" : true + }, "responses" : { "200" : { - "description" : "successful operation" + "description" : "successful operation", + "content" : { } } } } @@ -1034,24 +1289,25 @@ "post" : { "tags" : [ "fake" ], "summary" : "test inline additionalProperties", - "description" : "", "operationId" : "testInlineAdditionalProperties", - "consumes" : [ "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "param", + "requestBody" : { "description" : "request body", - "required" : true, - "schema" : { - "type" : "object", - "additionalProperties" : { - "type" : "string" + "content" : { + "application/json" : { + "schema" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" + } + } } - } - } ], + }, + "required" : true + }, "responses" : { "200" : { - "description" : "successful operation" + "description" : "successful operation", + "content" : { } } } } @@ -1062,658 +1318,671 @@ "summary" : "To test special tags", "description" : "To test special tags", "operationId" : "test_special_tags", - "consumes" : [ "application/json" ], - "produces" : [ "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", + "requestBody" : { "description" : "client model", - "required" : true, - "schema" : { - "$ref" : "#/definitions/Client" - } - } ], + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Client" + } + } + }, + "required" : true + }, "responses" : { "200" : { "description" : "successful operation", - "schema" : { - "$ref" : "#/definitions/Client" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Client" + } + } } } } } } }, - "securityDefinitions" : { - "petstore_auth" : { - "type" : "oauth2", - "authorizationUrl" : "http://petstore.swagger.io/api/oauth/dialog", - "flow" : "implicit", - "scopes" : { - "write:pets" : "modify pets in your account", - "read:pets" : "read your pets" - } - }, - "api_key" : { - "type" : "apiKey", - "name" : "api_key", - "in" : "header" - }, - "api_key_query" : { - "type" : "apiKey", - "name" : "api_key_query", - "in" : "query" - }, - "http_basic_test" : { - "type" : "basic" - } - }, - "definitions" : { - "Order" : { - "type" : "object", - "properties" : { - "id" : { - "type" : "integer", - "format" : "int64" - }, - "petId" : { - "type" : "integer", - "format" : "int64" - }, - "quantity" : { - "type" : "integer", - "format" : "int32" - }, - "shipDate" : { - "type" : "string", - "format" : "date-time" - }, - "status" : { - "type" : "string", - "description" : "Order Status", - "enum" : [ "placed", "approved", "delivered" ] + "components" : { + "schemas" : { + "Category" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64" + }, + "name" : { + "type" : "string" + } }, - "complete" : { - "type" : "boolean", - "default" : false + "xml" : { + "name" : "Category" } }, - "xml" : { - "name" : "Order" - } - }, - "Category" : { - "type" : "object", - "properties" : { - "id" : { - "type" : "integer", - "format" : "int64" + "User" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64", + "x-is-unique" : true + }, + "username" : { + "type" : "string" + }, + "firstName" : { + "type" : "string" + }, + "lastName" : { + "type" : "string" + }, + "email" : { + "type" : "string" + }, + "password" : { + "type" : "string" + }, + "phone" : { + "type" : "string" + }, + "userStatus" : { + "type" : "integer", + "description" : "User Status", + "format" : "int32" + } }, - "name" : { - "type" : "string" + "xml" : { + "name" : "User" } }, - "xml" : { - "name" : "Category" - } - }, - "User" : { - "type" : "object", - "properties" : { - "id" : { - "type" : "integer", - "format" : "int64", - "x-is-unique" : true - }, - "username" : { - "type" : "string" - }, - "firstName" : { - "type" : "string" - }, - "lastName" : { - "type" : "string" - }, - "email" : { - "type" : "string" - }, - "password" : { - "type" : "string" - }, - "phone" : { - "type" : "string" - }, - "userStatus" : { - "type" : "integer", - "format" : "int32", - "description" : "User Status" - } + "OuterNumber" : { + "type" : "number" }, - "xml" : { - "name" : "User" - } - }, - "Tag" : { - "type" : "object", - "properties" : { - "id" : { - "type" : "integer", - "format" : "int64" - }, - "name" : { - "type" : "string" + "ArrayOfNumberOnly" : { + "type" : "object", + "properties" : { + "ArrayNumber" : { + "type" : "array", + "items" : { + "type" : "number" + } + } } }, - "xml" : { - "name" : "Tag" - } - }, - "Pet" : { - "type" : "object", - "required" : [ "name", "photoUrls" ], - "properties" : { - "id" : { - "type" : "integer", - "format" : "int64", - "x-is-unique" : true - }, - "category" : { - "$ref" : "#/definitions/Category" - }, - "name" : { - "type" : "string", - "example" : "doggie" - }, - "photoUrls" : { - "type" : "array", - "xml" : { - "name" : "photoUrl", - "wrapped" : true + "Capitalization" : { + "type" : "object", + "properties" : { + "smallCamel" : { + "type" : "string" }, - "items" : { + "CapitalCamel" : { + "type" : "string" + }, + "small_Snake" : { + "type" : "string" + }, + "Capital_Snake" : { "type" : "string" - } - }, - "tags" : { - "type" : "array", - "xml" : { - "name" : "tag", - "wrapped" : true }, - "items" : { - "$ref" : "#/definitions/Tag" + "SCA_ETH_Flow_Points" : { + "type" : "string" + }, + "ATT_NAME" : { + "type" : "string", + "description" : "Name of the pet\n" } - }, - "status" : { - "type" : "string", - "description" : "pet status in the store", - "enum" : [ "available", "pending", "sold" ] - } - }, - "xml" : { - "name" : "Pet" - } - }, - "ApiResponse" : { - "type" : "object", - "properties" : { - "code" : { - "type" : "integer", - "format" : "int32" - }, - "type" : { - "type" : "string" - }, - "message" : { - "type" : "string" - } - } - }, - "$special[model.name]" : { - "properties" : { - "$special[property.name]" : { - "type" : "integer", - "format" : "int64" } }, - "xml" : { - "name" : "$special[model.name]" - } - }, - "Return" : { - "properties" : { - "return" : { - "type" : "integer", - "format" : "int32" + "MixedPropertiesAndAdditionalPropertiesClass" : { + "type" : "object", + "properties" : { + "uuid" : { + "type" : "string", + "format" : "uuid" + }, + "dateTime" : { + "type" : "string", + "format" : "date-time" + }, + "map" : { + "type" : "object", + "additionalProperties" : { + "$ref" : "#/components/schemas/Animal" + } + } } }, - "description" : "Model for testing reserved words", - "xml" : { - "name" : "Return" - } - }, - "Name" : { - "required" : [ "name" ], - "properties" : { - "name" : { - "type" : "integer", - "format" : "int32" - }, - "snake_case" : { - "type" : "integer", - "format" : "int32", - "readOnly" : true - }, - "property" : { - "type" : "string" - }, - "123Number" : { - "type" : "integer", - "readOnly" : true + "ApiResponse" : { + "type" : "object", + "properties" : { + "code" : { + "type" : "integer", + "format" : "int32" + }, + "type" : { + "type" : "string" + }, + "message" : { + "type" : "string" + } } }, - "description" : "Model for testing model name same as property name", - "xml" : { - "name" : "Name" - } - }, - "200_response" : { - "properties" : { - "name" : { - "type" : "integer", - "format" : "int32" + "Name" : { + "required" : [ "name" ], + "type" : "object", + "properties" : { + "name" : { + "type" : "integer", + "format" : "int32" + }, + "snake_case" : { + "type" : "integer", + "format" : "int32", + "readOnly" : true + }, + "property" : { + "type" : "string" + }, + "123Number" : { + "type" : "integer", + "readOnly" : true + } }, - "class" : { - "type" : "string" + "description" : "Model for testing model name same as property name", + "xml" : { + "name" : "Name" } }, - "description" : "Model for testing model name starting with number", - "xml" : { - "name" : "Name" - } - }, - "ClassModel" : { - "properties" : { - "_class" : { - "type" : "string" - } + "EnumClass" : { + "type" : "string", + "default" : "-efg", + "enum" : [ "_abc", "-efg", "(xyz)" ] }, - "description" : "Model for testing model with \"_class\" property" - }, - "Dog" : { - "allOf" : [ { - "$ref" : "#/definitions/Animal" - }, { + "List" : { "type" : "object", "properties" : { - "breed" : { + "123-list" : { "type" : "string" } } - } ] - }, - "Cat" : { - "allOf" : [ { - "$ref" : "#/definitions/Animal" - }, { + }, + "NumberOnly" : { "type" : "object", "properties" : { - "declawed" : { - "type" : "boolean" + "JustNumber" : { + "type" : "number" } } - } ] - }, - "Animal" : { - "type" : "object", - "required" : [ "className" ], - "discriminator" : "className", - "properties" : { - "className" : { - "type" : "string" - }, - "color" : { - "type" : "string", - "default" : "red" - } - } - }, - "AnimalFarm" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/Animal" - } - }, - "format_test" : { - "type" : "object", - "required" : [ "byte", "date", "number", "password" ], - "properties" : { - "integer" : { - "type" : "integer", - "minimum" : 10, - "maximum" : 100 - }, - "int32" : { - "type" : "integer", - "format" : "int32", - "minimum" : 20, - "maximum" : 200 - }, - "int64" : { - "type" : "integer", - "format" : "int64" - }, - "number" : { - "type" : "number", - "minimum" : 32.1, - "maximum" : 543.2 - }, - "float" : { - "type" : "number", - "format" : "float", - "minimum" : 54.3, - "maximum" : 987.6 - }, - "double" : { - "type" : "number", - "format" : "double", - "minimum" : 67.8, - "maximum" : 123.4 - }, - "string" : { - "type" : "string", - "pattern" : "/[a-z]/i" - }, - "byte" : { - "type" : "string", - "format" : "byte", - "pattern" : "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" - }, - "binary" : { - "type" : "string", - "format" : "binary" - }, - "date" : { - "type" : "string", - "format" : "date" - }, - "dateTime" : { - "type" : "string", - "format" : "date-time" - }, - "uuid" : { - "type" : "string", - "format" : "uuid" - }, - "password" : { - "type" : "string", - "format" : "password", - "minLength" : 10, - "maxLength" : 64 - } - } - }, - "EnumClass" : { - "type" : "string", - "enum" : [ "_abc", "-efg", "(xyz)" ], - "default" : "-efg" - }, - "Enum_Test" : { - "type" : "object", - "properties" : { - "enum_string" : { - "type" : "string", - "enum" : [ "UPPER", "lower", "" ] - }, - "enum_integer" : { - "type" : "integer", - "format" : "int32", - "enum" : [ 1, -1 ] - }, - "enum_number" : { - "type" : "number", - "format" : "double", - "enum" : [ 1.1, -1.2 ] + }, + "200_response" : { + "type" : "object", + "properties" : { + "name" : { + "type" : "integer", + "format" : "int32" + }, + "class" : { + "type" : "string" + } }, - "outerEnum" : { - "$ref" : "#/definitions/OuterEnum" + "description" : "Model for testing model name starting with number", + "xml" : { + "name" : "Name" } - } - }, - "AdditionalPropertiesClass" : { - "type" : "object", - "properties" : { - "map_property" : { - "type" : "object", - "additionalProperties" : { + }, + "Client" : { + "type" : "object", + "properties" : { + "client" : { "type" : "string" } - }, - "map_of_map_property" : { + } + }, + "Dog" : { + "allOf" : [ { + "$ref" : "#/components/schemas/Animal" + }, { "type" : "object", - "additionalProperties" : { - "type" : "object", - "additionalProperties" : { + "properties" : { + "breed" : { "type" : "string" } } - } - } - }, - "MixedPropertiesAndAdditionalPropertiesClass" : { - "type" : "object", - "properties" : { - "uuid" : { - "type" : "string", - "format" : "uuid" - }, - "dateTime" : { - "type" : "string", - "format" : "date-time" - }, - "map" : { - "type" : "object", - "additionalProperties" : { - "$ref" : "#/definitions/Animal" + } ] + }, + "Enum_Test" : { + "type" : "object", + "properties" : { + "enum_string" : { + "type" : "string", + "enum" : [ "UPPER", "lower", "" ] + }, + "enum_integer" : { + "type" : "integer", + "format" : "int32", + "enum" : [ 1, -1 ] + }, + "enum_number" : { + "type" : "number", + "format" : "double", + "enum" : [ 1.1, -1.2 ] + }, + "outerEnum" : { + "$ref" : "#/components/schemas/OuterEnum" } } - } - }, - "List" : { - "type" : "object", - "properties" : { - "123-list" : { - "type" : "string" - } - } - }, - "Client" : { - "type" : "object", - "properties" : { - "client" : { - "type" : "string" - } - } - }, - "ReadOnlyFirst" : { - "type" : "object", - "properties" : { - "bar" : { - "type" : "string", - "readOnly" : true - }, - "baz" : { - "type" : "string" - } - } - }, - "hasOnlyReadOnly" : { - "type" : "object", - "properties" : { - "bar" : { - "type" : "string", - "readOnly" : true - }, - "foo" : { - "type" : "string", - "readOnly" : true - } - } - }, - "Capitalization" : { - "type" : "object", - "properties" : { - "smallCamel" : { - "type" : "string" - }, - "CapitalCamel" : { - "type" : "string" - }, - "small_Snake" : { - "type" : "string" - }, - "Capital_Snake" : { - "type" : "string" - }, - "SCA_ETH_Flow_Points" : { - "type" : "string" + }, + "Order" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64" + }, + "petId" : { + "type" : "integer", + "format" : "int64" + }, + "quantity" : { + "type" : "integer", + "format" : "int32" + }, + "shipDate" : { + "type" : "string", + "format" : "date-time" + }, + "status" : { + "type" : "string", + "description" : "Order Status", + "enum" : [ "placed", "approved", "delivered" ] + }, + "complete" : { + "type" : "boolean", + "default" : false + } }, - "ATT_NAME" : { - "type" : "string", - "description" : "Name of the pet\n" + "xml" : { + "name" : "Order" } - } - }, - "MapTest" : { - "type" : "object", - "properties" : { - "map_map_of_string" : { - "type" : "object", - "additionalProperties" : { + }, + "AdditionalPropertiesClass" : { + "type" : "object", + "properties" : { + "map_property" : { "type" : "object", "additionalProperties" : { "type" : "string" } + }, + "map_of_map_property" : { + "type" : "object", + "additionalProperties" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" + } + } + } + } + }, + "$special[model.name]" : { + "type" : "object", + "properties" : { + "$special[property.name]" : { + "type" : "integer", + "format" : "int64" } }, - "map_of_enum_string" : { - "type" : "object", - "additionalProperties" : { - "type" : "string", - "enum" : [ "UPPER", "lower" ] + "xml" : { + "name" : "$special[model.name]" + } + }, + "Return" : { + "type" : "object", + "properties" : { + "return" : { + "type" : "integer", + "format" : "int32" } + }, + "description" : "Model for testing reserved words", + "xml" : { + "name" : "Return" } - } - }, - "ArrayTest" : { - "type" : "object", - "properties" : { - "array_of_string" : { - "type" : "array", - "items" : { + }, + "ReadOnlyFirst" : { + "type" : "object", + "properties" : { + "bar" : { + "type" : "string", + "readOnly" : true + }, + "baz" : { "type" : "string" } - }, - "array_array_of_integer" : { - "type" : "array", - "items" : { + } + }, + "ArrayOfArrayOfNumberOnly" : { + "type" : "object", + "properties" : { + "ArrayArrayNumber" : { "type" : "array", "items" : { - "type" : "integer", - "format" : "int64" + "type" : "array", + "items" : { + "type" : "number" + } } } - }, - "array_array_of_model" : { - "type" : "array", - "items" : { + } + }, + "OuterEnum" : { + "type" : "string", + "enum" : [ "placed", "approved", "delivered" ] + }, + "ArrayTest" : { + "type" : "object", + "properties" : { + "array_of_string" : { "type" : "array", "items" : { - "$ref" : "#/definitions/ReadOnlyFirst" + "type" : "string" + } + }, + "array_array_of_integer" : { + "type" : "array", + "items" : { + "type" : "array", + "items" : { + "type" : "integer", + "format" : "int64" + } + } + }, + "array_array_of_model" : { + "type" : "array", + "items" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/ReadOnlyFirst" + } } } } - } - }, - "NumberOnly" : { - "type" : "object", - "properties" : { - "JustNumber" : { - "type" : "number" + }, + "OuterComposite" : { + "type" : "object", + "properties" : { + "my_number" : { + "$ref" : "#/components/schemas/OuterNumber" + }, + "my_string" : { + "$ref" : "#/components/schemas/OuterString" + }, + "my_boolean" : { + "$ref" : "#/components/schemas/OuterBoolean" + } } - } - }, - "ArrayOfNumberOnly" : { - "type" : "object", - "properties" : { - "ArrayNumber" : { - "type" : "array", - "items" : { + }, + "format_test" : { + "required" : [ "byte", "date", "number", "password" ], + "type" : "object", + "properties" : { + "integer" : { + "maximum" : 1E+2, + "minimum" : 1E+1, + "type" : "integer" + }, + "int32" : { + "maximum" : 2E+2, + "minimum" : 2E+1, + "type" : "integer", + "format" : "int32" + }, + "int64" : { + "type" : "integer", + "format" : "int64" + }, + "number" : { + "maximum" : 543.2, + "minimum" : 32.1, "type" : "number" + }, + "float" : { + "maximum" : 987.6, + "minimum" : 54.3, + "type" : "number", + "format" : "float" + }, + "double" : { + "maximum" : 123.4, + "minimum" : 67.8, + "type" : "number", + "format" : "double" + }, + "string" : { + "pattern" : "/[a-z]/i", + "type" : "string" + }, + "byte" : { + "pattern" : "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$", + "type" : "string", + "format" : "byte" + }, + "binary" : { + "type" : "string", + "format" : "binary" + }, + "date" : { + "type" : "string", + "format" : "date" + }, + "dateTime" : { + "type" : "string", + "format" : "date-time" + }, + "uuid" : { + "type" : "string", + "format" : "uuid" + }, + "password" : { + "maxLength" : 64, + "minLength" : 10, + "type" : "string", + "format" : "password" } } - } - }, - "ArrayOfArrayOfNumberOnly" : { - "type" : "object", - "properties" : { - "ArrayArrayNumber" : { - "type" : "array", - "items" : { + }, + "EnumArrays" : { + "type" : "object", + "properties" : { + "just_symbol" : { + "type" : "string", + "enum" : [ ">=", "$" ] + }, + "array_enum" : { "type" : "array", "items" : { - "type" : "number" + "type" : "string", + "enum" : [ "fish", "crab" ] } } } - } - }, - "EnumArrays" : { - "type" : "object", - "properties" : { - "just_symbol" : { - "type" : "string", - "enum" : [ ">=", "$" ] + }, + "OuterString" : { + "type" : "string" + }, + "ClassModel" : { + "type" : "object", + "properties" : { + "_class" : { + "type" : "string" + } }, - "array_enum" : { - "type" : "array", - "items" : { + "description" : "Model for testing model with \"_class\" property" + }, + "OuterBoolean" : { + "type" : "boolean" + }, + "Animal" : { + "required" : [ "className" ], + "type" : "object", + "properties" : { + "className" : { + "type" : "string" + }, + "color" : { "type" : "string", - "enum" : [ "fish", "crab" ] + "default" : "red" } + }, + "discriminator" : { + "propertyName" : "className" } - } - }, - "OuterEnum" : { - "type" : "string", - "enum" : [ "placed", "approved", "delivered" ] - }, - "OuterComposite" : { - "type" : "object", - "properties" : { - "my_number" : { - "$ref" : "#/definitions/OuterNumber" + }, + "Cat" : { + "allOf" : [ { + "$ref" : "#/components/schemas/Animal" + }, { + "type" : "object", + "properties" : { + "declawed" : { + "type" : "boolean" + } + } + } ] + }, + "MapTest" : { + "type" : "object", + "properties" : { + "map_map_of_string" : { + "type" : "object", + "additionalProperties" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" + } + } + }, + "map_of_enum_string" : { + "type" : "object", + "additionalProperties" : { + "type" : "string", + "enum" : [ "UPPER", "lower" ] + } + } + } + }, + "Tag" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64" + }, + "name" : { + "type" : "string" + } }, - "my_string" : { - "$ref" : "#/definitions/OuterString" + "xml" : { + "name" : "Tag" + } + }, + "AnimalFarm" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Animal" + } + }, + "Pet" : { + "required" : [ "name", "photoUrls" ], + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64", + "x-is-unique" : true + }, + "category" : { + "$ref" : "#/components/schemas/Category" + }, + "name" : { + "type" : "string", + "example" : "doggie" + }, + "photoUrls" : { + "type" : "array", + "xml" : { + "name" : "photoUrl", + "wrapped" : true + }, + "items" : { + "type" : "string" + } + }, + "tags" : { + "type" : "array", + "xml" : { + "name" : "tag", + "wrapped" : true + }, + "items" : { + "$ref" : "#/components/schemas/Tag" + } + }, + "status" : { + "type" : "string", + "description" : "pet status in the store", + "enum" : [ "available", "pending", "sold" ] + } }, - "my_boolean" : { - "$ref" : "#/definitions/OuterBoolean" + "xml" : { + "name" : "Pet" + } + }, + "hasOnlyReadOnly" : { + "type" : "object", + "properties" : { + "bar" : { + "type" : "string", + "readOnly" : true + }, + "foo" : { + "type" : "string", + "readOnly" : true + } } } }, - "OuterNumber" : { - "type" : "number" - }, - "OuterString" : { - "type" : "string" - }, - "OuterBoolean" : { - "type" : "boolean" + "securitySchemes" : { + "petstore_auth" : { + "type" : "oauth2", + "flows" : { + "implicit" : { + "authorizationUrl" : "http://petstore.swagger.io/api/oauth/dialog", + "scopes" : { + "write:pets" : "modify pets in your account", + "read:pets" : "read your pets" + } + } + } + }, + "http_basic_test" : { + "type" : "http", + "scheme" : "basic" + }, + "api_key" : { + "type" : "apiKey", + "name" : "api_key", + "in" : "header" + }, + "api_key_query" : { + "type" : "apiKey", + "name" : "api_key_query", + "in" : "query" + } } - }, - "externalDocs" : { - "description" : "Find out more about Swagger", - "url" : "http://swagger.io" } } \ No newline at end of file diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/.swagger-codegen/VERSION b/samples/server/petstore/jaxrs/jersey1-useTags/.swagger-codegen/VERSION index 50794f17f1a..096bf47efe3 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/.swagger-codegen/VERSION +++ b/samples/server/petstore/jaxrs/jersey1-useTags/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.1-SNAPSHOT \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/pom.xml b/samples/server/petstore/jaxrs/jersey1-useTags/pom.xml index 26c5ad136a9..93a5e3bf933 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/pom.xml +++ b/samples/server/petstore/jaxrs/jersey1-useTags/pom.xml @@ -42,6 +42,15 @@ 60000 + + + + javax.validation + validation-api + ${beanvalidation-version} + + + start-jetty @@ -168,13 +177,15 @@ + javax.validation validation-api - 1.1.0.Final + ${beanvalidation-version} provided + @@ -189,13 +200,16 @@ 1.7 ${java.version} ${java.version} - 1.5.15 + 1.5.18 9.2.9.v20150224 1.19.1 2.8.9 1.7.21 4.12 2.5 + + 1.1.0.Final + UTF-8 diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/AnotherFakeApi.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/AnotherFakeApi.java index a1d379a5bc1..d80c8b065f9 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/AnotherFakeApi.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/AnotherFakeApi.java @@ -8,10 +8,13 @@ import io.swagger.jaxrs.*; import com.sun.jersey.multipart.FormDataParam; + import javax.validation.constraints.*; + import io.swagger.model.Client; + import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -31,9 +34,11 @@ @io.swagger.annotations.Api(description = "the AnotherFake API") + public class AnotherFakeApi { private final AnotherFakeApiService delegate = AnotherFakeApiServiceFactory.getAnotherFakeApi(); + @PATCH @Consumes({ "application/json" }) @@ -42,9 +47,12 @@ public class AnotherFakeApi { @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Client.class) }) public Response testSpecialTags( - @ApiParam(value = "client model" ,required=true) Client body, + @ApiParam(value = "client model" ,required=true) Client client +, @Context SecurityContext securityContext) throws NotFoundException { - return delegate.testSpecialTags(body,securityContext); + return delegate.testSpecialTags(client,securityContext); } + } + diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/AnotherFakeApiService.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/AnotherFakeApiService.java index eaec0e3e1ae..f8e5d6a0cfc 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/AnotherFakeApiService.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/AnotherFakeApiService.java @@ -7,6 +7,8 @@ import io.swagger.model.Client; + +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -17,9 +19,15 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; + import javax.validation.constraints.*; + + public abstract class AnotherFakeApiService { - public abstract Response testSpecialTags(Client body,SecurityContext securityContext) + + public abstract Response testSpecialTags(Client client,SecurityContext securityContext) throws NotFoundException; + } + diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/FakeApi.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/FakeApi.java index 3cf2646a388..38255844dbb 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/FakeApi.java @@ -8,13 +8,15 @@ import io.swagger.jaxrs.*; import com.sun.jersey.multipart.FormDataParam; + import javax.validation.constraints.*; + import java.math.BigDecimal; import io.swagger.model.Client; -import java.util.Date; import io.swagger.model.OuterComposite; + import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -34,137 +36,143 @@ @io.swagger.annotations.Api(description = "the Fake API") + public class FakeApi { private final FakeApiService delegate = FakeApiServiceFactory.getFakeApi(); + @POST - - - @io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) + @Consumes({ "*/*" }) + @Produces({ "*/*" }) + @io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) public Response fakeOuterBooleanSerialize( - @ApiParam(value = "Input boolean as post body" ) Boolean body, + @ApiParam(value = "Input boolean as post body" ) Boolean body +, @Context SecurityContext securityContext) throws NotFoundException { return delegate.fakeOuterBooleanSerialize(body,securityContext); } + @POST - - - @io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) + @Consumes({ "*/*" }) + @Produces({ "*/*" }) + @io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) public Response fakeOuterCompositeSerialize( - @ApiParam(value = "Input composite as post body" ) OuterComposite body, + @ApiParam(value = "Input composite as post body" ) OuterComposite outercomposite +, @Context SecurityContext securityContext) throws NotFoundException { - return delegate.fakeOuterCompositeSerialize(body,securityContext); + return delegate.fakeOuterCompositeSerialize(outercomposite,securityContext); } + @POST - - - @io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) + @Consumes({ "*/*" }) + @Produces({ "*/*" }) + @io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) public Response fakeOuterNumberSerialize( - @ApiParam(value = "Input number as post body" ) BigDecimal body, + @ApiParam(value = "Input number as post body" ) BigDecimal body +, @Context SecurityContext securityContext) throws NotFoundException { return delegate.fakeOuterNumberSerialize(body,securityContext); } + @POST - - - @io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) + @Consumes({ "*/*" }) + @Produces({ "*/*" }) + @io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of outer string types", response = String.class, tags={ "fake" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "Output string", response = String.class) }) public Response fakeOuterStringSerialize( - @ApiParam(value = "Input string as post body" ) String body, + @ApiParam(value = "Input string as post body" ) String body +, @Context SecurityContext securityContext) throws NotFoundException { return delegate.fakeOuterStringSerialize(body,securityContext); } + @PATCH @Consumes({ "application/json" }) @Produces({ "application/json" }) - @io.swagger.annotations.ApiOperation(value = "To test \"client\" model", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) + @io.swagger.annotations.ApiOperation(value = "To test \"client\" model", notes = "To test \"client\" model", response = Client.class, tags={ "fake" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Client.class) }) public Response testClientModel( - @ApiParam(value = "client model" ,required=true) Client body, + @ApiParam(value = "client model" ,required=true) Client client +, @Context SecurityContext securityContext) throws NotFoundException { - return delegate.testClientModel(body,securityContext); + return delegate.testClientModel(client,securityContext); } + @POST @Consumes({ "application/xml; charset=utf-8", "application/json; charset=utf-8" }) - @Produces({ "application/xml; charset=utf-8", "application/json; charset=utf-8" }) - @io.swagger.annotations.ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = Void.class, authorizations = { - @io.swagger.annotations.Authorization(value = "http_basic_test") - }, tags={ "fake", }) + + @io.swagger.annotations.ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = Void.class, tags={ "fake" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) public Response testEndpointParameters( - @ApiParam(value = "None", required=true) @FormParam("number") BigDecimal number, - @ApiParam(value = "None", required=true) @FormParam("double") Double _double, - @ApiParam(value = "None", required=true) @FormParam("pattern_without_delimiter") String patternWithoutDelimiter, - @ApiParam(value = "None", required=true) @FormParam("byte") byte[] _byte, - @ApiParam(value = "None") @FormParam("integer") Integer integer, - @ApiParam(value = "None") @FormParam("int32") Integer int32, - @ApiParam(value = "None") @FormParam("int64") Long int64, - @ApiParam(value = "None") @FormParam("float") Float _float, - @ApiParam(value = "None") @FormParam("string") String string, - @ApiParam(value = "None") @FormParam("binary") byte[] binary, - @ApiParam(value = "None") @FormParam("date") Date date, - @ApiParam(value = "None") @FormParam("dateTime") Date dateTime, - @ApiParam(value = "None") @FormParam("password") String password, - @ApiParam(value = "None") @FormParam("callback") String paramCallback, + @ApiParam(value = "" ,required=true) Object body +, @Context SecurityContext securityContext) throws NotFoundException { - return delegate.testEndpointParameters(number,_double,patternWithoutDelimiter,_byte,integer,int32,int64,_float,string,binary,date,dateTime,password,paramCallback,securityContext); + return delegate.testEndpointParameters(body,securityContext); } + @GET @Consumes({ "*/*" }) - @Produces({ "*/*" }) - @io.swagger.annotations.ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", response = Void.class, tags={ "fake", }) + + @io.swagger.annotations.ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", response = Void.class, tags={ "fake" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid request", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "Not found", response = Void.class) }) public Response testEnumParameters( - @ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $") @FormParam("enum_form_string_array") List enumFormStringArray, - @ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @DefaultValue("-efg") @FormParam("enum_form_string") String enumFormString, - @ApiParam(value = "Header parameter enum test (string array)" , allowableValues=">, $")@HeaderParam("enum_header_string_array") List enumHeaderStringArray, - @ApiParam(value = "Header parameter enum test (string)" , allowableValues="_abc, -efg, (xyz)", defaultValue="-efg")@HeaderParam("enum_header_string") String enumHeaderString, - @ApiParam(value = "Query parameter enum test (string array)", allowableValues=">, $") @QueryParam("enum_query_string_array") List enumQueryStringArray, - @ApiParam(value = "Query parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @DefaultValue("-efg") @QueryParam("enum_query_string") String enumQueryString, - @ApiParam(value = "Query parameter enum test (double)", allowableValues="1, -2") @QueryParam("enum_query_integer") Integer enumQueryInteger, - @ApiParam(value = "Query parameter enum test (double)", allowableValues="1.1, -1.2") @FormParam("enum_query_double") Double enumQueryDouble, + @ApiParam(value = "" ) Object body +, + @ApiParam(value = "Header parameter enum test (string array)" , allowableValues="range=[-infinity, infinity]")@HeaderParam("enum_header_string_array") List enumHeaderStringArray +, + @ApiParam(value = "Header parameter enum test (string)" )@HeaderParam("enum_header_string") String enumHeaderString +, + @ApiParam(value = "Query parameter enum test (string array)", allowableValues="range=[-infinity, infinity]") @QueryParam("enum_query_string_array") List enumQueryStringArray +, + @ApiParam(value = "Query parameter enum test (string)") @QueryParam("enum_query_string") String enumQueryString +, + @ApiParam(value = "Query parameter enum test (double)") @QueryParam("enum_query_integer") Integer enumQueryInteger +, @Context SecurityContext securityContext) throws NotFoundException { - return delegate.testEnumParameters(enumFormStringArray,enumFormString,enumHeaderStringArray,enumHeaderString,enumQueryStringArray,enumQueryString,enumQueryInteger,enumQueryDouble,securityContext); + return delegate.testEnumParameters(body,enumHeaderStringArray,enumHeaderString,enumQueryStringArray,enumQueryString,enumQueryInteger,securityContext); } + @POST @Consumes({ "application/json" }) - @io.swagger.annotations.ApiOperation(value = "test inline additionalProperties", notes = "", response = Void.class, tags={ "fake", }) + @io.swagger.annotations.ApiOperation(value = "test inline additionalProperties", notes = "", response = Void.class, tags={ "fake" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response testInlineAdditionalProperties( - @ApiParam(value = "request body" ,required=true) Object param, + @ApiParam(value = "request body" ,required=true) Map body +, @Context SecurityContext securityContext) throws NotFoundException { - return delegate.testInlineAdditionalProperties(param,securityContext); + return delegate.testInlineAdditionalProperties(body,securityContext); } + @GET @Consumes({ "application/json" }) @@ -173,10 +181,12 @@ public Response testInlineAdditionalProperties( @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response testJsonFormData( - @ApiParam(value = "field1", required=true) @FormParam("param") String param, - @ApiParam(value = "field2", required=true) @FormParam("param2") String param2, + @ApiParam(value = "" ,required=true) Object body +, @Context SecurityContext securityContext) throws NotFoundException { - return delegate.testJsonFormData(param,param2,securityContext); + return delegate.testJsonFormData(body,securityContext); } + } + diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/FakeApiService.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/FakeApiService.java index 3c7b947ca72..6b76ef33072 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/FakeApiService.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/FakeApiService.java @@ -7,9 +7,10 @@ import java.math.BigDecimal; import io.swagger.model.Client; -import java.util.Date; import io.swagger.model.OuterComposite; + +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -20,25 +21,39 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; + import javax.validation.constraints.*; + + public abstract class FakeApiService { + public abstract Response fakeOuterBooleanSerialize(Boolean body,SecurityContext securityContext) throws NotFoundException; - public abstract Response fakeOuterCompositeSerialize(OuterComposite body,SecurityContext securityContext) + + public abstract Response fakeOuterCompositeSerialize(OuterComposite outercomposite,SecurityContext securityContext) throws NotFoundException; + public abstract Response fakeOuterNumberSerialize(BigDecimal body,SecurityContext securityContext) throws NotFoundException; + public abstract Response fakeOuterStringSerialize(String body,SecurityContext securityContext) throws NotFoundException; - public abstract Response testClientModel(Client body,SecurityContext securityContext) + + public abstract Response testClientModel(Client client,SecurityContext securityContext) throws NotFoundException; - public abstract Response testEndpointParameters(BigDecimal number,Double _double,String patternWithoutDelimiter,byte[] _byte,Integer integer,Integer int32,Long int64,Float _float,String string,byte[] binary,Date date,Date dateTime,String password,String paramCallback,SecurityContext securityContext) + + public abstract Response testEndpointParameters(Object body,SecurityContext securityContext) throws NotFoundException; - public abstract Response testEnumParameters(List enumFormStringArray,String enumFormString,List enumHeaderStringArray,String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger,Double enumQueryDouble,SecurityContext securityContext) + + public abstract Response testEnumParameters(Object body,List enumHeaderStringArray,String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger,SecurityContext securityContext) throws NotFoundException; - public abstract Response testInlineAdditionalProperties(Object param,SecurityContext securityContext) + + public abstract Response testInlineAdditionalProperties(Map body,SecurityContext securityContext) throws NotFoundException; - public abstract Response testJsonFormData(String param,String param2,SecurityContext securityContext) + + public abstract Response testJsonFormData(Object body,SecurityContext securityContext) throws NotFoundException; + } + diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/FakeClassnameTags123Api.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/FakeClassnameTags123Api.java index b406c5cb0cd..6733c0cb974 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/FakeClassnameTags123Api.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/FakeClassnameTags123Api.java @@ -8,10 +8,13 @@ import io.swagger.jaxrs.*; import com.sun.jersey.multipart.FormDataParam; + import javax.validation.constraints.*; + import io.swagger.model.Client; + import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -31,22 +34,25 @@ @io.swagger.annotations.Api(description = "the FakeClassnameTags123 API") + public class FakeClassnameTags123Api { private final FakeClassnameTags123ApiService delegate = FakeClassnameTags123ApiServiceFactory.getFakeClassnameTags123Api(); + @PATCH @Consumes({ "application/json" }) @Produces({ "application/json" }) - @io.swagger.annotations.ApiOperation(value = "To test class name in snake case", notes = "", response = Client.class, authorizations = { - @io.swagger.annotations.Authorization(value = "api_key_query") - }, tags={ "fake_classname_tags 123#$%^" }) + @io.swagger.annotations.ApiOperation(value = "To test class name in snake case", notes = "", response = Client.class, tags={ "fake_classname_tags 123#$%^" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Client.class) }) public Response testClassname( - @ApiParam(value = "client model" ,required=true) Client body, + @ApiParam(value = "client model" ,required=true) Client client +, @Context SecurityContext securityContext) throws NotFoundException { - return delegate.testClassname(body,securityContext); + return delegate.testClassname(client,securityContext); } + } + diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/FakeClassnameTags123ApiService.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/FakeClassnameTags123ApiService.java index ecf374c3758..dfd03956c20 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/FakeClassnameTags123ApiService.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/FakeClassnameTags123ApiService.java @@ -7,6 +7,8 @@ import io.swagger.model.Client; + +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -17,9 +19,15 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; + import javax.validation.constraints.*; + + public abstract class FakeClassnameTags123ApiService { - public abstract Response testClassname(Client body,SecurityContext securityContext) + + public abstract Response testClassname(Client client,SecurityContext securityContext) throws NotFoundException; + } + diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/JacksonJsonProvider.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/JacksonJsonProvider.java index 60aa6ad1718..484860e63b0 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/JacksonJsonProvider.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/JacksonJsonProvider.java @@ -4,8 +4,11 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; + + import com.fasterxml.jackson.datatype.joda.*; + import com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider; import javax.ws.rs.Produces; @@ -21,7 +24,10 @@ public JacksonJsonProvider() { ObjectMapper objectMapper = new ObjectMapper() .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) + + .registerModule(new JodaModule()) + .setDateFormat(new RFC3339DateFormat()); setMapper(objectMapper); diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/PetApi.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/PetApi.java index d1187719cd4..a81572a51d7 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/PetApi.java @@ -8,12 +8,14 @@ import io.swagger.jaxrs.*; import com.sun.jersey.multipart.FormDataParam; + import javax.validation.constraints.*; -import java.io.File; + import io.swagger.model.ModelApiResponse; import io.swagger.model.Pet; + import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -33,160 +35,142 @@ @io.swagger.annotations.Api(description = "the Pet API") + public class PetApi { private final PetApiService delegate = PetApiServiceFactory.getPetApi(); + @POST @Consumes({ "application/json", "application/xml" }) - @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Add a new pet to the store", notes = "", response = Void.class, authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + + @io.swagger.annotations.ApiOperation(value = "Add a new pet to the store", notes = "", response = Void.class, tags={ "pet" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) public Response addPet( - @ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet body, + @ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet pet +, @Context SecurityContext securityContext) throws NotFoundException { - return delegate.addPet(body,securityContext); + return delegate.addPet(pet,securityContext); } + @DELETE - @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + + @io.swagger.annotations.ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, tags={ "pet" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) public Response deletePet( - @ApiParam(value = "Pet id to delete",required=true) @PathParam("petId") Long petId, - @ApiParam(value = "" )@HeaderParam("api_key") String apiKey, + @ApiParam(value = "Pet id to delete",required=true) @PathParam("petId") Integer petId +, + @ApiParam(value = "" )@HeaderParam("api_key") String apiKey +, @Context SecurityContext securityContext) throws NotFoundException { return delegate.deletePet(petId,apiKey,securityContext); } + @GET @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + @io.swagger.annotations.ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", tags={ "pet" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid status value", response = Void.class) }) public Response findPetsByStatus( - @ApiParam(value = "Status values that need to be considered for filter",required=true, allowableValues="available, pending, sold") @QueryParam("status") List status, + @ApiParam(value = "Status values that need to be considered for filter",required=true, allowableValues="range=[-infinity, infinity]") @QueryParam("status") List status +, @Context SecurityContext securityContext) throws NotFoundException { return delegate.findPetsByStatus(status,securityContext); } + @GET @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + @io.swagger.annotations.ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", tags={ "pet" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid tag value", response = Void.class) }) public Response findPetsByTags( - @ApiParam(value = "Tags to filter by",required=true) @QueryParam("tags") List tags, + @ApiParam(value = "Tags to filter by",required=true) @QueryParam("tags") List tags +, @Context SecurityContext securityContext) throws NotFoundException { return delegate.findPetsByTags(tags,securityContext); } + @GET @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = { - @io.swagger.annotations.Authorization(value = "api_key") - }, tags={ "pet", }) + @io.swagger.annotations.ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, tags={ "pet" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class) }) public Response getPetById( - @ApiParam(value = "ID of pet to return",required=true) @PathParam("petId") Long petId, + @ApiParam(value = "ID of pet to return",required=true) @PathParam("petId") Integer petId +, @Context SecurityContext securityContext) throws NotFoundException { return delegate.getPetById(petId,securityContext); } + @PUT @Consumes({ "application/json", "application/xml" }) - @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + + @io.swagger.annotations.ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, tags={ "pet" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class), @io.swagger.annotations.ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) public Response updatePet( - @ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet body, + @ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet pet +, @Context SecurityContext securityContext) throws NotFoundException { - return delegate.updatePet(body,securityContext); + return delegate.updatePet(pet,securityContext); } + @POST @Consumes({ "application/x-www-form-urlencoded" }) - @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + + @io.swagger.annotations.ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, tags={ "pet" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) public Response updatePetWithForm( - @ApiParam(value = "ID of pet that needs to be updated",required=true) @PathParam("petId") Long petId, - @ApiParam(value = "Updated name of the pet") @FormParam("name") String name, - @ApiParam(value = "Updated status of the pet") @FormParam("status") String status, + @ApiParam(value = "ID of pet that needs to be updated",required=true) @PathParam("petId") Integer petId +, + @ApiParam(value = "" ) Object body +, @Context SecurityContext securityContext) throws NotFoundException { - return delegate.updatePetWithForm(petId,name,status,securityContext); + return delegate.updatePetWithForm(petId,body,securityContext); } + @POST @Consumes({ "multipart/form-data" }) @Produces({ "application/json" }) - @io.swagger.annotations.ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet" }) + @io.swagger.annotations.ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, tags={ "pet" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) public Response uploadFile( - @ApiParam(value = "ID of pet to update",required=true) @PathParam("petId") Long petId, - @FormDataParam("additionalMetadata") String additionalMetadata, - @FormDataParam("file") InputStream inputStream, - @FormDataParam("file") FormDataContentDisposition fileDetail, + @ApiParam(value = "ID of pet to update",required=true) @PathParam("petId") Integer petId +, + @ApiParam(value = "" ) Object body +, @Context SecurityContext securityContext) throws NotFoundException { - return delegate.uploadFile(petId,additionalMetadata,inputStream, fileDetail,securityContext); + return delegate.uploadFile(petId,body,securityContext); } + } + diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/PetApiService.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/PetApiService.java index 62be64f485f..f0ea701e22e 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/PetApiService.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/PetApiService.java @@ -5,10 +5,11 @@ import com.sun.jersey.multipart.FormDataParam; -import java.io.File; import io.swagger.model.ModelApiResponse; import io.swagger.model.Pet; + +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -19,23 +20,36 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; + import javax.validation.constraints.*; + + public abstract class PetApiService { - public abstract Response addPet(Pet body,SecurityContext securityContext) + + public abstract Response addPet(Pet pet,SecurityContext securityContext) throws NotFoundException; - public abstract Response deletePet(Long petId,String apiKey,SecurityContext securityContext) + + public abstract Response deletePet(Integer petId,String apiKey,SecurityContext securityContext) throws NotFoundException; + public abstract Response findPetsByStatus( @NotNull List status,SecurityContext securityContext) throws NotFoundException; + public abstract Response findPetsByTags( @NotNull List tags,SecurityContext securityContext) throws NotFoundException; - public abstract Response getPetById(Long petId,SecurityContext securityContext) + + public abstract Response getPetById(Integer petId,SecurityContext securityContext) throws NotFoundException; - public abstract Response updatePet(Pet body,SecurityContext securityContext) + + public abstract Response updatePet(Pet pet,SecurityContext securityContext) throws NotFoundException; - public abstract Response updatePetWithForm(Long petId,String name,String status,SecurityContext securityContext) + + public abstract Response updatePetWithForm(Integer petId,Object body,SecurityContext securityContext) throws NotFoundException; - public abstract Response uploadFile(Long petId,String additionalMetadata,InputStream fileInputStream, FormDataContentDisposition fileDetail,SecurityContext securityContext) + + public abstract Response uploadFile(Integer petId,Object body,SecurityContext securityContext) throws NotFoundException; + } + diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/StoreApi.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/StoreApi.java index 314a34eb401..dfeeb3fb27f 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/StoreApi.java @@ -8,11 +8,14 @@ import io.swagger.jaxrs.*; import com.sun.jersey.multipart.FormDataParam; + import javax.validation.constraints.*; + import java.util.Map; import io.swagger.model.Order; + import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -32,30 +35,32 @@ @io.swagger.annotations.Api(description = "the Store API") + public class StoreApi { private final StoreApiService delegate = StoreApiServiceFactory.getStoreApi(); + @DELETE - @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = Void.class, tags={ "store", }) + + @io.swagger.annotations.ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = Void.class, tags={ "store" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Void.class) }) public Response deleteOrder( - @ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathParam("order_id") String orderId, + @ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathParam("order_id") String orderId +, @Context SecurityContext securityContext) throws NotFoundException { return delegate.deleteOrder(orderId,securityContext); } + @GET @Produces({ "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { - @io.swagger.annotations.Authorization(value = "api_key") - }, tags={ "store", }) + @io.swagger.annotations.ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", tags={ "store" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) public Response getInventory( @@ -63,33 +68,39 @@ public Response getInventory( throws NotFoundException { return delegate.getInventory(securityContext); } + @GET @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Find purchase order by ID", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) + @io.swagger.annotations.ApiOperation(value = "Find purchase order by ID", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Void.class) }) public Response getOrderById( - @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathParam("order_id") Long orderId, + @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathParam("order_id") Integer orderId +, @Context SecurityContext securityContext) throws NotFoundException { return delegate.getOrderById(orderId,securityContext); } + @POST - + @Consumes({ "*/*" }) @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid Order", response = Void.class) }) public Response placeOrder( - @ApiParam(value = "order placed for purchasing the pet" ,required=true) Order body, + @ApiParam(value = "order placed for purchasing the pet" ,required=true) Order order +, @Context SecurityContext securityContext) throws NotFoundException { - return delegate.placeOrder(body,securityContext); + return delegate.placeOrder(order,securityContext); } + } + diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/StoreApiService.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/StoreApiService.java index b5a01e43f3b..58e4ca97314 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/StoreApiService.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/StoreApiService.java @@ -8,6 +8,8 @@ import java.util.Map; import io.swagger.model.Order; + +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -18,15 +20,24 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; + import javax.validation.constraints.*; + + 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( @Min(1) @Max(5)Long orderId,SecurityContext securityContext) + + public abstract Response getOrderById( @DecimalMin("1") @DecimalMax("5")Integer orderId,SecurityContext securityContext) throws NotFoundException; - public abstract Response placeOrder(Order body,SecurityContext securityContext) + + public abstract Response placeOrder(Order order,SecurityContext securityContext) throws NotFoundException; + } + diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/UserApi.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/UserApi.java index 20d675ebdeb..ef41b46eec0 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/UserApi.java @@ -8,11 +8,13 @@ import io.swagger.jaxrs.*; import com.sun.jersey.multipart.FormDataParam; + import javax.validation.constraints.*; -import java.util.List; + import io.swagger.model.User; + import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -32,97 +34,112 @@ @io.swagger.annotations.Api(description = "the User API") + public class UserApi { private final UserApiService delegate = UserApiServiceFactory.getUserApi(); + @POST + @Consumes({ "*/*" }) - @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @io.swagger.annotations.ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response createUser( - @ApiParam(value = "Created user object" ,required=true) User body, + @ApiParam(value = "Created user object" ,required=true) User user +, @Context SecurityContext securityContext) throws NotFoundException { - return delegate.createUser(body,securityContext); + return delegate.createUser(user,securityContext); } + @POST + @Consumes({ "*/*" }) - @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) + @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response createUsersWithArrayInput( - @ApiParam(value = "List of user object" ,required=true) List body, + @ApiParam(value = "List of user object" ,required=true) List body +, @Context SecurityContext securityContext) throws NotFoundException { return delegate.createUsersWithArrayInput(body,securityContext); } + @POST + @Consumes({ "*/*" }) - @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) + @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response createUsersWithListInput( - @ApiParam(value = "List of user object" ,required=true) List body, + @ApiParam(value = "List of user object" ,required=true) List body +, @Context SecurityContext securityContext) throws NotFoundException { return delegate.createUsersWithListInput(body,securityContext); } + @DELETE - @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + + @io.swagger.annotations.ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) public Response deleteUser( - @ApiParam(value = "The name that needs to be deleted",required=true) @PathParam("username") String username, + @ApiParam(value = "The name that needs to be deleted",required=true) @PathParam("username") String username +, @Context SecurityContext securityContext) throws NotFoundException { return delegate.deleteUser(username,securityContext); } + @GET @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user", }) + @io.swagger.annotations.ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = User.class), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) public Response getUserByName( - @ApiParam(value = "The name that needs to be fetched. Use user1 for testing. ",required=true) @PathParam("username") String username, + @ApiParam(value = "The name that needs to be fetched. Use user1 for testing. ",required=true) @PathParam("username") String username +, @Context SecurityContext securityContext) throws NotFoundException { return delegate.getUserByName(username,securityContext); } + @GET @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user", }) + @io.swagger.annotations.ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = String.class), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username/password supplied", response = Void.class) }) public Response loginUser( - @ApiParam(value = "The user name for login",required=true) @QueryParam("username") String username, - @ApiParam(value = "The password for login in clear text",required=true) @QueryParam("password") String password, + @ApiParam(value = "The user name for login",required=true) @QueryParam("username") String username +, + @ApiParam(value = "The password for login in clear text",required=true) @QueryParam("password") String password +, @Context SecurityContext securityContext) throws NotFoundException { return delegate.loginUser(username,password,securityContext); } + @GET - @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) + + @io.swagger.annotations.ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response logoutUser( @@ -130,19 +147,24 @@ public Response logoutUser( throws NotFoundException { return delegate.logoutUser(securityContext); } + @PUT + @Consumes({ "*/*" }) - @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) public Response updateUser( - @ApiParam(value = "name that need to be deleted",required=true) @PathParam("username") String username, - @ApiParam(value = "Updated user object" ,required=true) User body, + @ApiParam(value = "Updated user object" ,required=true) User user +, + @ApiParam(value = "name that need to be deleted",required=true) @PathParam("username") String username +, @Context SecurityContext securityContext) throws NotFoundException { - return delegate.updateUser(username,body,securityContext); + return delegate.updateUser(user,username,securityContext); } + } + diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/UserApiService.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/UserApiService.java index 81d2eebcacf..eba19fe9501 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/UserApiService.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/UserApiService.java @@ -5,9 +5,10 @@ import com.sun.jersey.multipart.FormDataParam; -import java.util.List; import io.swagger.model.User; + +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -18,23 +19,36 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; + import javax.validation.constraints.*; + + public abstract class UserApiService { - public abstract Response createUser(User body,SecurityContext securityContext) + + public abstract Response createUser(User user,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( @NotNull String username, @NotNull String password,SecurityContext securityContext) throws NotFoundException; + public abstract Response logoutUser(SecurityContext securityContext) throws NotFoundException; - public abstract Response updateUser(String username,User body,SecurityContext securityContext) + + public abstract Response updateUser(User user,String username,SecurityContext securityContext) throws NotFoundException; + } + diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java index d2cbef7abb5..3f933b49554 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java @@ -13,7 +13,10 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; @@ -21,72 +24,137 @@ import java.util.HashMap; import java.util.List; import java.util.Map; + + + import javax.validation.constraints.*; + + + /** * AdditionalPropertiesClass */ public class AdditionalPropertiesClass { + + + + @JsonProperty("map_property") + + + private Map mapProperty = null; + + + + + + @JsonProperty("map_of_map_property") + + + private Map> mapOfMapProperty = null; + + + + + public AdditionalPropertiesClass mapProperty(Map mapProperty) { this.mapProperty = mapProperty; return this; } + + public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + if (this.mapProperty == null) { this.mapProperty = new HashMap(); } + this.mapProperty.put(key, mapPropertyItem); return this; } + + /** + + * Get mapProperty + + + * @return mapProperty **/ + + @JsonProperty("map_property") + @ApiModelProperty(value = "") + public Map getMapProperty() { return mapProperty; } + public void setMapProperty(Map mapProperty) { this.mapProperty = mapProperty; } + + + public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { this.mapOfMapProperty = mapOfMapProperty; return this; } + + public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + if (this.mapOfMapProperty == null) { this.mapOfMapProperty = new HashMap>(); } + this.mapOfMapProperty.put(key, mapOfMapPropertyItem); return this; } + + /** + + * Get mapOfMapProperty + + + * @return mapOfMapProperty **/ + + @JsonProperty("map_of_map_property") + @ApiModelProperty(value = "") + public Map> getMapOfMapProperty() { return mapOfMapProperty; } + public void setMapOfMapProperty(Map> mapOfMapProperty) { this.mapOfMapProperty = mapOfMapProperty; } + + + @Override @@ -108,6 +176,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -131,3 +201,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Animal.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Animal.java index 8f1fdfd45bb..95f65d55469 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Animal.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Animal.java @@ -13,64 +13,127 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + + + import javax.validation.constraints.*; + + + /** * Animal */ public class Animal { + + + + @JsonProperty("className") + + + + private String className = null; + + + + + @JsonProperty("color") + + + + private String color = "red"; + + + + public Animal className(String className) { this.className = className; return this; } + + + /** + + * Get className + + + * @return className **/ + + @JsonProperty("className") + @ApiModelProperty(required = true, value = "") + @NotNull + public String getClassName() { return className; } + public void setClassName(String className) { this.className = className; } + + + public Animal color(String color) { this.color = color; return this; } + + + /** + + * Get color + + + * @return color **/ + + @JsonProperty("color") + @ApiModelProperty(value = "") + public String getColor() { return color; } + public void setColor(String color) { this.color = color; } + + + @Override @@ -92,6 +155,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -115,3 +180,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/AnimalFarm.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/AnimalFarm.java index be5b217a5c0..faee4225a03 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/AnimalFarm.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/AnimalFarm.java @@ -13,17 +13,29 @@ package io.swagger.model; + import java.util.Objects; + + import io.swagger.model.Animal; import java.util.ArrayList; import java.util.List; + + + import javax.validation.constraints.*; + + + /** * AnimalFarm */ public class AnimalFarm extends ArrayList { + + + @Override public boolean equals(java.lang.Object o) { @@ -38,10 +50,12 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(super.hashCode()); + return Objects.hash(); } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -63,3 +77,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java index 7dcd2118293..8da6a4ed646 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java @@ -13,7 +13,10 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; @@ -21,42 +24,79 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; + + + import javax.validation.constraints.*; + + + /** * ArrayOfArrayOfNumberOnly */ public class ArrayOfArrayOfNumberOnly { + + + + @JsonProperty("ArrayArrayNumber") + + + private List> arrayArrayNumber = null; + + + + + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; return this; } + public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { this.arrayArrayNumber = new ArrayList>(); } + this.arrayArrayNumber.add(arrayArrayNumberItem); return this; } + + + /** + + * Get arrayArrayNumber + + + * @return arrayArrayNumber **/ + + @JsonProperty("ArrayArrayNumber") + @ApiModelProperty(value = "") + public List> getArrayArrayNumber() { return arrayArrayNumber; } + public void setArrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; } + + + @Override @@ -77,6 +117,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -99,3 +141,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java index 05331fa55e9..d572230b45c 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java @@ -13,7 +13,10 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; @@ -21,42 +24,79 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; + + + import javax.validation.constraints.*; + + + /** * ArrayOfNumberOnly */ public class ArrayOfNumberOnly { + + + + @JsonProperty("ArrayNumber") + + + private List arrayNumber = null; + + + + + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; return this; } + public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { this.arrayNumber = new ArrayList(); } + this.arrayNumber.add(arrayNumberItem); return this; } + + + /** + + * Get arrayNumber + + + * @return arrayNumber **/ + + @JsonProperty("ArrayNumber") + @ApiModelProperty(value = "") + public List getArrayNumber() { return arrayNumber; } + public void setArrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; } + + + @Override @@ -77,6 +117,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -99,3 +141,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ArrayTest.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ArrayTest.java index 295a1ea1f14..67b1c3f79e0 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ArrayTest.java @@ -13,7 +13,10 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; @@ -21,102 +24,195 @@ import io.swagger.model.ReadOnlyFirst; import java.util.ArrayList; import java.util.List; + + + import javax.validation.constraints.*; + + + /** * ArrayTest */ public class ArrayTest { + + + + @JsonProperty("array_of_string") + + + private List arrayOfString = null; + + + + + + @JsonProperty("array_array_of_integer") + + + private List> arrayArrayOfInteger = null; + + + + + + @JsonProperty("array_array_of_model") + + + private List> arrayArrayOfModel = null; + + + + + public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; return this; } + public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { this.arrayOfString = new ArrayList(); } + this.arrayOfString.add(arrayOfStringItem); return this; } + + + /** + + * Get arrayOfString + + + * @return arrayOfString **/ + + @JsonProperty("array_of_string") + @ApiModelProperty(value = "") + public List getArrayOfString() { return arrayOfString; } + public void setArrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; } + + + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; return this; } + public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { this.arrayArrayOfInteger = new ArrayList>(); } + this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; } + + + /** + + * Get arrayArrayOfInteger + + + * @return arrayArrayOfInteger **/ + + @JsonProperty("array_array_of_integer") + @ApiModelProperty(value = "") + public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; } + + + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; return this; } + public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { this.arrayArrayOfModel = new ArrayList>(); } + this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; } + + + /** + + * Get arrayArrayOfModel + + + * @return arrayArrayOfModel **/ + + @JsonProperty("array_array_of_model") + @ApiModelProperty(value = "") + public List> getArrayArrayOfModel() { return arrayArrayOfModel; } + public void setArrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } + + + @Override @@ -139,6 +235,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -163,3 +261,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Capitalization.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Capitalization.java index 6ee896a961d..b837c520bd6 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Capitalization.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Capitalization.java @@ -13,149 +13,311 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + + + import javax.validation.constraints.*; + + + /** * Capitalization */ public class Capitalization { + + + + @JsonProperty("smallCamel") + + + + private String smallCamel = null; + + + + + @JsonProperty("CapitalCamel") + + + + private String capitalCamel = null; + + + + + @JsonProperty("small_Snake") + + + + private String smallSnake = null; + + + + + @JsonProperty("Capital_Snake") + + + + private String capitalSnake = null; + + + + + @JsonProperty("SCA_ETH_Flow_Points") + + + + private String scAETHFlowPoints = null; + + + + + @JsonProperty("ATT_NAME") + + + + private String ATT_NAME = null; + + + + public Capitalization smallCamel(String smallCamel) { this.smallCamel = smallCamel; return this; } + + + /** + + * Get smallCamel + + + * @return smallCamel **/ + + @JsonProperty("smallCamel") + @ApiModelProperty(value = "") + public String getSmallCamel() { return smallCamel; } + public void setSmallCamel(String smallCamel) { this.smallCamel = smallCamel; } + + + public Capitalization capitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; return this; } + + + /** + + * Get capitalCamel + + + * @return capitalCamel **/ + + @JsonProperty("CapitalCamel") + @ApiModelProperty(value = "") + public String getCapitalCamel() { return capitalCamel; } + public void setCapitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; } + + + public Capitalization smallSnake(String smallSnake) { this.smallSnake = smallSnake; return this; } + + + /** + + * Get smallSnake + + + * @return smallSnake **/ + + @JsonProperty("small_Snake") + @ApiModelProperty(value = "") + public String getSmallSnake() { return smallSnake; } + public void setSmallSnake(String smallSnake) { this.smallSnake = smallSnake; } + + + public Capitalization capitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; return this; } + + + /** + + * Get capitalSnake + + + * @return capitalSnake **/ + + @JsonProperty("Capital_Snake") + @ApiModelProperty(value = "") + public String getCapitalSnake() { return capitalSnake; } + public void setCapitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; } + + + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; return this; } + + + /** + + * Get scAETHFlowPoints + + + * @return scAETHFlowPoints **/ + + @JsonProperty("SCA_ETH_Flow_Points") + @ApiModelProperty(value = "") + public String getScAETHFlowPoints() { return scAETHFlowPoints; } + public void setScAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; } + + + public Capitalization ATT_NAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; return this; } + + + /** + * Name of the pet + + + + * @return ATT_NAME **/ + + @JsonProperty("ATT_NAME") + @ApiModelProperty(value = "Name of the pet ") + public String getATTNAME() { return ATT_NAME; } + public void setATTNAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; } + + + @Override @@ -181,6 +343,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -208,3 +372,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Cat.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Cat.java index b96cffbbd79..bda7f6d885d 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Cat.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Cat.java @@ -13,40 +13,173 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import io.swagger.model.Animal; + + + import javax.validation.constraints.*; + + + /** * Cat */ public class Cat extends Animal { + + + + + @JsonProperty("className") + + + + + private String className = null; + + + + + + + @JsonProperty("color") + + + + + private String color = "red"; + + + + + + @JsonProperty("declawed") + + + + private Boolean declawed = null; + + + + + + public Cat className(String className) { + this.className = className; + return this; + } + + + + + /** + + + * Get className + + + + * @return className + **/ + + + @JsonProperty("className") + + @ApiModelProperty(required = true, value = "") + + @NotNull + + public String getClassName() { + return className; + } + + public void setClassName(String className) { + this.className = className; + } + + + + + public Cat color(String color) { + this.color = color; + return this; + } + + + + + /** + + + * Get color + + + + * @return color + **/ + + + @JsonProperty("color") + + @ApiModelProperty(value = "") + + public String getColor() { + return color; + } + + + public void setColor(String color) { + this.color = color; + } + + + + public Cat declawed(Boolean declawed) { this.declawed = declawed; return this; } + + + /** + + * Get declawed + + + * @return declawed **/ + + @JsonProperty("declawed") + @ApiModelProperty(value = "") - public Boolean isDeclawed() { + + public Boolean isisDeclawed() { return declawed; } + public void setDeclawed(Boolean declawed) { this.declawed = declawed; } + + + @Override @@ -58,21 +191,27 @@ public boolean equals(java.lang.Object o) { return false; } Cat cat = (Cat) o; - return Objects.equals(this.declawed, cat.declawed) && + return Objects.equals(this.className, cat.className) && + Objects.equals(this.color, cat.color) && + Objects.equals(this.declawed, cat.declawed) && super.equals(o); } @Override public int hashCode() { - return Objects.hash(declawed, super.hashCode()); + return Objects.hash(className, color, declawed, super.hashCode()); } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Cat {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); sb.append("}"); return sb.toString(); @@ -90,3 +229,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Category.java index 0408b4d6acf..37b9fe98e41 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Category.java @@ -13,61 +13,123 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + + + import javax.validation.constraints.*; + + + /** * Category */ public class Category { + + + + @JsonProperty("id") + + + + private Long id = null; + + + + + @JsonProperty("name") + + + + private String name = null; + + + + public Category id(Long id) { this.id = id; return this; } + + + /** + + * Get id + + + * @return id **/ + + @JsonProperty("id") + @ApiModelProperty(value = "") + public Long getId() { return id; } + public void setId(Long id) { this.id = id; } + + + public Category name(String name) { this.name = name; return this; } + + + /** + + * Get name + + + * @return name **/ + + @JsonProperty("name") + @ApiModelProperty(value = "") + public String getName() { return name; } + public void setName(String name) { this.name = name; } + + + @Override @@ -89,6 +151,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -112,3 +176,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ClassModel.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ClassModel.java index e96a4ff4eb8..8667943daef 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ClassModel.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ClassModel.java @@ -13,40 +13,77 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + + + import javax.validation.constraints.*; + + + /** * Model for testing model with \"_class\" property */ @ApiModel(description = "Model for testing model with \"_class\" property") public class ClassModel { + + + + @JsonProperty("_class") + + + + private String propertyClass = null; + + + + public ClassModel propertyClass(String propertyClass) { this.propertyClass = propertyClass; return this; } + + + /** + + * Get propertyClass + + + * @return propertyClass **/ + + @JsonProperty("_class") + @ApiModelProperty(value = "") + public String getPropertyClass() { return propertyClass; } + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } + + + @Override @@ -67,6 +104,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -89,3 +128,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Client.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Client.java index 7bae1955cb3..5e8e716bc01 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Client.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Client.java @@ -13,39 +13,76 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + + + import javax.validation.constraints.*; + + + /** * Client */ public class Client { + + + + @JsonProperty("client") + + + + private String client = null; + + + + public Client client(String client) { this.client = client; return this; } + + + /** + + * Get client + + + * @return client **/ + + @JsonProperty("client") + @ApiModelProperty(value = "") + public String getClient() { return client; } + public void setClient(String client) { this.client = client; } + + + @Override @@ -66,6 +103,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -88,3 +127,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Dog.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Dog.java index 94fd1071a92..5513088ecd1 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Dog.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Dog.java @@ -13,40 +13,173 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import io.swagger.model.Animal; + + + import javax.validation.constraints.*; + + + /** * Dog */ public class Dog extends Animal { + + + + + @JsonProperty("className") + + + + + private String className = null; + + + + + + + @JsonProperty("color") + + + + + private String color = "red"; + + + + + + @JsonProperty("breed") + + + + private String breed = null; + + + + + + public Dog className(String className) { + this.className = className; + return this; + } + + + + + /** + + + * Get className + + + + * @return className + **/ + + + @JsonProperty("className") + + @ApiModelProperty(required = true, value = "") + + @NotNull + + public String getClassName() { + return className; + } + + public void setClassName(String className) { + this.className = className; + } + + + + + public Dog color(String color) { + this.color = color; + return this; + } + + + + + /** + + + * Get color + + + + * @return color + **/ + + + @JsonProperty("color") + + @ApiModelProperty(value = "") + + public String getColor() { + return color; + } + + + public void setColor(String color) { + this.color = color; + } + + + + public Dog breed(String breed) { this.breed = breed; return this; } + + + /** + + * Get breed + + + * @return breed **/ + + @JsonProperty("breed") + @ApiModelProperty(value = "") + public String getBreed() { return breed; } + public void setBreed(String breed) { this.breed = breed; } + + + @Override @@ -58,21 +191,27 @@ public boolean equals(java.lang.Object o) { return false; } Dog dog = (Dog) o; - return Objects.equals(this.breed, dog.breed) && + return Objects.equals(this.className, dog.className) && + Objects.equals(this.color, dog.color) && + Objects.equals(this.breed, dog.breed) && super.equals(o); } @Override public int hashCode() { - return Objects.hash(breed, super.hashCode()); + return Objects.hash(className, color, breed, super.hashCode()); } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Dog {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); sb.append("}"); return sb.toString(); @@ -90,3 +229,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/EnumArrays.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/EnumArrays.java index 8542c26fea8..4551dda9140 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/EnumArrays.java @@ -13,7 +13,10 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -21,20 +24,37 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; + + + import javax.validation.constraints.*; + + + /** * EnumArrays */ public class EnumArrays { + + + /** * Gets or Sets justSymbol */ public enum JustSymbolEnum { + + + + GREATER_THAN_OR_EQUAL_TO(">="), + DOLLAR("$"); + + + private String value; @@ -59,16 +79,40 @@ public static JustSymbolEnum fromValue(String text) { } } + + + + @JsonProperty("just_symbol") + + + + private JustSymbolEnum justSymbol = null; + + + + + + + + /** * Gets or Sets arrayEnum */ public enum ArrayEnumEnum { + + + + FISH("fish"), + CRAB("crab"); + + + private String value; @@ -93,54 +137,101 @@ public static ArrayEnumEnum fromValue(String text) { } } + + + + @JsonProperty("array_enum") + + + private List arrayEnum = null; + + + + + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; return this; } + + + /** + + * Get justSymbol + + + * @return justSymbol **/ + + @JsonProperty("just_symbol") + @ApiModelProperty(value = "") + public JustSymbolEnum getJustSymbol() { return justSymbol; } + public void setJustSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; } + + + public EnumArrays arrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; return this; } + public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { this.arrayEnum = new ArrayList(); } + this.arrayEnum.add(arrayEnumItem); return this; } + + + /** + + * Get arrayEnum + + + * @return arrayEnum **/ + + @JsonProperty("array_enum") + @ApiModelProperty(value = "") + public List getArrayEnum() { return arrayEnum; } + public void setArrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; } + + + @Override @@ -162,6 +253,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -185,3 +278,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/EnumClass.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/EnumClass.java index 1a5899f15d0..628bdaf0d7f 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/EnumClass.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/EnumClass.java @@ -13,22 +13,36 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonValue; + + + import javax.validation.constraints.*; + + + + import com.fasterxml.jackson.annotation.JsonCreator; + /** * Gets or Sets EnumClass */ public enum EnumClass { + + _ABC("_abc"), _EFG("-efg"), _XYZ_("(xyz)"); + private String value; @@ -41,6 +55,7 @@ public String toString() { return String.valueOf(value); } + @JsonCreator public static EnumClass fromValue(String text) { for (EnumClass b : EnumClass.values()) { @@ -50,5 +65,8 @@ public static EnumClass fromValue(String text) { } return null; } + } + + diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/EnumTest.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/EnumTest.java index e233d15e2a9..2b3d3b3b8df 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/EnumTest.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/EnumTest.java @@ -13,29 +13,50 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import io.swagger.model.OuterEnum; + + + import javax.validation.constraints.*; + + + /** * EnumTest */ public class EnumTest { + + + /** * Gets or Sets enumString */ public enum EnumStringEnum { + + + + UPPER("UPPER"), + LOWER("lower"), + EMPTY(""); + + + private String value; @@ -60,16 +81,36 @@ public static EnumStringEnum fromValue(String text) { } } + + + + @JsonProperty("enum_string") + + + + private EnumStringEnum enumString = null; + + + + /** * Gets or Sets enumInteger */ public enum EnumIntegerEnum { + + + + NUMBER_1(1), + NUMBER_MINUS_1(-1); + + + private Integer value; @@ -94,16 +135,36 @@ public static EnumIntegerEnum fromValue(String text) { } } + + + + @JsonProperty("enum_integer") + + + + private EnumIntegerEnum enumInteger = null; + + + + /** * Gets or Sets enumNumber */ public enum EnumNumberEnum { + + + + NUMBER_1_DOT_1(1.1), + NUMBER_MINUS_1_DOT_2(-1.2); + + + private Double value; @@ -128,87 +189,172 @@ public static EnumNumberEnum fromValue(String text) { } } + + + + @JsonProperty("enum_number") + + + + private EnumNumberEnum enumNumber = null; + + + + + @JsonProperty("outerEnum") + + + + private OuterEnum outerEnum = null; + + + + public EnumTest enumString(EnumStringEnum enumString) { this.enumString = enumString; return this; } + + + /** + + * Get enumString + + + * @return enumString **/ + + @JsonProperty("enum_string") + @ApiModelProperty(value = "") + public EnumStringEnum getEnumString() { return enumString; } + public void setEnumString(EnumStringEnum enumString) { this.enumString = enumString; } + + + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; return this; } + + + /** + + * Get enumInteger + + + * @return enumInteger **/ + + @JsonProperty("enum_integer") + @ApiModelProperty(value = "") + public EnumIntegerEnum getEnumInteger() { return enumInteger; } + public void setEnumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; } + + + public EnumTest enumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; return this; } + + + /** + + * Get enumNumber + + + * @return enumNumber **/ + + @JsonProperty("enum_number") + @ApiModelProperty(value = "") + public EnumNumberEnum getEnumNumber() { return enumNumber; } + public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } + + + public EnumTest outerEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; return this; } + + + /** + + * Get outerEnum + + + * @return outerEnum **/ + + @JsonProperty("outerEnum") + @ApiModelProperty(value = "") + public OuterEnum getOuterEnum() { return outerEnum; } + public void setOuterEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; } + + + @Override @@ -232,6 +378,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -257,3 +405,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/FormatTest.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/FormatTest.java index bc552c619c3..d53abead37a 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/FormatTest.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/FormatTest.java @@ -13,7 +13,10 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; @@ -21,312 +24,648 @@ import java.math.BigDecimal; import java.util.Date; import java.util.UUID; + + + import javax.validation.constraints.*; + + + /** * FormatTest */ public class FormatTest { + + + + @JsonProperty("integer") + + + + private Integer integer = null; + + + + + @JsonProperty("int32") + + + + private Integer int32 = null; + + + + + @JsonProperty("int64") + + + + private Long int64 = null; + + + + + @JsonProperty("number") + + + + private BigDecimal number = null; + + + + + @JsonProperty("float") + + + + private Float _float = null; + + + + + @JsonProperty("double") + + + + private Double _double = null; + + + + + @JsonProperty("string") + + + + private String string = null; + + + + + @JsonProperty("byte") - private byte[] _byte = null; - + + + + + private String _byte = null; + + + + + + @JsonProperty("binary") - private byte[] binary = null; - + + + + + private String binary = null; + + + + + + @JsonProperty("date") + + + + private Date date = null; + + + + + @JsonProperty("dateTime") + + + + private Date dateTime = null; + + + + + @JsonProperty("uuid") + + + + private UUID uuid = null; + + + + + @JsonProperty("password") + + + + private String password = null; + + + + public FormatTest integer(Integer integer) { this.integer = integer; return this; } + + + /** + + * Get integer + + * minimum: 10 + + * maximum: 100 + * @return integer **/ + + @JsonProperty("integer") + @ApiModelProperty(value = "") + @Min(10) @Max(100) public Integer getInteger() { return integer; } + public void setInteger(Integer integer) { this.integer = integer; } + + + public FormatTest int32(Integer int32) { this.int32 = int32; return this; } + + + /** + + * Get int32 + + * minimum: 20 + + * maximum: 200 + * @return int32 **/ + + @JsonProperty("int32") + @ApiModelProperty(value = "") + @Min(20) @Max(200) public Integer getInt32() { return int32; } + public void setInt32(Integer int32) { this.int32 = int32; } + + + public FormatTest int64(Long int64) { this.int64 = int64; return this; } + + + /** + + * Get int64 + + + * @return int64 **/ + + @JsonProperty("int64") + @ApiModelProperty(value = "") + public Long getInt64() { return int64; } + public void setInt64(Long int64) { this.int64 = int64; } + + + public FormatTest number(BigDecimal number) { this.number = number; return this; } + + + /** + + * Get number - * minimum: 32.1 - * maximum: 543.2 + + + * @return number **/ + + @JsonProperty("number") + @ApiModelProperty(required = true, value = "") + @NotNull - @DecimalMin("32.1") @DecimalMax("543.2") public BigDecimal getNumber() { + + public BigDecimal getNumber() { return number; } + public void setNumber(BigDecimal number) { this.number = number; } + + + public FormatTest _float(Float _float) { this._float = _float; return this; } + + + /** + + * Get _float - * minimum: 54.3 - * maximum: 987.6 + + + * @return _float **/ + + @JsonProperty("float") + @ApiModelProperty(value = "") - @DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { + + public Float getFloat() { return _float; } + public void setFloat(Float _float) { this._float = _float; } + + + public FormatTest _double(Double _double) { this._double = _double; return this; } + + + /** + + * Get _double - * minimum: 67.8 - * maximum: 123.4 + + + * @return _double **/ + + @JsonProperty("double") + @ApiModelProperty(value = "") - @DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { + + public Double getDouble() { return _double; } + public void setDouble(Double _double) { this._double = _double; } + + + public FormatTest string(String string) { this.string = string; return this; } + + + /** + + * Get string + + + * @return string **/ + + @JsonProperty("string") + @ApiModelProperty(value = "") + @Pattern(regexp="/[a-z]/i") public String getString() { return string; } + public void setString(String string) { this.string = string; } + - public FormatTest _byte(byte[] _byte) { + + + public FormatTest _byte(String _byte) { this._byte = _byte; return this; } + + + /** + + * Get _byte + + + * @return _byte **/ + + @JsonProperty("byte") + @ApiModelProperty(required = true, value = "") + @NotNull - @Pattern(regexp="^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$") public byte[] getByte() { + + @Pattern(regexp="^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$") public String getByte() { return _byte; } + - public void setByte(byte[] _byte) { + public void setByte(String _byte) { this._byte = _byte; } + - public FormatTest binary(byte[] binary) { + + + public FormatTest binary(String binary) { this.binary = binary; return this; } + + + /** + + * Get binary + + + * @return binary **/ + + @JsonProperty("binary") + @ApiModelProperty(value = "") - public byte[] getBinary() { + + public String getBinary() { return binary; } + - public void setBinary(byte[] binary) { + public void setBinary(String binary) { this.binary = binary; } + + + public FormatTest date(Date date) { this.date = date; return this; } + + + /** + + * Get date + + + * @return date **/ + + @JsonProperty("date") + @ApiModelProperty(required = true, value = "") + @NotNull + public Date getDate() { return date; } + public void setDate(Date date) { this.date = date; } + + + public FormatTest dateTime(Date dateTime) { this.dateTime = dateTime; return this; } + + + /** + + * Get dateTime + + + * @return dateTime **/ + + @JsonProperty("dateTime") + @ApiModelProperty(value = "") + public Date getDateTime() { return dateTime; } + public void setDateTime(Date dateTime) { this.dateTime = dateTime; } + + + public FormatTest uuid(UUID uuid) { this.uuid = uuid; return this; } + + + /** + + * Get uuid + + + * @return uuid **/ + + @JsonProperty("uuid") + @ApiModelProperty(value = "") + public UUID getUuid() { return uuid; } + public void setUuid(UUID uuid) { this.uuid = uuid; } + + + public FormatTest password(String password) { this.password = password; return this; } + + + /** + + * Get password + + + * @return password **/ + + @JsonProperty("password") + @ApiModelProperty(required = true, value = "") + @NotNull - @Size(min=10,max=64) public String getPassword() { + + public String getPassword() { return password; } + public void setPassword(String password) { this.password = password; } + + + @Override @@ -359,6 +698,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -393,3 +734,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/HasOnlyReadOnly.java index 02480c10c65..5324359eb14 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/HasOnlyReadOnly.java @@ -13,43 +13,123 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + + + import javax.validation.constraints.*; + + + /** * HasOnlyReadOnly */ public class HasOnlyReadOnly { + + + + @JsonProperty("bar") + + + + private String bar = null; + + + + + @JsonProperty("foo") + + + + private String foo = null; + + + + + + public HasOnlyReadOnly bar(String bar) { + this.bar = bar; + return this; + } + + + /** + + * Get bar + + + * @return bar **/ + + @JsonProperty("bar") + @ApiModelProperty(value = "") + public String getBar() { return bar; } + + + public void setBar(String bar) { + this.bar = bar; + } + + + + public HasOnlyReadOnly foo(String foo) { + this.foo = foo; + return this; + } + + + + /** + + * Get foo + + + * @return foo **/ + + @JsonProperty("foo") + @ApiModelProperty(value = "") + public String getFoo() { return foo; } + + + public void setFoo(String foo) { + this.foo = foo; + } + + + @Override @@ -71,6 +151,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -94,3 +176,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/MapTest.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/MapTest.java index 73c04c4bd63..7cbd27f23a0 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/MapTest.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/MapTest.java @@ -13,7 +13,10 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,23 +25,53 @@ import java.util.HashMap; import java.util.List; import java.util.Map; + + + import javax.validation.constraints.*; + + + /** * MapTest */ public class MapTest { + + + + @JsonProperty("map_map_of_string") + + + private Map> mapMapOfString = null; + + + + + + + + + /** * Gets or Sets inner */ public enum InnerEnum { + + + + UPPER("UPPER"), + LOWER("lower"); + + + private String value; @@ -63,62 +96,112 @@ public static InnerEnum fromValue(String text) { } } + + + + @JsonProperty("map_of_enum_string") + + + private Map mapOfEnumString = null; + + + + + public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; return this; } + + public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { this.mapMapOfString = new HashMap>(); } + this.mapMapOfString.put(key, mapMapOfStringItem); return this; } + + /** + + * Get mapMapOfString + + + * @return mapMapOfString **/ + + @JsonProperty("map_map_of_string") + @ApiModelProperty(value = "") + public Map> getMapMapOfString() { return mapMapOfString; } + public void setMapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; } + + + public MapTest mapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; return this; } + + public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { this.mapOfEnumString = new HashMap(); } + this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; } + + /** + + * Get mapOfEnumString + + + * @return mapOfEnumString **/ + + @JsonProperty("map_of_enum_string") + @ApiModelProperty(value = "") + public Map getMapOfEnumString() { return mapOfEnumString; } + public void setMapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; } + + + @Override @@ -140,6 +223,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -163,3 +248,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java index 5e1d96f5ecc..f10ecd02304 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -13,7 +13,10 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; @@ -24,86 +27,173 @@ import java.util.List; import java.util.Map; import java.util.UUID; + + + import javax.validation.constraints.*; + + + /** * MixedPropertiesAndAdditionalPropertiesClass */ public class MixedPropertiesAndAdditionalPropertiesClass { + + + + @JsonProperty("uuid") + + + + private UUID uuid = null; + + + + + @JsonProperty("dateTime") + + + + private Date dateTime = null; + + + + + @JsonProperty("map") + + + private Map map = null; + + + + + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; return this; } + + + /** + + * Get uuid + + + * @return uuid **/ + + @JsonProperty("uuid") + @ApiModelProperty(value = "") + public UUID getUuid() { return uuid; } + public void setUuid(UUID uuid) { this.uuid = uuid; } + + + public MixedPropertiesAndAdditionalPropertiesClass dateTime(Date dateTime) { this.dateTime = dateTime; return this; } + + + /** + + * Get dateTime + + + * @return dateTime **/ + + @JsonProperty("dateTime") + @ApiModelProperty(value = "") + public Date getDateTime() { return dateTime; } + public void setDateTime(Date dateTime) { this.dateTime = dateTime; } + + + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { this.map = map; return this; } + + public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { this.map = new HashMap(); } + this.map.put(key, mapItem); return this; } + + /** + + * Get map + + + * @return map **/ + + @JsonProperty("map") + @ApiModelProperty(value = "") + public Map getMap() { return map; } + public void setMap(Map map) { this.map = map; } + + + @Override @@ -126,6 +216,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -150,3 +242,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Model200Response.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Model200Response.java index 954ef7ebed3..d43a8ebe5a9 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Model200Response.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Model200Response.java @@ -13,62 +13,124 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + + + import javax.validation.constraints.*; + + + /** * Model for testing model name starting with number */ @ApiModel(description = "Model for testing model name starting with number") public class Model200Response { + + + + @JsonProperty("name") + + + + private Integer name = null; + + + + + @JsonProperty("class") + + + + private String propertyClass = null; + + + + public Model200Response name(Integer name) { this.name = name; return this; } + + + /** + + * Get name + + + * @return name **/ + + @JsonProperty("name") + @ApiModelProperty(value = "") + public Integer getName() { return name; } + public void setName(Integer name) { this.name = name; } + + + public Model200Response propertyClass(String propertyClass) { this.propertyClass = propertyClass; return this; } + + + /** + + * Get propertyClass + + + * @return propertyClass **/ + + @JsonProperty("class") + @ApiModelProperty(value = "") + public String getPropertyClass() { return propertyClass; } + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } + + + @Override @@ -90,6 +152,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -113,3 +177,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ModelApiResponse.java index 2a54b591b32..98ccbc01819 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -13,83 +13,170 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + + + import javax.validation.constraints.*; + + + /** * ModelApiResponse */ public class ModelApiResponse { + + + + @JsonProperty("code") + + + + private Integer code = null; + + + + + @JsonProperty("type") + + + + private String type = null; + + + + + @JsonProperty("message") + + + + private String message = null; + + + + public ModelApiResponse code(Integer code) { this.code = code; return this; } + + + /** + + * Get code + + + * @return code **/ + + @JsonProperty("code") + @ApiModelProperty(value = "") + public Integer getCode() { return code; } + public void setCode(Integer code) { this.code = code; } + + + public ModelApiResponse type(String type) { this.type = type; return this; } + + + /** + + * Get type + + + * @return type **/ + + @JsonProperty("type") + @ApiModelProperty(value = "") + public String getType() { return type; } + public void setType(String type) { this.type = type; } + + + public ModelApiResponse message(String message) { this.message = message; return this; } + + + /** + + * Get message + + + * @return message **/ + + @JsonProperty("message") + @ApiModelProperty(value = "") + public String getMessage() { return message; } + public void setMessage(String message) { this.message = message; } + + + @Override @@ -112,6 +199,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -136,3 +225,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ModelReturn.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ModelReturn.java index 12b213d6afb..5fdd63263f8 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ModelReturn.java @@ -13,40 +13,77 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + + + import javax.validation.constraints.*; + + + /** * Model for testing reserved words */ @ApiModel(description = "Model for testing reserved words") public class ModelReturn { + + + + @JsonProperty("return") + + + + private Integer _return = null; + + + + public ModelReturn _return(Integer _return) { this._return = _return; return this; } + + + /** + + * Get _return + + + * @return _return **/ + + @JsonProperty("return") + @ApiModelProperty(value = "") + public Integer getReturn() { return _return; } + public void setReturn(Integer _return) { this._return = _return; } + + + @Override @@ -67,6 +104,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -89,3 +128,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Name.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Name.java index 771531b30ab..ad6d4dc2927 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Name.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Name.java @@ -13,89 +13,220 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + + + import javax.validation.constraints.*; + + + /** * Model for testing model name same as property name */ @ApiModel(description = "Model for testing model name same as property name") public class Name { + + + + @JsonProperty("name") + + + + private Integer name = null; + + + + + @JsonProperty("snake_case") + + + + private Integer snakeCase = null; + + + + + @JsonProperty("property") + + + + private String property = null; + + + + + @JsonProperty("123Number") + + + + private Integer _123Number = null; + + + + public Name name(Integer name) { this.name = name; return this; } + + + /** + + * Get name + + + * @return name **/ + + @JsonProperty("name") + @ApiModelProperty(required = true, value = "") + @NotNull + public Integer getName() { return name; } + public void setName(Integer name) { this.name = name; } + + + + public Name snakeCase(Integer snakeCase) { + this.snakeCase = snakeCase; + return this; + } + + + + /** + + * Get snakeCase + + + * @return snakeCase **/ + + @JsonProperty("snake_case") + @ApiModelProperty(value = "") + public Integer getSnakeCase() { return snakeCase; } + + public void setSnakeCase(Integer snakeCase) { + this.snakeCase = snakeCase; + } + + + + public Name property(String property) { this.property = property; return this; } + + + /** + + * Get property + + + * @return property **/ + + @JsonProperty("property") + @ApiModelProperty(value = "") + public String getProperty() { return property; } + public void setProperty(String property) { this.property = property; } + + + + + public Name _123Number(Integer _123Number) { + this._123Number = _123Number; + return this; + } + + + /** + + * Get _123Number + + + * @return _123Number **/ + + @JsonProperty("123Number") + @ApiModelProperty(value = "") + public Integer get123Number() { return _123Number; } + + + public void set123Number(Integer _123Number) { + this._123Number = _123Number; + } + + + @Override @@ -119,6 +250,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -144,3 +277,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/NumberOnly.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/NumberOnly.java index 82604a5b9c7..97654cc9c3c 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/NumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/NumberOnly.java @@ -13,40 +13,77 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; + + + import javax.validation.constraints.*; + + + /** * NumberOnly */ public class NumberOnly { + + + + @JsonProperty("JustNumber") + + + + private BigDecimal justNumber = null; + + + + public NumberOnly justNumber(BigDecimal justNumber) { this.justNumber = justNumber; return this; } + + + /** + + * Get justNumber + + + * @return justNumber **/ + + @JsonProperty("JustNumber") + @ApiModelProperty(value = "") + public BigDecimal getJustNumber() { return justNumber; } + public void setJustNumber(BigDecimal justNumber) { this.justNumber = justNumber; } + + + @Override @@ -67,6 +104,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -89,3 +128,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Order.java index 5147738768b..7feb30193a2 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Order.java @@ -13,41 +13,98 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.Date; + + + import javax.validation.constraints.*; + + + /** * Order */ public class Order { + + + + @JsonProperty("id") + + + + private Long id = null; + + + + + @JsonProperty("petId") + + + + private Long petId = null; + + + + + @JsonProperty("quantity") + + + + private Integer quantity = null; + + + + + @JsonProperty("shipDate") + + + + private Date shipDate = null; + + + + /** * Order Status */ public enum StatusEnum { + + + + PLACED("placed"), + APPROVED("approved"), + DELIVERED("delivered"); + + + private String value; @@ -72,125 +129,242 @@ public static StatusEnum fromValue(String text) { } } + + + + @JsonProperty("status") + + + + private StatusEnum status = null; + + + + + @JsonProperty("complete") + + + + private Boolean complete = false; + + + + public Order id(Long id) { this.id = id; return this; } + + + /** + + * Get id + + + * @return id **/ + + @JsonProperty("id") + @ApiModelProperty(value = "") + public Long getId() { return id; } + public void setId(Long id) { this.id = id; } + + + public Order petId(Long petId) { this.petId = petId; return this; } + + + /** + + * Get petId + + + * @return petId **/ + + @JsonProperty("petId") + @ApiModelProperty(value = "") + public Long getPetId() { return petId; } + public void setPetId(Long petId) { this.petId = petId; } + + + public Order quantity(Integer quantity) { this.quantity = quantity; return this; } + + + /** + + * Get quantity + + + * @return quantity **/ + + @JsonProperty("quantity") + @ApiModelProperty(value = "") + public Integer getQuantity() { return quantity; } + public void setQuantity(Integer quantity) { this.quantity = quantity; } + + + public Order shipDate(Date shipDate) { this.shipDate = shipDate; return this; } + + + /** + + * Get shipDate + + + * @return shipDate **/ + + @JsonProperty("shipDate") + @ApiModelProperty(value = "") + public Date getShipDate() { return shipDate; } + public void setShipDate(Date shipDate) { this.shipDate = shipDate; } + + + public Order status(StatusEnum status) { this.status = status; return this; } + + + /** + * Order Status + + + + * @return status **/ + + @JsonProperty("status") + @ApiModelProperty(value = "Order Status") + public StatusEnum getStatus() { return status; } + public void setStatus(StatusEnum status) { this.status = status; } + + + public Order complete(Boolean complete) { this.complete = complete; return this; } + + + /** + + * Get complete + + + * @return complete **/ + + @JsonProperty("complete") + @ApiModelProperty(value = "") - public Boolean isComplete() { + + public Boolean isisComplete() { return complete; } + public void setComplete(Boolean complete) { this.complete = complete; } + + + @Override @@ -216,6 +390,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -243,3 +419,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/OuterBoolean.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/OuterBoolean.java new file mode 100644 index 00000000000..2710300f712 --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/OuterBoolean.java @@ -0,0 +1,78 @@ +/* + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.model; + + +import java.util.Objects; + + + + + +import javax.validation.constraints.*; + + + + +/** + * OuterBoolean + */ + +public class OuterBoolean { + + + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return Objects.hash(); + } + + + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterBoolean {\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(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + + + diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/OuterComposite.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/OuterComposite.java index c144ee99521..97f0e707810 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/OuterComposite.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/OuterComposite.java @@ -13,84 +13,171 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; + + + import javax.validation.constraints.*; + + + /** * OuterComposite */ public class OuterComposite { + + + + @JsonProperty("my_number") + + + + private BigDecimal myNumber = null; + + + + + @JsonProperty("my_string") + + + + private String myString = null; + + + + + @JsonProperty("my_boolean") + + + + private Boolean myBoolean = null; + + + + public OuterComposite myNumber(BigDecimal myNumber) { this.myNumber = myNumber; return this; } + + + /** + + * Get myNumber + + + * @return myNumber **/ + + @JsonProperty("my_number") + @ApiModelProperty(value = "") + public BigDecimal getMyNumber() { return myNumber; } + public void setMyNumber(BigDecimal myNumber) { this.myNumber = myNumber; } + + + public OuterComposite myString(String myString) { this.myString = myString; return this; } + + + /** + + * Get myString + + + * @return myString **/ + + @JsonProperty("my_string") + @ApiModelProperty(value = "") + public String getMyString() { return myString; } + public void setMyString(String myString) { this.myString = myString; } + + + public OuterComposite myBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; return this; } + + + /** + + * Get myBoolean + + + * @return myBoolean **/ + + @JsonProperty("my_boolean") + @ApiModelProperty(value = "") + public Boolean getMyBoolean() { return myBoolean; } + public void setMyBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; } + + + @Override @@ -113,6 +200,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -137,3 +226,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/OuterEnum.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/OuterEnum.java index 6740674b07c..51728f9ba9f 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/OuterEnum.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/OuterEnum.java @@ -13,22 +13,36 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonValue; + + + import javax.validation.constraints.*; + + + + import com.fasterxml.jackson.annotation.JsonCreator; + /** * Gets or Sets OuterEnum */ public enum OuterEnum { + + PLACED("placed"), APPROVED("approved"), DELIVERED("delivered"); + private String value; @@ -41,6 +55,7 @@ public String toString() { return String.valueOf(value); } + @JsonCreator public static OuterEnum fromValue(String text) { for (OuterEnum b : OuterEnum.values()) { @@ -50,5 +65,8 @@ public static OuterEnum fromValue(String text) { } return null; } + } + + diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/OuterNumber.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/OuterNumber.java new file mode 100644 index 00000000000..245ff1651de --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/OuterNumber.java @@ -0,0 +1,78 @@ +/* + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.model; + + +import java.util.Objects; + + + + + +import javax.validation.constraints.*; + + + + +/** + * OuterNumber + */ + +public class OuterNumber { + + + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return Objects.hash(); + } + + + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterNumber {\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(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + + + diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/OuterString.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/OuterString.java new file mode 100644 index 00000000000..fa548ab0e00 --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/OuterString.java @@ -0,0 +1,78 @@ +/* + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.model; + + +import java.util.Objects; + + + + + +import javax.validation.constraints.*; + + + + +/** + * OuterString + */ + +public class OuterString { + + + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return Objects.hash(); + } + + + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterString {\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(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + + + diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Pet.java index 04480639f0f..402ac868b12 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Pet.java @@ -13,7 +13,10 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,37 +26,100 @@ import io.swagger.model.Tag; import java.util.ArrayList; import java.util.List; + + + import javax.validation.constraints.*; + + + /** * Pet */ public class Pet { + + + + @JsonProperty("id") + + + + private Long id = null; + + + + + @JsonProperty("category") + + + + private Category category = null; + + + + + @JsonProperty("name") + + + + private String name = null; + + + + + @JsonProperty("photoUrls") + + + private List photoUrls = new ArrayList(); + + + + + + @JsonProperty("tags") + + + private List tags = null; + + + + + /** * pet status in the store */ public enum StatusEnum { + + + + AVAILABLE("available"), + PENDING("pending"), + SOLD("sold"); + + + private String value; @@ -78,137 +144,252 @@ public static StatusEnum fromValue(String text) { } } + + + + @JsonProperty("status") + + + + private StatusEnum status = null; + + + + public Pet id(Long id) { this.id = id; return this; } + + + /** + + * Get id + + + * @return id **/ + + @JsonProperty("id") + @ApiModelProperty(value = "") + public Long getId() { return id; } + public void setId(Long id) { this.id = id; } + + + public Pet category(Category category) { this.category = category; return this; } + + + /** + + * Get category + + + * @return category **/ + + @JsonProperty("category") + @ApiModelProperty(value = "") + public Category getCategory() { return category; } + public void setCategory(Category category) { this.category = category; } + + + public Pet name(String name) { this.name = name; return this; } + + + /** + + * Get name + + + * @return name **/ + + @JsonProperty("name") + @ApiModelProperty(example = "doggie", required = true, value = "") + @NotNull + public String getName() { return name; } + public void setName(String name) { this.name = name; } + + + public Pet photoUrls(List photoUrls) { this.photoUrls = photoUrls; return this; } + public Pet addPhotoUrlsItem(String photoUrlsItem) { + this.photoUrls.add(photoUrlsItem); return this; } + + + /** + + * Get photoUrls + + + * @return photoUrls **/ + + @JsonProperty("photoUrls") + @ApiModelProperty(required = true, value = "") + @NotNull + public List getPhotoUrls() { return photoUrls; } + public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } + + + public Pet tags(List tags) { this.tags = tags; return this; } + public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { this.tags = new ArrayList(); } + this.tags.add(tagsItem); return this; } + + + /** + + * Get tags + + + * @return tags **/ + + @JsonProperty("tags") + @ApiModelProperty(value = "") + public List getTags() { return tags; } + public void setTags(List tags) { this.tags = tags; } + + + public Pet status(StatusEnum status) { this.status = status; return this; } + + + /** + * pet status in the store + + + + * @return status **/ + + @JsonProperty("status") + @ApiModelProperty(value = "pet status in the store") + public StatusEnum getStatus() { return status; } + public void setStatus(StatusEnum status) { this.status = status; } + + + @Override @@ -234,6 +415,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -261,3 +444,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ReadOnlyFirst.java index 5d26b4199f8..c139fe90bc0 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ReadOnlyFirst.java @@ -13,52 +13,123 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + + + import javax.validation.constraints.*; + + + /** * ReadOnlyFirst */ public class ReadOnlyFirst { + + + + @JsonProperty("bar") + + + + private String bar = null; + + + + + @JsonProperty("baz") + + + + private String baz = null; + + + + + public ReadOnlyFirst bar(String bar) { + this.bar = bar; + return this; + } + + + + /** + + * Get bar + + + * @return bar **/ + + @JsonProperty("bar") + @ApiModelProperty(value = "") + public String getBar() { return bar; } + + + public void setBar(String bar) { + this.bar = bar; + } + + + public ReadOnlyFirst baz(String baz) { this.baz = baz; return this; } + + + /** + + * Get baz + + + * @return baz **/ + + @JsonProperty("baz") + @ApiModelProperty(value = "") + public String getBaz() { return baz; } + public void setBaz(String baz) { this.baz = baz; } + + + @Override @@ -80,6 +151,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -103,3 +176,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/SpecialModelName.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/SpecialModelName.java index df3182fbd80..4fafb75f408 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/SpecialModelName.java @@ -13,39 +13,76 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + + + import javax.validation.constraints.*; + + + /** * SpecialModelName */ public class SpecialModelName { + + + + @JsonProperty("$special[property.name]") - private Long specialPropertyName = null; + + + + + private Long $specialPropertyName = null; + - public SpecialModelName specialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + + + + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; return this; } + + + /** - * Get specialPropertyName - * @return specialPropertyName + + + * Get $specialPropertyName + + + + * @return $specialPropertyName **/ + + @JsonProperty("$special[property.name]") + @ApiModelProperty(value = "") - public Long getSpecialPropertyName() { - return specialPropertyName; + + public Long get$SpecialPropertyName() { + return $specialPropertyName; } + - public void setSpecialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + public void set$SpecialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; } + + + @Override @@ -56,22 +93,24 @@ public boolean equals(java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName specialModelName = (SpecialModelName) o; - return Objects.equals(this.specialPropertyName, specialModelName.specialPropertyName); + SpecialModelName $specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); } @Override public int hashCode() { - return Objects.hash(specialPropertyName); + return Objects.hash($specialPropertyName); } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class SpecialModelName {\n"); - sb.append(" specialPropertyName: ").append(toIndentedString(specialPropertyName)).append("\n"); + sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n"); sb.append("}"); return sb.toString(); } @@ -88,3 +127,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Tag.java index a86f54144f8..1fffba9994d 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Tag.java @@ -13,61 +13,123 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + + + import javax.validation.constraints.*; + + + /** * Tag */ public class Tag { + + + + @JsonProperty("id") + + + + private Long id = null; + + + + + @JsonProperty("name") + + + + private String name = null; + + + + public Tag id(Long id) { this.id = id; return this; } + + + /** + + * Get id + + + * @return id **/ + + @JsonProperty("id") + @ApiModelProperty(value = "") + public Long getId() { return id; } + public void setId(Long id) { this.id = id; } + + + public Tag name(String name) { this.name = name; return this; } + + + /** + + * Get name + + + * @return name **/ + + @JsonProperty("name") + @ApiModelProperty(value = "") + public String getName() { return name; } + public void setName(String name) { this.name = name; } + + + @Override @@ -89,6 +151,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -112,3 +176,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/User.java index 0c1b67c0d5b..ffab5e5eb2a 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/User.java @@ -13,193 +13,405 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + + + import javax.validation.constraints.*; + + + /** * User */ public class User { + + + + @JsonProperty("id") + + + + private Long id = null; + + + + + @JsonProperty("username") + + + + private String username = null; + + + + + @JsonProperty("firstName") + + + + private String firstName = null; + + + + + @JsonProperty("lastName") + + + + private String lastName = null; + + + + + @JsonProperty("email") + + + + private String email = null; + + + + + @JsonProperty("password") + + + + private String password = null; + + + + + @JsonProperty("phone") + + + + private String phone = null; + + + + + @JsonProperty("userStatus") + + + + private Integer userStatus = null; + + + + public User id(Long id) { this.id = id; return this; } + + + /** + + * Get id + + + * @return id **/ + + @JsonProperty("id") + @ApiModelProperty(value = "") + public Long getId() { return id; } + public void setId(Long id) { this.id = id; } + + + public User username(String username) { this.username = username; return this; } + + + /** + + * Get username + + + * @return username **/ + + @JsonProperty("username") + @ApiModelProperty(value = "") + public String getUsername() { return username; } + public void setUsername(String username) { this.username = username; } + + + public User firstName(String firstName) { this.firstName = firstName; return this; } + + + /** + + * Get firstName + + + * @return firstName **/ + + @JsonProperty("firstName") + @ApiModelProperty(value = "") + public String getFirstName() { return firstName; } + public void setFirstName(String firstName) { this.firstName = firstName; } + + + public User lastName(String lastName) { this.lastName = lastName; return this; } + + + /** + + * Get lastName + + + * @return lastName **/ + + @JsonProperty("lastName") + @ApiModelProperty(value = "") + public String getLastName() { return lastName; } + public void setLastName(String lastName) { this.lastName = lastName; } + + + public User email(String email) { this.email = email; return this; } + + + /** + + * Get email + + + * @return email **/ + + @JsonProperty("email") + @ApiModelProperty(value = "") + public String getEmail() { return email; } + public void setEmail(String email) { this.email = email; } + + + public User password(String password) { this.password = password; return this; } + + + /** + + * Get password + + + * @return password **/ + + @JsonProperty("password") + @ApiModelProperty(value = "") + public String getPassword() { return password; } + public void setPassword(String password) { this.password = password; } + + + public User phone(String phone) { this.phone = phone; return this; } + + + /** + + * Get phone + + + * @return phone **/ + + @JsonProperty("phone") + @ApiModelProperty(value = "") + public String getPhone() { return phone; } + public void setPhone(String phone) { this.phone = phone; } + + + public User userStatus(Integer userStatus) { this.userStatus = userStatus; return this; } + + + /** + * User Status + + + + * @return userStatus **/ + + @JsonProperty("userStatus") + @ApiModelProperty(value = "User Status") + public Integer getUserStatus() { return userStatus; } + public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } + + + @Override @@ -227,6 +439,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -256,3 +470,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/io/swagger/api/impl/AnotherFakeApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/io/swagger/api/impl/AnotherFakeApiServiceImpl.java index 072d33568d4..dc1ec63474d 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/io/swagger/api/impl/AnotherFakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/io/swagger/api/impl/AnotherFakeApiServiceImpl.java @@ -7,6 +7,8 @@ import io.swagger.model.Client; + +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -17,13 +19,19 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; + import javax.validation.constraints.*; + + public class AnotherFakeApiServiceImpl extends AnotherFakeApiService { + @Override - public Response testSpecialTags(Client body, SecurityContext securityContext) + public Response testSpecialTags(Client client, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + } + diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/io/swagger/api/impl/FakeApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/io/swagger/api/impl/FakeApiServiceImpl.java index 4cae4c62be5..e72bf6418df 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/io/swagger/api/impl/FakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/io/swagger/api/impl/FakeApiServiceImpl.java @@ -7,9 +7,10 @@ import java.math.BigDecimal; import io.swagger.model.Client; -import java.util.Date; import io.swagger.model.OuterComposite; + +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -20,61 +21,75 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; + import javax.validation.constraints.*; + + public class FakeApiServiceImpl extends FakeApiService { + @Override public Response fakeOuterBooleanSerialize(Boolean body, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + @Override - public Response fakeOuterCompositeSerialize(OuterComposite body, SecurityContext securityContext) + public Response fakeOuterCompositeSerialize(OuterComposite outercomposite, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + @Override public Response fakeOuterNumberSerialize(BigDecimal body, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + @Override public Response fakeOuterStringSerialize(String body, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + @Override - public Response testClientModel(Client body, SecurityContext securityContext) + public Response testClientModel(Client client, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + @Override - public Response testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, Date date, Date dateTime, String password, String paramCallback, SecurityContext securityContext) + public Response testEndpointParameters(Object body, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + @Override - public Response testEnumParameters(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, SecurityContext securityContext) + public Response testEnumParameters(Object body, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + @Override - public Response testInlineAdditionalProperties(Object param, SecurityContext securityContext) + public Response testInlineAdditionalProperties(Map body, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + @Override - public Response testJsonFormData(String param, String param2, SecurityContext securityContext) + public Response testJsonFormData(Object 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/jersey1-useTags/src/main/java/io/swagger/api/impl/FakeClassnameTags123ApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/io/swagger/api/impl/FakeClassnameTags123ApiServiceImpl.java index 5b44353efec..3e8b774a57e 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/io/swagger/api/impl/FakeClassnameTags123ApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/io/swagger/api/impl/FakeClassnameTags123ApiServiceImpl.java @@ -7,6 +7,8 @@ import io.swagger.model.Client; + +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -17,13 +19,19 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; + import javax.validation.constraints.*; + + public class FakeClassnameTags123ApiServiceImpl extends FakeClassnameTags123ApiService { + @Override - public Response testClassname(Client body, SecurityContext securityContext) + public Response testClassname(Client client, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + } + diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java index 4ca20a47727..9516b877ef0 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java @@ -5,10 +5,11 @@ import com.sun.jersey.multipart.FormDataParam; -import java.io.File; import io.swagger.model.ModelApiResponse; import io.swagger.model.Pet; + +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -19,55 +20,68 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; + import javax.validation.constraints.*; + + public class PetApiServiceImpl extends PetApiService { + @Override - public Response addPet(Pet body, SecurityContext securityContext) + public Response addPet(Pet pet, 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) + public Response deletePet(Integer petId, String apiKey, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + @Override public Response findPetsByStatus( @NotNull List status, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + @Override public Response findPetsByTags( @NotNull 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) + public Response getPetById(Integer 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) + public Response updatePet(Pet pet, 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) + public Response updatePetWithForm(Integer petId, Object body, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + @Override - public Response uploadFile(Long petId, String additionalMetadata, InputStream fileInputStream, FormDataContentDisposition fileDetail, SecurityContext securityContext) + public Response uploadFile(Integer petId, Object 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/jersey1-useTags/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java index 96194fb16b8..1ddf0dca6c5 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java @@ -8,6 +8,8 @@ import java.util.Map; import io.swagger.model.Order; + +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -18,31 +20,40 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; + import javax.validation.constraints.*; + + 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( @Min(1) @Max(5)Long orderId, SecurityContext securityContext) + public Response getOrderById( @DecimalMin("1") @DecimalMax("5")Integer 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) + public Response placeOrder(Order order, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + } + diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java index ca562ed389c..1f9404d0645 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java @@ -5,9 +5,10 @@ import com.sun.jersey.multipart.FormDataParam; -import java.util.List; import io.swagger.model.User; + +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -18,55 +19,68 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; + import javax.validation.constraints.*; + + public class UserApiServiceImpl extends UserApiService { + @Override - public Response createUser(User body, SecurityContext securityContext) + public Response createUser(User user, 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( @NotNull String username, @NotNull 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) + public Response updateUser(User user, String username, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + } + diff --git a/samples/server/petstore/jaxrs/jersey1/.swagger-codegen/VERSION b/samples/server/petstore/jaxrs/jersey1/.swagger-codegen/VERSION index 50794f17f1a..096bf47efe3 100644 --- a/samples/server/petstore/jaxrs/jersey1/.swagger-codegen/VERSION +++ b/samples/server/petstore/jaxrs/jersey1/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.1-SNAPSHOT \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs/jersey1/pom.xml b/samples/server/petstore/jaxrs/jersey1/pom.xml index efaa0edf24b..bd280ebf2af 100644 --- a/samples/server/petstore/jaxrs/jersey1/pom.xml +++ b/samples/server/petstore/jaxrs/jersey1/pom.xml @@ -42,6 +42,15 @@ 60000 + + + + javax.validation + validation-api + ${beanvalidation-version} + + + start-jetty @@ -168,13 +177,15 @@ + javax.validation validation-api - 1.1.0.Final + ${beanvalidation-version} provided + @@ -189,13 +200,16 @@ 1.7 ${java.version} ${java.version} - 1.5.15 + 1.5.18 9.2.9.v20150224 1.19.1 2.8.9 1.7.21 4.12 2.5 + + 1.1.0.Final + UTF-8 diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/AnotherFakeApi.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/AnotherFakeApi.java index e6e3cde0650..ad4c3fafa6f 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/AnotherFakeApi.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/AnotherFakeApi.java @@ -8,10 +8,13 @@ import io.swagger.jaxrs.*; import com.sun.jersey.multipart.FormDataParam; + import javax.validation.constraints.*; + import io.swagger.model.Client; + import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -31,9 +34,11 @@ @io.swagger.annotations.Api(description = "the another-fake API") + public class AnotherFakeApi { private final AnotherFakeApiService delegate = AnotherFakeApiServiceFactory.getAnotherFakeApi(); + @PATCH @Path("/dummy") @Consumes({ "application/json" }) @@ -42,9 +47,12 @@ public class AnotherFakeApi { @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Client.class) }) public Response testSpecialTags( - @ApiParam(value = "client model" ,required=true) Client body, + @ApiParam(value = "client model" ,required=true) Client client +, @Context SecurityContext securityContext) throws NotFoundException { - return delegate.testSpecialTags(body,securityContext); + return delegate.testSpecialTags(client,securityContext); } + } + diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/AnotherFakeApiService.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/AnotherFakeApiService.java index eaec0e3e1ae..f8e5d6a0cfc 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/AnotherFakeApiService.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/AnotherFakeApiService.java @@ -7,6 +7,8 @@ import io.swagger.model.Client; + +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -17,9 +19,15 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; + import javax.validation.constraints.*; + + public abstract class AnotherFakeApiService { - public abstract Response testSpecialTags(Client body,SecurityContext securityContext) + + public abstract Response testSpecialTags(Client client,SecurityContext securityContext) throws NotFoundException; + } + diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/FakeApi.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/FakeApi.java index f93b18347c2..d333a4cfe5e 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/FakeApi.java @@ -8,13 +8,15 @@ import io.swagger.jaxrs.*; import com.sun.jersey.multipart.FormDataParam; + import javax.validation.constraints.*; + import java.math.BigDecimal; import io.swagger.model.Client; -import java.util.Date; import io.swagger.model.OuterComposite; + import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -34,137 +36,143 @@ @io.swagger.annotations.Api(description = "the fake API") + public class FakeApi { private final FakeApiService delegate = FakeApiServiceFactory.getFakeApi(); + @POST @Path("/outer/boolean") - - - @io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) + @Consumes({ "*/*" }) + @Produces({ "*/*" }) + @io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) public Response fakeOuterBooleanSerialize( - @ApiParam(value = "Input boolean as post body" ) Boolean body, + @ApiParam(value = "Input boolean as post body" ) Boolean body +, @Context SecurityContext securityContext) throws NotFoundException { return delegate.fakeOuterBooleanSerialize(body,securityContext); } + @POST @Path("/outer/composite") - - - @io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) + @Consumes({ "*/*" }) + @Produces({ "*/*" }) + @io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) public Response fakeOuterCompositeSerialize( - @ApiParam(value = "Input composite as post body" ) OuterComposite body, + @ApiParam(value = "Input composite as post body" ) OuterComposite outercomposite +, @Context SecurityContext securityContext) throws NotFoundException { - return delegate.fakeOuterCompositeSerialize(body,securityContext); + return delegate.fakeOuterCompositeSerialize(outercomposite,securityContext); } + @POST @Path("/outer/number") - - - @io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) + @Consumes({ "*/*" }) + @Produces({ "*/*" }) + @io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) public Response fakeOuterNumberSerialize( - @ApiParam(value = "Input number as post body" ) BigDecimal body, + @ApiParam(value = "Input number as post body" ) BigDecimal body +, @Context SecurityContext securityContext) throws NotFoundException { return delegate.fakeOuterNumberSerialize(body,securityContext); } + @POST @Path("/outer/string") - - - @io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) + @Consumes({ "*/*" }) + @Produces({ "*/*" }) + @io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of outer string types", response = String.class, tags={ "fake" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "Output string", response = String.class) }) public Response fakeOuterStringSerialize( - @ApiParam(value = "Input string as post body" ) String body, + @ApiParam(value = "Input string as post body" ) String body +, @Context SecurityContext securityContext) throws NotFoundException { return delegate.fakeOuterStringSerialize(body,securityContext); } + @PATCH @Consumes({ "application/json" }) @Produces({ "application/json" }) - @io.swagger.annotations.ApiOperation(value = "To test \"client\" model", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) + @io.swagger.annotations.ApiOperation(value = "To test \"client\" model", notes = "To test \"client\" model", response = Client.class, tags={ "fake" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Client.class) }) public Response testClientModel( - @ApiParam(value = "client model" ,required=true) Client body, + @ApiParam(value = "client model" ,required=true) Client client +, @Context SecurityContext securityContext) throws NotFoundException { - return delegate.testClientModel(body,securityContext); + return delegate.testClientModel(client,securityContext); } + @POST @Consumes({ "application/xml; charset=utf-8", "application/json; charset=utf-8" }) - @Produces({ "application/xml; charset=utf-8", "application/json; charset=utf-8" }) - @io.swagger.annotations.ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = Void.class, authorizations = { - @io.swagger.annotations.Authorization(value = "http_basic_test") - }, tags={ "fake", }) + + @io.swagger.annotations.ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = Void.class, tags={ "fake" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) public Response testEndpointParameters( - @ApiParam(value = "None", required=true) @FormParam("number") BigDecimal number, - @ApiParam(value = "None", required=true) @FormParam("double") Double _double, - @ApiParam(value = "None", required=true) @FormParam("pattern_without_delimiter") String patternWithoutDelimiter, - @ApiParam(value = "None", required=true) @FormParam("byte") byte[] _byte, - @ApiParam(value = "None") @FormParam("integer") Integer integer, - @ApiParam(value = "None") @FormParam("int32") Integer int32, - @ApiParam(value = "None") @FormParam("int64") Long int64, - @ApiParam(value = "None") @FormParam("float") Float _float, - @ApiParam(value = "None") @FormParam("string") String string, - @ApiParam(value = "None") @FormParam("binary") byte[] binary, - @ApiParam(value = "None") @FormParam("date") Date date, - @ApiParam(value = "None") @FormParam("dateTime") Date dateTime, - @ApiParam(value = "None") @FormParam("password") String password, - @ApiParam(value = "None") @FormParam("callback") String paramCallback, + @ApiParam(value = "" ,required=true) Object body +, @Context SecurityContext securityContext) throws NotFoundException { - return delegate.testEndpointParameters(number,_double,patternWithoutDelimiter,_byte,integer,int32,int64,_float,string,binary,date,dateTime,password,paramCallback,securityContext); + return delegate.testEndpointParameters(body,securityContext); } + @GET @Consumes({ "*/*" }) - @Produces({ "*/*" }) - @io.swagger.annotations.ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", response = Void.class, tags={ "fake", }) + + @io.swagger.annotations.ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", response = Void.class, tags={ "fake" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid request", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "Not found", response = Void.class) }) public Response testEnumParameters( - @ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $") @FormParam("enum_form_string_array") List enumFormStringArray, - @ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @DefaultValue("-efg") @FormParam("enum_form_string") String enumFormString, - @ApiParam(value = "Header parameter enum test (string array)" , allowableValues=">, $")@HeaderParam("enum_header_string_array") List enumHeaderStringArray, - @ApiParam(value = "Header parameter enum test (string)" , allowableValues="_abc, -efg, (xyz)", defaultValue="-efg")@HeaderParam("enum_header_string") String enumHeaderString, - @ApiParam(value = "Query parameter enum test (string array)", allowableValues=">, $") @QueryParam("enum_query_string_array") List enumQueryStringArray, - @ApiParam(value = "Query parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @DefaultValue("-efg") @QueryParam("enum_query_string") String enumQueryString, - @ApiParam(value = "Query parameter enum test (double)", allowableValues="1, -2") @QueryParam("enum_query_integer") Integer enumQueryInteger, - @ApiParam(value = "Query parameter enum test (double)", allowableValues="1.1, -1.2") @FormParam("enum_query_double") Double enumQueryDouble, + @ApiParam(value = "" ) Object body +, + @ApiParam(value = "Header parameter enum test (string array)" , allowableValues="range=[-infinity, infinity]")@HeaderParam("enum_header_string_array") List enumHeaderStringArray +, + @ApiParam(value = "Header parameter enum test (string)" )@HeaderParam("enum_header_string") String enumHeaderString +, + @ApiParam(value = "Query parameter enum test (string array)", allowableValues="range=[-infinity, infinity]") @QueryParam("enum_query_string_array") List enumQueryStringArray +, + @ApiParam(value = "Query parameter enum test (string)") @QueryParam("enum_query_string") String enumQueryString +, + @ApiParam(value = "Query parameter enum test (double)") @QueryParam("enum_query_integer") Integer enumQueryInteger +, @Context SecurityContext securityContext) throws NotFoundException { - return delegate.testEnumParameters(enumFormStringArray,enumFormString,enumHeaderStringArray,enumHeaderString,enumQueryStringArray,enumQueryString,enumQueryInteger,enumQueryDouble,securityContext); + return delegate.testEnumParameters(body,enumHeaderStringArray,enumHeaderString,enumQueryStringArray,enumQueryString,enumQueryInteger,securityContext); } + @POST @Path("/inline-additionalProperties") @Consumes({ "application/json" }) - @io.swagger.annotations.ApiOperation(value = "test inline additionalProperties", notes = "", response = Void.class, tags={ "fake", }) + @io.swagger.annotations.ApiOperation(value = "test inline additionalProperties", notes = "", response = Void.class, tags={ "fake" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response testInlineAdditionalProperties( - @ApiParam(value = "request body" ,required=true) Object param, + @ApiParam(value = "request body" ,required=true) Map body +, @Context SecurityContext securityContext) throws NotFoundException { - return delegate.testInlineAdditionalProperties(param,securityContext); + return delegate.testInlineAdditionalProperties(body,securityContext); } + @GET @Path("/jsonFormData") @Consumes({ "application/json" }) @@ -173,10 +181,12 @@ public Response testInlineAdditionalProperties( @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response testJsonFormData( - @ApiParam(value = "field1", required=true) @FormParam("param") String param, - @ApiParam(value = "field2", required=true) @FormParam("param2") String param2, + @ApiParam(value = "" ,required=true) Object body +, @Context SecurityContext securityContext) throws NotFoundException { - return delegate.testJsonFormData(param,param2,securityContext); + return delegate.testJsonFormData(body,securityContext); } + } + diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/FakeApiService.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/FakeApiService.java index 3c7b947ca72..6b76ef33072 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/FakeApiService.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/FakeApiService.java @@ -7,9 +7,10 @@ import java.math.BigDecimal; import io.swagger.model.Client; -import java.util.Date; import io.swagger.model.OuterComposite; + +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -20,25 +21,39 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; + import javax.validation.constraints.*; + + public abstract class FakeApiService { + public abstract Response fakeOuterBooleanSerialize(Boolean body,SecurityContext securityContext) throws NotFoundException; - public abstract Response fakeOuterCompositeSerialize(OuterComposite body,SecurityContext securityContext) + + public abstract Response fakeOuterCompositeSerialize(OuterComposite outercomposite,SecurityContext securityContext) throws NotFoundException; + public abstract Response fakeOuterNumberSerialize(BigDecimal body,SecurityContext securityContext) throws NotFoundException; + public abstract Response fakeOuterStringSerialize(String body,SecurityContext securityContext) throws NotFoundException; - public abstract Response testClientModel(Client body,SecurityContext securityContext) + + public abstract Response testClientModel(Client client,SecurityContext securityContext) throws NotFoundException; - public abstract Response testEndpointParameters(BigDecimal number,Double _double,String patternWithoutDelimiter,byte[] _byte,Integer integer,Integer int32,Long int64,Float _float,String string,byte[] binary,Date date,Date dateTime,String password,String paramCallback,SecurityContext securityContext) + + public abstract Response testEndpointParameters(Object body,SecurityContext securityContext) throws NotFoundException; - public abstract Response testEnumParameters(List enumFormStringArray,String enumFormString,List enumHeaderStringArray,String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger,Double enumQueryDouble,SecurityContext securityContext) + + public abstract Response testEnumParameters(Object body,List enumHeaderStringArray,String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger,SecurityContext securityContext) throws NotFoundException; - public abstract Response testInlineAdditionalProperties(Object param,SecurityContext securityContext) + + public abstract Response testInlineAdditionalProperties(Map body,SecurityContext securityContext) throws NotFoundException; - public abstract Response testJsonFormData(String param,String param2,SecurityContext securityContext) + + public abstract Response testJsonFormData(Object body,SecurityContext securityContext) throws NotFoundException; + } + diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/FakeClassnameTestApi.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/FakeClassnameTestApi.java index 7a0e5315338..969b79357ef 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/FakeClassnameTestApi.java @@ -8,10 +8,13 @@ import io.swagger.jaxrs.*; import com.sun.jersey.multipart.FormDataParam; + import javax.validation.constraints.*; + import io.swagger.model.Client; + import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -31,22 +34,25 @@ @io.swagger.annotations.Api(description = "the fake_classname_test API") + public class FakeClassnameTestApi { private final FakeClassnameTestApiService delegate = FakeClassnameTestApiServiceFactory.getFakeClassnameTestApi(); + @PATCH @Consumes({ "application/json" }) @Produces({ "application/json" }) - @io.swagger.annotations.ApiOperation(value = "To test class name in snake case", notes = "", response = Client.class, authorizations = { - @io.swagger.annotations.Authorization(value = "api_key_query") - }, tags={ "fake_classname_tags 123#$%^" }) + @io.swagger.annotations.ApiOperation(value = "To test class name in snake case", notes = "", response = Client.class, tags={ "fake_classname_tags 123#$%^" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Client.class) }) public Response testClassname( - @ApiParam(value = "client model" ,required=true) Client body, + @ApiParam(value = "client model" ,required=true) Client client +, @Context SecurityContext securityContext) throws NotFoundException { - return delegate.testClassname(body,securityContext); + return delegate.testClassname(client,securityContext); } + } + diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/FakeClassnameTestApiService.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/FakeClassnameTestApiService.java index 7dd1c6de0e4..0453e0cfb1a 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/FakeClassnameTestApiService.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/FakeClassnameTestApiService.java @@ -7,6 +7,8 @@ import io.swagger.model.Client; + +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -17,9 +19,15 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; + import javax.validation.constraints.*; + + public abstract class FakeClassnameTestApiService { - public abstract Response testClassname(Client body,SecurityContext securityContext) + + public abstract Response testClassname(Client client,SecurityContext securityContext) throws NotFoundException; + } + diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/JacksonJsonProvider.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/JacksonJsonProvider.java index 60aa6ad1718..484860e63b0 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/JacksonJsonProvider.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/JacksonJsonProvider.java @@ -4,8 +4,11 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; + + import com.fasterxml.jackson.datatype.joda.*; + import com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider; import javax.ws.rs.Produces; @@ -21,7 +24,10 @@ public JacksonJsonProvider() { ObjectMapper objectMapper = new ObjectMapper() .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) + + .registerModule(new JodaModule()) + .setDateFormat(new RFC3339DateFormat()); setMapper(objectMapper); diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/PetApi.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/PetApi.java index 0bd48fed494..d286772d50c 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/PetApi.java @@ -8,12 +8,14 @@ import io.swagger.jaxrs.*; import com.sun.jersey.multipart.FormDataParam; + import javax.validation.constraints.*; -import java.io.File; + import io.swagger.model.ModelApiResponse; import io.swagger.model.Pet; + import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -33,160 +35,142 @@ @io.swagger.annotations.Api(description = "the pet API") + public class PetApi { private final PetApiService delegate = PetApiServiceFactory.getPetApi(); + @POST @Consumes({ "application/json", "application/xml" }) - @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Add a new pet to the store", notes = "", response = Void.class, authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + + @io.swagger.annotations.ApiOperation(value = "Add a new pet to the store", notes = "", response = Void.class, tags={ "pet" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) public Response addPet( - @ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet body, + @ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet pet +, @Context SecurityContext securityContext) throws NotFoundException { - return delegate.addPet(body,securityContext); + return delegate.addPet(pet,securityContext); } + @DELETE @Path("/{petId}") - @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + + @io.swagger.annotations.ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, tags={ "pet" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) public Response deletePet( - @ApiParam(value = "Pet id to delete",required=true) @PathParam("petId") Long petId, - @ApiParam(value = "" )@HeaderParam("api_key") String apiKey, + @ApiParam(value = "Pet id to delete",required=true) @PathParam("petId") Integer petId +, + @ApiParam(value = "" )@HeaderParam("api_key") String apiKey +, @Context SecurityContext securityContext) throws NotFoundException { return delegate.deletePet(petId,apiKey,securityContext); } + @GET @Path("/findByStatus") @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + @io.swagger.annotations.ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", tags={ "pet" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid status value", response = Void.class) }) public Response findPetsByStatus( - @ApiParam(value = "Status values that need to be considered for filter",required=true, allowableValues="available, pending, sold") @QueryParam("status") List status, + @ApiParam(value = "Status values that need to be considered for filter",required=true, allowableValues="range=[-infinity, infinity]") @QueryParam("status") List status +, @Context SecurityContext securityContext) throws NotFoundException { return delegate.findPetsByStatus(status,securityContext); } + @GET @Path("/findByTags") @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + @io.swagger.annotations.ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", tags={ "pet" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid tag value", response = Void.class) }) public Response findPetsByTags( - @ApiParam(value = "Tags to filter by",required=true) @QueryParam("tags") List tags, + @ApiParam(value = "Tags to filter by",required=true) @QueryParam("tags") List tags +, @Context SecurityContext securityContext) throws NotFoundException { return delegate.findPetsByTags(tags,securityContext); } + @GET @Path("/{petId}") @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = { - @io.swagger.annotations.Authorization(value = "api_key") - }, tags={ "pet", }) + @io.swagger.annotations.ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, tags={ "pet" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class) }) public Response getPetById( - @ApiParam(value = "ID of pet to return",required=true) @PathParam("petId") Long petId, + @ApiParam(value = "ID of pet to return",required=true) @PathParam("petId") Integer petId +, @Context SecurityContext securityContext) throws NotFoundException { return delegate.getPetById(petId,securityContext); } + @PUT @Consumes({ "application/json", "application/xml" }) - @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + + @io.swagger.annotations.ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, tags={ "pet" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class), @io.swagger.annotations.ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) public Response updatePet( - @ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet body, + @ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet pet +, @Context SecurityContext securityContext) throws NotFoundException { - return delegate.updatePet(body,securityContext); + return delegate.updatePet(pet,securityContext); } + @POST @Path("/{petId}") @Consumes({ "application/x-www-form-urlencoded" }) - @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + + @io.swagger.annotations.ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, tags={ "pet" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) public Response updatePetWithForm( - @ApiParam(value = "ID of pet that needs to be updated",required=true) @PathParam("petId") Long petId, - @ApiParam(value = "Updated name of the pet") @FormParam("name") String name, - @ApiParam(value = "Updated status of the pet") @FormParam("status") String status, + @ApiParam(value = "ID of pet that needs to be updated",required=true) @PathParam("petId") Integer petId +, + @ApiParam(value = "" ) Object body +, @Context SecurityContext securityContext) throws NotFoundException { - return delegate.updatePetWithForm(petId,name,status,securityContext); + return delegate.updatePetWithForm(petId,body,securityContext); } + @POST @Path("/{petId}/uploadImage") @Consumes({ "multipart/form-data" }) @Produces({ "application/json" }) - @io.swagger.annotations.ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet" }) + @io.swagger.annotations.ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, tags={ "pet" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) public Response uploadFile( - @ApiParam(value = "ID of pet to update",required=true) @PathParam("petId") Long petId, - @FormDataParam("additionalMetadata") String additionalMetadata, - @FormDataParam("file") InputStream inputStream, - @FormDataParam("file") FormDataContentDisposition fileDetail, + @ApiParam(value = "ID of pet to update",required=true) @PathParam("petId") Integer petId +, + @ApiParam(value = "" ) Object body +, @Context SecurityContext securityContext) throws NotFoundException { - return delegate.uploadFile(petId,additionalMetadata,inputStream, fileDetail,securityContext); + return delegate.uploadFile(petId,body,securityContext); } + } + diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/PetApiService.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/PetApiService.java index 62be64f485f..f0ea701e22e 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/PetApiService.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/PetApiService.java @@ -5,10 +5,11 @@ import com.sun.jersey.multipart.FormDataParam; -import java.io.File; import io.swagger.model.ModelApiResponse; import io.swagger.model.Pet; + +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -19,23 +20,36 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; + import javax.validation.constraints.*; + + public abstract class PetApiService { - public abstract Response addPet(Pet body,SecurityContext securityContext) + + public abstract Response addPet(Pet pet,SecurityContext securityContext) throws NotFoundException; - public abstract Response deletePet(Long petId,String apiKey,SecurityContext securityContext) + + public abstract Response deletePet(Integer petId,String apiKey,SecurityContext securityContext) throws NotFoundException; + public abstract Response findPetsByStatus( @NotNull List status,SecurityContext securityContext) throws NotFoundException; + public abstract Response findPetsByTags( @NotNull List tags,SecurityContext securityContext) throws NotFoundException; - public abstract Response getPetById(Long petId,SecurityContext securityContext) + + public abstract Response getPetById(Integer petId,SecurityContext securityContext) throws NotFoundException; - public abstract Response updatePet(Pet body,SecurityContext securityContext) + + public abstract Response updatePet(Pet pet,SecurityContext securityContext) throws NotFoundException; - public abstract Response updatePetWithForm(Long petId,String name,String status,SecurityContext securityContext) + + public abstract Response updatePetWithForm(Integer petId,Object body,SecurityContext securityContext) throws NotFoundException; - public abstract Response uploadFile(Long petId,String additionalMetadata,InputStream fileInputStream, FormDataContentDisposition fileDetail,SecurityContext securityContext) + + public abstract Response uploadFile(Integer petId,Object body,SecurityContext securityContext) throws NotFoundException; + } + diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/StoreApi.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/StoreApi.java index 693228ad890..238b44fa30d 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/StoreApi.java @@ -8,11 +8,14 @@ import io.swagger.jaxrs.*; import com.sun.jersey.multipart.FormDataParam; + import javax.validation.constraints.*; + import java.util.Map; import io.swagger.model.Order; + import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -32,30 +35,32 @@ @io.swagger.annotations.Api(description = "the store API") + public class StoreApi { private final StoreApiService delegate = StoreApiServiceFactory.getStoreApi(); + @DELETE @Path("/order/{order_id}") - @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = Void.class, tags={ "store", }) + + @io.swagger.annotations.ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = Void.class, tags={ "store" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Void.class) }) public Response deleteOrder( - @ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathParam("order_id") String orderId, + @ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathParam("order_id") String orderId +, @Context SecurityContext securityContext) throws NotFoundException { return delegate.deleteOrder(orderId,securityContext); } + @GET @Path("/inventory") @Produces({ "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { - @io.swagger.annotations.Authorization(value = "api_key") - }, tags={ "store", }) + @io.swagger.annotations.ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", tags={ "store" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) public Response getInventory( @@ -63,33 +68,39 @@ public Response getInventory( throws NotFoundException { return delegate.getInventory(securityContext); } + @GET @Path("/order/{order_id}") @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Find purchase order by ID", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) + @io.swagger.annotations.ApiOperation(value = "Find purchase order by ID", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Void.class) }) public Response getOrderById( - @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathParam("order_id") Long orderId, + @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathParam("order_id") Integer orderId +, @Context SecurityContext securityContext) throws NotFoundException { return delegate.getOrderById(orderId,securityContext); } + @POST @Path("/order") - + @Consumes({ "*/*" }) @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid Order", response = Void.class) }) public Response placeOrder( - @ApiParam(value = "order placed for purchasing the pet" ,required=true) Order body, + @ApiParam(value = "order placed for purchasing the pet" ,required=true) Order order +, @Context SecurityContext securityContext) throws NotFoundException { - return delegate.placeOrder(body,securityContext); + return delegate.placeOrder(order,securityContext); } + } + diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/StoreApiService.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/StoreApiService.java index b5a01e43f3b..58e4ca97314 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/StoreApiService.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/StoreApiService.java @@ -8,6 +8,8 @@ import java.util.Map; import io.swagger.model.Order; + +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -18,15 +20,24 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; + import javax.validation.constraints.*; + + 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( @Min(1) @Max(5)Long orderId,SecurityContext securityContext) + + public abstract Response getOrderById( @DecimalMin("1") @DecimalMax("5")Integer orderId,SecurityContext securityContext) throws NotFoundException; - public abstract Response placeOrder(Order body,SecurityContext securityContext) + + public abstract Response placeOrder(Order order,SecurityContext securityContext) throws NotFoundException; + } + diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/UserApi.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/UserApi.java index 11ce07af10f..7e2b99b81e3 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/UserApi.java @@ -8,11 +8,13 @@ import io.swagger.jaxrs.*; import com.sun.jersey.multipart.FormDataParam; + import javax.validation.constraints.*; -import java.util.List; + import io.swagger.model.User; + import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -32,97 +34,112 @@ @io.swagger.annotations.Api(description = "the user API") + public class UserApi { private final UserApiService delegate = UserApiServiceFactory.getUserApi(); + @POST + @Consumes({ "*/*" }) - @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @io.swagger.annotations.ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response createUser( - @ApiParam(value = "Created user object" ,required=true) User body, + @ApiParam(value = "Created user object" ,required=true) User user +, @Context SecurityContext securityContext) throws NotFoundException { - return delegate.createUser(body,securityContext); + return delegate.createUser(user,securityContext); } + @POST @Path("/createWithArray") + @Consumes({ "*/*" }) - @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) + @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response createUsersWithArrayInput( - @ApiParam(value = "List of user object" ,required=true) List body, + @ApiParam(value = "List of user object" ,required=true) List body +, @Context SecurityContext securityContext) throws NotFoundException { return delegate.createUsersWithArrayInput(body,securityContext); } + @POST @Path("/createWithList") + @Consumes({ "*/*" }) - @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) + @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response createUsersWithListInput( - @ApiParam(value = "List of user object" ,required=true) List body, + @ApiParam(value = "List of user object" ,required=true) List body +, @Context SecurityContext securityContext) throws NotFoundException { return delegate.createUsersWithListInput(body,securityContext); } + @DELETE @Path("/{username}") - @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + + @io.swagger.annotations.ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) public Response deleteUser( - @ApiParam(value = "The name that needs to be deleted",required=true) @PathParam("username") String username, + @ApiParam(value = "The name that needs to be deleted",required=true) @PathParam("username") String username +, @Context SecurityContext securityContext) throws NotFoundException { return delegate.deleteUser(username,securityContext); } + @GET @Path("/{username}") @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user", }) + @io.swagger.annotations.ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = User.class), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) public Response getUserByName( - @ApiParam(value = "The name that needs to be fetched. Use user1 for testing. ",required=true) @PathParam("username") String username, + @ApiParam(value = "The name that needs to be fetched. Use user1 for testing. ",required=true) @PathParam("username") String username +, @Context SecurityContext securityContext) throws NotFoundException { return delegate.getUserByName(username,securityContext); } + @GET @Path("/login") @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user", }) + @io.swagger.annotations.ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = String.class), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username/password supplied", response = Void.class) }) public Response loginUser( - @ApiParam(value = "The user name for login",required=true) @QueryParam("username") String username, - @ApiParam(value = "The password for login in clear text",required=true) @QueryParam("password") String password, + @ApiParam(value = "The user name for login",required=true) @QueryParam("username") String username +, + @ApiParam(value = "The password for login in clear text",required=true) @QueryParam("password") String password +, @Context SecurityContext securityContext) throws NotFoundException { return delegate.loginUser(username,password,securityContext); } + @GET @Path("/logout") - @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) + + @io.swagger.annotations.ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response logoutUser( @@ -130,19 +147,24 @@ public Response logoutUser( throws NotFoundException { return delegate.logoutUser(securityContext); } + @PUT @Path("/{username}") + @Consumes({ "*/*" }) - @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user" }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) public Response updateUser( - @ApiParam(value = "name that need to be deleted",required=true) @PathParam("username") String username, - @ApiParam(value = "Updated user object" ,required=true) User body, + @ApiParam(value = "Updated user object" ,required=true) User user +, + @ApiParam(value = "name that need to be deleted",required=true) @PathParam("username") String username +, @Context SecurityContext securityContext) throws NotFoundException { - return delegate.updateUser(username,body,securityContext); + return delegate.updateUser(user,username,securityContext); } + } + diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/UserApiService.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/UserApiService.java index 81d2eebcacf..eba19fe9501 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/UserApiService.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/UserApiService.java @@ -5,9 +5,10 @@ import com.sun.jersey.multipart.FormDataParam; -import java.util.List; import io.swagger.model.User; + +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -18,23 +19,36 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; + import javax.validation.constraints.*; + + public abstract class UserApiService { - public abstract Response createUser(User body,SecurityContext securityContext) + + public abstract Response createUser(User user,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( @NotNull String username, @NotNull String password,SecurityContext securityContext) throws NotFoundException; + public abstract Response logoutUser(SecurityContext securityContext) throws NotFoundException; - public abstract Response updateUser(String username,User body,SecurityContext securityContext) + + public abstract Response updateUser(User user,String username,SecurityContext securityContext) throws NotFoundException; + } + diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java index d2cbef7abb5..3f933b49554 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java @@ -13,7 +13,10 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; @@ -21,72 +24,137 @@ import java.util.HashMap; import java.util.List; import java.util.Map; + + + import javax.validation.constraints.*; + + + /** * AdditionalPropertiesClass */ public class AdditionalPropertiesClass { + + + + @JsonProperty("map_property") + + + private Map mapProperty = null; + + + + + + @JsonProperty("map_of_map_property") + + + private Map> mapOfMapProperty = null; + + + + + public AdditionalPropertiesClass mapProperty(Map mapProperty) { this.mapProperty = mapProperty; return this; } + + public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + if (this.mapProperty == null) { this.mapProperty = new HashMap(); } + this.mapProperty.put(key, mapPropertyItem); return this; } + + /** + + * Get mapProperty + + + * @return mapProperty **/ + + @JsonProperty("map_property") + @ApiModelProperty(value = "") + public Map getMapProperty() { return mapProperty; } + public void setMapProperty(Map mapProperty) { this.mapProperty = mapProperty; } + + + public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { this.mapOfMapProperty = mapOfMapProperty; return this; } + + public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + if (this.mapOfMapProperty == null) { this.mapOfMapProperty = new HashMap>(); } + this.mapOfMapProperty.put(key, mapOfMapPropertyItem); return this; } + + /** + + * Get mapOfMapProperty + + + * @return mapOfMapProperty **/ + + @JsonProperty("map_of_map_property") + @ApiModelProperty(value = "") + public Map> getMapOfMapProperty() { return mapOfMapProperty; } + public void setMapOfMapProperty(Map> mapOfMapProperty) { this.mapOfMapProperty = mapOfMapProperty; } + + + @Override @@ -108,6 +176,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -131,3 +201,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Animal.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Animal.java index 8f1fdfd45bb..95f65d55469 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Animal.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Animal.java @@ -13,64 +13,127 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + + + import javax.validation.constraints.*; + + + /** * Animal */ public class Animal { + + + + @JsonProperty("className") + + + + private String className = null; + + + + + @JsonProperty("color") + + + + private String color = "red"; + + + + public Animal className(String className) { this.className = className; return this; } + + + /** + + * Get className + + + * @return className **/ + + @JsonProperty("className") + @ApiModelProperty(required = true, value = "") + @NotNull + public String getClassName() { return className; } + public void setClassName(String className) { this.className = className; } + + + public Animal color(String color) { this.color = color; return this; } + + + /** + + * Get color + + + * @return color **/ + + @JsonProperty("color") + @ApiModelProperty(value = "") + public String getColor() { return color; } + public void setColor(String color) { this.color = color; } + + + @Override @@ -92,6 +155,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -115,3 +180,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/AnimalFarm.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/AnimalFarm.java index be5b217a5c0..faee4225a03 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/AnimalFarm.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/AnimalFarm.java @@ -13,17 +13,29 @@ package io.swagger.model; + import java.util.Objects; + + import io.swagger.model.Animal; import java.util.ArrayList; import java.util.List; + + + import javax.validation.constraints.*; + + + /** * AnimalFarm */ public class AnimalFarm extends ArrayList { + + + @Override public boolean equals(java.lang.Object o) { @@ -38,10 +50,12 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(super.hashCode()); + return Objects.hash(); } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -63,3 +77,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java index 7dcd2118293..8da6a4ed646 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java @@ -13,7 +13,10 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; @@ -21,42 +24,79 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; + + + import javax.validation.constraints.*; + + + /** * ArrayOfArrayOfNumberOnly */ public class ArrayOfArrayOfNumberOnly { + + + + @JsonProperty("ArrayArrayNumber") + + + private List> arrayArrayNumber = null; + + + + + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; return this; } + public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { this.arrayArrayNumber = new ArrayList>(); } + this.arrayArrayNumber.add(arrayArrayNumberItem); return this; } + + + /** + + * Get arrayArrayNumber + + + * @return arrayArrayNumber **/ + + @JsonProperty("ArrayArrayNumber") + @ApiModelProperty(value = "") + public List> getArrayArrayNumber() { return arrayArrayNumber; } + public void setArrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; } + + + @Override @@ -77,6 +117,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -99,3 +141,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java index 05331fa55e9..d572230b45c 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java @@ -13,7 +13,10 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; @@ -21,42 +24,79 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; + + + import javax.validation.constraints.*; + + + /** * ArrayOfNumberOnly */ public class ArrayOfNumberOnly { + + + + @JsonProperty("ArrayNumber") + + + private List arrayNumber = null; + + + + + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; return this; } + public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { this.arrayNumber = new ArrayList(); } + this.arrayNumber.add(arrayNumberItem); return this; } + + + /** + + * Get arrayNumber + + + * @return arrayNumber **/ + + @JsonProperty("ArrayNumber") + @ApiModelProperty(value = "") + public List getArrayNumber() { return arrayNumber; } + public void setArrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; } + + + @Override @@ -77,6 +117,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -99,3 +141,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ArrayTest.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ArrayTest.java index 295a1ea1f14..67b1c3f79e0 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ArrayTest.java @@ -13,7 +13,10 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; @@ -21,102 +24,195 @@ import io.swagger.model.ReadOnlyFirst; import java.util.ArrayList; import java.util.List; + + + import javax.validation.constraints.*; + + + /** * ArrayTest */ public class ArrayTest { + + + + @JsonProperty("array_of_string") + + + private List arrayOfString = null; + + + + + + @JsonProperty("array_array_of_integer") + + + private List> arrayArrayOfInteger = null; + + + + + + @JsonProperty("array_array_of_model") + + + private List> arrayArrayOfModel = null; + + + + + public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; return this; } + public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { this.arrayOfString = new ArrayList(); } + this.arrayOfString.add(arrayOfStringItem); return this; } + + + /** + + * Get arrayOfString + + + * @return arrayOfString **/ + + @JsonProperty("array_of_string") + @ApiModelProperty(value = "") + public List getArrayOfString() { return arrayOfString; } + public void setArrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; } + + + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; return this; } + public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { this.arrayArrayOfInteger = new ArrayList>(); } + this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; } + + + /** + + * Get arrayArrayOfInteger + + + * @return arrayArrayOfInteger **/ + + @JsonProperty("array_array_of_integer") + @ApiModelProperty(value = "") + public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; } + + + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; return this; } + public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { this.arrayArrayOfModel = new ArrayList>(); } + this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; } + + + /** + + * Get arrayArrayOfModel + + + * @return arrayArrayOfModel **/ + + @JsonProperty("array_array_of_model") + @ApiModelProperty(value = "") + public List> getArrayArrayOfModel() { return arrayArrayOfModel; } + public void setArrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } + + + @Override @@ -139,6 +235,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -163,3 +261,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Capitalization.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Capitalization.java index 6ee896a961d..b837c520bd6 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Capitalization.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Capitalization.java @@ -13,149 +13,311 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + + + import javax.validation.constraints.*; + + + /** * Capitalization */ public class Capitalization { + + + + @JsonProperty("smallCamel") + + + + private String smallCamel = null; + + + + + @JsonProperty("CapitalCamel") + + + + private String capitalCamel = null; + + + + + @JsonProperty("small_Snake") + + + + private String smallSnake = null; + + + + + @JsonProperty("Capital_Snake") + + + + private String capitalSnake = null; + + + + + @JsonProperty("SCA_ETH_Flow_Points") + + + + private String scAETHFlowPoints = null; + + + + + @JsonProperty("ATT_NAME") + + + + private String ATT_NAME = null; + + + + public Capitalization smallCamel(String smallCamel) { this.smallCamel = smallCamel; return this; } + + + /** + + * Get smallCamel + + + * @return smallCamel **/ + + @JsonProperty("smallCamel") + @ApiModelProperty(value = "") + public String getSmallCamel() { return smallCamel; } + public void setSmallCamel(String smallCamel) { this.smallCamel = smallCamel; } + + + public Capitalization capitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; return this; } + + + /** + + * Get capitalCamel + + + * @return capitalCamel **/ + + @JsonProperty("CapitalCamel") + @ApiModelProperty(value = "") + public String getCapitalCamel() { return capitalCamel; } + public void setCapitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; } + + + public Capitalization smallSnake(String smallSnake) { this.smallSnake = smallSnake; return this; } + + + /** + + * Get smallSnake + + + * @return smallSnake **/ + + @JsonProperty("small_Snake") + @ApiModelProperty(value = "") + public String getSmallSnake() { return smallSnake; } + public void setSmallSnake(String smallSnake) { this.smallSnake = smallSnake; } + + + public Capitalization capitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; return this; } + + + /** + + * Get capitalSnake + + + * @return capitalSnake **/ + + @JsonProperty("Capital_Snake") + @ApiModelProperty(value = "") + public String getCapitalSnake() { return capitalSnake; } + public void setCapitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; } + + + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; return this; } + + + /** + + * Get scAETHFlowPoints + + + * @return scAETHFlowPoints **/ + + @JsonProperty("SCA_ETH_Flow_Points") + @ApiModelProperty(value = "") + public String getScAETHFlowPoints() { return scAETHFlowPoints; } + public void setScAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; } + + + public Capitalization ATT_NAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; return this; } + + + /** + * Name of the pet + + + + * @return ATT_NAME **/ + + @JsonProperty("ATT_NAME") + @ApiModelProperty(value = "Name of the pet ") + public String getATTNAME() { return ATT_NAME; } + public void setATTNAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; } + + + @Override @@ -181,6 +343,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -208,3 +372,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Cat.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Cat.java index b96cffbbd79..bda7f6d885d 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Cat.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Cat.java @@ -13,40 +13,173 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import io.swagger.model.Animal; + + + import javax.validation.constraints.*; + + + /** * Cat */ public class Cat extends Animal { + + + + + @JsonProperty("className") + + + + + private String className = null; + + + + + + + @JsonProperty("color") + + + + + private String color = "red"; + + + + + + @JsonProperty("declawed") + + + + private Boolean declawed = null; + + + + + + public Cat className(String className) { + this.className = className; + return this; + } + + + + + /** + + + * Get className + + + + * @return className + **/ + + + @JsonProperty("className") + + @ApiModelProperty(required = true, value = "") + + @NotNull + + public String getClassName() { + return className; + } + + public void setClassName(String className) { + this.className = className; + } + + + + + public Cat color(String color) { + this.color = color; + return this; + } + + + + + /** + + + * Get color + + + + * @return color + **/ + + + @JsonProperty("color") + + @ApiModelProperty(value = "") + + public String getColor() { + return color; + } + + + public void setColor(String color) { + this.color = color; + } + + + + public Cat declawed(Boolean declawed) { this.declawed = declawed; return this; } + + + /** + + * Get declawed + + + * @return declawed **/ + + @JsonProperty("declawed") + @ApiModelProperty(value = "") - public Boolean isDeclawed() { + + public Boolean isisDeclawed() { return declawed; } + public void setDeclawed(Boolean declawed) { this.declawed = declawed; } + + + @Override @@ -58,21 +191,27 @@ public boolean equals(java.lang.Object o) { return false; } Cat cat = (Cat) o; - return Objects.equals(this.declawed, cat.declawed) && + return Objects.equals(this.className, cat.className) && + Objects.equals(this.color, cat.color) && + Objects.equals(this.declawed, cat.declawed) && super.equals(o); } @Override public int hashCode() { - return Objects.hash(declawed, super.hashCode()); + return Objects.hash(className, color, declawed, super.hashCode()); } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Cat {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); sb.append("}"); return sb.toString(); @@ -90,3 +229,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Category.java index 0408b4d6acf..37b9fe98e41 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Category.java @@ -13,61 +13,123 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + + + import javax.validation.constraints.*; + + + /** * Category */ public class Category { + + + + @JsonProperty("id") + + + + private Long id = null; + + + + + @JsonProperty("name") + + + + private String name = null; + + + + public Category id(Long id) { this.id = id; return this; } + + + /** + + * Get id + + + * @return id **/ + + @JsonProperty("id") + @ApiModelProperty(value = "") + public Long getId() { return id; } + public void setId(Long id) { this.id = id; } + + + public Category name(String name) { this.name = name; return this; } + + + /** + + * Get name + + + * @return name **/ + + @JsonProperty("name") + @ApiModelProperty(value = "") + public String getName() { return name; } + public void setName(String name) { this.name = name; } + + + @Override @@ -89,6 +151,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -112,3 +176,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ClassModel.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ClassModel.java index e96a4ff4eb8..8667943daef 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ClassModel.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ClassModel.java @@ -13,40 +13,77 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + + + import javax.validation.constraints.*; + + + /** * Model for testing model with \"_class\" property */ @ApiModel(description = "Model for testing model with \"_class\" property") public class ClassModel { + + + + @JsonProperty("_class") + + + + private String propertyClass = null; + + + + public ClassModel propertyClass(String propertyClass) { this.propertyClass = propertyClass; return this; } + + + /** + + * Get propertyClass + + + * @return propertyClass **/ + + @JsonProperty("_class") + @ApiModelProperty(value = "") + public String getPropertyClass() { return propertyClass; } + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } + + + @Override @@ -67,6 +104,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -89,3 +128,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Client.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Client.java index 7bae1955cb3..5e8e716bc01 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Client.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Client.java @@ -13,39 +13,76 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + + + import javax.validation.constraints.*; + + + /** * Client */ public class Client { + + + + @JsonProperty("client") + + + + private String client = null; + + + + public Client client(String client) { this.client = client; return this; } + + + /** + + * Get client + + + * @return client **/ + + @JsonProperty("client") + @ApiModelProperty(value = "") + public String getClient() { return client; } + public void setClient(String client) { this.client = client; } + + + @Override @@ -66,6 +103,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -88,3 +127,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Dog.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Dog.java index 94fd1071a92..5513088ecd1 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Dog.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Dog.java @@ -13,40 +13,173 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import io.swagger.model.Animal; + + + import javax.validation.constraints.*; + + + /** * Dog */ public class Dog extends Animal { + + + + + @JsonProperty("className") + + + + + private String className = null; + + + + + + + @JsonProperty("color") + + + + + private String color = "red"; + + + + + + @JsonProperty("breed") + + + + private String breed = null; + + + + + + public Dog className(String className) { + this.className = className; + return this; + } + + + + + /** + + + * Get className + + + + * @return className + **/ + + + @JsonProperty("className") + + @ApiModelProperty(required = true, value = "") + + @NotNull + + public String getClassName() { + return className; + } + + public void setClassName(String className) { + this.className = className; + } + + + + + public Dog color(String color) { + this.color = color; + return this; + } + + + + + /** + + + * Get color + + + + * @return color + **/ + + + @JsonProperty("color") + + @ApiModelProperty(value = "") + + public String getColor() { + return color; + } + + + public void setColor(String color) { + this.color = color; + } + + + + public Dog breed(String breed) { this.breed = breed; return this; } + + + /** + + * Get breed + + + * @return breed **/ + + @JsonProperty("breed") + @ApiModelProperty(value = "") + public String getBreed() { return breed; } + public void setBreed(String breed) { this.breed = breed; } + + + @Override @@ -58,21 +191,27 @@ public boolean equals(java.lang.Object o) { return false; } Dog dog = (Dog) o; - return Objects.equals(this.breed, dog.breed) && + return Objects.equals(this.className, dog.className) && + Objects.equals(this.color, dog.color) && + Objects.equals(this.breed, dog.breed) && super.equals(o); } @Override public int hashCode() { - return Objects.hash(breed, super.hashCode()); + return Objects.hash(className, color, breed, super.hashCode()); } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Dog {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); sb.append("}"); return sb.toString(); @@ -90,3 +229,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/EnumArrays.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/EnumArrays.java index 8542c26fea8..4551dda9140 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/EnumArrays.java @@ -13,7 +13,10 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -21,20 +24,37 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; + + + import javax.validation.constraints.*; + + + /** * EnumArrays */ public class EnumArrays { + + + /** * Gets or Sets justSymbol */ public enum JustSymbolEnum { + + + + GREATER_THAN_OR_EQUAL_TO(">="), + DOLLAR("$"); + + + private String value; @@ -59,16 +79,40 @@ public static JustSymbolEnum fromValue(String text) { } } + + + + @JsonProperty("just_symbol") + + + + private JustSymbolEnum justSymbol = null; + + + + + + + + /** * Gets or Sets arrayEnum */ public enum ArrayEnumEnum { + + + + FISH("fish"), + CRAB("crab"); + + + private String value; @@ -93,54 +137,101 @@ public static ArrayEnumEnum fromValue(String text) { } } + + + + @JsonProperty("array_enum") + + + private List arrayEnum = null; + + + + + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; return this; } + + + /** + + * Get justSymbol + + + * @return justSymbol **/ + + @JsonProperty("just_symbol") + @ApiModelProperty(value = "") + public JustSymbolEnum getJustSymbol() { return justSymbol; } + public void setJustSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; } + + + public EnumArrays arrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; return this; } + public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { this.arrayEnum = new ArrayList(); } + this.arrayEnum.add(arrayEnumItem); return this; } + + + /** + + * Get arrayEnum + + + * @return arrayEnum **/ + + @JsonProperty("array_enum") + @ApiModelProperty(value = "") + public List getArrayEnum() { return arrayEnum; } + public void setArrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; } + + + @Override @@ -162,6 +253,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -185,3 +278,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/EnumClass.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/EnumClass.java index 1a5899f15d0..628bdaf0d7f 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/EnumClass.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/EnumClass.java @@ -13,22 +13,36 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonValue; + + + import javax.validation.constraints.*; + + + + import com.fasterxml.jackson.annotation.JsonCreator; + /** * Gets or Sets EnumClass */ public enum EnumClass { + + _ABC("_abc"), _EFG("-efg"), _XYZ_("(xyz)"); + private String value; @@ -41,6 +55,7 @@ public String toString() { return String.valueOf(value); } + @JsonCreator public static EnumClass fromValue(String text) { for (EnumClass b : EnumClass.values()) { @@ -50,5 +65,8 @@ public static EnumClass fromValue(String text) { } return null; } + } + + diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/EnumTest.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/EnumTest.java index e233d15e2a9..2b3d3b3b8df 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/EnumTest.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/EnumTest.java @@ -13,29 +13,50 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import io.swagger.model.OuterEnum; + + + import javax.validation.constraints.*; + + + /** * EnumTest */ public class EnumTest { + + + /** * Gets or Sets enumString */ public enum EnumStringEnum { + + + + UPPER("UPPER"), + LOWER("lower"), + EMPTY(""); + + + private String value; @@ -60,16 +81,36 @@ public static EnumStringEnum fromValue(String text) { } } + + + + @JsonProperty("enum_string") + + + + private EnumStringEnum enumString = null; + + + + /** * Gets or Sets enumInteger */ public enum EnumIntegerEnum { + + + + NUMBER_1(1), + NUMBER_MINUS_1(-1); + + + private Integer value; @@ -94,16 +135,36 @@ public static EnumIntegerEnum fromValue(String text) { } } + + + + @JsonProperty("enum_integer") + + + + private EnumIntegerEnum enumInteger = null; + + + + /** * Gets or Sets enumNumber */ public enum EnumNumberEnum { + + + + NUMBER_1_DOT_1(1.1), + NUMBER_MINUS_1_DOT_2(-1.2); + + + private Double value; @@ -128,87 +189,172 @@ public static EnumNumberEnum fromValue(String text) { } } + + + + @JsonProperty("enum_number") + + + + private EnumNumberEnum enumNumber = null; + + + + + @JsonProperty("outerEnum") + + + + private OuterEnum outerEnum = null; + + + + public EnumTest enumString(EnumStringEnum enumString) { this.enumString = enumString; return this; } + + + /** + + * Get enumString + + + * @return enumString **/ + + @JsonProperty("enum_string") + @ApiModelProperty(value = "") + public EnumStringEnum getEnumString() { return enumString; } + public void setEnumString(EnumStringEnum enumString) { this.enumString = enumString; } + + + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; return this; } + + + /** + + * Get enumInteger + + + * @return enumInteger **/ + + @JsonProperty("enum_integer") + @ApiModelProperty(value = "") + public EnumIntegerEnum getEnumInteger() { return enumInteger; } + public void setEnumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; } + + + public EnumTest enumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; return this; } + + + /** + + * Get enumNumber + + + * @return enumNumber **/ + + @JsonProperty("enum_number") + @ApiModelProperty(value = "") + public EnumNumberEnum getEnumNumber() { return enumNumber; } + public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } + + + public EnumTest outerEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; return this; } + + + /** + + * Get outerEnum + + + * @return outerEnum **/ + + @JsonProperty("outerEnum") + @ApiModelProperty(value = "") + public OuterEnum getOuterEnum() { return outerEnum; } + public void setOuterEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; } + + + @Override @@ -232,6 +378,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -257,3 +405,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/FormatTest.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/FormatTest.java index bc552c619c3..d53abead37a 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/FormatTest.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/FormatTest.java @@ -13,7 +13,10 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; @@ -21,312 +24,648 @@ import java.math.BigDecimal; import java.util.Date; import java.util.UUID; + + + import javax.validation.constraints.*; + + + /** * FormatTest */ public class FormatTest { + + + + @JsonProperty("integer") + + + + private Integer integer = null; + + + + + @JsonProperty("int32") + + + + private Integer int32 = null; + + + + + @JsonProperty("int64") + + + + private Long int64 = null; + + + + + @JsonProperty("number") + + + + private BigDecimal number = null; + + + + + @JsonProperty("float") + + + + private Float _float = null; + + + + + @JsonProperty("double") + + + + private Double _double = null; + + + + + @JsonProperty("string") + + + + private String string = null; + + + + + @JsonProperty("byte") - private byte[] _byte = null; - + + + + + private String _byte = null; + + + + + + @JsonProperty("binary") - private byte[] binary = null; - + + + + + private String binary = null; + + + + + + @JsonProperty("date") + + + + private Date date = null; + + + + + @JsonProperty("dateTime") + + + + private Date dateTime = null; + + + + + @JsonProperty("uuid") + + + + private UUID uuid = null; + + + + + @JsonProperty("password") + + + + private String password = null; + + + + public FormatTest integer(Integer integer) { this.integer = integer; return this; } + + + /** + + * Get integer + + * minimum: 10 + + * maximum: 100 + * @return integer **/ + + @JsonProperty("integer") + @ApiModelProperty(value = "") + @Min(10) @Max(100) public Integer getInteger() { return integer; } + public void setInteger(Integer integer) { this.integer = integer; } + + + public FormatTest int32(Integer int32) { this.int32 = int32; return this; } + + + /** + + * Get int32 + + * minimum: 20 + + * maximum: 200 + * @return int32 **/ + + @JsonProperty("int32") + @ApiModelProperty(value = "") + @Min(20) @Max(200) public Integer getInt32() { return int32; } + public void setInt32(Integer int32) { this.int32 = int32; } + + + public FormatTest int64(Long int64) { this.int64 = int64; return this; } + + + /** + + * Get int64 + + + * @return int64 **/ + + @JsonProperty("int64") + @ApiModelProperty(value = "") + public Long getInt64() { return int64; } + public void setInt64(Long int64) { this.int64 = int64; } + + + public FormatTest number(BigDecimal number) { this.number = number; return this; } + + + /** + + * Get number - * minimum: 32.1 - * maximum: 543.2 + + + * @return number **/ + + @JsonProperty("number") + @ApiModelProperty(required = true, value = "") + @NotNull - @DecimalMin("32.1") @DecimalMax("543.2") public BigDecimal getNumber() { + + public BigDecimal getNumber() { return number; } + public void setNumber(BigDecimal number) { this.number = number; } + + + public FormatTest _float(Float _float) { this._float = _float; return this; } + + + /** + + * Get _float - * minimum: 54.3 - * maximum: 987.6 + + + * @return _float **/ + + @JsonProperty("float") + @ApiModelProperty(value = "") - @DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { + + public Float getFloat() { return _float; } + public void setFloat(Float _float) { this._float = _float; } + + + public FormatTest _double(Double _double) { this._double = _double; return this; } + + + /** + + * Get _double - * minimum: 67.8 - * maximum: 123.4 + + + * @return _double **/ + + @JsonProperty("double") + @ApiModelProperty(value = "") - @DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { + + public Double getDouble() { return _double; } + public void setDouble(Double _double) { this._double = _double; } + + + public FormatTest string(String string) { this.string = string; return this; } + + + /** + + * Get string + + + * @return string **/ + + @JsonProperty("string") + @ApiModelProperty(value = "") + @Pattern(regexp="/[a-z]/i") public String getString() { return string; } + public void setString(String string) { this.string = string; } + - public FormatTest _byte(byte[] _byte) { + + + public FormatTest _byte(String _byte) { this._byte = _byte; return this; } + + + /** + + * Get _byte + + + * @return _byte **/ + + @JsonProperty("byte") + @ApiModelProperty(required = true, value = "") + @NotNull - @Pattern(regexp="^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$") public byte[] getByte() { + + @Pattern(regexp="^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$") public String getByte() { return _byte; } + - public void setByte(byte[] _byte) { + public void setByte(String _byte) { this._byte = _byte; } + - public FormatTest binary(byte[] binary) { + + + public FormatTest binary(String binary) { this.binary = binary; return this; } + + + /** + + * Get binary + + + * @return binary **/ + + @JsonProperty("binary") + @ApiModelProperty(value = "") - public byte[] getBinary() { + + public String getBinary() { return binary; } + - public void setBinary(byte[] binary) { + public void setBinary(String binary) { this.binary = binary; } + + + public FormatTest date(Date date) { this.date = date; return this; } + + + /** + + * Get date + + + * @return date **/ + + @JsonProperty("date") + @ApiModelProperty(required = true, value = "") + @NotNull + public Date getDate() { return date; } + public void setDate(Date date) { this.date = date; } + + + public FormatTest dateTime(Date dateTime) { this.dateTime = dateTime; return this; } + + + /** + + * Get dateTime + + + * @return dateTime **/ + + @JsonProperty("dateTime") + @ApiModelProperty(value = "") + public Date getDateTime() { return dateTime; } + public void setDateTime(Date dateTime) { this.dateTime = dateTime; } + + + public FormatTest uuid(UUID uuid) { this.uuid = uuid; return this; } + + + /** + + * Get uuid + + + * @return uuid **/ + + @JsonProperty("uuid") + @ApiModelProperty(value = "") + public UUID getUuid() { return uuid; } + public void setUuid(UUID uuid) { this.uuid = uuid; } + + + public FormatTest password(String password) { this.password = password; return this; } + + + /** + + * Get password + + + * @return password **/ + + @JsonProperty("password") + @ApiModelProperty(required = true, value = "") + @NotNull - @Size(min=10,max=64) public String getPassword() { + + public String getPassword() { return password; } + public void setPassword(String password) { this.password = password; } + + + @Override @@ -359,6 +698,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -393,3 +734,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/HasOnlyReadOnly.java index 02480c10c65..5324359eb14 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/HasOnlyReadOnly.java @@ -13,43 +13,123 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + + + import javax.validation.constraints.*; + + + /** * HasOnlyReadOnly */ public class HasOnlyReadOnly { + + + + @JsonProperty("bar") + + + + private String bar = null; + + + + + @JsonProperty("foo") + + + + private String foo = null; + + + + + + public HasOnlyReadOnly bar(String bar) { + this.bar = bar; + return this; + } + + + /** + + * Get bar + + + * @return bar **/ + + @JsonProperty("bar") + @ApiModelProperty(value = "") + public String getBar() { return bar; } + + + public void setBar(String bar) { + this.bar = bar; + } + + + + public HasOnlyReadOnly foo(String foo) { + this.foo = foo; + return this; + } + + + + /** + + * Get foo + + + * @return foo **/ + + @JsonProperty("foo") + @ApiModelProperty(value = "") + public String getFoo() { return foo; } + + + public void setFoo(String foo) { + this.foo = foo; + } + + + @Override @@ -71,6 +151,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -94,3 +176,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/MapTest.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/MapTest.java index 73c04c4bd63..7cbd27f23a0 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/MapTest.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/MapTest.java @@ -13,7 +13,10 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,23 +25,53 @@ import java.util.HashMap; import java.util.List; import java.util.Map; + + + import javax.validation.constraints.*; + + + /** * MapTest */ public class MapTest { + + + + @JsonProperty("map_map_of_string") + + + private Map> mapMapOfString = null; + + + + + + + + + /** * Gets or Sets inner */ public enum InnerEnum { + + + + UPPER("UPPER"), + LOWER("lower"); + + + private String value; @@ -63,62 +96,112 @@ public static InnerEnum fromValue(String text) { } } + + + + @JsonProperty("map_of_enum_string") + + + private Map mapOfEnumString = null; + + + + + public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; return this; } + + public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { this.mapMapOfString = new HashMap>(); } + this.mapMapOfString.put(key, mapMapOfStringItem); return this; } + + /** + + * Get mapMapOfString + + + * @return mapMapOfString **/ + + @JsonProperty("map_map_of_string") + @ApiModelProperty(value = "") + public Map> getMapMapOfString() { return mapMapOfString; } + public void setMapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; } + + + public MapTest mapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; return this; } + + public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { this.mapOfEnumString = new HashMap(); } + this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; } + + /** + + * Get mapOfEnumString + + + * @return mapOfEnumString **/ + + @JsonProperty("map_of_enum_string") + @ApiModelProperty(value = "") + public Map getMapOfEnumString() { return mapOfEnumString; } + public void setMapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; } + + + @Override @@ -140,6 +223,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -163,3 +248,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java index 5e1d96f5ecc..f10ecd02304 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -13,7 +13,10 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; @@ -24,86 +27,173 @@ import java.util.List; import java.util.Map; import java.util.UUID; + + + import javax.validation.constraints.*; + + + /** * MixedPropertiesAndAdditionalPropertiesClass */ public class MixedPropertiesAndAdditionalPropertiesClass { + + + + @JsonProperty("uuid") + + + + private UUID uuid = null; + + + + + @JsonProperty("dateTime") + + + + private Date dateTime = null; + + + + + @JsonProperty("map") + + + private Map map = null; + + + + + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; return this; } + + + /** + + * Get uuid + + + * @return uuid **/ + + @JsonProperty("uuid") + @ApiModelProperty(value = "") + public UUID getUuid() { return uuid; } + public void setUuid(UUID uuid) { this.uuid = uuid; } + + + public MixedPropertiesAndAdditionalPropertiesClass dateTime(Date dateTime) { this.dateTime = dateTime; return this; } + + + /** + + * Get dateTime + + + * @return dateTime **/ + + @JsonProperty("dateTime") + @ApiModelProperty(value = "") + public Date getDateTime() { return dateTime; } + public void setDateTime(Date dateTime) { this.dateTime = dateTime; } + + + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { this.map = map; return this; } + + public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { this.map = new HashMap(); } + this.map.put(key, mapItem); return this; } + + /** + + * Get map + + + * @return map **/ + + @JsonProperty("map") + @ApiModelProperty(value = "") + public Map getMap() { return map; } + public void setMap(Map map) { this.map = map; } + + + @Override @@ -126,6 +216,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -150,3 +242,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Model200Response.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Model200Response.java index 954ef7ebed3..d43a8ebe5a9 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Model200Response.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Model200Response.java @@ -13,62 +13,124 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + + + import javax.validation.constraints.*; + + + /** * Model for testing model name starting with number */ @ApiModel(description = "Model for testing model name starting with number") public class Model200Response { + + + + @JsonProperty("name") + + + + private Integer name = null; + + + + + @JsonProperty("class") + + + + private String propertyClass = null; + + + + public Model200Response name(Integer name) { this.name = name; return this; } + + + /** + + * Get name + + + * @return name **/ + + @JsonProperty("name") + @ApiModelProperty(value = "") + public Integer getName() { return name; } + public void setName(Integer name) { this.name = name; } + + + public Model200Response propertyClass(String propertyClass) { this.propertyClass = propertyClass; return this; } + + + /** + + * Get propertyClass + + + * @return propertyClass **/ + + @JsonProperty("class") + @ApiModelProperty(value = "") + public String getPropertyClass() { return propertyClass; } + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } + + + @Override @@ -90,6 +152,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -113,3 +177,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ModelApiResponse.java index 2a54b591b32..98ccbc01819 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -13,83 +13,170 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + + + import javax.validation.constraints.*; + + + /** * ModelApiResponse */ public class ModelApiResponse { + + + + @JsonProperty("code") + + + + private Integer code = null; + + + + + @JsonProperty("type") + + + + private String type = null; + + + + + @JsonProperty("message") + + + + private String message = null; + + + + public ModelApiResponse code(Integer code) { this.code = code; return this; } + + + /** + + * Get code + + + * @return code **/ + + @JsonProperty("code") + @ApiModelProperty(value = "") + public Integer getCode() { return code; } + public void setCode(Integer code) { this.code = code; } + + + public ModelApiResponse type(String type) { this.type = type; return this; } + + + /** + + * Get type + + + * @return type **/ + + @JsonProperty("type") + @ApiModelProperty(value = "") + public String getType() { return type; } + public void setType(String type) { this.type = type; } + + + public ModelApiResponse message(String message) { this.message = message; return this; } + + + /** + + * Get message + + + * @return message **/ + + @JsonProperty("message") + @ApiModelProperty(value = "") + public String getMessage() { return message; } + public void setMessage(String message) { this.message = message; } + + + @Override @@ -112,6 +199,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -136,3 +225,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ModelReturn.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ModelReturn.java index 12b213d6afb..5fdd63263f8 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ModelReturn.java @@ -13,40 +13,77 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + + + import javax.validation.constraints.*; + + + /** * Model for testing reserved words */ @ApiModel(description = "Model for testing reserved words") public class ModelReturn { + + + + @JsonProperty("return") + + + + private Integer _return = null; + + + + public ModelReturn _return(Integer _return) { this._return = _return; return this; } + + + /** + + * Get _return + + + * @return _return **/ + + @JsonProperty("return") + @ApiModelProperty(value = "") + public Integer getReturn() { return _return; } + public void setReturn(Integer _return) { this._return = _return; } + + + @Override @@ -67,6 +104,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -89,3 +128,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Name.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Name.java index 771531b30ab..ad6d4dc2927 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Name.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Name.java @@ -13,89 +13,220 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + + + import javax.validation.constraints.*; + + + /** * Model for testing model name same as property name */ @ApiModel(description = "Model for testing model name same as property name") public class Name { + + + + @JsonProperty("name") + + + + private Integer name = null; + + + + + @JsonProperty("snake_case") + + + + private Integer snakeCase = null; + + + + + @JsonProperty("property") + + + + private String property = null; + + + + + @JsonProperty("123Number") + + + + private Integer _123Number = null; + + + + public Name name(Integer name) { this.name = name; return this; } + + + /** + + * Get name + + + * @return name **/ + + @JsonProperty("name") + @ApiModelProperty(required = true, value = "") + @NotNull + public Integer getName() { return name; } + public void setName(Integer name) { this.name = name; } + + + + public Name snakeCase(Integer snakeCase) { + this.snakeCase = snakeCase; + return this; + } + + + + /** + + * Get snakeCase + + + * @return snakeCase **/ + + @JsonProperty("snake_case") + @ApiModelProperty(value = "") + public Integer getSnakeCase() { return snakeCase; } + + public void setSnakeCase(Integer snakeCase) { + this.snakeCase = snakeCase; + } + + + + public Name property(String property) { this.property = property; return this; } + + + /** + + * Get property + + + * @return property **/ + + @JsonProperty("property") + @ApiModelProperty(value = "") + public String getProperty() { return property; } + public void setProperty(String property) { this.property = property; } + + + + + public Name _123Number(Integer _123Number) { + this._123Number = _123Number; + return this; + } + + + /** + + * Get _123Number + + + * @return _123Number **/ + + @JsonProperty("123Number") + @ApiModelProperty(value = "") + public Integer get123Number() { return _123Number; } + + + public void set123Number(Integer _123Number) { + this._123Number = _123Number; + } + + + @Override @@ -119,6 +250,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -144,3 +277,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/NumberOnly.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/NumberOnly.java index 82604a5b9c7..97654cc9c3c 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/NumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/NumberOnly.java @@ -13,40 +13,77 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; + + + import javax.validation.constraints.*; + + + /** * NumberOnly */ public class NumberOnly { + + + + @JsonProperty("JustNumber") + + + + private BigDecimal justNumber = null; + + + + public NumberOnly justNumber(BigDecimal justNumber) { this.justNumber = justNumber; return this; } + + + /** + + * Get justNumber + + + * @return justNumber **/ + + @JsonProperty("JustNumber") + @ApiModelProperty(value = "") + public BigDecimal getJustNumber() { return justNumber; } + public void setJustNumber(BigDecimal justNumber) { this.justNumber = justNumber; } + + + @Override @@ -67,6 +104,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -89,3 +128,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Order.java index 5147738768b..7feb30193a2 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Order.java @@ -13,41 +13,98 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.Date; + + + import javax.validation.constraints.*; + + + /** * Order */ public class Order { + + + + @JsonProperty("id") + + + + private Long id = null; + + + + + @JsonProperty("petId") + + + + private Long petId = null; + + + + + @JsonProperty("quantity") + + + + private Integer quantity = null; + + + + + @JsonProperty("shipDate") + + + + private Date shipDate = null; + + + + /** * Order Status */ public enum StatusEnum { + + + + PLACED("placed"), + APPROVED("approved"), + DELIVERED("delivered"); + + + private String value; @@ -72,125 +129,242 @@ public static StatusEnum fromValue(String text) { } } + + + + @JsonProperty("status") + + + + private StatusEnum status = null; + + + + + @JsonProperty("complete") + + + + private Boolean complete = false; + + + + public Order id(Long id) { this.id = id; return this; } + + + /** + + * Get id + + + * @return id **/ + + @JsonProperty("id") + @ApiModelProperty(value = "") + public Long getId() { return id; } + public void setId(Long id) { this.id = id; } + + + public Order petId(Long petId) { this.petId = petId; return this; } + + + /** + + * Get petId + + + * @return petId **/ + + @JsonProperty("petId") + @ApiModelProperty(value = "") + public Long getPetId() { return petId; } + public void setPetId(Long petId) { this.petId = petId; } + + + public Order quantity(Integer quantity) { this.quantity = quantity; return this; } + + + /** + + * Get quantity + + + * @return quantity **/ + + @JsonProperty("quantity") + @ApiModelProperty(value = "") + public Integer getQuantity() { return quantity; } + public void setQuantity(Integer quantity) { this.quantity = quantity; } + + + public Order shipDate(Date shipDate) { this.shipDate = shipDate; return this; } + + + /** + + * Get shipDate + + + * @return shipDate **/ + + @JsonProperty("shipDate") + @ApiModelProperty(value = "") + public Date getShipDate() { return shipDate; } + public void setShipDate(Date shipDate) { this.shipDate = shipDate; } + + + public Order status(StatusEnum status) { this.status = status; return this; } + + + /** + * Order Status + + + + * @return status **/ + + @JsonProperty("status") + @ApiModelProperty(value = "Order Status") + public StatusEnum getStatus() { return status; } + public void setStatus(StatusEnum status) { this.status = status; } + + + public Order complete(Boolean complete) { this.complete = complete; return this; } + + + /** + + * Get complete + + + * @return complete **/ + + @JsonProperty("complete") + @ApiModelProperty(value = "") - public Boolean isComplete() { + + public Boolean isisComplete() { return complete; } + public void setComplete(Boolean complete) { this.complete = complete; } + + + @Override @@ -216,6 +390,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -243,3 +419,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/OuterBoolean.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/OuterBoolean.java new file mode 100644 index 00000000000..2710300f712 --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/OuterBoolean.java @@ -0,0 +1,78 @@ +/* + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.model; + + +import java.util.Objects; + + + + + +import javax.validation.constraints.*; + + + + +/** + * OuterBoolean + */ + +public class OuterBoolean { + + + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return Objects.hash(); + } + + + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterBoolean {\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(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + + + diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/OuterComposite.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/OuterComposite.java index c144ee99521..97f0e707810 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/OuterComposite.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/OuterComposite.java @@ -13,84 +13,171 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; + + + import javax.validation.constraints.*; + + + /** * OuterComposite */ public class OuterComposite { + + + + @JsonProperty("my_number") + + + + private BigDecimal myNumber = null; + + + + + @JsonProperty("my_string") + + + + private String myString = null; + + + + + @JsonProperty("my_boolean") + + + + private Boolean myBoolean = null; + + + + public OuterComposite myNumber(BigDecimal myNumber) { this.myNumber = myNumber; return this; } + + + /** + + * Get myNumber + + + * @return myNumber **/ + + @JsonProperty("my_number") + @ApiModelProperty(value = "") + public BigDecimal getMyNumber() { return myNumber; } + public void setMyNumber(BigDecimal myNumber) { this.myNumber = myNumber; } + + + public OuterComposite myString(String myString) { this.myString = myString; return this; } + + + /** + + * Get myString + + + * @return myString **/ + + @JsonProperty("my_string") + @ApiModelProperty(value = "") + public String getMyString() { return myString; } + public void setMyString(String myString) { this.myString = myString; } + + + public OuterComposite myBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; return this; } + + + /** + + * Get myBoolean + + + * @return myBoolean **/ + + @JsonProperty("my_boolean") + @ApiModelProperty(value = "") + public Boolean getMyBoolean() { return myBoolean; } + public void setMyBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; } + + + @Override @@ -113,6 +200,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -137,3 +226,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/OuterEnum.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/OuterEnum.java index 6740674b07c..51728f9ba9f 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/OuterEnum.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/OuterEnum.java @@ -13,22 +13,36 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonValue; + + + import javax.validation.constraints.*; + + + + import com.fasterxml.jackson.annotation.JsonCreator; + /** * Gets or Sets OuterEnum */ public enum OuterEnum { + + PLACED("placed"), APPROVED("approved"), DELIVERED("delivered"); + private String value; @@ -41,6 +55,7 @@ public String toString() { return String.valueOf(value); } + @JsonCreator public static OuterEnum fromValue(String text) { for (OuterEnum b : OuterEnum.values()) { @@ -50,5 +65,8 @@ public static OuterEnum fromValue(String text) { } return null; } + } + + diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/OuterNumber.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/OuterNumber.java new file mode 100644 index 00000000000..245ff1651de --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/OuterNumber.java @@ -0,0 +1,78 @@ +/* + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.model; + + +import java.util.Objects; + + + + + +import javax.validation.constraints.*; + + + + +/** + * OuterNumber + */ + +public class OuterNumber { + + + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return Objects.hash(); + } + + + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterNumber {\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(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + + + diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/OuterString.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/OuterString.java new file mode 100644 index 00000000000..fa548ab0e00 --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/OuterString.java @@ -0,0 +1,78 @@ +/* + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.model; + + +import java.util.Objects; + + + + + +import javax.validation.constraints.*; + + + + +/** + * OuterString + */ + +public class OuterString { + + + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return Objects.hash(); + } + + + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterString {\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(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + + + diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Pet.java index 04480639f0f..402ac868b12 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Pet.java @@ -13,7 +13,10 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,37 +26,100 @@ import io.swagger.model.Tag; import java.util.ArrayList; import java.util.List; + + + import javax.validation.constraints.*; + + + /** * Pet */ public class Pet { + + + + @JsonProperty("id") + + + + private Long id = null; + + + + + @JsonProperty("category") + + + + private Category category = null; + + + + + @JsonProperty("name") + + + + private String name = null; + + + + + @JsonProperty("photoUrls") + + + private List photoUrls = new ArrayList(); + + + + + + @JsonProperty("tags") + + + private List tags = null; + + + + + /** * pet status in the store */ public enum StatusEnum { + + + + AVAILABLE("available"), + PENDING("pending"), + SOLD("sold"); + + + private String value; @@ -78,137 +144,252 @@ public static StatusEnum fromValue(String text) { } } + + + + @JsonProperty("status") + + + + private StatusEnum status = null; + + + + public Pet id(Long id) { this.id = id; return this; } + + + /** + + * Get id + + + * @return id **/ + + @JsonProperty("id") + @ApiModelProperty(value = "") + public Long getId() { return id; } + public void setId(Long id) { this.id = id; } + + + public Pet category(Category category) { this.category = category; return this; } + + + /** + + * Get category + + + * @return category **/ + + @JsonProperty("category") + @ApiModelProperty(value = "") + public Category getCategory() { return category; } + public void setCategory(Category category) { this.category = category; } + + + public Pet name(String name) { this.name = name; return this; } + + + /** + + * Get name + + + * @return name **/ + + @JsonProperty("name") + @ApiModelProperty(example = "doggie", required = true, value = "") + @NotNull + public String getName() { return name; } + public void setName(String name) { this.name = name; } + + + public Pet photoUrls(List photoUrls) { this.photoUrls = photoUrls; return this; } + public Pet addPhotoUrlsItem(String photoUrlsItem) { + this.photoUrls.add(photoUrlsItem); return this; } + + + /** + + * Get photoUrls + + + * @return photoUrls **/ + + @JsonProperty("photoUrls") + @ApiModelProperty(required = true, value = "") + @NotNull + public List getPhotoUrls() { return photoUrls; } + public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } + + + public Pet tags(List tags) { this.tags = tags; return this; } + public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { this.tags = new ArrayList(); } + this.tags.add(tagsItem); return this; } + + + /** + + * Get tags + + + * @return tags **/ + + @JsonProperty("tags") + @ApiModelProperty(value = "") + public List getTags() { return tags; } + public void setTags(List tags) { this.tags = tags; } + + + public Pet status(StatusEnum status) { this.status = status; return this; } + + + /** + * pet status in the store + + + + * @return status **/ + + @JsonProperty("status") + @ApiModelProperty(value = "pet status in the store") + public StatusEnum getStatus() { return status; } + public void setStatus(StatusEnum status) { this.status = status; } + + + @Override @@ -234,6 +415,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -261,3 +444,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ReadOnlyFirst.java index 5d26b4199f8..c139fe90bc0 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ReadOnlyFirst.java @@ -13,52 +13,123 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + + + import javax.validation.constraints.*; + + + /** * ReadOnlyFirst */ public class ReadOnlyFirst { + + + + @JsonProperty("bar") + + + + private String bar = null; + + + + + @JsonProperty("baz") + + + + private String baz = null; + + + + + public ReadOnlyFirst bar(String bar) { + this.bar = bar; + return this; + } + + + + /** + + * Get bar + + + * @return bar **/ + + @JsonProperty("bar") + @ApiModelProperty(value = "") + public String getBar() { return bar; } + + + public void setBar(String bar) { + this.bar = bar; + } + + + public ReadOnlyFirst baz(String baz) { this.baz = baz; return this; } + + + /** + + * Get baz + + + * @return baz **/ + + @JsonProperty("baz") + @ApiModelProperty(value = "") + public String getBaz() { return baz; } + public void setBaz(String baz) { this.baz = baz; } + + + @Override @@ -80,6 +151,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -103,3 +176,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/SpecialModelName.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/SpecialModelName.java index df3182fbd80..4fafb75f408 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/SpecialModelName.java @@ -13,39 +13,76 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + + + import javax.validation.constraints.*; + + + /** * SpecialModelName */ public class SpecialModelName { + + + + @JsonProperty("$special[property.name]") - private Long specialPropertyName = null; + + + + + private Long $specialPropertyName = null; + - public SpecialModelName specialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + + + + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; return this; } + + + /** - * Get specialPropertyName - * @return specialPropertyName + + + * Get $specialPropertyName + + + + * @return $specialPropertyName **/ + + @JsonProperty("$special[property.name]") + @ApiModelProperty(value = "") - public Long getSpecialPropertyName() { - return specialPropertyName; + + public Long get$SpecialPropertyName() { + return $specialPropertyName; } + - public void setSpecialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + public void set$SpecialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; } + + + @Override @@ -56,22 +93,24 @@ public boolean equals(java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName specialModelName = (SpecialModelName) o; - return Objects.equals(this.specialPropertyName, specialModelName.specialPropertyName); + SpecialModelName $specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); } @Override public int hashCode() { - return Objects.hash(specialPropertyName); + return Objects.hash($specialPropertyName); } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class SpecialModelName {\n"); - sb.append(" specialPropertyName: ").append(toIndentedString(specialPropertyName)).append("\n"); + sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n"); sb.append("}"); return sb.toString(); } @@ -88,3 +127,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Tag.java index a86f54144f8..1fffba9994d 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Tag.java @@ -13,61 +13,123 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + + + import javax.validation.constraints.*; + + + /** * Tag */ public class Tag { + + + + @JsonProperty("id") + + + + private Long id = null; + + + + + @JsonProperty("name") + + + + private String name = null; + + + + public Tag id(Long id) { this.id = id; return this; } + + + /** + + * Get id + + + * @return id **/ + + @JsonProperty("id") + @ApiModelProperty(value = "") + public Long getId() { return id; } + public void setId(Long id) { this.id = id; } + + + public Tag name(String name) { this.name = name; return this; } + + + /** + + * Get name + + + * @return name **/ + + @JsonProperty("name") + @ApiModelProperty(value = "") + public String getName() { return name; } + public void setName(String name) { this.name = name; } + + + @Override @@ -89,6 +151,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -112,3 +176,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/User.java index 0c1b67c0d5b..ffab5e5eb2a 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/User.java @@ -13,193 +13,405 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + + + import javax.validation.constraints.*; + + + /** * User */ public class User { + + + + @JsonProperty("id") + + + + private Long id = null; + + + + + @JsonProperty("username") + + + + private String username = null; + + + + + @JsonProperty("firstName") + + + + private String firstName = null; + + + + + @JsonProperty("lastName") + + + + private String lastName = null; + + + + + @JsonProperty("email") + + + + private String email = null; + + + + + @JsonProperty("password") + + + + private String password = null; + + + + + @JsonProperty("phone") + + + + private String phone = null; + + + + + @JsonProperty("userStatus") + + + + private Integer userStatus = null; + + + + public User id(Long id) { this.id = id; return this; } + + + /** + + * Get id + + + * @return id **/ + + @JsonProperty("id") + @ApiModelProperty(value = "") + public Long getId() { return id; } + public void setId(Long id) { this.id = id; } + + + public User username(String username) { this.username = username; return this; } + + + /** + + * Get username + + + * @return username **/ + + @JsonProperty("username") + @ApiModelProperty(value = "") + public String getUsername() { return username; } + public void setUsername(String username) { this.username = username; } + + + public User firstName(String firstName) { this.firstName = firstName; return this; } + + + /** + + * Get firstName + + + * @return firstName **/ + + @JsonProperty("firstName") + @ApiModelProperty(value = "") + public String getFirstName() { return firstName; } + public void setFirstName(String firstName) { this.firstName = firstName; } + + + public User lastName(String lastName) { this.lastName = lastName; return this; } + + + /** + + * Get lastName + + + * @return lastName **/ + + @JsonProperty("lastName") + @ApiModelProperty(value = "") + public String getLastName() { return lastName; } + public void setLastName(String lastName) { this.lastName = lastName; } + + + public User email(String email) { this.email = email; return this; } + + + /** + + * Get email + + + * @return email **/ + + @JsonProperty("email") + @ApiModelProperty(value = "") + public String getEmail() { return email; } + public void setEmail(String email) { this.email = email; } + + + public User password(String password) { this.password = password; return this; } + + + /** + + * Get password + + + * @return password **/ + + @JsonProperty("password") + @ApiModelProperty(value = "") + public String getPassword() { return password; } + public void setPassword(String password) { this.password = password; } + + + public User phone(String phone) { this.phone = phone; return this; } + + + /** + + * Get phone + + + * @return phone **/ + + @JsonProperty("phone") + @ApiModelProperty(value = "") + public String getPhone() { return phone; } + public void setPhone(String phone) { this.phone = phone; } + + + public User userStatus(Integer userStatus) { this.userStatus = userStatus; return this; } + + + /** + * User Status + + + + * @return userStatus **/ + + @JsonProperty("userStatus") + @ApiModelProperty(value = "User Status") + public Integer getUserStatus() { return userStatus; } + public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } + + + @Override @@ -227,6 +439,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -256,3 +470,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey1/src/main/java/io/swagger/api/impl/AnotherFakeApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey1/src/main/java/io/swagger/api/impl/AnotherFakeApiServiceImpl.java index 072d33568d4..dc1ec63474d 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/main/java/io/swagger/api/impl/AnotherFakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey1/src/main/java/io/swagger/api/impl/AnotherFakeApiServiceImpl.java @@ -7,6 +7,8 @@ import io.swagger.model.Client; + +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -17,13 +19,19 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; + import javax.validation.constraints.*; + + public class AnotherFakeApiServiceImpl extends AnotherFakeApiService { + @Override - public Response testSpecialTags(Client body, SecurityContext securityContext) + public Response testSpecialTags(Client client, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + } + diff --git a/samples/server/petstore/jaxrs/jersey1/src/main/java/io/swagger/api/impl/FakeApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey1/src/main/java/io/swagger/api/impl/FakeApiServiceImpl.java index 4cae4c62be5..e72bf6418df 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/main/java/io/swagger/api/impl/FakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey1/src/main/java/io/swagger/api/impl/FakeApiServiceImpl.java @@ -7,9 +7,10 @@ import java.math.BigDecimal; import io.swagger.model.Client; -import java.util.Date; import io.swagger.model.OuterComposite; + +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -20,61 +21,75 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; + import javax.validation.constraints.*; + + public class FakeApiServiceImpl extends FakeApiService { + @Override public Response fakeOuterBooleanSerialize(Boolean body, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + @Override - public Response fakeOuterCompositeSerialize(OuterComposite body, SecurityContext securityContext) + public Response fakeOuterCompositeSerialize(OuterComposite outercomposite, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + @Override public Response fakeOuterNumberSerialize(BigDecimal body, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + @Override public Response fakeOuterStringSerialize(String body, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + @Override - public Response testClientModel(Client body, SecurityContext securityContext) + public Response testClientModel(Client client, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + @Override - public Response testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, Date date, Date dateTime, String password, String paramCallback, SecurityContext securityContext) + public Response testEndpointParameters(Object body, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + @Override - public Response testEnumParameters(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, SecurityContext securityContext) + public Response testEnumParameters(Object body, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + @Override - public Response testInlineAdditionalProperties(Object param, SecurityContext securityContext) + public Response testInlineAdditionalProperties(Map body, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + @Override - public Response testJsonFormData(String param, String param2, SecurityContext securityContext) + public Response testJsonFormData(Object 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/jersey1/src/main/java/io/swagger/api/impl/FakeClassnameTestApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey1/src/main/java/io/swagger/api/impl/FakeClassnameTestApiServiceImpl.java index 071dbe62e15..7c5b15433ab 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/main/java/io/swagger/api/impl/FakeClassnameTestApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey1/src/main/java/io/swagger/api/impl/FakeClassnameTestApiServiceImpl.java @@ -7,6 +7,8 @@ import io.swagger.model.Client; + +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -17,13 +19,19 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; + import javax.validation.constraints.*; + + public class FakeClassnameTestApiServiceImpl extends FakeClassnameTestApiService { + @Override - public Response testClassname(Client body, SecurityContext securityContext) + public Response testClassname(Client client, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + } + diff --git a/samples/server/petstore/jaxrs/jersey1/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey1/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java index 4ca20a47727..9516b877ef0 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey1/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java @@ -5,10 +5,11 @@ import com.sun.jersey.multipart.FormDataParam; -import java.io.File; import io.swagger.model.ModelApiResponse; import io.swagger.model.Pet; + +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -19,55 +20,68 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; + import javax.validation.constraints.*; + + public class PetApiServiceImpl extends PetApiService { + @Override - public Response addPet(Pet body, SecurityContext securityContext) + public Response addPet(Pet pet, 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) + public Response deletePet(Integer petId, String apiKey, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + @Override public Response findPetsByStatus( @NotNull List status, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + @Override public Response findPetsByTags( @NotNull 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) + public Response getPetById(Integer 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) + public Response updatePet(Pet pet, 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) + public Response updatePetWithForm(Integer petId, Object body, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + @Override - public Response uploadFile(Long petId, String additionalMetadata, InputStream fileInputStream, FormDataContentDisposition fileDetail, SecurityContext securityContext) + public Response uploadFile(Integer petId, Object 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/jersey1/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey1/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java index 96194fb16b8..1ddf0dca6c5 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey1/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java @@ -8,6 +8,8 @@ import java.util.Map; import io.swagger.model.Order; + +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -18,31 +20,40 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; + import javax.validation.constraints.*; + + 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( @Min(1) @Max(5)Long orderId, SecurityContext securityContext) + public Response getOrderById( @DecimalMin("1") @DecimalMax("5")Integer 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) + public Response placeOrder(Order order, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + } + diff --git a/samples/server/petstore/jaxrs/jersey1/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey1/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java index ca562ed389c..1f9404d0645 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey1/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java @@ -5,9 +5,10 @@ import com.sun.jersey.multipart.FormDataParam; -import java.util.List; import io.swagger.model.User; + +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -18,55 +19,68 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; + import javax.validation.constraints.*; + + public class UserApiServiceImpl extends UserApiService { + @Override - public Response createUser(User body, SecurityContext securityContext) + public Response createUser(User user, 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( @NotNull String username, @NotNull 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) + public Response updateUser(User user, String username, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + } + diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/.swagger-codegen/VERSION b/samples/server/petstore/jaxrs/jersey2-useTags/.swagger-codegen/VERSION index f9f7450d135..096bf47efe3 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/.swagger-codegen/VERSION +++ b/samples/server/petstore/jaxrs/jersey2-useTags/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.0-SNAPSHOT \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/pom.xml b/samples/server/petstore/jaxrs/jersey2-useTags/pom.xml index e148200aaca..3a3d266dad3 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/pom.xml +++ b/samples/server/petstore/jaxrs/jersey2-useTags/pom.xml @@ -51,6 +51,15 @@ 60000 + + + + javax.validation + validation-api + ${beanvalidation-version} + + + start-jetty @@ -133,11 +142,14 @@ jersey-media-multipart ${jersey2-version} + + - com.fasterxml.jackson.datatype - jackson-datatype-joda - ${jackson-version} + com.fasterxml.jackson.datatype + jackson-datatype-joda + ${jackson-version} + com.fasterxml.jackson.jaxrs jackson-jaxrs-json-provider @@ -151,14 +163,17 @@ + + javax.validation validation-api - 1.1.0.Final + ${beanvalidation-version} provided + @@ -173,13 +188,17 @@ 1.7 ${java.version} ${java.version} - 1.5.15 + 1.5.18 9.2.9.v20150224 2.22.2 2.8.9 + 4.12 1.1.7 2.5 + + 1.1.0.Final + UTF-8 diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/AnotherFakeApi.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/AnotherFakeApi.java index a671d04db60..131d9200cca 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/AnotherFakeApi.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/AnotherFakeApi.java @@ -9,6 +9,7 @@ import io.swagger.model.Client; + import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -23,13 +24,16 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; import javax.ws.rs.*; + import javax.validation.constraints.*; + @Path("/AnotherFake") @io.swagger.annotations.Api(description = "the AnotherFake API") + public class AnotherFakeApi { private final AnotherFakeApiService delegate; @@ -54,6 +58,7 @@ public AnotherFakeApi(@Context ServletConfig servletContext) { this.delegate = delegate; } + @PATCH @Consumes({ "application/json" }) @@ -61,9 +66,11 @@ public AnotherFakeApi(@Context ServletConfig servletContext) { @io.swagger.annotations.ApiOperation(value = "To test special tags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - public Response testSpecialTags(@ApiParam(value = "client model" ,required=true) Client body + public Response testSpecialTags(@ApiParam(value = "client model" ,required=true) Client client ,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.testSpecialTags(body,securityContext); + return delegate.testSpecialTags(client,securityContext); } + } + diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/AnotherFakeApiService.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/AnotherFakeApiService.java index ca43c203e82..3849fe160d7 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/AnotherFakeApiService.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/AnotherFakeApiService.java @@ -7,6 +7,8 @@ import io.swagger.model.Client; + +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -14,8 +16,14 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; + import javax.validation.constraints.*; + + public abstract class AnotherFakeApiService { - public abstract Response testSpecialTags(Client body,SecurityContext securityContext) throws NotFoundException; + + public abstract Response testSpecialTags(Client client,SecurityContext securityContext) throws NotFoundException; + } + diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/FakeApi.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/FakeApi.java index 06e1622f8b6..1d5b6e18188 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/FakeApi.java @@ -9,9 +9,9 @@ import java.math.BigDecimal; import io.swagger.model.Client; -import java.util.Date; import io.swagger.model.OuterComposite; + import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -26,13 +26,16 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; import javax.ws.rs.*; + import javax.validation.constraints.*; + @Path("/Fake") @io.swagger.annotations.Api(description = "the Fake API") + public class FakeApi { private final FakeApiService delegate; @@ -57,10 +60,11 @@ public FakeApi(@Context ServletConfig servletContext) { this.delegate = delegate; } + @POST - - + @Consumes({ "*/*" }) + @Produces({ "*/*" }) @io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) @@ -69,22 +73,24 @@ public Response fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as po throws NotFoundException { return delegate.fakeOuterBooleanSerialize(body,securityContext); } + @POST - - + @Consumes({ "*/*" }) + @Produces({ "*/*" }) @io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) - public Response fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) OuterComposite body + public Response fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) OuterComposite outercomposite ,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.fakeOuterCompositeSerialize(body,securityContext); + return delegate.fakeOuterCompositeSerialize(outercomposite,securityContext); } + @POST - - + @Consumes({ "*/*" }) + @Produces({ "*/*" }) @io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) @@ -93,10 +99,11 @@ public Response fakeOuterNumberSerialize(@ApiParam(value = "Input number as post throws NotFoundException { return delegate.fakeOuterNumberSerialize(body,securityContext); } + @POST - - + @Consumes({ "*/*" }) + @Produces({ "*/*" }) @io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "Output string", response = String.class) }) @@ -105,6 +112,7 @@ public Response fakeOuterStringSerialize(@ApiParam(value = "Input string as post throws NotFoundException { return delegate.fakeOuterStringSerialize(body,securityContext); } + @PATCH @Consumes({ "application/json" }) @@ -112,61 +120,60 @@ public Response fakeOuterStringSerialize(@ApiParam(value = "Input string as post @io.swagger.annotations.ApiOperation(value = "To test \"client\" model", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - public Response testClientModel(@ApiParam(value = "client model" ,required=true) Client body + public Response testClientModel(@ApiParam(value = "client model" ,required=true) Client client ,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.testClientModel(body,securityContext); + return delegate.testClientModel(client,securityContext); } + @POST @Consumes({ "application/xml; charset=utf-8", "application/json; charset=utf-8" }) - @Produces({ "application/xml; charset=utf-8", "application/json; charset=utf-8" }) - @io.swagger.annotations.ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = Void.class, authorizations = { - @io.swagger.annotations.Authorization(value = "http_basic_test") - }, tags={ "fake", }) + + @io.swagger.annotations.ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = Void.class, tags={ "fake", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) - public Response testEndpointParameters(@ApiParam(value = "None", required=true) @FormParam("number") BigDecimal number -,@ApiParam(value = "None", required=true) @FormParam("double") Double _double -,@ApiParam(value = "None", required=true) @FormParam("pattern_without_delimiter") String patternWithoutDelimiter -,@ApiParam(value = "None", required=true) @FormParam("byte") byte[] _byte -,@ApiParam(value = "None") @FormParam("integer") Integer integer -,@ApiParam(value = "None") @FormParam("int32") Integer int32 -,@ApiParam(value = "None") @FormParam("int64") Long int64 -,@ApiParam(value = "None") @FormParam("float") Float _float -,@ApiParam(value = "None") @FormParam("string") String string -,@ApiParam(value = "None") @FormParam("binary") byte[] binary -,@ApiParam(value = "None") @FormParam("date") Date date -,@ApiParam(value = "None") @FormParam("dateTime") Date dateTime -,@ApiParam(value = "None") @FormParam("password") String password -,@ApiParam(value = "None") @FormParam("callback") String paramCallback + public Response testEndpointParameters(@ApiParam(value = "" ,required=true) Object body ,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.testEndpointParameters(number,_double,patternWithoutDelimiter,_byte,integer,int32,int64,_float,string,binary,date,dateTime,password,paramCallback,securityContext); + return delegate.testEndpointParameters(body,securityContext); } + @GET @Consumes({ "*/*" }) - @Produces({ "*/*" }) + @io.swagger.annotations.ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", response = Void.class, tags={ "fake", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid request", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "Not found", response = Void.class) }) - public Response testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $") @FormParam("enum_form_string_array") List enumFormStringArray -,@ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @DefaultValue("-efg") @FormParam("enum_form_string") String enumFormString -,@ApiParam(value = "Header parameter enum test (string array)" , allowableValues=">, $")@HeaderParam("enum_header_string_array") List enumHeaderStringArray -,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_abc, -efg, (xyz)", defaultValue="-efg")@HeaderParam("enum_header_string") String enumHeaderString -,@ApiParam(value = "Query parameter enum test (string array)", allowableValues=">, $") @QueryParam("enum_query_string_array") List enumQueryStringArray -,@ApiParam(value = "Query parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @DefaultValue("-efg") @QueryParam("enum_query_string") String enumQueryString -,@ApiParam(value = "Query parameter enum test (double)", allowableValues="1, -2") @QueryParam("enum_query_integer") Integer enumQueryInteger -,@ApiParam(value = "Query parameter enum test (double)", allowableValues="1.1, -1.2") @FormParam("enum_query_double") Double enumQueryDouble + public Response testEnumParameters(@ApiParam(value = "" ) Object body +,@ApiParam(value = "Header parameter enum test (string array)" , allowableValues="range=[-infinity, infinity]")@HeaderParam("enum_header_string_array") List enumHeaderStringArray +,@ApiParam(value = "Header parameter enum test (string)" )@HeaderParam("enum_header_string") String enumHeaderString +,@ApiParam(value = "Query parameter enum test (string array)", allowableValues="range=[-infinity, infinity]") @QueryParam("enum_query_string_array") List enumQueryStringArray +,@ApiParam(value = "Query parameter enum test (string)") @QueryParam("enum_query_string") String enumQueryString +,@ApiParam(value = "Query parameter enum test (double)") @QueryParam("enum_query_integer") Integer enumQueryInteger ,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.testEnumParameters(enumFormStringArray,enumFormString,enumHeaderStringArray,enumHeaderString,enumQueryStringArray,enumQueryString,enumQueryInteger,enumQueryDouble,securityContext); + return delegate.testEnumParameters(body,enumHeaderStringArray,enumHeaderString,enumQueryStringArray,enumQueryString,enumQueryInteger,securityContext); } + + @POST + + @Consumes({ "application/json" }) + + @io.swagger.annotations.ApiOperation(value = "test inline additionalProperties", notes = "", response = Void.class, tags={ "fake", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + public Response testInlineAdditionalProperties(@ApiParam(value = "request body" ,required=true) Map body +,@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.testInlineAdditionalProperties(body,securityContext); + } + @GET @Consumes({ "application/json" }) @@ -174,10 +181,11 @@ public Response testEnumParameters(@ApiParam(value = "Form parameter enum test ( @io.swagger.annotations.ApiOperation(value = "test json serialization of form data", notes = "", response = Void.class, tags={ "fake", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - public Response testJsonFormData(@ApiParam(value = "field1", required=true) @FormParam("param") String param -,@ApiParam(value = "field2", required=true) @FormParam("param2") String param2 + public Response testJsonFormData(@ApiParam(value = "" ,required=true) Object body ,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.testJsonFormData(param,param2,securityContext); + return delegate.testJsonFormData(body,securityContext); } + } + diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/FakeApiService.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/FakeApiService.java index 71148802573..9d94f0a1c50 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/FakeApiService.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/FakeApiService.java @@ -7,9 +7,10 @@ import java.math.BigDecimal; import io.swagger.model.Client; -import java.util.Date; import io.swagger.model.OuterComposite; + +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -17,15 +18,30 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; + import javax.validation.constraints.*; + + public abstract class FakeApiService { + public abstract Response fakeOuterBooleanSerialize(Boolean body,SecurityContext securityContext) throws NotFoundException; - public abstract Response fakeOuterCompositeSerialize(OuterComposite body,SecurityContext securityContext) throws NotFoundException; + + public abstract Response fakeOuterCompositeSerialize(OuterComposite outercomposite,SecurityContext securityContext) throws NotFoundException; + public abstract Response fakeOuterNumberSerialize(BigDecimal body,SecurityContext securityContext) throws NotFoundException; + public abstract Response fakeOuterStringSerialize(String body,SecurityContext securityContext) throws NotFoundException; - public abstract Response testClientModel(Client body,SecurityContext securityContext) throws NotFoundException; - public abstract Response testEndpointParameters(BigDecimal number,Double _double,String patternWithoutDelimiter,byte[] _byte,Integer integer,Integer int32,Long int64,Float _float,String string,byte[] binary,Date date,Date dateTime,String password,String paramCallback,SecurityContext securityContext) throws NotFoundException; - public abstract Response testEnumParameters(List enumFormStringArray,String enumFormString,List enumHeaderStringArray,String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger,Double enumQueryDouble,SecurityContext securityContext) throws NotFoundException; - public abstract Response testJsonFormData(String param,String param2,SecurityContext securityContext) throws NotFoundException; + + public abstract Response testClientModel(Client client,SecurityContext securityContext) throws NotFoundException; + + public abstract Response testEndpointParameters(Object body,SecurityContext securityContext) throws NotFoundException; + + public abstract Response testEnumParameters(Object body,List enumHeaderStringArray,String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger,SecurityContext securityContext) throws NotFoundException; + + public abstract Response testInlineAdditionalProperties(Map body,SecurityContext securityContext) throws NotFoundException; + + public abstract Response testJsonFormData(Object body,SecurityContext securityContext) throws NotFoundException; + } + diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/FakeClassnameTags123Api.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/FakeClassnameTags123Api.java index 9a71d18cc0d..6a42bc8e413 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/FakeClassnameTags123Api.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/FakeClassnameTags123Api.java @@ -9,6 +9,7 @@ import io.swagger.model.Client; + import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -23,13 +24,16 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; import javax.ws.rs.*; + import javax.validation.constraints.*; + @Path("/FakeClassnameTags123") @io.swagger.annotations.Api(description = "the FakeClassnameTags123 API") + public class FakeClassnameTags123Api { private final FakeClassnameTags123ApiService delegate; @@ -54,18 +58,19 @@ public FakeClassnameTags123Api(@Context ServletConfig servletContext) { this.delegate = delegate; } + @PATCH @Consumes({ "application/json" }) @Produces({ "application/json" }) - @io.swagger.annotations.ApiOperation(value = "To test class name in snake case", notes = "", response = Client.class, authorizations = { - @io.swagger.annotations.Authorization(value = "api_key_query") - }, tags={ "fake_classname_tags 123#$%^", }) + @io.swagger.annotations.ApiOperation(value = "To test class name in snake case", notes = "", response = Client.class, tags={ "fake_classname_tags 123#$%^", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - public Response testClassname(@ApiParam(value = "client model" ,required=true) Client body + public Response testClassname(@ApiParam(value = "client model" ,required=true) Client client ,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.testClassname(body,securityContext); + return delegate.testClassname(client,securityContext); } + } + diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/FakeClassnameTags123ApiService.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/FakeClassnameTags123ApiService.java index 65e819f60e2..2173cfc69b0 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/FakeClassnameTags123ApiService.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/FakeClassnameTags123ApiService.java @@ -7,6 +7,8 @@ import io.swagger.model.Client; + +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -14,8 +16,14 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; + import javax.validation.constraints.*; + + public abstract class FakeClassnameTags123ApiService { - public abstract Response testClassname(Client body,SecurityContext securityContext) throws NotFoundException; + + public abstract Response testClassname(Client client,SecurityContext securityContext) throws NotFoundException; + } + diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/JacksonJsonProvider.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/JacksonJsonProvider.java index 60aa6ad1718..484860e63b0 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/JacksonJsonProvider.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/JacksonJsonProvider.java @@ -4,8 +4,11 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; + + import com.fasterxml.jackson.datatype.joda.*; + import com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider; import javax.ws.rs.Produces; @@ -21,7 +24,10 @@ public JacksonJsonProvider() { ObjectMapper objectMapper = new ObjectMapper() .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) + + .registerModule(new JodaModule()) + .setDateFormat(new RFC3339DateFormat()); setMapper(objectMapper); diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/PetApi.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/PetApi.java index 5c84144601e..e006384f953 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/PetApi.java @@ -7,10 +7,10 @@ import io.swagger.annotations.ApiParam; import io.swagger.jaxrs.*; -import java.io.File; import io.swagger.model.ModelApiResponse; import io.swagger.model.Pet; + import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -25,13 +25,16 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; import javax.ws.rs.*; + import javax.validation.constraints.*; + @Path("/Pet") @io.swagger.annotations.Api(description = "the Pet API") + public class PetApi { private final PetApiService delegate; @@ -56,70 +59,54 @@ public PetApi(@Context ServletConfig servletContext) { this.delegate = delegate; } + @POST @Consumes({ "application/json", "application/xml" }) - @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Add a new pet to the store", notes = "", response = Void.class, authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + + @io.swagger.annotations.ApiOperation(value = "Add a new pet to the store", notes = "", response = Void.class, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) - public Response addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet body + public Response addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet pet ,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.addPet(body,securityContext); + return delegate.addPet(pet,securityContext); } + @DELETE - @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + + @io.swagger.annotations.ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) - public Response deletePet(@ApiParam(value = "Pet id to delete",required=true) @PathParam("petId") Long petId + public Response deletePet(@ApiParam(value = "Pet id to delete",required=true) @PathParam("petId") Integer petId ,@ApiParam(value = "" )@HeaderParam("api_key") String apiKey ,@Context SecurityContext securityContext) throws NotFoundException { return delegate.deletePet(petId,apiKey,securityContext); } + @GET @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + @io.swagger.annotations.ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid status value", response = Void.class) }) - public Response findPetsByStatus(@ApiParam(value = "Status values that need to be considered for filter",required=true, allowableValues="available, pending, sold") @QueryParam("status") List status + public Response findPetsByStatus(@ApiParam(value = "Status values that need to be considered for filter",required=true, allowableValues="range=[-infinity, infinity]") @QueryParam("status") List status ,@Context SecurityContext securityContext) throws NotFoundException { return delegate.findPetsByStatus(status,securityContext); } + @GET @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + @io.swagger.annotations.ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @@ -129,83 +116,68 @@ public Response findPetsByTags(@ApiParam(value = "Tags to filter by",required=tr throws NotFoundException { return delegate.findPetsByTags(tags,securityContext); } + @GET @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = { - @io.swagger.annotations.Authorization(value = "api_key") - }, tags={ "pet", }) + @io.swagger.annotations.ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class) }) - public Response getPetById(@ApiParam(value = "ID of pet to return",required=true) @PathParam("petId") Long petId + public Response getPetById(@ApiParam(value = "ID of pet to return",required=true) @PathParam("petId") Integer petId ,@Context SecurityContext securityContext) throws NotFoundException { return delegate.getPetById(petId,securityContext); } + @PUT @Consumes({ "application/json", "application/xml" }) - @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + + @io.swagger.annotations.ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class), @io.swagger.annotations.ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) - public Response updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet body + public Response updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet pet ,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.updatePet(body,securityContext); + return delegate.updatePet(pet,securityContext); } + @POST @Consumes({ "application/x-www-form-urlencoded" }) - @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + + @io.swagger.annotations.ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) - public Response updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true) @PathParam("petId") Long petId -,@ApiParam(value = "Updated name of the pet") @FormParam("name") String name -,@ApiParam(value = "Updated status of the pet") @FormParam("status") String status + public Response updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true) @PathParam("petId") Integer petId +,@ApiParam(value = "" ) Object body ,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.updatePetWithForm(petId,name,status,securityContext); + return delegate.updatePetWithForm(petId,body,securityContext); } + @POST @Consumes({ "multipart/form-data" }) @Produces({ "application/json" }) - @io.swagger.annotations.ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + @io.swagger.annotations.ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - public Response uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathParam("petId") Long petId -,@ApiParam(value = "Additional data to pass to server")@FormDataParam("additionalMetadata") String additionalMetadata -, - @FormDataParam("file") InputStream fileInputStream, - @FormDataParam("file") FormDataContentDisposition fileDetail + public Response uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathParam("petId") Integer petId +,@ApiParam(value = "" ) Object body ,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.uploadFile(petId,additionalMetadata,fileInputStream, fileDetail,securityContext); + return delegate.uploadFile(petId,body,securityContext); } + } + diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/PetApiService.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/PetApiService.java index 31566759c5f..fb7665f68db 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/PetApiService.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/PetApiService.java @@ -5,10 +5,11 @@ import org.glassfish.jersey.media.multipart.FormDataContentDisposition; -import java.io.File; import io.swagger.model.ModelApiResponse; import io.swagger.model.Pet; + +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -16,15 +17,28 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; + import javax.validation.constraints.*; + + 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 addPet(Pet pet,SecurityContext securityContext) throws NotFoundException; + + public abstract Response deletePet(Integer petId,String apiKey,SecurityContext securityContext) throws NotFoundException; + public abstract Response findPetsByStatus( @NotNull List status,SecurityContext securityContext) throws NotFoundException; + public abstract Response findPetsByTags( @NotNull 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(Long petId,String additionalMetadata,InputStream fileInputStream, FormDataContentDisposition fileDetail,SecurityContext securityContext) throws NotFoundException; + + public abstract Response getPetById(Integer petId,SecurityContext securityContext) throws NotFoundException; + + public abstract Response updatePet(Pet pet,SecurityContext securityContext) throws NotFoundException; + + public abstract Response updatePetWithForm(Integer petId,Object body,SecurityContext securityContext) throws NotFoundException; + + public abstract Response uploadFile(Integer petId,Object body,SecurityContext securityContext) throws NotFoundException; + } + diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/StoreApi.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/StoreApi.java index ff115214b86..3317d874f26 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/StoreApi.java @@ -10,6 +10,7 @@ import java.util.Map; import io.swagger.model.Order; + import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -24,13 +25,16 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; import javax.ws.rs.*; + import javax.validation.constraints.*; + @Path("/Store") @io.swagger.annotations.Api(description = "the Store API") + public class StoreApi { private final StoreApiService delegate; @@ -55,10 +59,11 @@ public StoreApi(@Context ServletConfig servletContext) { this.delegate = delegate; } + @DELETE - @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = Void.class, tags={ "store", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @@ -69,19 +74,19 @@ public Response deleteOrder(@ApiParam(value = "ID of the order that needs to be throws NotFoundException { return delegate.deleteOrder(orderId,securityContext); } + @GET @Produces({ "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { - @io.swagger.annotations.Authorization(value = "api_key") - }, tags={ "store", }) + @io.swagger.annotations.ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", tags={ "store", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) public Response getInventory(@Context SecurityContext securityContext) throws NotFoundException { return delegate.getInventory(securityContext); } + @GET @@ -93,23 +98,26 @@ public Response getInventory(@Context SecurityContext securityContext) @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Void.class) }) - public Response getOrderById(@ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathParam("order_id") Long orderId + public Response getOrderById(@ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathParam("order_id") Integer orderId ,@Context SecurityContext securityContext) throws NotFoundException { return delegate.getOrderById(orderId,securityContext); } + @POST - + @Consumes({ "*/*" }) @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid Order", response = Void.class) }) - public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true) Order body + public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true) Order order ,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.placeOrder(body,securityContext); + return delegate.placeOrder(order,securityContext); } + } + diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/StoreApiService.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/StoreApiService.java index 911c70033c4..59152f49fc0 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/StoreApiService.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/StoreApiService.java @@ -8,6 +8,8 @@ import java.util.Map; import io.swagger.model.Order; + +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -15,11 +17,20 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; + import javax.validation.constraints.*; + + 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( @Min(1) @Max(5)Long orderId,SecurityContext securityContext) throws NotFoundException; - public abstract Response placeOrder(Order body,SecurityContext securityContext) throws NotFoundException; + + public abstract Response getOrderById( @DecimalMin("1") @DecimalMax("5")Integer orderId,SecurityContext securityContext) throws NotFoundException; + + public abstract Response placeOrder(Order order,SecurityContext securityContext) throws NotFoundException; + } + diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/UserApi.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/UserApi.java index 371e6bb210c..10d079b2c33 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/UserApi.java @@ -7,9 +7,9 @@ import io.swagger.annotations.ApiParam; import io.swagger.jaxrs.*; -import java.util.List; import io.swagger.model.User; + import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -24,13 +24,16 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; import javax.ws.rs.*; + import javax.validation.constraints.*; + @Path("/User") @io.swagger.annotations.Api(description = "the User API") + public class UserApi { private final UserApiService delegate; @@ -55,22 +58,24 @@ public UserApi(@Context ServletConfig servletContext) { this.delegate = delegate; } + @POST + @Consumes({ "*/*" }) - @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - public Response createUser(@ApiParam(value = "Created user object" ,required=true) User body + public Response createUser(@ApiParam(value = "Created user object" ,required=true) User user ,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.createUser(body,securityContext); + return delegate.createUser(user,securityContext); } + @POST + @Consumes({ "*/*" }) - @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) @@ -79,10 +84,11 @@ public Response createUsersWithArrayInput(@ApiParam(value = "List of user object throws NotFoundException { return delegate.createUsersWithArrayInput(body,securityContext); } + @POST + @Consumes({ "*/*" }) - @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) @@ -91,10 +97,11 @@ public Response createUsersWithListInput(@ApiParam(value = "List of user object" throws NotFoundException { return delegate.createUsersWithListInput(body,securityContext); } + @DELETE - @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), @@ -105,6 +112,7 @@ public Response deleteUser(@ApiParam(value = "The name that needs to be deleted" throws NotFoundException { return delegate.deleteUser(username,securityContext); } + @GET @@ -121,6 +129,7 @@ public Response getUserByName(@ApiParam(value = "The name that needs to be fetch throws NotFoundException { return delegate.getUserByName(username,securityContext); } + @GET @@ -136,10 +145,11 @@ public Response loginUser(@ApiParam(value = "The user name for login",required=t throws NotFoundException { return delegate.loginUser(username,password,securityContext); } + @GET - @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) @@ -147,19 +157,22 @@ public Response logoutUser(@Context SecurityContext securityContext) throws NotFoundException { return delegate.logoutUser(securityContext); } + @PUT + @Consumes({ "*/*" }) - @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) - public Response updateUser(@ApiParam(value = "name that need to be deleted",required=true) @PathParam("username") String username -,@ApiParam(value = "Updated user object" ,required=true) User body + public Response updateUser(@ApiParam(value = "Updated user object" ,required=true) User user +,@ApiParam(value = "name that need to be deleted",required=true) @PathParam("username") String username ,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.updateUser(username,body,securityContext); + return delegate.updateUser(user,username,securityContext); } + } + diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/UserApiService.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/UserApiService.java index 8bbee3394d5..24fc51891c3 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/UserApiService.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/UserApiService.java @@ -5,9 +5,10 @@ import org.glassfish.jersey.media.multipart.FormDataContentDisposition; -import java.util.List; import io.swagger.model.User; + +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -15,15 +16,28 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; + import javax.validation.constraints.*; + + public abstract class UserApiService { - public abstract Response createUser(User body,SecurityContext securityContext) throws NotFoundException; + + public abstract Response createUser(User user,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( @NotNull String username, @NotNull 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; + + public abstract Response updateUser(User user,String username,SecurityContext securityContext) throws NotFoundException; + } + diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java index d2cbef7abb5..3f933b49554 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java @@ -13,7 +13,10 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; @@ -21,72 +24,137 @@ import java.util.HashMap; import java.util.List; import java.util.Map; + + + import javax.validation.constraints.*; + + + /** * AdditionalPropertiesClass */ public class AdditionalPropertiesClass { + + + + @JsonProperty("map_property") + + + private Map mapProperty = null; + + + + + + @JsonProperty("map_of_map_property") + + + private Map> mapOfMapProperty = null; + + + + + public AdditionalPropertiesClass mapProperty(Map mapProperty) { this.mapProperty = mapProperty; return this; } + + public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + if (this.mapProperty == null) { this.mapProperty = new HashMap(); } + this.mapProperty.put(key, mapPropertyItem); return this; } + + /** + + * Get mapProperty + + + * @return mapProperty **/ + + @JsonProperty("map_property") + @ApiModelProperty(value = "") + public Map getMapProperty() { return mapProperty; } + public void setMapProperty(Map mapProperty) { this.mapProperty = mapProperty; } + + + public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { this.mapOfMapProperty = mapOfMapProperty; return this; } + + public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + if (this.mapOfMapProperty == null) { this.mapOfMapProperty = new HashMap>(); } + this.mapOfMapProperty.put(key, mapOfMapPropertyItem); return this; } + + /** + + * Get mapOfMapProperty + + + * @return mapOfMapProperty **/ + + @JsonProperty("map_of_map_property") + @ApiModelProperty(value = "") + public Map> getMapOfMapProperty() { return mapOfMapProperty; } + public void setMapOfMapProperty(Map> mapOfMapProperty) { this.mapOfMapProperty = mapOfMapProperty; } + + + @Override @@ -108,6 +176,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -131,3 +201,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/Animal.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/Animal.java index 8f1fdfd45bb..95f65d55469 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/Animal.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/Animal.java @@ -13,64 +13,127 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + + + import javax.validation.constraints.*; + + + /** * Animal */ public class Animal { + + + + @JsonProperty("className") + + + + private String className = null; + + + + + @JsonProperty("color") + + + + private String color = "red"; + + + + public Animal className(String className) { this.className = className; return this; } + + + /** + + * Get className + + + * @return className **/ + + @JsonProperty("className") + @ApiModelProperty(required = true, value = "") + @NotNull + public String getClassName() { return className; } + public void setClassName(String className) { this.className = className; } + + + public Animal color(String color) { this.color = color; return this; } + + + /** + + * Get color + + + * @return color **/ + + @JsonProperty("color") + @ApiModelProperty(value = "") + public String getColor() { return color; } + public void setColor(String color) { this.color = color; } + + + @Override @@ -92,6 +155,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -115,3 +180,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/AnimalFarm.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/AnimalFarm.java index be5b217a5c0..faee4225a03 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/AnimalFarm.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/AnimalFarm.java @@ -13,17 +13,29 @@ package io.swagger.model; + import java.util.Objects; + + import io.swagger.model.Animal; import java.util.ArrayList; import java.util.List; + + + import javax.validation.constraints.*; + + + /** * AnimalFarm */ public class AnimalFarm extends ArrayList { + + + @Override public boolean equals(java.lang.Object o) { @@ -38,10 +50,12 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(super.hashCode()); + return Objects.hash(); } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -63,3 +77,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java index 7dcd2118293..8da6a4ed646 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java @@ -13,7 +13,10 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; @@ -21,42 +24,79 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; + + + import javax.validation.constraints.*; + + + /** * ArrayOfArrayOfNumberOnly */ public class ArrayOfArrayOfNumberOnly { + + + + @JsonProperty("ArrayArrayNumber") + + + private List> arrayArrayNumber = null; + + + + + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; return this; } + public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { this.arrayArrayNumber = new ArrayList>(); } + this.arrayArrayNumber.add(arrayArrayNumberItem); return this; } + + + /** + + * Get arrayArrayNumber + + + * @return arrayArrayNumber **/ + + @JsonProperty("ArrayArrayNumber") + @ApiModelProperty(value = "") + public List> getArrayArrayNumber() { return arrayArrayNumber; } + public void setArrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; } + + + @Override @@ -77,6 +117,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -99,3 +141,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java index 05331fa55e9..d572230b45c 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java @@ -13,7 +13,10 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; @@ -21,42 +24,79 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; + + + import javax.validation.constraints.*; + + + /** * ArrayOfNumberOnly */ public class ArrayOfNumberOnly { + + + + @JsonProperty("ArrayNumber") + + + private List arrayNumber = null; + + + + + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; return this; } + public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { this.arrayNumber = new ArrayList(); } + this.arrayNumber.add(arrayNumberItem); return this; } + + + /** + + * Get arrayNumber + + + * @return arrayNumber **/ + + @JsonProperty("ArrayNumber") + @ApiModelProperty(value = "") + public List getArrayNumber() { return arrayNumber; } + public void setArrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; } + + + @Override @@ -77,6 +117,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -99,3 +141,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/ArrayTest.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/ArrayTest.java index 295a1ea1f14..67b1c3f79e0 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/ArrayTest.java @@ -13,7 +13,10 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; @@ -21,102 +24,195 @@ import io.swagger.model.ReadOnlyFirst; import java.util.ArrayList; import java.util.List; + + + import javax.validation.constraints.*; + + + /** * ArrayTest */ public class ArrayTest { + + + + @JsonProperty("array_of_string") + + + private List arrayOfString = null; + + + + + + @JsonProperty("array_array_of_integer") + + + private List> arrayArrayOfInteger = null; + + + + + + @JsonProperty("array_array_of_model") + + + private List> arrayArrayOfModel = null; + + + + + public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; return this; } + public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { this.arrayOfString = new ArrayList(); } + this.arrayOfString.add(arrayOfStringItem); return this; } + + + /** + + * Get arrayOfString + + + * @return arrayOfString **/ + + @JsonProperty("array_of_string") + @ApiModelProperty(value = "") + public List getArrayOfString() { return arrayOfString; } + public void setArrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; } + + + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; return this; } + public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { this.arrayArrayOfInteger = new ArrayList>(); } + this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; } + + + /** + + * Get arrayArrayOfInteger + + + * @return arrayArrayOfInteger **/ + + @JsonProperty("array_array_of_integer") + @ApiModelProperty(value = "") + public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; } + + + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; return this; } + public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { this.arrayArrayOfModel = new ArrayList>(); } + this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; } + + + /** + + * Get arrayArrayOfModel + + + * @return arrayArrayOfModel **/ + + @JsonProperty("array_array_of_model") + @ApiModelProperty(value = "") + public List> getArrayArrayOfModel() { return arrayArrayOfModel; } + public void setArrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } + + + @Override @@ -139,6 +235,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -163,3 +261,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/Capitalization.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/Capitalization.java index 6ee896a961d..b837c520bd6 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/Capitalization.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/Capitalization.java @@ -13,149 +13,311 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + + + import javax.validation.constraints.*; + + + /** * Capitalization */ public class Capitalization { + + + + @JsonProperty("smallCamel") + + + + private String smallCamel = null; + + + + + @JsonProperty("CapitalCamel") + + + + private String capitalCamel = null; + + + + + @JsonProperty("small_Snake") + + + + private String smallSnake = null; + + + + + @JsonProperty("Capital_Snake") + + + + private String capitalSnake = null; + + + + + @JsonProperty("SCA_ETH_Flow_Points") + + + + private String scAETHFlowPoints = null; + + + + + @JsonProperty("ATT_NAME") + + + + private String ATT_NAME = null; + + + + public Capitalization smallCamel(String smallCamel) { this.smallCamel = smallCamel; return this; } + + + /** + + * Get smallCamel + + + * @return smallCamel **/ + + @JsonProperty("smallCamel") + @ApiModelProperty(value = "") + public String getSmallCamel() { return smallCamel; } + public void setSmallCamel(String smallCamel) { this.smallCamel = smallCamel; } + + + public Capitalization capitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; return this; } + + + /** + + * Get capitalCamel + + + * @return capitalCamel **/ + + @JsonProperty("CapitalCamel") + @ApiModelProperty(value = "") + public String getCapitalCamel() { return capitalCamel; } + public void setCapitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; } + + + public Capitalization smallSnake(String smallSnake) { this.smallSnake = smallSnake; return this; } + + + /** + + * Get smallSnake + + + * @return smallSnake **/ + + @JsonProperty("small_Snake") + @ApiModelProperty(value = "") + public String getSmallSnake() { return smallSnake; } + public void setSmallSnake(String smallSnake) { this.smallSnake = smallSnake; } + + + public Capitalization capitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; return this; } + + + /** + + * Get capitalSnake + + + * @return capitalSnake **/ + + @JsonProperty("Capital_Snake") + @ApiModelProperty(value = "") + public String getCapitalSnake() { return capitalSnake; } + public void setCapitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; } + + + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; return this; } + + + /** + + * Get scAETHFlowPoints + + + * @return scAETHFlowPoints **/ + + @JsonProperty("SCA_ETH_Flow_Points") + @ApiModelProperty(value = "") + public String getScAETHFlowPoints() { return scAETHFlowPoints; } + public void setScAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; } + + + public Capitalization ATT_NAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; return this; } + + + /** + * Name of the pet + + + + * @return ATT_NAME **/ + + @JsonProperty("ATT_NAME") + @ApiModelProperty(value = "Name of the pet ") + public String getATTNAME() { return ATT_NAME; } + public void setATTNAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; } + + + @Override @@ -181,6 +343,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -208,3 +372,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/Cat.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/Cat.java index b96cffbbd79..bda7f6d885d 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/Cat.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/Cat.java @@ -13,40 +13,173 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import io.swagger.model.Animal; + + + import javax.validation.constraints.*; + + + /** * Cat */ public class Cat extends Animal { + + + + + @JsonProperty("className") + + + + + private String className = null; + + + + + + + @JsonProperty("color") + + + + + private String color = "red"; + + + + + + @JsonProperty("declawed") + + + + private Boolean declawed = null; + + + + + + public Cat className(String className) { + this.className = className; + return this; + } + + + + + /** + + + * Get className + + + + * @return className + **/ + + + @JsonProperty("className") + + @ApiModelProperty(required = true, value = "") + + @NotNull + + public String getClassName() { + return className; + } + + public void setClassName(String className) { + this.className = className; + } + + + + + public Cat color(String color) { + this.color = color; + return this; + } + + + + + /** + + + * Get color + + + + * @return color + **/ + + + @JsonProperty("color") + + @ApiModelProperty(value = "") + + public String getColor() { + return color; + } + + + public void setColor(String color) { + this.color = color; + } + + + + public Cat declawed(Boolean declawed) { this.declawed = declawed; return this; } + + + /** + + * Get declawed + + + * @return declawed **/ + + @JsonProperty("declawed") + @ApiModelProperty(value = "") - public Boolean isDeclawed() { + + public Boolean isisDeclawed() { return declawed; } + public void setDeclawed(Boolean declawed) { this.declawed = declawed; } + + + @Override @@ -58,21 +191,27 @@ public boolean equals(java.lang.Object o) { return false; } Cat cat = (Cat) o; - return Objects.equals(this.declawed, cat.declawed) && + return Objects.equals(this.className, cat.className) && + Objects.equals(this.color, cat.color) && + Objects.equals(this.declawed, cat.declawed) && super.equals(o); } @Override public int hashCode() { - return Objects.hash(declawed, super.hashCode()); + return Objects.hash(className, color, declawed, super.hashCode()); } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Cat {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); sb.append("}"); return sb.toString(); @@ -90,3 +229,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/Category.java index 0408b4d6acf..37b9fe98e41 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/Category.java @@ -13,61 +13,123 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + + + import javax.validation.constraints.*; + + + /** * Category */ public class Category { + + + + @JsonProperty("id") + + + + private Long id = null; + + + + + @JsonProperty("name") + + + + private String name = null; + + + + public Category id(Long id) { this.id = id; return this; } + + + /** + + * Get id + + + * @return id **/ + + @JsonProperty("id") + @ApiModelProperty(value = "") + public Long getId() { return id; } + public void setId(Long id) { this.id = id; } + + + public Category name(String name) { this.name = name; return this; } + + + /** + + * Get name + + + * @return name **/ + + @JsonProperty("name") + @ApiModelProperty(value = "") + public String getName() { return name; } + public void setName(String name) { this.name = name; } + + + @Override @@ -89,6 +151,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -112,3 +176,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/ClassModel.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/ClassModel.java index e96a4ff4eb8..8667943daef 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/ClassModel.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/ClassModel.java @@ -13,40 +13,77 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + + + import javax.validation.constraints.*; + + + /** * Model for testing model with \"_class\" property */ @ApiModel(description = "Model for testing model with \"_class\" property") public class ClassModel { + + + + @JsonProperty("_class") + + + + private String propertyClass = null; + + + + public ClassModel propertyClass(String propertyClass) { this.propertyClass = propertyClass; return this; } + + + /** + + * Get propertyClass + + + * @return propertyClass **/ + + @JsonProperty("_class") + @ApiModelProperty(value = "") + public String getPropertyClass() { return propertyClass; } + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } + + + @Override @@ -67,6 +104,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -89,3 +128,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/Client.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/Client.java index 7bae1955cb3..5e8e716bc01 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/Client.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/Client.java @@ -13,39 +13,76 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + + + import javax.validation.constraints.*; + + + /** * Client */ public class Client { + + + + @JsonProperty("client") + + + + private String client = null; + + + + public Client client(String client) { this.client = client; return this; } + + + /** + + * Get client + + + * @return client **/ + + @JsonProperty("client") + @ApiModelProperty(value = "") + public String getClient() { return client; } + public void setClient(String client) { this.client = client; } + + + @Override @@ -66,6 +103,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -88,3 +127,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/Dog.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/Dog.java index 94fd1071a92..5513088ecd1 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/Dog.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/Dog.java @@ -13,40 +13,173 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import io.swagger.model.Animal; + + + import javax.validation.constraints.*; + + + /** * Dog */ public class Dog extends Animal { + + + + + @JsonProperty("className") + + + + + private String className = null; + + + + + + + @JsonProperty("color") + + + + + private String color = "red"; + + + + + + @JsonProperty("breed") + + + + private String breed = null; + + + + + + public Dog className(String className) { + this.className = className; + return this; + } + + + + + /** + + + * Get className + + + + * @return className + **/ + + + @JsonProperty("className") + + @ApiModelProperty(required = true, value = "") + + @NotNull + + public String getClassName() { + return className; + } + + public void setClassName(String className) { + this.className = className; + } + + + + + public Dog color(String color) { + this.color = color; + return this; + } + + + + + /** + + + * Get color + + + + * @return color + **/ + + + @JsonProperty("color") + + @ApiModelProperty(value = "") + + public String getColor() { + return color; + } + + + public void setColor(String color) { + this.color = color; + } + + + + public Dog breed(String breed) { this.breed = breed; return this; } + + + /** + + * Get breed + + + * @return breed **/ + + @JsonProperty("breed") + @ApiModelProperty(value = "") + public String getBreed() { return breed; } + public void setBreed(String breed) { this.breed = breed; } + + + @Override @@ -58,21 +191,27 @@ public boolean equals(java.lang.Object o) { return false; } Dog dog = (Dog) o; - return Objects.equals(this.breed, dog.breed) && + return Objects.equals(this.className, dog.className) && + Objects.equals(this.color, dog.color) && + Objects.equals(this.breed, dog.breed) && super.equals(o); } @Override public int hashCode() { - return Objects.hash(breed, super.hashCode()); + return Objects.hash(className, color, breed, super.hashCode()); } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Dog {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); sb.append("}"); return sb.toString(); @@ -90,3 +229,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/EnumArrays.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/EnumArrays.java index 8542c26fea8..4551dda9140 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/EnumArrays.java @@ -13,7 +13,10 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -21,20 +24,37 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; + + + import javax.validation.constraints.*; + + + /** * EnumArrays */ public class EnumArrays { + + + /** * Gets or Sets justSymbol */ public enum JustSymbolEnum { + + + + GREATER_THAN_OR_EQUAL_TO(">="), + DOLLAR("$"); + + + private String value; @@ -59,16 +79,40 @@ public static JustSymbolEnum fromValue(String text) { } } + + + + @JsonProperty("just_symbol") + + + + private JustSymbolEnum justSymbol = null; + + + + + + + + /** * Gets or Sets arrayEnum */ public enum ArrayEnumEnum { + + + + FISH("fish"), + CRAB("crab"); + + + private String value; @@ -93,54 +137,101 @@ public static ArrayEnumEnum fromValue(String text) { } } + + + + @JsonProperty("array_enum") + + + private List arrayEnum = null; + + + + + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; return this; } + + + /** + + * Get justSymbol + + + * @return justSymbol **/ + + @JsonProperty("just_symbol") + @ApiModelProperty(value = "") + public JustSymbolEnum getJustSymbol() { return justSymbol; } + public void setJustSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; } + + + public EnumArrays arrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; return this; } + public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { this.arrayEnum = new ArrayList(); } + this.arrayEnum.add(arrayEnumItem); return this; } + + + /** + + * Get arrayEnum + + + * @return arrayEnum **/ + + @JsonProperty("array_enum") + @ApiModelProperty(value = "") + public List getArrayEnum() { return arrayEnum; } + public void setArrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; } + + + @Override @@ -162,6 +253,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -185,3 +278,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/EnumClass.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/EnumClass.java index 1a5899f15d0..628bdaf0d7f 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/EnumClass.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/EnumClass.java @@ -13,22 +13,36 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonValue; + + + import javax.validation.constraints.*; + + + + import com.fasterxml.jackson.annotation.JsonCreator; + /** * Gets or Sets EnumClass */ public enum EnumClass { + + _ABC("_abc"), _EFG("-efg"), _XYZ_("(xyz)"); + private String value; @@ -41,6 +55,7 @@ public String toString() { return String.valueOf(value); } + @JsonCreator public static EnumClass fromValue(String text) { for (EnumClass b : EnumClass.values()) { @@ -50,5 +65,8 @@ public static EnumClass fromValue(String text) { } return null; } + } + + diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/EnumTest.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/EnumTest.java index e233d15e2a9..2b3d3b3b8df 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/EnumTest.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/EnumTest.java @@ -13,29 +13,50 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import io.swagger.model.OuterEnum; + + + import javax.validation.constraints.*; + + + /** * EnumTest */ public class EnumTest { + + + /** * Gets or Sets enumString */ public enum EnumStringEnum { + + + + UPPER("UPPER"), + LOWER("lower"), + EMPTY(""); + + + private String value; @@ -60,16 +81,36 @@ public static EnumStringEnum fromValue(String text) { } } + + + + @JsonProperty("enum_string") + + + + private EnumStringEnum enumString = null; + + + + /** * Gets or Sets enumInteger */ public enum EnumIntegerEnum { + + + + NUMBER_1(1), + NUMBER_MINUS_1(-1); + + + private Integer value; @@ -94,16 +135,36 @@ public static EnumIntegerEnum fromValue(String text) { } } + + + + @JsonProperty("enum_integer") + + + + private EnumIntegerEnum enumInteger = null; + + + + /** * Gets or Sets enumNumber */ public enum EnumNumberEnum { + + + + NUMBER_1_DOT_1(1.1), + NUMBER_MINUS_1_DOT_2(-1.2); + + + private Double value; @@ -128,87 +189,172 @@ public static EnumNumberEnum fromValue(String text) { } } + + + + @JsonProperty("enum_number") + + + + private EnumNumberEnum enumNumber = null; + + + + + @JsonProperty("outerEnum") + + + + private OuterEnum outerEnum = null; + + + + public EnumTest enumString(EnumStringEnum enumString) { this.enumString = enumString; return this; } + + + /** + + * Get enumString + + + * @return enumString **/ + + @JsonProperty("enum_string") + @ApiModelProperty(value = "") + public EnumStringEnum getEnumString() { return enumString; } + public void setEnumString(EnumStringEnum enumString) { this.enumString = enumString; } + + + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; return this; } + + + /** + + * Get enumInteger + + + * @return enumInteger **/ + + @JsonProperty("enum_integer") + @ApiModelProperty(value = "") + public EnumIntegerEnum getEnumInteger() { return enumInteger; } + public void setEnumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; } + + + public EnumTest enumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; return this; } + + + /** + + * Get enumNumber + + + * @return enumNumber **/ + + @JsonProperty("enum_number") + @ApiModelProperty(value = "") + public EnumNumberEnum getEnumNumber() { return enumNumber; } + public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } + + + public EnumTest outerEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; return this; } + + + /** + + * Get outerEnum + + + * @return outerEnum **/ + + @JsonProperty("outerEnum") + @ApiModelProperty(value = "") + public OuterEnum getOuterEnum() { return outerEnum; } + public void setOuterEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; } + + + @Override @@ -232,6 +378,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -257,3 +405,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/FormatTest.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/FormatTest.java index bc552c619c3..d53abead37a 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/FormatTest.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/FormatTest.java @@ -13,7 +13,10 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; @@ -21,312 +24,648 @@ import java.math.BigDecimal; import java.util.Date; import java.util.UUID; + + + import javax.validation.constraints.*; + + + /** * FormatTest */ public class FormatTest { + + + + @JsonProperty("integer") + + + + private Integer integer = null; + + + + + @JsonProperty("int32") + + + + private Integer int32 = null; + + + + + @JsonProperty("int64") + + + + private Long int64 = null; + + + + + @JsonProperty("number") + + + + private BigDecimal number = null; + + + + + @JsonProperty("float") + + + + private Float _float = null; + + + + + @JsonProperty("double") + + + + private Double _double = null; + + + + + @JsonProperty("string") + + + + private String string = null; + + + + + @JsonProperty("byte") - private byte[] _byte = null; - + + + + + private String _byte = null; + + + + + + @JsonProperty("binary") - private byte[] binary = null; - + + + + + private String binary = null; + + + + + + @JsonProperty("date") + + + + private Date date = null; + + + + + @JsonProperty("dateTime") + + + + private Date dateTime = null; + + + + + @JsonProperty("uuid") + + + + private UUID uuid = null; + + + + + @JsonProperty("password") + + + + private String password = null; + + + + public FormatTest integer(Integer integer) { this.integer = integer; return this; } + + + /** + + * Get integer + + * minimum: 10 + + * maximum: 100 + * @return integer **/ + + @JsonProperty("integer") + @ApiModelProperty(value = "") + @Min(10) @Max(100) public Integer getInteger() { return integer; } + public void setInteger(Integer integer) { this.integer = integer; } + + + public FormatTest int32(Integer int32) { this.int32 = int32; return this; } + + + /** + + * Get int32 + + * minimum: 20 + + * maximum: 200 + * @return int32 **/ + + @JsonProperty("int32") + @ApiModelProperty(value = "") + @Min(20) @Max(200) public Integer getInt32() { return int32; } + public void setInt32(Integer int32) { this.int32 = int32; } + + + public FormatTest int64(Long int64) { this.int64 = int64; return this; } + + + /** + + * Get int64 + + + * @return int64 **/ + + @JsonProperty("int64") + @ApiModelProperty(value = "") + public Long getInt64() { return int64; } + public void setInt64(Long int64) { this.int64 = int64; } + + + public FormatTest number(BigDecimal number) { this.number = number; return this; } + + + /** + + * Get number - * minimum: 32.1 - * maximum: 543.2 + + + * @return number **/ + + @JsonProperty("number") + @ApiModelProperty(required = true, value = "") + @NotNull - @DecimalMin("32.1") @DecimalMax("543.2") public BigDecimal getNumber() { + + public BigDecimal getNumber() { return number; } + public void setNumber(BigDecimal number) { this.number = number; } + + + public FormatTest _float(Float _float) { this._float = _float; return this; } + + + /** + + * Get _float - * minimum: 54.3 - * maximum: 987.6 + + + * @return _float **/ + + @JsonProperty("float") + @ApiModelProperty(value = "") - @DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { + + public Float getFloat() { return _float; } + public void setFloat(Float _float) { this._float = _float; } + + + public FormatTest _double(Double _double) { this._double = _double; return this; } + + + /** + + * Get _double - * minimum: 67.8 - * maximum: 123.4 + + + * @return _double **/ + + @JsonProperty("double") + @ApiModelProperty(value = "") - @DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { + + public Double getDouble() { return _double; } + public void setDouble(Double _double) { this._double = _double; } + + + public FormatTest string(String string) { this.string = string; return this; } + + + /** + + * Get string + + + * @return string **/ + + @JsonProperty("string") + @ApiModelProperty(value = "") + @Pattern(regexp="/[a-z]/i") public String getString() { return string; } + public void setString(String string) { this.string = string; } + - public FormatTest _byte(byte[] _byte) { + + + public FormatTest _byte(String _byte) { this._byte = _byte; return this; } + + + /** + + * Get _byte + + + * @return _byte **/ + + @JsonProperty("byte") + @ApiModelProperty(required = true, value = "") + @NotNull - @Pattern(regexp="^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$") public byte[] getByte() { + + @Pattern(regexp="^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$") public String getByte() { return _byte; } + - public void setByte(byte[] _byte) { + public void setByte(String _byte) { this._byte = _byte; } + - public FormatTest binary(byte[] binary) { + + + public FormatTest binary(String binary) { this.binary = binary; return this; } + + + /** + + * Get binary + + + * @return binary **/ + + @JsonProperty("binary") + @ApiModelProperty(value = "") - public byte[] getBinary() { + + public String getBinary() { return binary; } + - public void setBinary(byte[] binary) { + public void setBinary(String binary) { this.binary = binary; } + + + public FormatTest date(Date date) { this.date = date; return this; } + + + /** + + * Get date + + + * @return date **/ + + @JsonProperty("date") + @ApiModelProperty(required = true, value = "") + @NotNull + public Date getDate() { return date; } + public void setDate(Date date) { this.date = date; } + + + public FormatTest dateTime(Date dateTime) { this.dateTime = dateTime; return this; } + + + /** + + * Get dateTime + + + * @return dateTime **/ + + @JsonProperty("dateTime") + @ApiModelProperty(value = "") + public Date getDateTime() { return dateTime; } + public void setDateTime(Date dateTime) { this.dateTime = dateTime; } + + + public FormatTest uuid(UUID uuid) { this.uuid = uuid; return this; } + + + /** + + * Get uuid + + + * @return uuid **/ + + @JsonProperty("uuid") + @ApiModelProperty(value = "") + public UUID getUuid() { return uuid; } + public void setUuid(UUID uuid) { this.uuid = uuid; } + + + public FormatTest password(String password) { this.password = password; return this; } + + + /** + + * Get password + + + * @return password **/ + + @JsonProperty("password") + @ApiModelProperty(required = true, value = "") + @NotNull - @Size(min=10,max=64) public String getPassword() { + + public String getPassword() { return password; } + public void setPassword(String password) { this.password = password; } + + + @Override @@ -359,6 +698,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -393,3 +734,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/HasOnlyReadOnly.java index 02480c10c65..5324359eb14 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/HasOnlyReadOnly.java @@ -13,43 +13,123 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + + + import javax.validation.constraints.*; + + + /** * HasOnlyReadOnly */ public class HasOnlyReadOnly { + + + + @JsonProperty("bar") + + + + private String bar = null; + + + + + @JsonProperty("foo") + + + + private String foo = null; + + + + + + public HasOnlyReadOnly bar(String bar) { + this.bar = bar; + return this; + } + + + /** + + * Get bar + + + * @return bar **/ + + @JsonProperty("bar") + @ApiModelProperty(value = "") + public String getBar() { return bar; } + + + public void setBar(String bar) { + this.bar = bar; + } + + + + public HasOnlyReadOnly foo(String foo) { + this.foo = foo; + return this; + } + + + + /** + + * Get foo + + + * @return foo **/ + + @JsonProperty("foo") + @ApiModelProperty(value = "") + public String getFoo() { return foo; } + + + public void setFoo(String foo) { + this.foo = foo; + } + + + @Override @@ -71,6 +151,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -94,3 +176,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/MapTest.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/MapTest.java index 73c04c4bd63..7cbd27f23a0 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/MapTest.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/MapTest.java @@ -13,7 +13,10 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,23 +25,53 @@ import java.util.HashMap; import java.util.List; import java.util.Map; + + + import javax.validation.constraints.*; + + + /** * MapTest */ public class MapTest { + + + + @JsonProperty("map_map_of_string") + + + private Map> mapMapOfString = null; + + + + + + + + + /** * Gets or Sets inner */ public enum InnerEnum { + + + + UPPER("UPPER"), + LOWER("lower"); + + + private String value; @@ -63,62 +96,112 @@ public static InnerEnum fromValue(String text) { } } + + + + @JsonProperty("map_of_enum_string") + + + private Map mapOfEnumString = null; + + + + + public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; return this; } + + public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { this.mapMapOfString = new HashMap>(); } + this.mapMapOfString.put(key, mapMapOfStringItem); return this; } + + /** + + * Get mapMapOfString + + + * @return mapMapOfString **/ + + @JsonProperty("map_map_of_string") + @ApiModelProperty(value = "") + public Map> getMapMapOfString() { return mapMapOfString; } + public void setMapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; } + + + public MapTest mapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; return this; } + + public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { this.mapOfEnumString = new HashMap(); } + this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; } + + /** + + * Get mapOfEnumString + + + * @return mapOfEnumString **/ + + @JsonProperty("map_of_enum_string") + @ApiModelProperty(value = "") + public Map getMapOfEnumString() { return mapOfEnumString; } + public void setMapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; } + + + @Override @@ -140,6 +223,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -163,3 +248,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java index 5e1d96f5ecc..f10ecd02304 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -13,7 +13,10 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; @@ -24,86 +27,173 @@ import java.util.List; import java.util.Map; import java.util.UUID; + + + import javax.validation.constraints.*; + + + /** * MixedPropertiesAndAdditionalPropertiesClass */ public class MixedPropertiesAndAdditionalPropertiesClass { + + + + @JsonProperty("uuid") + + + + private UUID uuid = null; + + + + + @JsonProperty("dateTime") + + + + private Date dateTime = null; + + + + + @JsonProperty("map") + + + private Map map = null; + + + + + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; return this; } + + + /** + + * Get uuid + + + * @return uuid **/ + + @JsonProperty("uuid") + @ApiModelProperty(value = "") + public UUID getUuid() { return uuid; } + public void setUuid(UUID uuid) { this.uuid = uuid; } + + + public MixedPropertiesAndAdditionalPropertiesClass dateTime(Date dateTime) { this.dateTime = dateTime; return this; } + + + /** + + * Get dateTime + + + * @return dateTime **/ + + @JsonProperty("dateTime") + @ApiModelProperty(value = "") + public Date getDateTime() { return dateTime; } + public void setDateTime(Date dateTime) { this.dateTime = dateTime; } + + + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { this.map = map; return this; } + + public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { this.map = new HashMap(); } + this.map.put(key, mapItem); return this; } + + /** + + * Get map + + + * @return map **/ + + @JsonProperty("map") + @ApiModelProperty(value = "") + public Map getMap() { return map; } + public void setMap(Map map) { this.map = map; } + + + @Override @@ -126,6 +216,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -150,3 +242,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/Model200Response.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/Model200Response.java index 954ef7ebed3..d43a8ebe5a9 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/Model200Response.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/Model200Response.java @@ -13,62 +13,124 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + + + import javax.validation.constraints.*; + + + /** * Model for testing model name starting with number */ @ApiModel(description = "Model for testing model name starting with number") public class Model200Response { + + + + @JsonProperty("name") + + + + private Integer name = null; + + + + + @JsonProperty("class") + + + + private String propertyClass = null; + + + + public Model200Response name(Integer name) { this.name = name; return this; } + + + /** + + * Get name + + + * @return name **/ + + @JsonProperty("name") + @ApiModelProperty(value = "") + public Integer getName() { return name; } + public void setName(Integer name) { this.name = name; } + + + public Model200Response propertyClass(String propertyClass) { this.propertyClass = propertyClass; return this; } + + + /** + + * Get propertyClass + + + * @return propertyClass **/ + + @JsonProperty("class") + @ApiModelProperty(value = "") + public String getPropertyClass() { return propertyClass; } + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } + + + @Override @@ -90,6 +152,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -113,3 +177,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/ModelApiResponse.java index 2a54b591b32..98ccbc01819 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -13,83 +13,170 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + + + import javax.validation.constraints.*; + + + /** * ModelApiResponse */ public class ModelApiResponse { + + + + @JsonProperty("code") + + + + private Integer code = null; + + + + + @JsonProperty("type") + + + + private String type = null; + + + + + @JsonProperty("message") + + + + private String message = null; + + + + public ModelApiResponse code(Integer code) { this.code = code; return this; } + + + /** + + * Get code + + + * @return code **/ + + @JsonProperty("code") + @ApiModelProperty(value = "") + public Integer getCode() { return code; } + public void setCode(Integer code) { this.code = code; } + + + public ModelApiResponse type(String type) { this.type = type; return this; } + + + /** + + * Get type + + + * @return type **/ + + @JsonProperty("type") + @ApiModelProperty(value = "") + public String getType() { return type; } + public void setType(String type) { this.type = type; } + + + public ModelApiResponse message(String message) { this.message = message; return this; } + + + /** + + * Get message + + + * @return message **/ + + @JsonProperty("message") + @ApiModelProperty(value = "") + public String getMessage() { return message; } + public void setMessage(String message) { this.message = message; } + + + @Override @@ -112,6 +199,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -136,3 +225,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/ModelReturn.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/ModelReturn.java index 12b213d6afb..5fdd63263f8 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/ModelReturn.java @@ -13,40 +13,77 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + + + import javax.validation.constraints.*; + + + /** * Model for testing reserved words */ @ApiModel(description = "Model for testing reserved words") public class ModelReturn { + + + + @JsonProperty("return") + + + + private Integer _return = null; + + + + public ModelReturn _return(Integer _return) { this._return = _return; return this; } + + + /** + + * Get _return + + + * @return _return **/ + + @JsonProperty("return") + @ApiModelProperty(value = "") + public Integer getReturn() { return _return; } + public void setReturn(Integer _return) { this._return = _return; } + + + @Override @@ -67,6 +104,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -89,3 +128,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/Name.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/Name.java index 771531b30ab..ad6d4dc2927 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/Name.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/Name.java @@ -13,89 +13,220 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + + + import javax.validation.constraints.*; + + + /** * Model for testing model name same as property name */ @ApiModel(description = "Model for testing model name same as property name") public class Name { + + + + @JsonProperty("name") + + + + private Integer name = null; + + + + + @JsonProperty("snake_case") + + + + private Integer snakeCase = null; + + + + + @JsonProperty("property") + + + + private String property = null; + + + + + @JsonProperty("123Number") + + + + private Integer _123Number = null; + + + + public Name name(Integer name) { this.name = name; return this; } + + + /** + + * Get name + + + * @return name **/ + + @JsonProperty("name") + @ApiModelProperty(required = true, value = "") + @NotNull + public Integer getName() { return name; } + public void setName(Integer name) { this.name = name; } + + + + public Name snakeCase(Integer snakeCase) { + this.snakeCase = snakeCase; + return this; + } + + + + /** + + * Get snakeCase + + + * @return snakeCase **/ + + @JsonProperty("snake_case") + @ApiModelProperty(value = "") + public Integer getSnakeCase() { return snakeCase; } + + public void setSnakeCase(Integer snakeCase) { + this.snakeCase = snakeCase; + } + + + + public Name property(String property) { this.property = property; return this; } + + + /** + + * Get property + + + * @return property **/ + + @JsonProperty("property") + @ApiModelProperty(value = "") + public String getProperty() { return property; } + public void setProperty(String property) { this.property = property; } + + + + + public Name _123Number(Integer _123Number) { + this._123Number = _123Number; + return this; + } + + + /** + + * Get _123Number + + + * @return _123Number **/ + + @JsonProperty("123Number") + @ApiModelProperty(value = "") + public Integer get123Number() { return _123Number; } + + + public void set123Number(Integer _123Number) { + this._123Number = _123Number; + } + + + @Override @@ -119,6 +250,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -144,3 +277,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/NumberOnly.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/NumberOnly.java index 82604a5b9c7..97654cc9c3c 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/NumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/NumberOnly.java @@ -13,40 +13,77 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; + + + import javax.validation.constraints.*; + + + /** * NumberOnly */ public class NumberOnly { + + + + @JsonProperty("JustNumber") + + + + private BigDecimal justNumber = null; + + + + public NumberOnly justNumber(BigDecimal justNumber) { this.justNumber = justNumber; return this; } + + + /** + + * Get justNumber + + + * @return justNumber **/ + + @JsonProperty("JustNumber") + @ApiModelProperty(value = "") + public BigDecimal getJustNumber() { return justNumber; } + public void setJustNumber(BigDecimal justNumber) { this.justNumber = justNumber; } + + + @Override @@ -67,6 +104,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -89,3 +128,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/Order.java index 5147738768b..7feb30193a2 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/Order.java @@ -13,41 +13,98 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.Date; + + + import javax.validation.constraints.*; + + + /** * Order */ public class Order { + + + + @JsonProperty("id") + + + + private Long id = null; + + + + + @JsonProperty("petId") + + + + private Long petId = null; + + + + + @JsonProperty("quantity") + + + + private Integer quantity = null; + + + + + @JsonProperty("shipDate") + + + + private Date shipDate = null; + + + + /** * Order Status */ public enum StatusEnum { + + + + PLACED("placed"), + APPROVED("approved"), + DELIVERED("delivered"); + + + private String value; @@ -72,125 +129,242 @@ public static StatusEnum fromValue(String text) { } } + + + + @JsonProperty("status") + + + + private StatusEnum status = null; + + + + + @JsonProperty("complete") + + + + private Boolean complete = false; + + + + public Order id(Long id) { this.id = id; return this; } + + + /** + + * Get id + + + * @return id **/ + + @JsonProperty("id") + @ApiModelProperty(value = "") + public Long getId() { return id; } + public void setId(Long id) { this.id = id; } + + + public Order petId(Long petId) { this.petId = petId; return this; } + + + /** + + * Get petId + + + * @return petId **/ + + @JsonProperty("petId") + @ApiModelProperty(value = "") + public Long getPetId() { return petId; } + public void setPetId(Long petId) { this.petId = petId; } + + + public Order quantity(Integer quantity) { this.quantity = quantity; return this; } + + + /** + + * Get quantity + + + * @return quantity **/ + + @JsonProperty("quantity") + @ApiModelProperty(value = "") + public Integer getQuantity() { return quantity; } + public void setQuantity(Integer quantity) { this.quantity = quantity; } + + + public Order shipDate(Date shipDate) { this.shipDate = shipDate; return this; } + + + /** + + * Get shipDate + + + * @return shipDate **/ + + @JsonProperty("shipDate") + @ApiModelProperty(value = "") + public Date getShipDate() { return shipDate; } + public void setShipDate(Date shipDate) { this.shipDate = shipDate; } + + + public Order status(StatusEnum status) { this.status = status; return this; } + + + /** + * Order Status + + + + * @return status **/ + + @JsonProperty("status") + @ApiModelProperty(value = "Order Status") + public StatusEnum getStatus() { return status; } + public void setStatus(StatusEnum status) { this.status = status; } + + + public Order complete(Boolean complete) { this.complete = complete; return this; } + + + /** + + * Get complete + + + * @return complete **/ + + @JsonProperty("complete") + @ApiModelProperty(value = "") - public Boolean isComplete() { + + public Boolean isisComplete() { return complete; } + public void setComplete(Boolean complete) { this.complete = complete; } + + + @Override @@ -216,6 +390,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -243,3 +419,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/OuterBoolean.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/OuterBoolean.java new file mode 100644 index 00000000000..2710300f712 --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/OuterBoolean.java @@ -0,0 +1,78 @@ +/* + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.model; + + +import java.util.Objects; + + + + + +import javax.validation.constraints.*; + + + + +/** + * OuterBoolean + */ + +public class OuterBoolean { + + + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return Objects.hash(); + } + + + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterBoolean {\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(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + + + diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/OuterComposite.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/OuterComposite.java index c144ee99521..97f0e707810 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/OuterComposite.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/OuterComposite.java @@ -13,84 +13,171 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; + + + import javax.validation.constraints.*; + + + /** * OuterComposite */ public class OuterComposite { + + + + @JsonProperty("my_number") + + + + private BigDecimal myNumber = null; + + + + + @JsonProperty("my_string") + + + + private String myString = null; + + + + + @JsonProperty("my_boolean") + + + + private Boolean myBoolean = null; + + + + public OuterComposite myNumber(BigDecimal myNumber) { this.myNumber = myNumber; return this; } + + + /** + + * Get myNumber + + + * @return myNumber **/ + + @JsonProperty("my_number") + @ApiModelProperty(value = "") + public BigDecimal getMyNumber() { return myNumber; } + public void setMyNumber(BigDecimal myNumber) { this.myNumber = myNumber; } + + + public OuterComposite myString(String myString) { this.myString = myString; return this; } + + + /** + + * Get myString + + + * @return myString **/ + + @JsonProperty("my_string") + @ApiModelProperty(value = "") + public String getMyString() { return myString; } + public void setMyString(String myString) { this.myString = myString; } + + + public OuterComposite myBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; return this; } + + + /** + + * Get myBoolean + + + * @return myBoolean **/ + + @JsonProperty("my_boolean") + @ApiModelProperty(value = "") + public Boolean getMyBoolean() { return myBoolean; } + public void setMyBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; } + + + @Override @@ -113,6 +200,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -137,3 +226,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/OuterEnum.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/OuterEnum.java index 6740674b07c..51728f9ba9f 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/OuterEnum.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/OuterEnum.java @@ -13,22 +13,36 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonValue; + + + import javax.validation.constraints.*; + + + + import com.fasterxml.jackson.annotation.JsonCreator; + /** * Gets or Sets OuterEnum */ public enum OuterEnum { + + PLACED("placed"), APPROVED("approved"), DELIVERED("delivered"); + private String value; @@ -41,6 +55,7 @@ public String toString() { return String.valueOf(value); } + @JsonCreator public static OuterEnum fromValue(String text) { for (OuterEnum b : OuterEnum.values()) { @@ -50,5 +65,8 @@ public static OuterEnum fromValue(String text) { } return null; } + } + + diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/OuterNumber.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/OuterNumber.java new file mode 100644 index 00000000000..245ff1651de --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/OuterNumber.java @@ -0,0 +1,78 @@ +/* + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.model; + + +import java.util.Objects; + + + + + +import javax.validation.constraints.*; + + + + +/** + * OuterNumber + */ + +public class OuterNumber { + + + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return Objects.hash(); + } + + + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterNumber {\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(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + + + diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/OuterString.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/OuterString.java new file mode 100644 index 00000000000..fa548ab0e00 --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/OuterString.java @@ -0,0 +1,78 @@ +/* + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.model; + + +import java.util.Objects; + + + + + +import javax.validation.constraints.*; + + + + +/** + * OuterString + */ + +public class OuterString { + + + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return Objects.hash(); + } + + + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterString {\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(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + + + diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/Pet.java index 04480639f0f..402ac868b12 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/Pet.java @@ -13,7 +13,10 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,37 +26,100 @@ import io.swagger.model.Tag; import java.util.ArrayList; import java.util.List; + + + import javax.validation.constraints.*; + + + /** * Pet */ public class Pet { + + + + @JsonProperty("id") + + + + private Long id = null; + + + + + @JsonProperty("category") + + + + private Category category = null; + + + + + @JsonProperty("name") + + + + private String name = null; + + + + + @JsonProperty("photoUrls") + + + private List photoUrls = new ArrayList(); + + + + + + @JsonProperty("tags") + + + private List tags = null; + + + + + /** * pet status in the store */ public enum StatusEnum { + + + + AVAILABLE("available"), + PENDING("pending"), + SOLD("sold"); + + + private String value; @@ -78,137 +144,252 @@ public static StatusEnum fromValue(String text) { } } + + + + @JsonProperty("status") + + + + private StatusEnum status = null; + + + + public Pet id(Long id) { this.id = id; return this; } + + + /** + + * Get id + + + * @return id **/ + + @JsonProperty("id") + @ApiModelProperty(value = "") + public Long getId() { return id; } + public void setId(Long id) { this.id = id; } + + + public Pet category(Category category) { this.category = category; return this; } + + + /** + + * Get category + + + * @return category **/ + + @JsonProperty("category") + @ApiModelProperty(value = "") + public Category getCategory() { return category; } + public void setCategory(Category category) { this.category = category; } + + + public Pet name(String name) { this.name = name; return this; } + + + /** + + * Get name + + + * @return name **/ + + @JsonProperty("name") + @ApiModelProperty(example = "doggie", required = true, value = "") + @NotNull + public String getName() { return name; } + public void setName(String name) { this.name = name; } + + + public Pet photoUrls(List photoUrls) { this.photoUrls = photoUrls; return this; } + public Pet addPhotoUrlsItem(String photoUrlsItem) { + this.photoUrls.add(photoUrlsItem); return this; } + + + /** + + * Get photoUrls + + + * @return photoUrls **/ + + @JsonProperty("photoUrls") + @ApiModelProperty(required = true, value = "") + @NotNull + public List getPhotoUrls() { return photoUrls; } + public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } + + + public Pet tags(List tags) { this.tags = tags; return this; } + public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { this.tags = new ArrayList(); } + this.tags.add(tagsItem); return this; } + + + /** + + * Get tags + + + * @return tags **/ + + @JsonProperty("tags") + @ApiModelProperty(value = "") + public List getTags() { return tags; } + public void setTags(List tags) { this.tags = tags; } + + + public Pet status(StatusEnum status) { this.status = status; return this; } + + + /** + * pet status in the store + + + + * @return status **/ + + @JsonProperty("status") + @ApiModelProperty(value = "pet status in the store") + public StatusEnum getStatus() { return status; } + public void setStatus(StatusEnum status) { this.status = status; } + + + @Override @@ -234,6 +415,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -261,3 +444,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/ReadOnlyFirst.java index 5d26b4199f8..c139fe90bc0 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/ReadOnlyFirst.java @@ -13,52 +13,123 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + + + import javax.validation.constraints.*; + + + /** * ReadOnlyFirst */ public class ReadOnlyFirst { + + + + @JsonProperty("bar") + + + + private String bar = null; + + + + + @JsonProperty("baz") + + + + private String baz = null; + + + + + public ReadOnlyFirst bar(String bar) { + this.bar = bar; + return this; + } + + + + /** + + * Get bar + + + * @return bar **/ + + @JsonProperty("bar") + @ApiModelProperty(value = "") + public String getBar() { return bar; } + + + public void setBar(String bar) { + this.bar = bar; + } + + + public ReadOnlyFirst baz(String baz) { this.baz = baz; return this; } + + + /** + + * Get baz + + + * @return baz **/ + + @JsonProperty("baz") + @ApiModelProperty(value = "") + public String getBaz() { return baz; } + public void setBaz(String baz) { this.baz = baz; } + + + @Override @@ -80,6 +151,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -103,3 +176,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/SpecialModelName.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/SpecialModelName.java index df3182fbd80..4fafb75f408 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/SpecialModelName.java @@ -13,39 +13,76 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + + + import javax.validation.constraints.*; + + + /** * SpecialModelName */ public class SpecialModelName { + + + + @JsonProperty("$special[property.name]") - private Long specialPropertyName = null; + + + + + private Long $specialPropertyName = null; + - public SpecialModelName specialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + + + + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; return this; } + + + /** - * Get specialPropertyName - * @return specialPropertyName + + + * Get $specialPropertyName + + + + * @return $specialPropertyName **/ + + @JsonProperty("$special[property.name]") + @ApiModelProperty(value = "") - public Long getSpecialPropertyName() { - return specialPropertyName; + + public Long get$SpecialPropertyName() { + return $specialPropertyName; } + - public void setSpecialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + public void set$SpecialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; } + + + @Override @@ -56,22 +93,24 @@ public boolean equals(java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName specialModelName = (SpecialModelName) o; - return Objects.equals(this.specialPropertyName, specialModelName.specialPropertyName); + SpecialModelName $specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); } @Override public int hashCode() { - return Objects.hash(specialPropertyName); + return Objects.hash($specialPropertyName); } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class SpecialModelName {\n"); - sb.append(" specialPropertyName: ").append(toIndentedString(specialPropertyName)).append("\n"); + sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n"); sb.append("}"); return sb.toString(); } @@ -88,3 +127,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/Tag.java index a86f54144f8..1fffba9994d 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/Tag.java @@ -13,61 +13,123 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + + + import javax.validation.constraints.*; + + + /** * Tag */ public class Tag { + + + + @JsonProperty("id") + + + + private Long id = null; + + + + + @JsonProperty("name") + + + + private String name = null; + + + + public Tag id(Long id) { this.id = id; return this; } + + + /** + + * Get id + + + * @return id **/ + + @JsonProperty("id") + @ApiModelProperty(value = "") + public Long getId() { return id; } + public void setId(Long id) { this.id = id; } + + + public Tag name(String name) { this.name = name; return this; } + + + /** + + * Get name + + + * @return name **/ + + @JsonProperty("name") + @ApiModelProperty(value = "") + public String getName() { return name; } + public void setName(String name) { this.name = name; } + + + @Override @@ -89,6 +151,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -112,3 +176,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/User.java index 0c1b67c0d5b..ffab5e5eb2a 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/model/User.java @@ -13,193 +13,405 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + + + import javax.validation.constraints.*; + + + /** * User */ public class User { + + + + @JsonProperty("id") + + + + private Long id = null; + + + + + @JsonProperty("username") + + + + private String username = null; + + + + + @JsonProperty("firstName") + + + + private String firstName = null; + + + + + @JsonProperty("lastName") + + + + private String lastName = null; + + + + + @JsonProperty("email") + + + + private String email = null; + + + + + @JsonProperty("password") + + + + private String password = null; + + + + + @JsonProperty("phone") + + + + private String phone = null; + + + + + @JsonProperty("userStatus") + + + + private Integer userStatus = null; + + + + public User id(Long id) { this.id = id; return this; } + + + /** + + * Get id + + + * @return id **/ + + @JsonProperty("id") + @ApiModelProperty(value = "") + public Long getId() { return id; } + public void setId(Long id) { this.id = id; } + + + public User username(String username) { this.username = username; return this; } + + + /** + + * Get username + + + * @return username **/ + + @JsonProperty("username") + @ApiModelProperty(value = "") + public String getUsername() { return username; } + public void setUsername(String username) { this.username = username; } + + + public User firstName(String firstName) { this.firstName = firstName; return this; } + + + /** + + * Get firstName + + + * @return firstName **/ + + @JsonProperty("firstName") + @ApiModelProperty(value = "") + public String getFirstName() { return firstName; } + public void setFirstName(String firstName) { this.firstName = firstName; } + + + public User lastName(String lastName) { this.lastName = lastName; return this; } + + + /** + + * Get lastName + + + * @return lastName **/ + + @JsonProperty("lastName") + @ApiModelProperty(value = "") + public String getLastName() { return lastName; } + public void setLastName(String lastName) { this.lastName = lastName; } + + + public User email(String email) { this.email = email; return this; } + + + /** + + * Get email + + + * @return email **/ + + @JsonProperty("email") + @ApiModelProperty(value = "") + public String getEmail() { return email; } + public void setEmail(String email) { this.email = email; } + + + public User password(String password) { this.password = password; return this; } + + + /** + + * Get password + + + * @return password **/ + + @JsonProperty("password") + @ApiModelProperty(value = "") + public String getPassword() { return password; } + public void setPassword(String password) { this.password = password; } + + + public User phone(String phone) { this.phone = phone; return this; } + + + /** + + * Get phone + + + * @return phone **/ + + @JsonProperty("phone") + @ApiModelProperty(value = "") + public String getPhone() { return phone; } + public void setPhone(String phone) { this.phone = phone; } + + + public User userStatus(Integer userStatus) { this.userStatus = userStatus; return this; } + + + /** + * User Status + + + + * @return userStatus **/ + + @JsonProperty("userStatus") + @ApiModelProperty(value = "User Status") + public Integer getUserStatus() { return userStatus; } + public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } + + + @Override @@ -227,6 +439,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -256,3 +470,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/io/swagger/api/impl/AnotherFakeApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/io/swagger/api/impl/AnotherFakeApiServiceImpl.java index 77b9e358572..fca81930fd1 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/io/swagger/api/impl/AnotherFakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/io/swagger/api/impl/AnotherFakeApiServiceImpl.java @@ -5,6 +5,8 @@ import io.swagger.model.Client; + +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -14,12 +16,18 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; + import javax.validation.constraints.*; + + public class AnotherFakeApiServiceImpl extends AnotherFakeApiService { + @Override - public Response testSpecialTags(Client body, SecurityContext securityContext) throws NotFoundException { + public Response testSpecialTags(Client client, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + } + diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/io/swagger/api/impl/FakeApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/io/swagger/api/impl/FakeApiServiceImpl.java index 529420f7f70..3713d4ccf73 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/io/swagger/api/impl/FakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/io/swagger/api/impl/FakeApiServiceImpl.java @@ -5,9 +5,10 @@ import java.math.BigDecimal; import io.swagger.model.Client; -import java.util.Date; import io.swagger.model.OuterComposite; + +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -17,47 +18,66 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; + import javax.validation.constraints.*; + + public class FakeApiServiceImpl extends FakeApiService { + @Override public Response fakeOuterBooleanSerialize(Boolean body, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + @Override - public Response fakeOuterCompositeSerialize(OuterComposite body, SecurityContext securityContext) throws NotFoundException { + public Response fakeOuterCompositeSerialize(OuterComposite outercomposite, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + @Override public Response fakeOuterNumberSerialize(BigDecimal body, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + @Override public Response fakeOuterStringSerialize(String body, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + @Override - public Response testClientModel(Client body, SecurityContext securityContext) throws NotFoundException { + public Response testClientModel(Client client, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + @Override - public Response testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, Date date, Date dateTime, String password, String paramCallback, SecurityContext securityContext) throws NotFoundException { + public Response testEndpointParameters(Object body, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + @Override - public Response testEnumParameters(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, SecurityContext securityContext) throws NotFoundException { + public Response testEnumParameters(Object body, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + @Override - public Response testJsonFormData(String param, String param2, SecurityContext securityContext) throws NotFoundException { + public Response testInlineAdditionalProperties(Map body, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + + @Override + public Response testJsonFormData(Object 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/jersey2-useTags/src/main/java/io/swagger/api/impl/FakeClassnameTags123ApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/io/swagger/api/impl/FakeClassnameTags123ApiServiceImpl.java index 61301d3617b..1bd2e54abf9 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/io/swagger/api/impl/FakeClassnameTags123ApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/io/swagger/api/impl/FakeClassnameTags123ApiServiceImpl.java @@ -5,6 +5,8 @@ import io.swagger.model.Client; + +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -14,12 +16,18 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; + import javax.validation.constraints.*; + + public class FakeClassnameTags123ApiServiceImpl extends FakeClassnameTags123ApiService { + @Override - public Response testClassname(Client body, SecurityContext securityContext) throws NotFoundException { + public Response testClassname(Client client, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + } + diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java index be3e7e167e7..61c8ec54fed 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java @@ -3,10 +3,11 @@ import io.swagger.api.*; import io.swagger.model.*; -import java.io.File; import io.swagger.model.ModelApiResponse; import io.swagger.model.Pet; + +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -16,47 +17,60 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; + import javax.validation.constraints.*; + + public class PetApiServiceImpl extends PetApiService { + @Override - public Response addPet(Pet body, SecurityContext securityContext) throws NotFoundException { + public Response addPet(Pet pet, 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 { + public Response deletePet(Integer petId, String apiKey, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + @Override public Response findPetsByStatus( @NotNull List status, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + @Override public Response findPetsByTags( @NotNull 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 { + public Response getPetById(Integer 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 { + public Response updatePet(Pet pet, 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 { + public Response updatePetWithForm(Integer petId, Object body, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + @Override - public Response uploadFile(Long petId, String additionalMetadata, InputStream fileInputStream, FormDataContentDisposition fileDetail, SecurityContext securityContext) throws NotFoundException { + public Response uploadFile(Integer petId, Object 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/jersey2-useTags/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java index f8fd4cec86b..0f9d37bf71e 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java @@ -6,6 +6,8 @@ import java.util.Map; import io.swagger.model.Order; + +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -15,27 +17,36 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; + import javax.validation.constraints.*; + + 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( @Min(1) @Max(5)Long orderId, SecurityContext securityContext) throws NotFoundException { + public Response getOrderById( @DecimalMin("1") @DecimalMax("5")Integer 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 { + public Response placeOrder(Order order, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + } + diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java index 5853e33168d..9a4fb3961c7 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java @@ -3,9 +3,10 @@ import io.swagger.api.*; import io.swagger.model.*; -import java.util.List; import io.swagger.model.User; + +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -15,47 +16,60 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; + import javax.validation.constraints.*; + + public class UserApiServiceImpl extends UserApiService { + @Override - public Response createUser(User body, SecurityContext securityContext) throws NotFoundException { + public Response createUser(User user, 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( @NotNull String username, @NotNull 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 { + public Response updateUser(User user, String username, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + } + diff --git a/samples/server/petstore/jaxrs/jersey2/.swagger-codegen/VERSION b/samples/server/petstore/jaxrs/jersey2/.swagger-codegen/VERSION index 50794f17f1a..096bf47efe3 100644 --- a/samples/server/petstore/jaxrs/jersey2/.swagger-codegen/VERSION +++ b/samples/server/petstore/jaxrs/jersey2/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.1-SNAPSHOT \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs/jersey2/pom.xml b/samples/server/petstore/jaxrs/jersey2/pom.xml index 03d596436fd..11ca075c081 100644 --- a/samples/server/petstore/jaxrs/jersey2/pom.xml +++ b/samples/server/petstore/jaxrs/jersey2/pom.xml @@ -51,6 +51,15 @@ 60000 + + + + javax.validation + validation-api + ${beanvalidation-version} + + + start-jetty @@ -133,11 +142,14 @@ jersey-media-multipart ${jersey2-version} + + - com.fasterxml.jackson.datatype - jackson-datatype-joda - ${jackson-version} + com.fasterxml.jackson.datatype + jackson-datatype-joda + ${jackson-version} + com.fasterxml.jackson.jaxrs jackson-jaxrs-json-provider @@ -151,14 +163,17 @@ + + javax.validation validation-api - 1.1.0.Final + ${beanvalidation-version} provided + @@ -173,13 +188,17 @@ 1.7 ${java.version} ${java.version} - 1.5.15 + 1.5.18 9.2.9.v20150224 2.22.2 2.8.9 + 4.12 1.1.7 2.5 + + 1.1.0.Final + UTF-8 diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/AnotherFakeApi.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/AnotherFakeApi.java index c79af3fc280..7a25b938f2e 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/AnotherFakeApi.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/AnotherFakeApi.java @@ -9,6 +9,7 @@ import io.swagger.model.Client; + import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -23,13 +24,16 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; import javax.ws.rs.*; + import javax.validation.constraints.*; + @Path("/another-fake") @io.swagger.annotations.Api(description = "the another-fake API") + public class AnotherFakeApi { private final AnotherFakeApiService delegate; @@ -54,6 +58,7 @@ public AnotherFakeApi(@Context ServletConfig servletContext) { this.delegate = delegate; } + @PATCH @Path("/dummy") @Consumes({ "application/json" }) @@ -61,9 +66,11 @@ public AnotherFakeApi(@Context ServletConfig servletContext) { @io.swagger.annotations.ApiOperation(value = "To test special tags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - public Response testSpecialTags(@ApiParam(value = "client model" ,required=true) Client body + public Response testSpecialTags(@ApiParam(value = "client model" ,required=true) Client client ,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.testSpecialTags(body,securityContext); + return delegate.testSpecialTags(client,securityContext); } + } + diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/AnotherFakeApiService.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/AnotherFakeApiService.java index ca43c203e82..3849fe160d7 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/AnotherFakeApiService.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/AnotherFakeApiService.java @@ -7,6 +7,8 @@ import io.swagger.model.Client; + +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -14,8 +16,14 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; + import javax.validation.constraints.*; + + public abstract class AnotherFakeApiService { - public abstract Response testSpecialTags(Client body,SecurityContext securityContext) throws NotFoundException; + + public abstract Response testSpecialTags(Client client,SecurityContext securityContext) throws NotFoundException; + } + diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/FakeApi.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/FakeApi.java index d16817cce9b..9151a811286 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/FakeApi.java @@ -9,9 +9,9 @@ import java.math.BigDecimal; import io.swagger.model.Client; -import java.util.Date; import io.swagger.model.OuterComposite; + import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -26,13 +26,16 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; import javax.ws.rs.*; + import javax.validation.constraints.*; + @Path("/fake") @io.swagger.annotations.Api(description = "the fake API") + public class FakeApi { private final FakeApiService delegate; @@ -57,10 +60,11 @@ public FakeApi(@Context ServletConfig servletContext) { this.delegate = delegate; } + @POST @Path("/outer/boolean") - - + @Consumes({ "*/*" }) + @Produces({ "*/*" }) @io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) @@ -69,22 +73,24 @@ public Response fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as po throws NotFoundException { return delegate.fakeOuterBooleanSerialize(body,securityContext); } + @POST @Path("/outer/composite") - - + @Consumes({ "*/*" }) + @Produces({ "*/*" }) @io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) - public Response fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) OuterComposite body + public Response fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) OuterComposite outercomposite ,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.fakeOuterCompositeSerialize(body,securityContext); + return delegate.fakeOuterCompositeSerialize(outercomposite,securityContext); } + @POST @Path("/outer/number") - - + @Consumes({ "*/*" }) + @Produces({ "*/*" }) @io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) @@ -93,10 +99,11 @@ public Response fakeOuterNumberSerialize(@ApiParam(value = "Input number as post throws NotFoundException { return delegate.fakeOuterNumberSerialize(body,securityContext); } + @POST @Path("/outer/string") - - + @Consumes({ "*/*" }) + @Produces({ "*/*" }) @io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "Output string", response = String.class) }) @@ -105,6 +112,7 @@ public Response fakeOuterStringSerialize(@ApiParam(value = "Input string as post throws NotFoundException { return delegate.fakeOuterStringSerialize(body,securityContext); } + @PATCH @Consumes({ "application/json" }) @@ -112,61 +120,47 @@ public Response fakeOuterStringSerialize(@ApiParam(value = "Input string as post @io.swagger.annotations.ApiOperation(value = "To test \"client\" model", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - public Response testClientModel(@ApiParam(value = "client model" ,required=true) Client body + public Response testClientModel(@ApiParam(value = "client model" ,required=true) Client client ,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.testClientModel(body,securityContext); + return delegate.testClientModel(client,securityContext); } + @POST @Consumes({ "application/xml; charset=utf-8", "application/json; charset=utf-8" }) - @Produces({ "application/xml; charset=utf-8", "application/json; charset=utf-8" }) - @io.swagger.annotations.ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = Void.class, authorizations = { - @io.swagger.annotations.Authorization(value = "http_basic_test") - }, tags={ "fake", }) + + @io.swagger.annotations.ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = Void.class, tags={ "fake", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) - public Response testEndpointParameters(@ApiParam(value = "None", required=true) @FormParam("number") BigDecimal number -,@ApiParam(value = "None", required=true) @FormParam("double") Double _double -,@ApiParam(value = "None", required=true) @FormParam("pattern_without_delimiter") String patternWithoutDelimiter -,@ApiParam(value = "None", required=true) @FormParam("byte") byte[] _byte -,@ApiParam(value = "None") @FormParam("integer") Integer integer -,@ApiParam(value = "None") @FormParam("int32") Integer int32 -,@ApiParam(value = "None") @FormParam("int64") Long int64 -,@ApiParam(value = "None") @FormParam("float") Float _float -,@ApiParam(value = "None") @FormParam("string") String string -,@ApiParam(value = "None") @FormParam("binary") byte[] binary -,@ApiParam(value = "None") @FormParam("date") Date date -,@ApiParam(value = "None") @FormParam("dateTime") Date dateTime -,@ApiParam(value = "None") @FormParam("password") String password -,@ApiParam(value = "None") @FormParam("callback") String paramCallback + public Response testEndpointParameters(@ApiParam(value = "" ,required=true) Object body ,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.testEndpointParameters(number,_double,patternWithoutDelimiter,_byte,integer,int32,int64,_float,string,binary,date,dateTime,password,paramCallback,securityContext); + return delegate.testEndpointParameters(body,securityContext); } + @GET @Consumes({ "*/*" }) - @Produces({ "*/*" }) + @io.swagger.annotations.ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", response = Void.class, tags={ "fake", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid request", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "Not found", response = Void.class) }) - public Response testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $") @FormParam("enum_form_string_array") List enumFormStringArray -,@ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @DefaultValue("-efg") @FormParam("enum_form_string") String enumFormString -,@ApiParam(value = "Header parameter enum test (string array)" , allowableValues=">, $")@HeaderParam("enum_header_string_array") List enumHeaderStringArray -,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_abc, -efg, (xyz)", defaultValue="-efg")@HeaderParam("enum_header_string") String enumHeaderString -,@ApiParam(value = "Query parameter enum test (string array)", allowableValues=">, $") @QueryParam("enum_query_string_array") List enumQueryStringArray -,@ApiParam(value = "Query parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @DefaultValue("-efg") @QueryParam("enum_query_string") String enumQueryString -,@ApiParam(value = "Query parameter enum test (double)", allowableValues="1, -2") @QueryParam("enum_query_integer") Integer enumQueryInteger -,@ApiParam(value = "Query parameter enum test (double)", allowableValues="1.1, -1.2") @FormParam("enum_query_double") Double enumQueryDouble + public Response testEnumParameters(@ApiParam(value = "" ) Object body +,@ApiParam(value = "Header parameter enum test (string array)" , allowableValues="range=[-infinity, infinity]")@HeaderParam("enum_header_string_array") List enumHeaderStringArray +,@ApiParam(value = "Header parameter enum test (string)" )@HeaderParam("enum_header_string") String enumHeaderString +,@ApiParam(value = "Query parameter enum test (string array)", allowableValues="range=[-infinity, infinity]") @QueryParam("enum_query_string_array") List enumQueryStringArray +,@ApiParam(value = "Query parameter enum test (string)") @QueryParam("enum_query_string") String enumQueryString +,@ApiParam(value = "Query parameter enum test (double)") @QueryParam("enum_query_integer") Integer enumQueryInteger ,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.testEnumParameters(enumFormStringArray,enumFormString,enumHeaderStringArray,enumHeaderString,enumQueryStringArray,enumQueryString,enumQueryInteger,enumQueryDouble,securityContext); + return delegate.testEnumParameters(body,enumHeaderStringArray,enumHeaderString,enumQueryStringArray,enumQueryString,enumQueryInteger,securityContext); } + @POST @Path("/inline-additionalProperties") @Consumes({ "application/json" }) @@ -174,11 +168,12 @@ public Response testEnumParameters(@ApiParam(value = "Form parameter enum test ( @io.swagger.annotations.ApiOperation(value = "test inline additionalProperties", notes = "", response = Void.class, tags={ "fake", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - public Response testInlineAdditionalProperties(@ApiParam(value = "request body" ,required=true) Object param + public Response testInlineAdditionalProperties(@ApiParam(value = "request body" ,required=true) Map body ,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.testInlineAdditionalProperties(param,securityContext); + return delegate.testInlineAdditionalProperties(body,securityContext); } + @GET @Path("/jsonFormData") @Consumes({ "application/json" }) @@ -186,10 +181,11 @@ public Response testInlineAdditionalProperties(@ApiParam(value = "request body" @io.swagger.annotations.ApiOperation(value = "test json serialization of form data", notes = "", response = Void.class, tags={ "fake", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - public Response testJsonFormData(@ApiParam(value = "field1", required=true) @FormParam("param") String param -,@ApiParam(value = "field2", required=true) @FormParam("param2") String param2 + public Response testJsonFormData(@ApiParam(value = "" ,required=true) Object body ,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.testJsonFormData(param,param2,securityContext); + return delegate.testJsonFormData(body,securityContext); } + } + diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/FakeApiService.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/FakeApiService.java index 16ef0a8dbfb..9d94f0a1c50 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/FakeApiService.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/FakeApiService.java @@ -7,9 +7,10 @@ import java.math.BigDecimal; import io.swagger.model.Client; -import java.util.Date; import io.swagger.model.OuterComposite; + +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -17,16 +18,30 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; + import javax.validation.constraints.*; + + public abstract class FakeApiService { + public abstract Response fakeOuterBooleanSerialize(Boolean body,SecurityContext securityContext) throws NotFoundException; - public abstract Response fakeOuterCompositeSerialize(OuterComposite body,SecurityContext securityContext) throws NotFoundException; + + public abstract Response fakeOuterCompositeSerialize(OuterComposite outercomposite,SecurityContext securityContext) throws NotFoundException; + public abstract Response fakeOuterNumberSerialize(BigDecimal body,SecurityContext securityContext) throws NotFoundException; + public abstract Response fakeOuterStringSerialize(String body,SecurityContext securityContext) throws NotFoundException; - public abstract Response testClientModel(Client body,SecurityContext securityContext) throws NotFoundException; - public abstract Response testEndpointParameters(BigDecimal number,Double _double,String patternWithoutDelimiter,byte[] _byte,Integer integer,Integer int32,Long int64,Float _float,String string,byte[] binary,Date date,Date dateTime,String password,String paramCallback,SecurityContext securityContext) throws NotFoundException; - public abstract Response testEnumParameters(List enumFormStringArray,String enumFormString,List enumHeaderStringArray,String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger,Double enumQueryDouble,SecurityContext securityContext) throws NotFoundException; - public abstract Response testInlineAdditionalProperties(Object param,SecurityContext securityContext) throws NotFoundException; - public abstract Response testJsonFormData(String param,String param2,SecurityContext securityContext) throws NotFoundException; + + public abstract Response testClientModel(Client client,SecurityContext securityContext) throws NotFoundException; + + public abstract Response testEndpointParameters(Object body,SecurityContext securityContext) throws NotFoundException; + + public abstract Response testEnumParameters(Object body,List enumHeaderStringArray,String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger,SecurityContext securityContext) throws NotFoundException; + + public abstract Response testInlineAdditionalProperties(Map body,SecurityContext securityContext) throws NotFoundException; + + public abstract Response testJsonFormData(Object body,SecurityContext securityContext) throws NotFoundException; + } + diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/FakeClassnameTestApi.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/FakeClassnameTestApi.java index d72e946b99a..2d22653526e 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/FakeClassnameTestApi.java @@ -9,6 +9,7 @@ import io.swagger.model.Client; + import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -23,13 +24,16 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; import javax.ws.rs.*; + import javax.validation.constraints.*; + @Path("/fake_classname_test") @io.swagger.annotations.Api(description = "the fake_classname_test API") + public class FakeClassnameTestApi { private final FakeClassnameTestApiService delegate; @@ -54,18 +58,19 @@ public FakeClassnameTestApi(@Context ServletConfig servletContext) { this.delegate = delegate; } + @PATCH @Consumes({ "application/json" }) @Produces({ "application/json" }) - @io.swagger.annotations.ApiOperation(value = "To test class name in snake case", notes = "", response = Client.class, authorizations = { - @io.swagger.annotations.Authorization(value = "api_key_query") - }, tags={ "fake_classname_tags 123#$%^", }) + @io.swagger.annotations.ApiOperation(value = "To test class name in snake case", notes = "", response = Client.class, tags={ "fake_classname_tags 123#$%^", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - public Response testClassname(@ApiParam(value = "client model" ,required=true) Client body + public Response testClassname(@ApiParam(value = "client model" ,required=true) Client client ,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.testClassname(body,securityContext); + return delegate.testClassname(client,securityContext); } + } + diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/FakeClassnameTestApiService.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/FakeClassnameTestApiService.java index 9bf76fef9ef..c70eb68590a 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/FakeClassnameTestApiService.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/FakeClassnameTestApiService.java @@ -7,6 +7,8 @@ import io.swagger.model.Client; + +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -14,8 +16,14 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; + import javax.validation.constraints.*; + + public abstract class FakeClassnameTestApiService { - public abstract Response testClassname(Client body,SecurityContext securityContext) throws NotFoundException; + + public abstract Response testClassname(Client client,SecurityContext securityContext) throws NotFoundException; + } + diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/JacksonJsonProvider.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/JacksonJsonProvider.java index 60aa6ad1718..484860e63b0 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/JacksonJsonProvider.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/JacksonJsonProvider.java @@ -4,8 +4,11 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; + + import com.fasterxml.jackson.datatype.joda.*; + import com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider; import javax.ws.rs.Produces; @@ -21,7 +24,10 @@ public JacksonJsonProvider() { ObjectMapper objectMapper = new ObjectMapper() .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) + + .registerModule(new JodaModule()) + .setDateFormat(new RFC3339DateFormat()); setMapper(objectMapper); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/PetApi.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/PetApi.java index 0ce48e9ecb3..4ed59509225 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/PetApi.java @@ -7,10 +7,10 @@ import io.swagger.annotations.ApiParam; import io.swagger.jaxrs.*; -import java.io.File; import io.swagger.model.ModelApiResponse; import io.swagger.model.Pet; + import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -25,13 +25,16 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; import javax.ws.rs.*; + import javax.validation.constraints.*; + @Path("/pet") @io.swagger.annotations.Api(description = "the pet API") + public class PetApi { private final PetApiService delegate; @@ -56,70 +59,54 @@ public PetApi(@Context ServletConfig servletContext) { this.delegate = delegate; } + @POST @Consumes({ "application/json", "application/xml" }) - @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Add a new pet to the store", notes = "", response = Void.class, authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + + @io.swagger.annotations.ApiOperation(value = "Add a new pet to the store", notes = "", response = Void.class, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) - public Response addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet body + public Response addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet pet ,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.addPet(body,securityContext); + return delegate.addPet(pet,securityContext); } + @DELETE @Path("/{petId}") - @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + + @io.swagger.annotations.ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) - public Response deletePet(@ApiParam(value = "Pet id to delete",required=true) @PathParam("petId") Long petId + public Response deletePet(@ApiParam(value = "Pet id to delete",required=true) @PathParam("petId") Integer petId ,@ApiParam(value = "" )@HeaderParam("api_key") String apiKey ,@Context SecurityContext securityContext) throws NotFoundException { return delegate.deletePet(petId,apiKey,securityContext); } + @GET @Path("/findByStatus") @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + @io.swagger.annotations.ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid status value", response = Void.class) }) - public Response findPetsByStatus(@ApiParam(value = "Status values that need to be considered for filter",required=true, allowableValues="available, pending, sold") @QueryParam("status") List status + public Response findPetsByStatus(@ApiParam(value = "Status values that need to be considered for filter",required=true, allowableValues="range=[-infinity, infinity]") @QueryParam("status") List status ,@Context SecurityContext securityContext) throws NotFoundException { return delegate.findPetsByStatus(status,securityContext); } + @GET @Path("/findByTags") @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + @io.swagger.annotations.ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @@ -129,83 +116,68 @@ public Response findPetsByTags(@ApiParam(value = "Tags to filter by",required=tr throws NotFoundException { return delegate.findPetsByTags(tags,securityContext); } + @GET @Path("/{petId}") @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = { - @io.swagger.annotations.Authorization(value = "api_key") - }, tags={ "pet", }) + @io.swagger.annotations.ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class) }) - public Response getPetById(@ApiParam(value = "ID of pet to return",required=true) @PathParam("petId") Long petId + public Response getPetById(@ApiParam(value = "ID of pet to return",required=true) @PathParam("petId") Integer petId ,@Context SecurityContext securityContext) throws NotFoundException { return delegate.getPetById(petId,securityContext); } + @PUT @Consumes({ "application/json", "application/xml" }) - @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + + @io.swagger.annotations.ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class), @io.swagger.annotations.ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) - public Response updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet body + public Response updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet pet ,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.updatePet(body,securityContext); + return delegate.updatePet(pet,securityContext); } + @POST @Path("/{petId}") @Consumes({ "application/x-www-form-urlencoded" }) - @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + + @io.swagger.annotations.ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) - public Response updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true) @PathParam("petId") Long petId -,@ApiParam(value = "Updated name of the pet") @FormParam("name") String name -,@ApiParam(value = "Updated status of the pet") @FormParam("status") String status + public Response updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true) @PathParam("petId") Integer petId +,@ApiParam(value = "" ) Object body ,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.updatePetWithForm(petId,name,status,securityContext); + return delegate.updatePetWithForm(petId,body,securityContext); } + @POST @Path("/{petId}/uploadImage") @Consumes({ "multipart/form-data" }) @Produces({ "application/json" }) - @io.swagger.annotations.ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { - @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { - @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - }, tags={ "pet", }) + @io.swagger.annotations.ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - public Response uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathParam("petId") Long petId -,@ApiParam(value = "Additional data to pass to server")@FormDataParam("additionalMetadata") String additionalMetadata -, - @FormDataParam("file") InputStream fileInputStream, - @FormDataParam("file") FormDataContentDisposition fileDetail + public Response uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathParam("petId") Integer petId +,@ApiParam(value = "" ) Object body ,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.uploadFile(petId,additionalMetadata,fileInputStream, fileDetail,securityContext); + return delegate.uploadFile(petId,body,securityContext); } + } + diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/PetApiService.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/PetApiService.java index 31566759c5f..fb7665f68db 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/PetApiService.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/PetApiService.java @@ -5,10 +5,11 @@ import org.glassfish.jersey.media.multipart.FormDataContentDisposition; -import java.io.File; import io.swagger.model.ModelApiResponse; import io.swagger.model.Pet; + +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -16,15 +17,28 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; + import javax.validation.constraints.*; + + 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 addPet(Pet pet,SecurityContext securityContext) throws NotFoundException; + + public abstract Response deletePet(Integer petId,String apiKey,SecurityContext securityContext) throws NotFoundException; + public abstract Response findPetsByStatus( @NotNull List status,SecurityContext securityContext) throws NotFoundException; + public abstract Response findPetsByTags( @NotNull 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(Long petId,String additionalMetadata,InputStream fileInputStream, FormDataContentDisposition fileDetail,SecurityContext securityContext) throws NotFoundException; + + public abstract Response getPetById(Integer petId,SecurityContext securityContext) throws NotFoundException; + + public abstract Response updatePet(Pet pet,SecurityContext securityContext) throws NotFoundException; + + public abstract Response updatePetWithForm(Integer petId,Object body,SecurityContext securityContext) throws NotFoundException; + + public abstract Response uploadFile(Integer petId,Object body,SecurityContext securityContext) throws NotFoundException; + } + diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/StoreApi.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/StoreApi.java index ab75794709c..7040e173023 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/StoreApi.java @@ -10,6 +10,7 @@ import java.util.Map; import io.swagger.model.Order; + import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -24,13 +25,16 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; import javax.ws.rs.*; + import javax.validation.constraints.*; + @Path("/store") @io.swagger.annotations.Api(description = "the store API") + public class StoreApi { private final StoreApiService delegate; @@ -55,10 +59,11 @@ public StoreApi(@Context ServletConfig servletContext) { this.delegate = delegate; } + @DELETE @Path("/order/{order_id}") - @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = Void.class, tags={ "store", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @@ -69,19 +74,19 @@ public Response deleteOrder(@ApiParam(value = "ID of the order that needs to be throws NotFoundException { return delegate.deleteOrder(orderId,securityContext); } + @GET @Path("/inventory") @Produces({ "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { - @io.swagger.annotations.Authorization(value = "api_key") - }, tags={ "store", }) + @io.swagger.annotations.ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", tags={ "store", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) public Response getInventory(@Context SecurityContext securityContext) throws NotFoundException { return delegate.getInventory(securityContext); } + @GET @Path("/order/{order_id}") @@ -93,23 +98,26 @@ public Response getInventory(@Context SecurityContext securityContext) @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Void.class) }) - public Response getOrderById(@ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathParam("order_id") Long orderId + public Response getOrderById(@ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathParam("order_id") Integer orderId ,@Context SecurityContext securityContext) throws NotFoundException { return delegate.getOrderById(orderId,securityContext); } + @POST @Path("/order") - + @Consumes({ "*/*" }) @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid Order", response = Void.class) }) - public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true) Order body + public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true) Order order ,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.placeOrder(body,securityContext); + return delegate.placeOrder(order,securityContext); } + } + diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/StoreApiService.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/StoreApiService.java index 911c70033c4..59152f49fc0 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/StoreApiService.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/StoreApiService.java @@ -8,6 +8,8 @@ import java.util.Map; import io.swagger.model.Order; + +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -15,11 +17,20 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; + import javax.validation.constraints.*; + + 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( @Min(1) @Max(5)Long orderId,SecurityContext securityContext) throws NotFoundException; - public abstract Response placeOrder(Order body,SecurityContext securityContext) throws NotFoundException; + + public abstract Response getOrderById( @DecimalMin("1") @DecimalMax("5")Integer orderId,SecurityContext securityContext) throws NotFoundException; + + public abstract Response placeOrder(Order order,SecurityContext securityContext) throws NotFoundException; + } + diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/UserApi.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/UserApi.java index 3cc93e9043c..f95d5bfbb9b 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/UserApi.java @@ -7,9 +7,9 @@ import io.swagger.annotations.ApiParam; import io.swagger.jaxrs.*; -import java.util.List; import io.swagger.model.User; + import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -24,13 +24,16 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; import javax.ws.rs.*; + import javax.validation.constraints.*; + @Path("/user") @io.swagger.annotations.Api(description = "the user API") + public class UserApi { private final UserApiService delegate; @@ -55,22 +58,24 @@ public UserApi(@Context ServletConfig servletContext) { this.delegate = delegate; } + @POST + @Consumes({ "*/*" }) - @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - public Response createUser(@ApiParam(value = "Created user object" ,required=true) User body + public Response createUser(@ApiParam(value = "Created user object" ,required=true) User user ,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.createUser(body,securityContext); + return delegate.createUser(user,securityContext); } + @POST @Path("/createWithArray") + @Consumes({ "*/*" }) - @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) @@ -79,10 +84,11 @@ public Response createUsersWithArrayInput(@ApiParam(value = "List of user object throws NotFoundException { return delegate.createUsersWithArrayInput(body,securityContext); } + @POST @Path("/createWithList") + @Consumes({ "*/*" }) - @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) @@ -91,10 +97,11 @@ public Response createUsersWithListInput(@ApiParam(value = "List of user object" throws NotFoundException { return delegate.createUsersWithListInput(body,securityContext); } + @DELETE @Path("/{username}") - @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), @@ -105,6 +112,7 @@ public Response deleteUser(@ApiParam(value = "The name that needs to be deleted" throws NotFoundException { return delegate.deleteUser(username,securityContext); } + @GET @Path("/{username}") @@ -121,6 +129,7 @@ public Response getUserByName(@ApiParam(value = "The name that needs to be fetch throws NotFoundException { return delegate.getUserByName(username,securityContext); } + @GET @Path("/login") @@ -136,10 +145,11 @@ public Response loginUser(@ApiParam(value = "The user name for login",required=t throws NotFoundException { return delegate.loginUser(username,password,securityContext); } + @GET @Path("/logout") - @Produces({ "application/xml", "application/json" }) + @io.swagger.annotations.ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) @@ -147,19 +157,22 @@ public Response logoutUser(@Context SecurityContext securityContext) throws NotFoundException { return delegate.logoutUser(securityContext); } + @PUT @Path("/{username}") + @Consumes({ "*/*" }) - @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) - public Response updateUser(@ApiParam(value = "name that need to be deleted",required=true) @PathParam("username") String username -,@ApiParam(value = "Updated user object" ,required=true) User body + public Response updateUser(@ApiParam(value = "Updated user object" ,required=true) User user +,@ApiParam(value = "name that need to be deleted",required=true) @PathParam("username") String username ,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.updateUser(username,body,securityContext); + return delegate.updateUser(user,username,securityContext); } + } + diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/UserApiService.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/UserApiService.java index 8bbee3394d5..24fc51891c3 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/UserApiService.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/UserApiService.java @@ -5,9 +5,10 @@ import org.glassfish.jersey.media.multipart.FormDataContentDisposition; -import java.util.List; import io.swagger.model.User; + +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -15,15 +16,28 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; + import javax.validation.constraints.*; + + public abstract class UserApiService { - public abstract Response createUser(User body,SecurityContext securityContext) throws NotFoundException; + + public abstract Response createUser(User user,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( @NotNull String username, @NotNull 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; + + public abstract Response updateUser(User user,String username,SecurityContext securityContext) throws NotFoundException; + } + diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java index d2cbef7abb5..3f933b49554 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java @@ -13,7 +13,10 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; @@ -21,72 +24,137 @@ import java.util.HashMap; import java.util.List; import java.util.Map; + + + import javax.validation.constraints.*; + + + /** * AdditionalPropertiesClass */ public class AdditionalPropertiesClass { + + + + @JsonProperty("map_property") + + + private Map mapProperty = null; + + + + + + @JsonProperty("map_of_map_property") + + + private Map> mapOfMapProperty = null; + + + + + public AdditionalPropertiesClass mapProperty(Map mapProperty) { this.mapProperty = mapProperty; return this; } + + public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + if (this.mapProperty == null) { this.mapProperty = new HashMap(); } + this.mapProperty.put(key, mapPropertyItem); return this; } + + /** + + * Get mapProperty + + + * @return mapProperty **/ + + @JsonProperty("map_property") + @ApiModelProperty(value = "") + public Map getMapProperty() { return mapProperty; } + public void setMapProperty(Map mapProperty) { this.mapProperty = mapProperty; } + + + public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { this.mapOfMapProperty = mapOfMapProperty; return this; } + + public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + if (this.mapOfMapProperty == null) { this.mapOfMapProperty = new HashMap>(); } + this.mapOfMapProperty.put(key, mapOfMapPropertyItem); return this; } + + /** + + * Get mapOfMapProperty + + + * @return mapOfMapProperty **/ + + @JsonProperty("map_of_map_property") + @ApiModelProperty(value = "") + public Map> getMapOfMapProperty() { return mapOfMapProperty; } + public void setMapOfMapProperty(Map> mapOfMapProperty) { this.mapOfMapProperty = mapOfMapProperty; } + + + @Override @@ -108,6 +176,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -131,3 +201,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Animal.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Animal.java index 8f1fdfd45bb..95f65d55469 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Animal.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Animal.java @@ -13,64 +13,127 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + + + import javax.validation.constraints.*; + + + /** * Animal */ public class Animal { + + + + @JsonProperty("className") + + + + private String className = null; + + + + + @JsonProperty("color") + + + + private String color = "red"; + + + + public Animal className(String className) { this.className = className; return this; } + + + /** + + * Get className + + + * @return className **/ + + @JsonProperty("className") + @ApiModelProperty(required = true, value = "") + @NotNull + public String getClassName() { return className; } + public void setClassName(String className) { this.className = className; } + + + public Animal color(String color) { this.color = color; return this; } + + + /** + + * Get color + + + * @return color **/ + + @JsonProperty("color") + @ApiModelProperty(value = "") + public String getColor() { return color; } + public void setColor(String color) { this.color = color; } + + + @Override @@ -92,6 +155,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -115,3 +180,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/AnimalFarm.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/AnimalFarm.java index be5b217a5c0..faee4225a03 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/AnimalFarm.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/AnimalFarm.java @@ -13,17 +13,29 @@ package io.swagger.model; + import java.util.Objects; + + import io.swagger.model.Animal; import java.util.ArrayList; import java.util.List; + + + import javax.validation.constraints.*; + + + /** * AnimalFarm */ public class AnimalFarm extends ArrayList { + + + @Override public boolean equals(java.lang.Object o) { @@ -38,10 +50,12 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(super.hashCode()); + return Objects.hash(); } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -63,3 +77,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java index 7dcd2118293..8da6a4ed646 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java @@ -13,7 +13,10 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; @@ -21,42 +24,79 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; + + + import javax.validation.constraints.*; + + + /** * ArrayOfArrayOfNumberOnly */ public class ArrayOfArrayOfNumberOnly { + + + + @JsonProperty("ArrayArrayNumber") + + + private List> arrayArrayNumber = null; + + + + + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; return this; } + public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { this.arrayArrayNumber = new ArrayList>(); } + this.arrayArrayNumber.add(arrayArrayNumberItem); return this; } + + + /** + + * Get arrayArrayNumber + + + * @return arrayArrayNumber **/ + + @JsonProperty("ArrayArrayNumber") + @ApiModelProperty(value = "") + public List> getArrayArrayNumber() { return arrayArrayNumber; } + public void setArrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; } + + + @Override @@ -77,6 +117,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -99,3 +141,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java index 05331fa55e9..d572230b45c 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java @@ -13,7 +13,10 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; @@ -21,42 +24,79 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; + + + import javax.validation.constraints.*; + + + /** * ArrayOfNumberOnly */ public class ArrayOfNumberOnly { + + + + @JsonProperty("ArrayNumber") + + + private List arrayNumber = null; + + + + + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; return this; } + public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { this.arrayNumber = new ArrayList(); } + this.arrayNumber.add(arrayNumberItem); return this; } + + + /** + + * Get arrayNumber + + + * @return arrayNumber **/ + + @JsonProperty("ArrayNumber") + @ApiModelProperty(value = "") + public List getArrayNumber() { return arrayNumber; } + public void setArrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; } + + + @Override @@ -77,6 +117,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -99,3 +141,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ArrayTest.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ArrayTest.java index 295a1ea1f14..67b1c3f79e0 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ArrayTest.java @@ -13,7 +13,10 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; @@ -21,102 +24,195 @@ import io.swagger.model.ReadOnlyFirst; import java.util.ArrayList; import java.util.List; + + + import javax.validation.constraints.*; + + + /** * ArrayTest */ public class ArrayTest { + + + + @JsonProperty("array_of_string") + + + private List arrayOfString = null; + + + + + + @JsonProperty("array_array_of_integer") + + + private List> arrayArrayOfInteger = null; + + + + + + @JsonProperty("array_array_of_model") + + + private List> arrayArrayOfModel = null; + + + + + public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; return this; } + public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { this.arrayOfString = new ArrayList(); } + this.arrayOfString.add(arrayOfStringItem); return this; } + + + /** + + * Get arrayOfString + + + * @return arrayOfString **/ + + @JsonProperty("array_of_string") + @ApiModelProperty(value = "") + public List getArrayOfString() { return arrayOfString; } + public void setArrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; } + + + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; return this; } + public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { this.arrayArrayOfInteger = new ArrayList>(); } + this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; } + + + /** + + * Get arrayArrayOfInteger + + + * @return arrayArrayOfInteger **/ + + @JsonProperty("array_array_of_integer") + @ApiModelProperty(value = "") + public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; } + + + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; return this; } + public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { this.arrayArrayOfModel = new ArrayList>(); } + this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; } + + + /** + + * Get arrayArrayOfModel + + + * @return arrayArrayOfModel **/ + + @JsonProperty("array_array_of_model") + @ApiModelProperty(value = "") + public List> getArrayArrayOfModel() { return arrayArrayOfModel; } + public void setArrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } + + + @Override @@ -139,6 +235,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -163,3 +261,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Capitalization.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Capitalization.java index 6ee896a961d..b837c520bd6 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Capitalization.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Capitalization.java @@ -13,149 +13,311 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + + + import javax.validation.constraints.*; + + + /** * Capitalization */ public class Capitalization { + + + + @JsonProperty("smallCamel") + + + + private String smallCamel = null; + + + + + @JsonProperty("CapitalCamel") + + + + private String capitalCamel = null; + + + + + @JsonProperty("small_Snake") + + + + private String smallSnake = null; + + + + + @JsonProperty("Capital_Snake") + + + + private String capitalSnake = null; + + + + + @JsonProperty("SCA_ETH_Flow_Points") + + + + private String scAETHFlowPoints = null; + + + + + @JsonProperty("ATT_NAME") + + + + private String ATT_NAME = null; + + + + public Capitalization smallCamel(String smallCamel) { this.smallCamel = smallCamel; return this; } + + + /** + + * Get smallCamel + + + * @return smallCamel **/ + + @JsonProperty("smallCamel") + @ApiModelProperty(value = "") + public String getSmallCamel() { return smallCamel; } + public void setSmallCamel(String smallCamel) { this.smallCamel = smallCamel; } + + + public Capitalization capitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; return this; } + + + /** + + * Get capitalCamel + + + * @return capitalCamel **/ + + @JsonProperty("CapitalCamel") + @ApiModelProperty(value = "") + public String getCapitalCamel() { return capitalCamel; } + public void setCapitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; } + + + public Capitalization smallSnake(String smallSnake) { this.smallSnake = smallSnake; return this; } + + + /** + + * Get smallSnake + + + * @return smallSnake **/ + + @JsonProperty("small_Snake") + @ApiModelProperty(value = "") + public String getSmallSnake() { return smallSnake; } + public void setSmallSnake(String smallSnake) { this.smallSnake = smallSnake; } + + + public Capitalization capitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; return this; } + + + /** + + * Get capitalSnake + + + * @return capitalSnake **/ + + @JsonProperty("Capital_Snake") + @ApiModelProperty(value = "") + public String getCapitalSnake() { return capitalSnake; } + public void setCapitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; } + + + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; return this; } + + + /** + + * Get scAETHFlowPoints + + + * @return scAETHFlowPoints **/ + + @JsonProperty("SCA_ETH_Flow_Points") + @ApiModelProperty(value = "") + public String getScAETHFlowPoints() { return scAETHFlowPoints; } + public void setScAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; } + + + public Capitalization ATT_NAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; return this; } + + + /** + * Name of the pet + + + + * @return ATT_NAME **/ + + @JsonProperty("ATT_NAME") + @ApiModelProperty(value = "Name of the pet ") + public String getATTNAME() { return ATT_NAME; } + public void setATTNAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; } + + + @Override @@ -181,6 +343,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -208,3 +372,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Cat.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Cat.java index b96cffbbd79..bda7f6d885d 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Cat.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Cat.java @@ -13,40 +13,173 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import io.swagger.model.Animal; + + + import javax.validation.constraints.*; + + + /** * Cat */ public class Cat extends Animal { + + + + + @JsonProperty("className") + + + + + private String className = null; + + + + + + + @JsonProperty("color") + + + + + private String color = "red"; + + + + + + @JsonProperty("declawed") + + + + private Boolean declawed = null; + + + + + + public Cat className(String className) { + this.className = className; + return this; + } + + + + + /** + + + * Get className + + + + * @return className + **/ + + + @JsonProperty("className") + + @ApiModelProperty(required = true, value = "") + + @NotNull + + public String getClassName() { + return className; + } + + public void setClassName(String className) { + this.className = className; + } + + + + + public Cat color(String color) { + this.color = color; + return this; + } + + + + + /** + + + * Get color + + + + * @return color + **/ + + + @JsonProperty("color") + + @ApiModelProperty(value = "") + + public String getColor() { + return color; + } + + + public void setColor(String color) { + this.color = color; + } + + + + public Cat declawed(Boolean declawed) { this.declawed = declawed; return this; } + + + /** + + * Get declawed + + + * @return declawed **/ + + @JsonProperty("declawed") + @ApiModelProperty(value = "") - public Boolean isDeclawed() { + + public Boolean isisDeclawed() { return declawed; } + public void setDeclawed(Boolean declawed) { this.declawed = declawed; } + + + @Override @@ -58,21 +191,27 @@ public boolean equals(java.lang.Object o) { return false; } Cat cat = (Cat) o; - return Objects.equals(this.declawed, cat.declawed) && + return Objects.equals(this.className, cat.className) && + Objects.equals(this.color, cat.color) && + Objects.equals(this.declawed, cat.declawed) && super.equals(o); } @Override public int hashCode() { - return Objects.hash(declawed, super.hashCode()); + return Objects.hash(className, color, declawed, super.hashCode()); } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Cat {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); sb.append("}"); return sb.toString(); @@ -90,3 +229,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Category.java index 0408b4d6acf..37b9fe98e41 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Category.java @@ -13,61 +13,123 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + + + import javax.validation.constraints.*; + + + /** * Category */ public class Category { + + + + @JsonProperty("id") + + + + private Long id = null; + + + + + @JsonProperty("name") + + + + private String name = null; + + + + public Category id(Long id) { this.id = id; return this; } + + + /** + + * Get id + + + * @return id **/ + + @JsonProperty("id") + @ApiModelProperty(value = "") + public Long getId() { return id; } + public void setId(Long id) { this.id = id; } + + + public Category name(String name) { this.name = name; return this; } + + + /** + + * Get name + + + * @return name **/ + + @JsonProperty("name") + @ApiModelProperty(value = "") + public String getName() { return name; } + public void setName(String name) { this.name = name; } + + + @Override @@ -89,6 +151,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -112,3 +176,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ClassModel.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ClassModel.java index e96a4ff4eb8..8667943daef 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ClassModel.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ClassModel.java @@ -13,40 +13,77 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + + + import javax.validation.constraints.*; + + + /** * Model for testing model with \"_class\" property */ @ApiModel(description = "Model for testing model with \"_class\" property") public class ClassModel { + + + + @JsonProperty("_class") + + + + private String propertyClass = null; + + + + public ClassModel propertyClass(String propertyClass) { this.propertyClass = propertyClass; return this; } + + + /** + + * Get propertyClass + + + * @return propertyClass **/ + + @JsonProperty("_class") + @ApiModelProperty(value = "") + public String getPropertyClass() { return propertyClass; } + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } + + + @Override @@ -67,6 +104,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -89,3 +128,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Client.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Client.java index 7bae1955cb3..5e8e716bc01 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Client.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Client.java @@ -13,39 +13,76 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + + + import javax.validation.constraints.*; + + + /** * Client */ public class Client { + + + + @JsonProperty("client") + + + + private String client = null; + + + + public Client client(String client) { this.client = client; return this; } + + + /** + + * Get client + + + * @return client **/ + + @JsonProperty("client") + @ApiModelProperty(value = "") + public String getClient() { return client; } + public void setClient(String client) { this.client = client; } + + + @Override @@ -66,6 +103,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -88,3 +127,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Dog.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Dog.java index 94fd1071a92..5513088ecd1 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Dog.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Dog.java @@ -13,40 +13,173 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import io.swagger.model.Animal; + + + import javax.validation.constraints.*; + + + /** * Dog */ public class Dog extends Animal { + + + + + @JsonProperty("className") + + + + + private String className = null; + + + + + + + @JsonProperty("color") + + + + + private String color = "red"; + + + + + + @JsonProperty("breed") + + + + private String breed = null; + + + + + + public Dog className(String className) { + this.className = className; + return this; + } + + + + + /** + + + * Get className + + + + * @return className + **/ + + + @JsonProperty("className") + + @ApiModelProperty(required = true, value = "") + + @NotNull + + public String getClassName() { + return className; + } + + public void setClassName(String className) { + this.className = className; + } + + + + + public Dog color(String color) { + this.color = color; + return this; + } + + + + + /** + + + * Get color + + + + * @return color + **/ + + + @JsonProperty("color") + + @ApiModelProperty(value = "") + + public String getColor() { + return color; + } + + + public void setColor(String color) { + this.color = color; + } + + + + public Dog breed(String breed) { this.breed = breed; return this; } + + + /** + + * Get breed + + + * @return breed **/ + + @JsonProperty("breed") + @ApiModelProperty(value = "") + public String getBreed() { return breed; } + public void setBreed(String breed) { this.breed = breed; } + + + @Override @@ -58,21 +191,27 @@ public boolean equals(java.lang.Object o) { return false; } Dog dog = (Dog) o; - return Objects.equals(this.breed, dog.breed) && + return Objects.equals(this.className, dog.className) && + Objects.equals(this.color, dog.color) && + Objects.equals(this.breed, dog.breed) && super.equals(o); } @Override public int hashCode() { - return Objects.hash(breed, super.hashCode()); + return Objects.hash(className, color, breed, super.hashCode()); } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Dog {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); sb.append("}"); return sb.toString(); @@ -90,3 +229,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/EnumArrays.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/EnumArrays.java index 8542c26fea8..4551dda9140 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/EnumArrays.java @@ -13,7 +13,10 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -21,20 +24,37 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; + + + import javax.validation.constraints.*; + + + /** * EnumArrays */ public class EnumArrays { + + + /** * Gets or Sets justSymbol */ public enum JustSymbolEnum { + + + + GREATER_THAN_OR_EQUAL_TO(">="), + DOLLAR("$"); + + + private String value; @@ -59,16 +79,40 @@ public static JustSymbolEnum fromValue(String text) { } } + + + + @JsonProperty("just_symbol") + + + + private JustSymbolEnum justSymbol = null; + + + + + + + + /** * Gets or Sets arrayEnum */ public enum ArrayEnumEnum { + + + + FISH("fish"), + CRAB("crab"); + + + private String value; @@ -93,54 +137,101 @@ public static ArrayEnumEnum fromValue(String text) { } } + + + + @JsonProperty("array_enum") + + + private List arrayEnum = null; + + + + + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; return this; } + + + /** + + * Get justSymbol + + + * @return justSymbol **/ + + @JsonProperty("just_symbol") + @ApiModelProperty(value = "") + public JustSymbolEnum getJustSymbol() { return justSymbol; } + public void setJustSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; } + + + public EnumArrays arrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; return this; } + public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { this.arrayEnum = new ArrayList(); } + this.arrayEnum.add(arrayEnumItem); return this; } + + + /** + + * Get arrayEnum + + + * @return arrayEnum **/ + + @JsonProperty("array_enum") + @ApiModelProperty(value = "") + public List getArrayEnum() { return arrayEnum; } + public void setArrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; } + + + @Override @@ -162,6 +253,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -185,3 +278,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/EnumClass.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/EnumClass.java index 1a5899f15d0..628bdaf0d7f 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/EnumClass.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/EnumClass.java @@ -13,22 +13,36 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonValue; + + + import javax.validation.constraints.*; + + + + import com.fasterxml.jackson.annotation.JsonCreator; + /** * Gets or Sets EnumClass */ public enum EnumClass { + + _ABC("_abc"), _EFG("-efg"), _XYZ_("(xyz)"); + private String value; @@ -41,6 +55,7 @@ public String toString() { return String.valueOf(value); } + @JsonCreator public static EnumClass fromValue(String text) { for (EnumClass b : EnumClass.values()) { @@ -50,5 +65,8 @@ public static EnumClass fromValue(String text) { } return null; } + } + + diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/EnumTest.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/EnumTest.java index e233d15e2a9..2b3d3b3b8df 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/EnumTest.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/EnumTest.java @@ -13,29 +13,50 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import io.swagger.model.OuterEnum; + + + import javax.validation.constraints.*; + + + /** * EnumTest */ public class EnumTest { + + + /** * Gets or Sets enumString */ public enum EnumStringEnum { + + + + UPPER("UPPER"), + LOWER("lower"), + EMPTY(""); + + + private String value; @@ -60,16 +81,36 @@ public static EnumStringEnum fromValue(String text) { } } + + + + @JsonProperty("enum_string") + + + + private EnumStringEnum enumString = null; + + + + /** * Gets or Sets enumInteger */ public enum EnumIntegerEnum { + + + + NUMBER_1(1), + NUMBER_MINUS_1(-1); + + + private Integer value; @@ -94,16 +135,36 @@ public static EnumIntegerEnum fromValue(String text) { } } + + + + @JsonProperty("enum_integer") + + + + private EnumIntegerEnum enumInteger = null; + + + + /** * Gets or Sets enumNumber */ public enum EnumNumberEnum { + + + + NUMBER_1_DOT_1(1.1), + NUMBER_MINUS_1_DOT_2(-1.2); + + + private Double value; @@ -128,87 +189,172 @@ public static EnumNumberEnum fromValue(String text) { } } + + + + @JsonProperty("enum_number") + + + + private EnumNumberEnum enumNumber = null; + + + + + @JsonProperty("outerEnum") + + + + private OuterEnum outerEnum = null; + + + + public EnumTest enumString(EnumStringEnum enumString) { this.enumString = enumString; return this; } + + + /** + + * Get enumString + + + * @return enumString **/ + + @JsonProperty("enum_string") + @ApiModelProperty(value = "") + public EnumStringEnum getEnumString() { return enumString; } + public void setEnumString(EnumStringEnum enumString) { this.enumString = enumString; } + + + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; return this; } + + + /** + + * Get enumInteger + + + * @return enumInteger **/ + + @JsonProperty("enum_integer") + @ApiModelProperty(value = "") + public EnumIntegerEnum getEnumInteger() { return enumInteger; } + public void setEnumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; } + + + public EnumTest enumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; return this; } + + + /** + + * Get enumNumber + + + * @return enumNumber **/ + + @JsonProperty("enum_number") + @ApiModelProperty(value = "") + public EnumNumberEnum getEnumNumber() { return enumNumber; } + public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } + + + public EnumTest outerEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; return this; } + + + /** + + * Get outerEnum + + + * @return outerEnum **/ + + @JsonProperty("outerEnum") + @ApiModelProperty(value = "") + public OuterEnum getOuterEnum() { return outerEnum; } + public void setOuterEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; } + + + @Override @@ -232,6 +378,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -257,3 +405,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/FormatTest.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/FormatTest.java index bc552c619c3..d53abead37a 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/FormatTest.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/FormatTest.java @@ -13,7 +13,10 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; @@ -21,312 +24,648 @@ import java.math.BigDecimal; import java.util.Date; import java.util.UUID; + + + import javax.validation.constraints.*; + + + /** * FormatTest */ public class FormatTest { + + + + @JsonProperty("integer") + + + + private Integer integer = null; + + + + + @JsonProperty("int32") + + + + private Integer int32 = null; + + + + + @JsonProperty("int64") + + + + private Long int64 = null; + + + + + @JsonProperty("number") + + + + private BigDecimal number = null; + + + + + @JsonProperty("float") + + + + private Float _float = null; + + + + + @JsonProperty("double") + + + + private Double _double = null; + + + + + @JsonProperty("string") + + + + private String string = null; + + + + + @JsonProperty("byte") - private byte[] _byte = null; - + + + + + private String _byte = null; + + + + + + @JsonProperty("binary") - private byte[] binary = null; - + + + + + private String binary = null; + + + + + + @JsonProperty("date") + + + + private Date date = null; + + + + + @JsonProperty("dateTime") + + + + private Date dateTime = null; + + + + + @JsonProperty("uuid") + + + + private UUID uuid = null; + + + + + @JsonProperty("password") + + + + private String password = null; + + + + public FormatTest integer(Integer integer) { this.integer = integer; return this; } + + + /** + + * Get integer + + * minimum: 10 + + * maximum: 100 + * @return integer **/ + + @JsonProperty("integer") + @ApiModelProperty(value = "") + @Min(10) @Max(100) public Integer getInteger() { return integer; } + public void setInteger(Integer integer) { this.integer = integer; } + + + public FormatTest int32(Integer int32) { this.int32 = int32; return this; } + + + /** + + * Get int32 + + * minimum: 20 + + * maximum: 200 + * @return int32 **/ + + @JsonProperty("int32") + @ApiModelProperty(value = "") + @Min(20) @Max(200) public Integer getInt32() { return int32; } + public void setInt32(Integer int32) { this.int32 = int32; } + + + public FormatTest int64(Long int64) { this.int64 = int64; return this; } + + + /** + + * Get int64 + + + * @return int64 **/ + + @JsonProperty("int64") + @ApiModelProperty(value = "") + public Long getInt64() { return int64; } + public void setInt64(Long int64) { this.int64 = int64; } + + + public FormatTest number(BigDecimal number) { this.number = number; return this; } + + + /** + + * Get number - * minimum: 32.1 - * maximum: 543.2 + + + * @return number **/ + + @JsonProperty("number") + @ApiModelProperty(required = true, value = "") + @NotNull - @DecimalMin("32.1") @DecimalMax("543.2") public BigDecimal getNumber() { + + public BigDecimal getNumber() { return number; } + public void setNumber(BigDecimal number) { this.number = number; } + + + public FormatTest _float(Float _float) { this._float = _float; return this; } + + + /** + + * Get _float - * minimum: 54.3 - * maximum: 987.6 + + + * @return _float **/ + + @JsonProperty("float") + @ApiModelProperty(value = "") - @DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { + + public Float getFloat() { return _float; } + public void setFloat(Float _float) { this._float = _float; } + + + public FormatTest _double(Double _double) { this._double = _double; return this; } + + + /** + + * Get _double - * minimum: 67.8 - * maximum: 123.4 + + + * @return _double **/ + + @JsonProperty("double") + @ApiModelProperty(value = "") - @DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { + + public Double getDouble() { return _double; } + public void setDouble(Double _double) { this._double = _double; } + + + public FormatTest string(String string) { this.string = string; return this; } + + + /** + + * Get string + + + * @return string **/ + + @JsonProperty("string") + @ApiModelProperty(value = "") + @Pattern(regexp="/[a-z]/i") public String getString() { return string; } + public void setString(String string) { this.string = string; } + - public FormatTest _byte(byte[] _byte) { + + + public FormatTest _byte(String _byte) { this._byte = _byte; return this; } + + + /** + + * Get _byte + + + * @return _byte **/ + + @JsonProperty("byte") + @ApiModelProperty(required = true, value = "") + @NotNull - @Pattern(regexp="^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$") public byte[] getByte() { + + @Pattern(regexp="^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$") public String getByte() { return _byte; } + - public void setByte(byte[] _byte) { + public void setByte(String _byte) { this._byte = _byte; } + - public FormatTest binary(byte[] binary) { + + + public FormatTest binary(String binary) { this.binary = binary; return this; } + + + /** + + * Get binary + + + * @return binary **/ + + @JsonProperty("binary") + @ApiModelProperty(value = "") - public byte[] getBinary() { + + public String getBinary() { return binary; } + - public void setBinary(byte[] binary) { + public void setBinary(String binary) { this.binary = binary; } + + + public FormatTest date(Date date) { this.date = date; return this; } + + + /** + + * Get date + + + * @return date **/ + + @JsonProperty("date") + @ApiModelProperty(required = true, value = "") + @NotNull + public Date getDate() { return date; } + public void setDate(Date date) { this.date = date; } + + + public FormatTest dateTime(Date dateTime) { this.dateTime = dateTime; return this; } + + + /** + + * Get dateTime + + + * @return dateTime **/ + + @JsonProperty("dateTime") + @ApiModelProperty(value = "") + public Date getDateTime() { return dateTime; } + public void setDateTime(Date dateTime) { this.dateTime = dateTime; } + + + public FormatTest uuid(UUID uuid) { this.uuid = uuid; return this; } + + + /** + + * Get uuid + + + * @return uuid **/ + + @JsonProperty("uuid") + @ApiModelProperty(value = "") + public UUID getUuid() { return uuid; } + public void setUuid(UUID uuid) { this.uuid = uuid; } + + + public FormatTest password(String password) { this.password = password; return this; } + + + /** + + * Get password + + + * @return password **/ + + @JsonProperty("password") + @ApiModelProperty(required = true, value = "") + @NotNull - @Size(min=10,max=64) public String getPassword() { + + public String getPassword() { return password; } + public void setPassword(String password) { this.password = password; } + + + @Override @@ -359,6 +698,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -393,3 +734,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/HasOnlyReadOnly.java index 02480c10c65..5324359eb14 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/HasOnlyReadOnly.java @@ -13,43 +13,123 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + + + import javax.validation.constraints.*; + + + /** * HasOnlyReadOnly */ public class HasOnlyReadOnly { + + + + @JsonProperty("bar") + + + + private String bar = null; + + + + + @JsonProperty("foo") + + + + private String foo = null; + + + + + + public HasOnlyReadOnly bar(String bar) { + this.bar = bar; + return this; + } + + + /** + + * Get bar + + + * @return bar **/ + + @JsonProperty("bar") + @ApiModelProperty(value = "") + public String getBar() { return bar; } + + + public void setBar(String bar) { + this.bar = bar; + } + + + + public HasOnlyReadOnly foo(String foo) { + this.foo = foo; + return this; + } + + + + /** + + * Get foo + + + * @return foo **/ + + @JsonProperty("foo") + @ApiModelProperty(value = "") + public String getFoo() { return foo; } + + + public void setFoo(String foo) { + this.foo = foo; + } + + + @Override @@ -71,6 +151,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -94,3 +176,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/MapTest.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/MapTest.java index 73c04c4bd63..7cbd27f23a0 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/MapTest.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/MapTest.java @@ -13,7 +13,10 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -22,23 +25,53 @@ import java.util.HashMap; import java.util.List; import java.util.Map; + + + import javax.validation.constraints.*; + + + /** * MapTest */ public class MapTest { + + + + @JsonProperty("map_map_of_string") + + + private Map> mapMapOfString = null; + + + + + + + + + /** * Gets or Sets inner */ public enum InnerEnum { + + + + UPPER("UPPER"), + LOWER("lower"); + + + private String value; @@ -63,62 +96,112 @@ public static InnerEnum fromValue(String text) { } } + + + + @JsonProperty("map_of_enum_string") + + + private Map mapOfEnumString = null; + + + + + public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; return this; } + + public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { this.mapMapOfString = new HashMap>(); } + this.mapMapOfString.put(key, mapMapOfStringItem); return this; } + + /** + + * Get mapMapOfString + + + * @return mapMapOfString **/ + + @JsonProperty("map_map_of_string") + @ApiModelProperty(value = "") + public Map> getMapMapOfString() { return mapMapOfString; } + public void setMapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; } + + + public MapTest mapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; return this; } + + public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { this.mapOfEnumString = new HashMap(); } + this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; } + + /** + + * Get mapOfEnumString + + + * @return mapOfEnumString **/ + + @JsonProperty("map_of_enum_string") + @ApiModelProperty(value = "") + public Map getMapOfEnumString() { return mapOfEnumString; } + public void setMapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; } + + + @Override @@ -140,6 +223,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -163,3 +248,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java index 5e1d96f5ecc..f10ecd02304 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -13,7 +13,10 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; @@ -24,86 +27,173 @@ import java.util.List; import java.util.Map; import java.util.UUID; + + + import javax.validation.constraints.*; + + + /** * MixedPropertiesAndAdditionalPropertiesClass */ public class MixedPropertiesAndAdditionalPropertiesClass { + + + + @JsonProperty("uuid") + + + + private UUID uuid = null; + + + + + @JsonProperty("dateTime") + + + + private Date dateTime = null; + + + + + @JsonProperty("map") + + + private Map map = null; + + + + + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; return this; } + + + /** + + * Get uuid + + + * @return uuid **/ + + @JsonProperty("uuid") + @ApiModelProperty(value = "") + public UUID getUuid() { return uuid; } + public void setUuid(UUID uuid) { this.uuid = uuid; } + + + public MixedPropertiesAndAdditionalPropertiesClass dateTime(Date dateTime) { this.dateTime = dateTime; return this; } + + + /** + + * Get dateTime + + + * @return dateTime **/ + + @JsonProperty("dateTime") + @ApiModelProperty(value = "") + public Date getDateTime() { return dateTime; } + public void setDateTime(Date dateTime) { this.dateTime = dateTime; } + + + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { this.map = map; return this; } + + public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { this.map = new HashMap(); } + this.map.put(key, mapItem); return this; } + + /** + + * Get map + + + * @return map **/ + + @JsonProperty("map") + @ApiModelProperty(value = "") + public Map getMap() { return map; } + public void setMap(Map map) { this.map = map; } + + + @Override @@ -126,6 +216,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -150,3 +242,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Model200Response.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Model200Response.java index 954ef7ebed3..d43a8ebe5a9 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Model200Response.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Model200Response.java @@ -13,62 +13,124 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + + + import javax.validation.constraints.*; + + + /** * Model for testing model name starting with number */ @ApiModel(description = "Model for testing model name starting with number") public class Model200Response { + + + + @JsonProperty("name") + + + + private Integer name = null; + + + + + @JsonProperty("class") + + + + private String propertyClass = null; + + + + public Model200Response name(Integer name) { this.name = name; return this; } + + + /** + + * Get name + + + * @return name **/ + + @JsonProperty("name") + @ApiModelProperty(value = "") + public Integer getName() { return name; } + public void setName(Integer name) { this.name = name; } + + + public Model200Response propertyClass(String propertyClass) { this.propertyClass = propertyClass; return this; } + + + /** + + * Get propertyClass + + + * @return propertyClass **/ + + @JsonProperty("class") + @ApiModelProperty(value = "") + public String getPropertyClass() { return propertyClass; } + public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } + + + @Override @@ -90,6 +152,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -113,3 +177,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ModelApiResponse.java index 2a54b591b32..98ccbc01819 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -13,83 +13,170 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + + + import javax.validation.constraints.*; + + + /** * ModelApiResponse */ public class ModelApiResponse { + + + + @JsonProperty("code") + + + + private Integer code = null; + + + + + @JsonProperty("type") + + + + private String type = null; + + + + + @JsonProperty("message") + + + + private String message = null; + + + + public ModelApiResponse code(Integer code) { this.code = code; return this; } + + + /** + + * Get code + + + * @return code **/ + + @JsonProperty("code") + @ApiModelProperty(value = "") + public Integer getCode() { return code; } + public void setCode(Integer code) { this.code = code; } + + + public ModelApiResponse type(String type) { this.type = type; return this; } + + + /** + + * Get type + + + * @return type **/ + + @JsonProperty("type") + @ApiModelProperty(value = "") + public String getType() { return type; } + public void setType(String type) { this.type = type; } + + + public ModelApiResponse message(String message) { this.message = message; return this; } + + + /** + + * Get message + + + * @return message **/ + + @JsonProperty("message") + @ApiModelProperty(value = "") + public String getMessage() { return message; } + public void setMessage(String message) { this.message = message; } + + + @Override @@ -112,6 +199,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -136,3 +225,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ModelReturn.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ModelReturn.java index 12b213d6afb..5fdd63263f8 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ModelReturn.java @@ -13,40 +13,77 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + + + import javax.validation.constraints.*; + + + /** * Model for testing reserved words */ @ApiModel(description = "Model for testing reserved words") public class ModelReturn { + + + + @JsonProperty("return") + + + + private Integer _return = null; + + + + public ModelReturn _return(Integer _return) { this._return = _return; return this; } + + + /** + + * Get _return + + + * @return _return **/ + + @JsonProperty("return") + @ApiModelProperty(value = "") + public Integer getReturn() { return _return; } + public void setReturn(Integer _return) { this._return = _return; } + + + @Override @@ -67,6 +104,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -89,3 +128,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Name.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Name.java index 771531b30ab..ad6d4dc2927 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Name.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Name.java @@ -13,89 +13,220 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + + + import javax.validation.constraints.*; + + + /** * Model for testing model name same as property name */ @ApiModel(description = "Model for testing model name same as property name") public class Name { + + + + @JsonProperty("name") + + + + private Integer name = null; + + + + + @JsonProperty("snake_case") + + + + private Integer snakeCase = null; + + + + + @JsonProperty("property") + + + + private String property = null; + + + + + @JsonProperty("123Number") + + + + private Integer _123Number = null; + + + + public Name name(Integer name) { this.name = name; return this; } + + + /** + + * Get name + + + * @return name **/ + + @JsonProperty("name") + @ApiModelProperty(required = true, value = "") + @NotNull + public Integer getName() { return name; } + public void setName(Integer name) { this.name = name; } + + + + public Name snakeCase(Integer snakeCase) { + this.snakeCase = snakeCase; + return this; + } + + + + /** + + * Get snakeCase + + + * @return snakeCase **/ + + @JsonProperty("snake_case") + @ApiModelProperty(value = "") + public Integer getSnakeCase() { return snakeCase; } + + public void setSnakeCase(Integer snakeCase) { + this.snakeCase = snakeCase; + } + + + + public Name property(String property) { this.property = property; return this; } + + + /** + + * Get property + + + * @return property **/ + + @JsonProperty("property") + @ApiModelProperty(value = "") + public String getProperty() { return property; } + public void setProperty(String property) { this.property = property; } + + + + + public Name _123Number(Integer _123Number) { + this._123Number = _123Number; + return this; + } + + + /** + + * Get _123Number + + + * @return _123Number **/ + + @JsonProperty("123Number") + @ApiModelProperty(value = "") + public Integer get123Number() { return _123Number; } + + + public void set123Number(Integer _123Number) { + this._123Number = _123Number; + } + + + @Override @@ -119,6 +250,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -144,3 +277,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/NumberOnly.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/NumberOnly.java index 82604a5b9c7..97654cc9c3c 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/NumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/NumberOnly.java @@ -13,40 +13,77 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; + + + import javax.validation.constraints.*; + + + /** * NumberOnly */ public class NumberOnly { + + + + @JsonProperty("JustNumber") + + + + private BigDecimal justNumber = null; + + + + public NumberOnly justNumber(BigDecimal justNumber) { this.justNumber = justNumber; return this; } + + + /** + + * Get justNumber + + + * @return justNumber **/ + + @JsonProperty("JustNumber") + @ApiModelProperty(value = "") + public BigDecimal getJustNumber() { return justNumber; } + public void setJustNumber(BigDecimal justNumber) { this.justNumber = justNumber; } + + + @Override @@ -67,6 +104,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -89,3 +128,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Order.java index 5147738768b..7feb30193a2 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Order.java @@ -13,41 +13,98 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.Date; + + + import javax.validation.constraints.*; + + + /** * Order */ public class Order { + + + + @JsonProperty("id") + + + + private Long id = null; + + + + + @JsonProperty("petId") + + + + private Long petId = null; + + + + + @JsonProperty("quantity") + + + + private Integer quantity = null; + + + + + @JsonProperty("shipDate") + + + + private Date shipDate = null; + + + + /** * Order Status */ public enum StatusEnum { + + + + PLACED("placed"), + APPROVED("approved"), + DELIVERED("delivered"); + + + private String value; @@ -72,125 +129,242 @@ public static StatusEnum fromValue(String text) { } } + + + + @JsonProperty("status") + + + + private StatusEnum status = null; + + + + + @JsonProperty("complete") + + + + private Boolean complete = false; + + + + public Order id(Long id) { this.id = id; return this; } + + + /** + + * Get id + + + * @return id **/ + + @JsonProperty("id") + @ApiModelProperty(value = "") + public Long getId() { return id; } + public void setId(Long id) { this.id = id; } + + + public Order petId(Long petId) { this.petId = petId; return this; } + + + /** + + * Get petId + + + * @return petId **/ + + @JsonProperty("petId") + @ApiModelProperty(value = "") + public Long getPetId() { return petId; } + public void setPetId(Long petId) { this.petId = petId; } + + + public Order quantity(Integer quantity) { this.quantity = quantity; return this; } + + + /** + + * Get quantity + + + * @return quantity **/ + + @JsonProperty("quantity") + @ApiModelProperty(value = "") + public Integer getQuantity() { return quantity; } + public void setQuantity(Integer quantity) { this.quantity = quantity; } + + + public Order shipDate(Date shipDate) { this.shipDate = shipDate; return this; } + + + /** + + * Get shipDate + + + * @return shipDate **/ + + @JsonProperty("shipDate") + @ApiModelProperty(value = "") + public Date getShipDate() { return shipDate; } + public void setShipDate(Date shipDate) { this.shipDate = shipDate; } + + + public Order status(StatusEnum status) { this.status = status; return this; } + + + /** + * Order Status + + + + * @return status **/ + + @JsonProperty("status") + @ApiModelProperty(value = "Order Status") + public StatusEnum getStatus() { return status; } + public void setStatus(StatusEnum status) { this.status = status; } + + + public Order complete(Boolean complete) { this.complete = complete; return this; } + + + /** + + * Get complete + + + * @return complete **/ + + @JsonProperty("complete") + @ApiModelProperty(value = "") - public Boolean isComplete() { + + public Boolean isisComplete() { return complete; } + public void setComplete(Boolean complete) { this.complete = complete; } + + + @Override @@ -216,6 +390,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -243,3 +419,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/OuterBoolean.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/OuterBoolean.java new file mode 100644 index 00000000000..2710300f712 --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/OuterBoolean.java @@ -0,0 +1,78 @@ +/* + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.model; + + +import java.util.Objects; + + + + + +import javax.validation.constraints.*; + + + + +/** + * OuterBoolean + */ + +public class OuterBoolean { + + + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return Objects.hash(); + } + + + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterBoolean {\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(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + + + diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/OuterComposite.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/OuterComposite.java index c144ee99521..97f0e707810 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/OuterComposite.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/OuterComposite.java @@ -13,84 +13,171 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; + + + import javax.validation.constraints.*; + + + /** * OuterComposite */ public class OuterComposite { + + + + @JsonProperty("my_number") + + + + private BigDecimal myNumber = null; + + + + + @JsonProperty("my_string") + + + + private String myString = null; + + + + + @JsonProperty("my_boolean") + + + + private Boolean myBoolean = null; + + + + public OuterComposite myNumber(BigDecimal myNumber) { this.myNumber = myNumber; return this; } + + + /** + + * Get myNumber + + + * @return myNumber **/ + + @JsonProperty("my_number") + @ApiModelProperty(value = "") + public BigDecimal getMyNumber() { return myNumber; } + public void setMyNumber(BigDecimal myNumber) { this.myNumber = myNumber; } + + + public OuterComposite myString(String myString) { this.myString = myString; return this; } + + + /** + + * Get myString + + + * @return myString **/ + + @JsonProperty("my_string") + @ApiModelProperty(value = "") + public String getMyString() { return myString; } + public void setMyString(String myString) { this.myString = myString; } + + + public OuterComposite myBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; return this; } + + + /** + + * Get myBoolean + + + * @return myBoolean **/ + + @JsonProperty("my_boolean") + @ApiModelProperty(value = "") + public Boolean getMyBoolean() { return myBoolean; } + public void setMyBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; } + + + @Override @@ -113,6 +200,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -137,3 +226,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/OuterEnum.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/OuterEnum.java index 6740674b07c..51728f9ba9f 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/OuterEnum.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/OuterEnum.java @@ -13,22 +13,36 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonValue; + + + import javax.validation.constraints.*; + + + + import com.fasterxml.jackson.annotation.JsonCreator; + /** * Gets or Sets OuterEnum */ public enum OuterEnum { + + PLACED("placed"), APPROVED("approved"), DELIVERED("delivered"); + private String value; @@ -41,6 +55,7 @@ public String toString() { return String.valueOf(value); } + @JsonCreator public static OuterEnum fromValue(String text) { for (OuterEnum b : OuterEnum.values()) { @@ -50,5 +65,8 @@ public static OuterEnum fromValue(String text) { } return null; } + } + + diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/OuterNumber.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/OuterNumber.java new file mode 100644 index 00000000000..245ff1651de --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/OuterNumber.java @@ -0,0 +1,78 @@ +/* + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.model; + + +import java.util.Objects; + + + + + +import javax.validation.constraints.*; + + + + +/** + * OuterNumber + */ + +public class OuterNumber { + + + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return Objects.hash(); + } + + + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterNumber {\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(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + + + diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/OuterString.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/OuterString.java new file mode 100644 index 00000000000..fa548ab0e00 --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/OuterString.java @@ -0,0 +1,78 @@ +/* + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.model; + + +import java.util.Objects; + + + + + +import javax.validation.constraints.*; + + + + +/** + * OuterString + */ + +public class OuterString { + + + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return Objects.hash(); + } + + + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterString {\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(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + + + diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Pet.java index 04480639f0f..402ac868b12 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Pet.java @@ -13,7 +13,10 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -23,37 +26,100 @@ import io.swagger.model.Tag; import java.util.ArrayList; import java.util.List; + + + import javax.validation.constraints.*; + + + /** * Pet */ public class Pet { + + + + @JsonProperty("id") + + + + private Long id = null; + + + + + @JsonProperty("category") + + + + private Category category = null; + + + + + @JsonProperty("name") + + + + private String name = null; + + + + + @JsonProperty("photoUrls") + + + private List photoUrls = new ArrayList(); + + + + + + @JsonProperty("tags") + + + private List tags = null; + + + + + /** * pet status in the store */ public enum StatusEnum { + + + + AVAILABLE("available"), + PENDING("pending"), + SOLD("sold"); + + + private String value; @@ -78,137 +144,252 @@ public static StatusEnum fromValue(String text) { } } + + + + @JsonProperty("status") + + + + private StatusEnum status = null; + + + + public Pet id(Long id) { this.id = id; return this; } + + + /** + + * Get id + + + * @return id **/ + + @JsonProperty("id") + @ApiModelProperty(value = "") + public Long getId() { return id; } + public void setId(Long id) { this.id = id; } + + + public Pet category(Category category) { this.category = category; return this; } + + + /** + + * Get category + + + * @return category **/ + + @JsonProperty("category") + @ApiModelProperty(value = "") + public Category getCategory() { return category; } + public void setCategory(Category category) { this.category = category; } + + + public Pet name(String name) { this.name = name; return this; } + + + /** + + * Get name + + + * @return name **/ + + @JsonProperty("name") + @ApiModelProperty(example = "doggie", required = true, value = "") + @NotNull + public String getName() { return name; } + public void setName(String name) { this.name = name; } + + + public Pet photoUrls(List photoUrls) { this.photoUrls = photoUrls; return this; } + public Pet addPhotoUrlsItem(String photoUrlsItem) { + this.photoUrls.add(photoUrlsItem); return this; } + + + /** + + * Get photoUrls + + + * @return photoUrls **/ + + @JsonProperty("photoUrls") + @ApiModelProperty(required = true, value = "") + @NotNull + public List getPhotoUrls() { return photoUrls; } + public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } + + + public Pet tags(List tags) { this.tags = tags; return this; } + public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { this.tags = new ArrayList(); } + this.tags.add(tagsItem); return this; } + + + /** + + * Get tags + + + * @return tags **/ + + @JsonProperty("tags") + @ApiModelProperty(value = "") + public List getTags() { return tags; } + public void setTags(List tags) { this.tags = tags; } + + + public Pet status(StatusEnum status) { this.status = status; return this; } + + + /** + * pet status in the store + + + + * @return status **/ + + @JsonProperty("status") + @ApiModelProperty(value = "pet status in the store") + public StatusEnum getStatus() { return status; } + public void setStatus(StatusEnum status) { this.status = status; } + + + @Override @@ -234,6 +415,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -261,3 +444,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ReadOnlyFirst.java index 5d26b4199f8..c139fe90bc0 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ReadOnlyFirst.java @@ -13,52 +13,123 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + + + import javax.validation.constraints.*; + + + /** * ReadOnlyFirst */ public class ReadOnlyFirst { + + + + @JsonProperty("bar") + + + + private String bar = null; + + + + + @JsonProperty("baz") + + + + private String baz = null; + + + + + public ReadOnlyFirst bar(String bar) { + this.bar = bar; + return this; + } + + + + /** + + * Get bar + + + * @return bar **/ + + @JsonProperty("bar") + @ApiModelProperty(value = "") + public String getBar() { return bar; } + + + public void setBar(String bar) { + this.bar = bar; + } + + + public ReadOnlyFirst baz(String baz) { this.baz = baz; return this; } + + + /** + + * Get baz + + + * @return baz **/ + + @JsonProperty("baz") + @ApiModelProperty(value = "") + public String getBaz() { return baz; } + public void setBaz(String baz) { this.baz = baz; } + + + @Override @@ -80,6 +151,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -103,3 +176,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/SpecialModelName.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/SpecialModelName.java index df3182fbd80..4fafb75f408 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/SpecialModelName.java @@ -13,39 +13,76 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + + + import javax.validation.constraints.*; + + + /** * SpecialModelName */ public class SpecialModelName { + + + + @JsonProperty("$special[property.name]") - private Long specialPropertyName = null; + + + + + private Long $specialPropertyName = null; + - public SpecialModelName specialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + + + + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; return this; } + + + /** - * Get specialPropertyName - * @return specialPropertyName + + + * Get $specialPropertyName + + + + * @return $specialPropertyName **/ + + @JsonProperty("$special[property.name]") + @ApiModelProperty(value = "") - public Long getSpecialPropertyName() { - return specialPropertyName; + + public Long get$SpecialPropertyName() { + return $specialPropertyName; } + - public void setSpecialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + public void set$SpecialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; } + + + @Override @@ -56,22 +93,24 @@ public boolean equals(java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName specialModelName = (SpecialModelName) o; - return Objects.equals(this.specialPropertyName, specialModelName.specialPropertyName); + SpecialModelName $specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); } @Override public int hashCode() { - return Objects.hash(specialPropertyName); + return Objects.hash($specialPropertyName); } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class SpecialModelName {\n"); - sb.append(" specialPropertyName: ").append(toIndentedString(specialPropertyName)).append("\n"); + sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n"); sb.append("}"); return sb.toString(); } @@ -88,3 +127,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Tag.java index a86f54144f8..1fffba9994d 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Tag.java @@ -13,61 +13,123 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + + + import javax.validation.constraints.*; + + + /** * Tag */ public class Tag { + + + + @JsonProperty("id") + + + + private Long id = null; + + + + + @JsonProperty("name") + + + + private String name = null; + + + + public Tag id(Long id) { this.id = id; return this; } + + + /** + + * Get id + + + * @return id **/ + + @JsonProperty("id") + @ApiModelProperty(value = "") + public Long getId() { return id; } + public void setId(Long id) { this.id = id; } + + + public Tag name(String name) { this.name = name; return this; } + + + /** + + * Get name + + + * @return name **/ + + @JsonProperty("name") + @ApiModelProperty(value = "") + public String getName() { return name; } + public void setName(String name) { this.name = name; } + + + @Override @@ -89,6 +151,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -112,3 +176,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/User.java index 0c1b67c0d5b..ffab5e5eb2a 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/User.java @@ -13,193 +13,405 @@ package io.swagger.model; + import java.util.Objects; + + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + + + import javax.validation.constraints.*; + + + /** * User */ public class User { + + + + @JsonProperty("id") + + + + private Long id = null; + + + + + @JsonProperty("username") + + + + private String username = null; + + + + + @JsonProperty("firstName") + + + + private String firstName = null; + + + + + @JsonProperty("lastName") + + + + private String lastName = null; + + + + + @JsonProperty("email") + + + + private String email = null; + + + + + @JsonProperty("password") + + + + private String password = null; + + + + + @JsonProperty("phone") + + + + private String phone = null; + + + + + @JsonProperty("userStatus") + + + + private Integer userStatus = null; + + + + public User id(Long id) { this.id = id; return this; } + + + /** + + * Get id + + + * @return id **/ + + @JsonProperty("id") + @ApiModelProperty(value = "") + public Long getId() { return id; } + public void setId(Long id) { this.id = id; } + + + public User username(String username) { this.username = username; return this; } + + + /** + + * Get username + + + * @return username **/ + + @JsonProperty("username") + @ApiModelProperty(value = "") + public String getUsername() { return username; } + public void setUsername(String username) { this.username = username; } + + + public User firstName(String firstName) { this.firstName = firstName; return this; } + + + /** + + * Get firstName + + + * @return firstName **/ + + @JsonProperty("firstName") + @ApiModelProperty(value = "") + public String getFirstName() { return firstName; } + public void setFirstName(String firstName) { this.firstName = firstName; } + + + public User lastName(String lastName) { this.lastName = lastName; return this; } + + + /** + + * Get lastName + + + * @return lastName **/ + + @JsonProperty("lastName") + @ApiModelProperty(value = "") + public String getLastName() { return lastName; } + public void setLastName(String lastName) { this.lastName = lastName; } + + + public User email(String email) { this.email = email; return this; } + + + /** + + * Get email + + + * @return email **/ + + @JsonProperty("email") + @ApiModelProperty(value = "") + public String getEmail() { return email; } + public void setEmail(String email) { this.email = email; } + + + public User password(String password) { this.password = password; return this; } + + + /** + + * Get password + + + * @return password **/ + + @JsonProperty("password") + @ApiModelProperty(value = "") + public String getPassword() { return password; } + public void setPassword(String password) { this.password = password; } + + + public User phone(String phone) { this.phone = phone; return this; } + + + /** + + * Get phone + + + * @return phone **/ + + @JsonProperty("phone") + @ApiModelProperty(value = "") + public String getPhone() { return phone; } + public void setPhone(String phone) { this.phone = phone; } + + + public User userStatus(Integer userStatus) { this.userStatus = userStatus; return this; } + + + /** + * User Status + + + + * @return userStatus **/ + + @JsonProperty("userStatus") + @ApiModelProperty(value = "User Status") + public Integer getUserStatus() { return userStatus; } + public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } + + + @Override @@ -227,6 +439,8 @@ public int hashCode() { } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -256,3 +470,5 @@ private String toIndentedString(java.lang.Object o) { } } + + diff --git a/samples/server/petstore/jaxrs/jersey2/src/main/java/io/swagger/api/impl/AnotherFakeApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey2/src/main/java/io/swagger/api/impl/AnotherFakeApiServiceImpl.java index 77b9e358572..fca81930fd1 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/main/java/io/swagger/api/impl/AnotherFakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey2/src/main/java/io/swagger/api/impl/AnotherFakeApiServiceImpl.java @@ -5,6 +5,8 @@ import io.swagger.model.Client; + +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -14,12 +16,18 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; + import javax.validation.constraints.*; + + public class AnotherFakeApiServiceImpl extends AnotherFakeApiService { + @Override - public Response testSpecialTags(Client body, SecurityContext securityContext) throws NotFoundException { + public Response testSpecialTags(Client client, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + } + diff --git a/samples/server/petstore/jaxrs/jersey2/src/main/java/io/swagger/api/impl/FakeApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey2/src/main/java/io/swagger/api/impl/FakeApiServiceImpl.java index bd8eb54209c..3713d4ccf73 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/main/java/io/swagger/api/impl/FakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey2/src/main/java/io/swagger/api/impl/FakeApiServiceImpl.java @@ -5,9 +5,10 @@ import java.math.BigDecimal; import io.swagger.model.Client; -import java.util.Date; import io.swagger.model.OuterComposite; + +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -17,52 +18,66 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; + import javax.validation.constraints.*; + + public class FakeApiServiceImpl extends FakeApiService { + @Override public Response fakeOuterBooleanSerialize(Boolean body, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + @Override - public Response fakeOuterCompositeSerialize(OuterComposite body, SecurityContext securityContext) throws NotFoundException { + public Response fakeOuterCompositeSerialize(OuterComposite outercomposite, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + @Override public Response fakeOuterNumberSerialize(BigDecimal body, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + @Override public Response fakeOuterStringSerialize(String body, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + @Override - public Response testClientModel(Client body, SecurityContext securityContext) throws NotFoundException { + public Response testClientModel(Client client, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + @Override - public Response testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, Date date, Date dateTime, String password, String paramCallback, SecurityContext securityContext) throws NotFoundException { + public Response testEndpointParameters(Object body, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + @Override - public Response testEnumParameters(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, SecurityContext securityContext) throws NotFoundException { + public Response testEnumParameters(Object body, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + @Override - public Response testInlineAdditionalProperties(Object param, SecurityContext securityContext) throws NotFoundException { + public Response testInlineAdditionalProperties(Map body, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + @Override - public Response testJsonFormData(String param, String param2, SecurityContext securityContext) throws NotFoundException { + public Response testJsonFormData(Object 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/jersey2/src/main/java/io/swagger/api/impl/FakeClassnameTestApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey2/src/main/java/io/swagger/api/impl/FakeClassnameTestApiServiceImpl.java index 2d77e24e3e4..4edc7821764 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/main/java/io/swagger/api/impl/FakeClassnameTestApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey2/src/main/java/io/swagger/api/impl/FakeClassnameTestApiServiceImpl.java @@ -5,6 +5,8 @@ import io.swagger.model.Client; + +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -14,12 +16,18 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; + import javax.validation.constraints.*; + + public class FakeClassnameTestApiServiceImpl extends FakeClassnameTestApiService { + @Override - public Response testClassname(Client body, SecurityContext securityContext) throws NotFoundException { + public Response testClassname(Client client, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + } + diff --git a/samples/server/petstore/jaxrs/jersey2/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey2/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java index be3e7e167e7..61c8ec54fed 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey2/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java @@ -3,10 +3,11 @@ import io.swagger.api.*; import io.swagger.model.*; -import java.io.File; import io.swagger.model.ModelApiResponse; import io.swagger.model.Pet; + +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -16,47 +17,60 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; + import javax.validation.constraints.*; + + public class PetApiServiceImpl extends PetApiService { + @Override - public Response addPet(Pet body, SecurityContext securityContext) throws NotFoundException { + public Response addPet(Pet pet, 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 { + public Response deletePet(Integer petId, String apiKey, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + @Override public Response findPetsByStatus( @NotNull List status, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + @Override public Response findPetsByTags( @NotNull 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 { + public Response getPetById(Integer 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 { + public Response updatePet(Pet pet, 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 { + public Response updatePetWithForm(Integer petId, Object body, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + @Override - public Response uploadFile(Long petId, String additionalMetadata, InputStream fileInputStream, FormDataContentDisposition fileDetail, SecurityContext securityContext) throws NotFoundException { + public Response uploadFile(Integer petId, Object 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/jersey2/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey2/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java index f8fd4cec86b..0f9d37bf71e 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey2/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java @@ -6,6 +6,8 @@ import java.util.Map; import io.swagger.model.Order; + +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -15,27 +17,36 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; + import javax.validation.constraints.*; + + 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( @Min(1) @Max(5)Long orderId, SecurityContext securityContext) throws NotFoundException { + public Response getOrderById( @DecimalMin("1") @DecimalMax("5")Integer 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 { + public Response placeOrder(Order order, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + } + diff --git a/samples/server/petstore/jaxrs/jersey2/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey2/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java index 5853e33168d..9a4fb3961c7 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey2/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java @@ -3,9 +3,10 @@ import io.swagger.api.*; import io.swagger.model.*; -import java.util.List; import io.swagger.model.User; + +import java.util.Map; import java.util.List; import io.swagger.api.NotFoundException; @@ -15,47 +16,60 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; + import javax.validation.constraints.*; + + public class UserApiServiceImpl extends UserApiService { + @Override - public Response createUser(User body, SecurityContext securityContext) throws NotFoundException { + public Response createUser(User user, 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( @NotNull String username, @NotNull 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 { + public Response updateUser(User user, String username, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } + } +