diff --git a/bin/java-undertow-petstore-server.sh b/bin/java-undertow-petstore-server.sh index 9e949909f4d..8c1438c9a53 100755 --- a/bin/java-undertow-petstore-server.sh +++ b/bin/java-undertow-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/undertow -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l undertow -o samples/server/petstore/undertow" +ags="$@ generate -t modules/swagger-codegen/src/main/resources/undertow -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l undertow -o samples/server/petstore/undertow" java $JAVA_OPTS -jar $executable $ags diff --git a/modules/swagger-codegen/src/main/resources/Java/gradlew.bat.mustache b/modules/swagger-codegen/src/main/resources/Java/gradlew.bat.mustache index 72d362dafd8..5f192121eb4 100644 --- a/modules/swagger-codegen/src/main/resources/Java/gradlew.bat.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/gradlew.bat.mustache @@ -1,90 +1,90 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/api.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/api.mustache index 8cfc5ab01db..59b71d2ba47 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/api.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/api.mustache @@ -1,56 +1,56 @@ -package {{package}}; - -import {{modelPackage}}.*; -import {{package}}.{{classname}}Service; -import {{package}}.factories.{{classname}}ServiceFactory; - -import io.swagger.annotations.ApiParam; -import io.swagger.jaxrs.*; - -{{#imports}}import {{import}}; -{{/imports}} - -import java.util.List; -import {{package}}.NotFoundException; - -import java.io.InputStream; - -import org.glassfish.jersey.media.multipart.FormDataContentDisposition; -import org.glassfish.jersey.media.multipart.FormDataParam; - -import javax.ws.rs.core.Context; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.SecurityContext; -import javax.ws.rs.*; - -@Path("/{{baseName}}") -{{#hasConsumes}}@Consumes({ {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}} -{{#hasProduces}}@Produces({ {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}} -@io.swagger.annotations.Api(description = "the {{baseName}} API") -{{>generatedAnnotation}} -{{#operations}} -public class {{classname}} { - private final {{classname}}Service delegate = {{classname}}ServiceFactory.get{{classname}}(); - -{{#operation}} - @{{httpMethod}} - {{#subresourceOperation}}@Path("{{path}}"){{/subresourceOperation}} - {{#hasConsumes}}@Consumes({ {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}} - {{#hasProduces}}@Produces({ {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}} - @io.swagger.annotations.ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", response = {{{returnType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { - {{#authMethods}}@io.swagger.annotations.Authorization(value = "{{name}}"{{#isOAuth}}, scopes = { - {{#scopes}}@io.swagger.annotations.AuthorizationScope(scope = "{{scope}}", description = "{{description}}"){{#hasMore}}, - {{/hasMore}}{{/scopes}} - }{{/isOAuth}}){{#hasMore}}, - {{/hasMore}}{{/authMethods}} - }{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}",{{/vendorExtensions.x-tags}} }) - @io.swagger.annotations.ApiResponses(value = { {{#responses}} - @io.swagger.annotations.ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{returnType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}){{#hasMore}}, - {{/hasMore}}{{/responses}} }) - public Response {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}},{{/allParams}}@Context SecurityContext securityContext) - throws NotFoundException { - return delegate.{{nickname}}({{#allParams}}{{#isFile}}{{paramName}}InputStream, {{paramName}}Detail{{/isFile}}{{^isFile}}{{paramName}}{{/isFile}},{{/allParams}}securityContext); - } -{{/operation}} -} -{{/operations}} +package {{package}}; + +import {{modelPackage}}.*; +import {{package}}.{{classname}}Service; +import {{package}}.factories.{{classname}}ServiceFactory; + +import io.swagger.annotations.ApiParam; +import io.swagger.jaxrs.*; + +{{#imports}}import {{import}}; +{{/imports}} + +import java.util.List; +import {{package}}.NotFoundException; + +import java.io.InputStream; + +import org.glassfish.jersey.media.multipart.FormDataContentDisposition; +import org.glassfish.jersey.media.multipart.FormDataParam; + +import javax.ws.rs.core.Context; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; +import javax.ws.rs.*; + +@Path("/{{baseName}}") +{{#hasConsumes}}@Consumes({ {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}} +{{#hasProduces}}@Produces({ {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}} +@io.swagger.annotations.Api(description = "the {{baseName}} API") +{{>generatedAnnotation}} +{{#operations}} +public class {{classname}} { + private final {{classname}}Service delegate = {{classname}}ServiceFactory.get{{classname}}(); + +{{#operation}} + @{{httpMethod}} + {{#subresourceOperation}}@Path("{{path}}"){{/subresourceOperation}} + {{#hasConsumes}}@Consumes({ {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}} + {{#hasProduces}}@Produces({ {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}} + @io.swagger.annotations.ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", response = {{{returnType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { + {{#authMethods}}@io.swagger.annotations.Authorization(value = "{{name}}"{{#isOAuth}}, scopes = { + {{#scopes}}@io.swagger.annotations.AuthorizationScope(scope = "{{scope}}", description = "{{description}}"){{#hasMore}}, + {{/hasMore}}{{/scopes}} + }{{/isOAuth}}){{#hasMore}}, + {{/hasMore}}{{/authMethods}} + }{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}",{{/vendorExtensions.x-tags}} }) + @io.swagger.annotations.ApiResponses(value = { {{#responses}} + @io.swagger.annotations.ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{returnType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}){{#hasMore}}, + {{/hasMore}}{{/responses}} }) + public Response {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}},{{/allParams}}@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.{{nickname}}({{#allParams}}{{#isFile}}{{paramName}}InputStream, {{paramName}}Detail{{/isFile}}{{^isFile}}{{paramName}}{{/isFile}},{{/allParams}}securityContext); + } +{{/operation}} +} +{{/operations}} diff --git a/modules/swagger-codegen/src/main/resources/JavaSpring/application.properties b/modules/swagger-codegen/src/main/resources/JavaSpring/application.properties index 858a5f007b5..8d3a7a8292b 100644 --- a/modules/swagger-codegen/src/main/resources/JavaSpring/application.properties +++ b/modules/swagger-codegen/src/main/resources/JavaSpring/application.properties @@ -1,2 +1,2 @@ -springfox.documentation.swagger.v2.path=/api-docs -#server.port=8090 \ No newline at end of file +springfox.documentation.swagger.v2.path=/api-docs +#server.port=8090 diff --git a/modules/swagger-codegen/src/main/resources/JavaSpring/libraries/spring-boot/homeController.mustache b/modules/swagger-codegen/src/main/resources/JavaSpring/libraries/spring-boot/homeController.mustache index a3528010fb1..bc33ec134e8 100644 --- a/modules/swagger-codegen/src/main/resources/JavaSpring/libraries/spring-boot/homeController.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaSpring/libraries/spring-boot/homeController.mustache @@ -1,16 +1,16 @@ -package {{configPackage}}; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; - -/** - * Home redirection to swagger api documentation - */ -@Controller -public class HomeController { - @RequestMapping(value = "/") - public String index() { - System.out.println("swagger-ui.html"); - return "redirect:swagger-ui.html"; - } -} \ No newline at end of file +package {{configPackage}}; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; + +/** + * Home redirection to swagger api documentation + */ +@Controller +public class HomeController { + @RequestMapping(value = "/") + public String index() { + System.out.println("swagger-ui.html"); + return "redirect:swagger-ui.html"; + } +} diff --git a/modules/swagger-codegen/src/main/resources/JavaSpring/libraries/spring-boot/swagger2SpringBoot.mustache b/modules/swagger-codegen/src/main/resources/JavaSpring/libraries/spring-boot/swagger2SpringBoot.mustache index ebd4ae4ac55..6d9f64d1a5a 100644 --- a/modules/swagger-codegen/src/main/resources/JavaSpring/libraries/spring-boot/swagger2SpringBoot.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaSpring/libraries/spring-boot/swagger2SpringBoot.mustache @@ -1,36 +1,36 @@ -package {{basePackage}}; - -import org.springframework.boot.CommandLineRunner; -import org.springframework.boot.ExitCodeGenerator; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.ComponentScan; - -import springfox.documentation.swagger2.annotations.EnableSwagger2; - -@SpringBootApplication -@EnableSwagger2 -@ComponentScan(basePackages = "{{basePackage}}") -public class Swagger2SpringBoot implements CommandLineRunner { - - @Override - public void run(String... arg0) throws Exception { - if (arg0.length > 0 && arg0[0].equals("exitcode")) { - throw new ExitException(); - } - } - - public static void main(String[] args) throws Exception { - new SpringApplication(Swagger2SpringBoot.class).run(args); - } - - class ExitException extends RuntimeException implements ExitCodeGenerator { - private static final long serialVersionUID = 1L; - - @Override - public int getExitCode() { - return 10; - } - - } -} \ No newline at end of file +package {{basePackage}}; + +import org.springframework.boot.CommandLineRunner; +import org.springframework.boot.ExitCodeGenerator; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +import springfox.documentation.swagger2.annotations.EnableSwagger2; + +@SpringBootApplication +@EnableSwagger2 +@ComponentScan(basePackages = "{{basePackage}}") +public class Swagger2SpringBoot implements CommandLineRunner { + + @Override + public void run(String... arg0) throws Exception { + if (arg0.length > 0 && arg0[0].equals("exitcode")) { + throw new ExitException(); + } + } + + public static void main(String[] args) throws Exception { + new SpringApplication(Swagger2SpringBoot.class).run(args); + } + + class ExitException extends RuntimeException implements ExitCodeGenerator { + private static final long serialVersionUID = 1L; + + @Override + public int getExitCode() { + return 10; + } + + } +} diff --git a/modules/swagger-codegen/src/main/resources/scala/gradlew.bat.mustache b/modules/swagger-codegen/src/main/resources/scala/gradlew.bat.mustache index 72d362dafd8..5f192121eb4 100644 --- a/modules/swagger-codegen/src/main/resources/scala/gradlew.bat.mustache +++ b/modules/swagger-codegen/src/main/resources/scala/gradlew.bat.mustache @@ -1,90 +1,90 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/modules/swagger-codegen/src/main/resources/undertow/pom.mustache b/modules/swagger-codegen/src/main/resources/undertow/pom.mustache index f15f97eab44..f351376888b 100644 --- a/modules/swagger-codegen/src/main/resources/undertow/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/undertow/pom.mustache @@ -186,4 +186,4 @@ - \ No newline at end of file + diff --git a/modules/swagger-codegen/src/main/resources/undertow/primary.crt b/modules/swagger-codegen/src/main/resources/undertow/primary.crt index 51ee3649759..34f9272f81e 100644 --- a/modules/swagger-codegen/src/main/resources/undertow/primary.crt +++ b/modules/swagger-codegen/src/main/resources/undertow/primary.crt @@ -1,19 +1,19 @@ -----BEGIN CERTIFICATE----- -MIIDmzCCAoOgAwIBAgIEHnAgtDANBgkqhkiG9w0BAQsFADB+MQswCQYDVQQGEwJDQTEQMA4GA1UE -CBMHT250YXJpbzEUMBIGA1UEBxMLTWlzc2lzc2F1Z2ExJjAkBgNVBAoTHU5ldHdvcmsgTmV3IFRl -Y2hub2xvZ2llcyBJbmMuMQwwCgYDVQQLEwNERVYxETAPBgNVBAMTCFN0ZXZlIEh1MB4XDTE2MDkw -MTE2MTYxNVoXDTI2MDcxMTE2MTYxNVowfjELMAkGA1UEBhMCQ0ExEDAOBgNVBAgTB09udGFyaW8x -FDASBgNVBAcTC01pc3Npc3NhdWdhMSYwJAYDVQQKEx1OZXR3b3JrIE5ldyBUZWNobm9sb2dpZXMg -SW5jLjEMMAoGA1UECxMDREVWMREwDwYDVQQDEwhTdGV2ZSBIdTCCASIwDQYJKoZIhvcNAQEBBQAD -ggEPADCCAQoCggEBALrlxMtDb60DogElf4TBz504tRheZimAE0dJL/Yby4nacJdqvc5l4z+WWpDf -rI9krQ2Yi9yvhwAP+PrR6gWcIqWP4cpNE7XIAUDgr4CtyI7CptT/lpjtbkz4DGCMmaeDn0jqHqJt -SeSZGfwVu5zAGm8n4sHatjnnxBI/iWzkTII3V4xv0WeK37szNTEd+ly2ag7n2IV5zNnYmqZTeMQm -J2ENS+IwAG3ENtiVtrVTx/2bGtqutJjtdxsN58/cUG/guRyMT6OPI8Yi3ZzevdvRbxadyhEl/Kaw -6vJcdxmJI3tp4lx+p6sAxOWa7aapJe4JxutAQqzv0GKdVjoHKQ1wB60CAwEAAaMhMB8wHQYDVR0O -BBYEFIPF9SBd06RWU1eDL73CKfy01lavMA0GCSqGSIb3DQEBCwUAA4IBAQAoaKZGOak3Upz/ordF -slZoJuZlCu7jnKQEjYwHf3DNxcd1WmgFPtMcna6pW0VUxPIfidEA6VCMsGoK1RvshB0SjrRdCht6 -5qPXs9kV3NW0WvMiwDSYZZ9HgaZ9efTe5E9Fzc7ltKrE43L6k8NJcaEEWEdpdjFbrAqH4I+j/Vro -K3OhIo062fXjas5ipL4gF+3ECImjWzirQP8UiAfM0/36x7rtAu3btH/qI9hSyx39LBPPE5AsDJZ4 -dSMwNTW1gqmBAZIj+zQ/RD5dyWfPwON7Q+t96YbK6WBuYo0xy+I+PjcUgrWYWP3N24hlq8ZBIei+ +MIIDmzCCAoOgAwIBAgIEHnAgtDANBgkqhkiG9w0BAQsFADB+MQswCQYDVQQGEwJDQTEQMA4GA1UE +CBMHT250YXJpbzEUMBIGA1UEBxMLTWlzc2lzc2F1Z2ExJjAkBgNVBAoTHU5ldHdvcmsgTmV3IFRl +Y2hub2xvZ2llcyBJbmMuMQwwCgYDVQQLEwNERVYxETAPBgNVBAMTCFN0ZXZlIEh1MB4XDTE2MDkw +MTE2MTYxNVoXDTI2MDcxMTE2MTYxNVowfjELMAkGA1UEBhMCQ0ExEDAOBgNVBAgTB09udGFyaW8x +FDASBgNVBAcTC01pc3Npc3NhdWdhMSYwJAYDVQQKEx1OZXR3b3JrIE5ldyBUZWNobm9sb2dpZXMg +SW5jLjEMMAoGA1UECxMDREVWMREwDwYDVQQDEwhTdGV2ZSBIdTCCASIwDQYJKoZIhvcNAQEBBQAD +ggEPADCCAQoCggEBALrlxMtDb60DogElf4TBz504tRheZimAE0dJL/Yby4nacJdqvc5l4z+WWpDf +rI9krQ2Yi9yvhwAP+PrR6gWcIqWP4cpNE7XIAUDgr4CtyI7CptT/lpjtbkz4DGCMmaeDn0jqHqJt +SeSZGfwVu5zAGm8n4sHatjnnxBI/iWzkTII3V4xv0WeK37szNTEd+ly2ag7n2IV5zNnYmqZTeMQm +J2ENS+IwAG3ENtiVtrVTx/2bGtqutJjtdxsN58/cUG/guRyMT6OPI8Yi3ZzevdvRbxadyhEl/Kaw +6vJcdxmJI3tp4lx+p6sAxOWa7aapJe4JxutAQqzv0GKdVjoHKQ1wB60CAwEAAaMhMB8wHQYDVR0O +BBYEFIPF9SBd06RWU1eDL73CKfy01lavMA0GCSqGSIb3DQEBCwUAA4IBAQAoaKZGOak3Upz/ordF +slZoJuZlCu7jnKQEjYwHf3DNxcd1WmgFPtMcna6pW0VUxPIfidEA6VCMsGoK1RvshB0SjrRdCht6 +5qPXs9kV3NW0WvMiwDSYZZ9HgaZ9efTe5E9Fzc7ltKrE43L6k8NJcaEEWEdpdjFbrAqH4I+j/Vro +K3OhIo062fXjas5ipL4gF+3ECImjWzirQP8UiAfM0/36x7rtAu3btH/qI9hSyx39LBPPE5AsDJZ4 +dSMwNTW1gqmBAZIj+zQ/RD5dyWfPwON7Q+t96YbK6WBuYo0xy+I+PjcUgrWYWP3N24hlq8ZBIei+ BudoEVJlIlmS0aRCuP8n -----END CERTIFICATE----- diff --git a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/Category.java b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/Category.java index 502d1c42bda..658d31fe8ef 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/Category.java +++ b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/Category.java @@ -8,10 +8,14 @@ import io.swagger.annotations.ApiModelProperty; +/** + * A category for a pet + **/ /** - * Category + * A category for a pet */ +@ApiModel(description = "A category for a pet") public class Category { @JsonProperty("id") diff --git a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/ModelApiResponse.java b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/ModelApiResponse.java index a8375a0abba..019b262f3fb 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/ModelApiResponse.java +++ b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/ModelApiResponse.java @@ -8,10 +8,14 @@ import io.swagger.annotations.ApiModelProperty; +/** + * Describes the result of uploading an image resource + **/ /** - * ModelApiResponse + * Describes the result of uploading an image resource */ +@ApiModel(description = "Describes the result of uploading an image resource") public class ModelApiResponse { @JsonProperty("code") diff --git a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/Order.java b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/Order.java index 09fe1ee39c3..c2d1850bc4b 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/Order.java +++ b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/Order.java @@ -10,10 +10,14 @@ import org.joda.time.DateTime; +/** + * An order for a pets from the pet store + **/ /** - * Order + * An order for a pets from the pet store */ +@ApiModel(description = "An order for a pets from the pet store") public class Order { @JsonProperty("id") diff --git a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/Pet.java b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/Pet.java index 9189a91034b..6701d0d1e84 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/Pet.java +++ b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/Pet.java @@ -13,10 +13,14 @@ import java.util.List; +/** + * A pet for sale in the pet store + **/ /** - * Pet + * A pet for sale in the pet store */ +@ApiModel(description = "A pet for sale in the pet store") public class Pet { @JsonProperty("id") diff --git a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/Tag.java b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/Tag.java index e75d10df70e..63c38e1ae54 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/Tag.java +++ b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/Tag.java @@ -8,10 +8,14 @@ import io.swagger.annotations.ApiModelProperty; +/** + * A tag for a pet + **/ /** - * Tag + * A tag for a pet */ +@ApiModel(description = "A tag for a pet") public class Tag { @JsonProperty("id") diff --git a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/User.java b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/User.java index 11a1a82a5cd..b5d56178593 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/User.java +++ b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/User.java @@ -8,10 +8,14 @@ import io.swagger.annotations.ApiModelProperty; +/** + * A User who is purchasing from the pet store + **/ /** - * User + * A User who is purchasing from the pet store */ +@ApiModel(description = "A User who is purchasing from the pet store") public class User { @JsonProperty("id") diff --git a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/Category.java b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/Category.java index 502d1c42bda..658d31fe8ef 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/Category.java +++ b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/Category.java @@ -8,10 +8,14 @@ import io.swagger.annotations.ApiModelProperty; +/** + * A category for a pet + **/ /** - * Category + * A category for a pet */ +@ApiModel(description = "A category for a pet") public class Category { @JsonProperty("id") diff --git a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/ModelApiResponse.java b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/ModelApiResponse.java index a8375a0abba..019b262f3fb 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/ModelApiResponse.java +++ b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/ModelApiResponse.java @@ -8,10 +8,14 @@ import io.swagger.annotations.ApiModelProperty; +/** + * Describes the result of uploading an image resource + **/ /** - * ModelApiResponse + * Describes the result of uploading an image resource */ +@ApiModel(description = "Describes the result of uploading an image resource") public class ModelApiResponse { @JsonProperty("code") diff --git a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/Order.java b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/Order.java index 09fe1ee39c3..c2d1850bc4b 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/Order.java +++ b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/Order.java @@ -10,10 +10,14 @@ import org.joda.time.DateTime; +/** + * An order for a pets from the pet store + **/ /** - * Order + * An order for a pets from the pet store */ +@ApiModel(description = "An order for a pets from the pet store") public class Order { @JsonProperty("id") diff --git a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/Pet.java b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/Pet.java index 9189a91034b..6701d0d1e84 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/Pet.java +++ b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/Pet.java @@ -13,10 +13,14 @@ import java.util.List; +/** + * A pet for sale in the pet store + **/ /** - * Pet + * A pet for sale in the pet store */ +@ApiModel(description = "A pet for sale in the pet store") public class Pet { @JsonProperty("id") diff --git a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/Tag.java b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/Tag.java index e75d10df70e..63c38e1ae54 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/Tag.java +++ b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/Tag.java @@ -8,10 +8,14 @@ import io.swagger.annotations.ApiModelProperty; +/** + * A tag for a pet + **/ /** - * Tag + * A tag for a pet */ +@ApiModel(description = "A tag for a pet") public class Tag { @JsonProperty("id") diff --git a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/User.java b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/User.java index 11a1a82a5cd..b5d56178593 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/User.java +++ b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/User.java @@ -8,10 +8,14 @@ import io.swagger.annotations.ApiModelProperty; +/** + * A User who is purchasing from the pet store + **/ /** - * User + * A User who is purchasing from the pet store */ +@ApiModel(description = "A User who is purchasing from the pet store") public class User { @JsonProperty("id") 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 a87a5a4bb60..0e97ac1707f 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 @@ -60,19 +60,20 @@ public class FakeApi { 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("string") String string, + @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, @Context SecurityContext securityContext) throws NotFoundException { - return delegate.testEndpointParameters(number,_double,string,_byte,integer,int32,int64,_float,binary,date,dateTime,password,securityContext); + return delegate.testEndpointParameters(number,_double,patternWithoutDelimiter,_byte,integer,int32,int64,_float,string,binary,date,dateTime,password,securityContext); } @GET @@ -83,9 +84,9 @@ public class FakeApi { @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)") @FormParam("enum_form_string_array") List enumFormStringArray, + @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)" )@HeaderParam("enum_header_string_array") List enumHeaderStringArray, + @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, 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 8f37e8c4282..d721c5d458a 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 @@ -24,7 +24,7 @@ import javax.ws.rs.core.SecurityContext; public abstract class FakeApiService { public abstract Response testClientModel(Client body,SecurityContext securityContext) throws NotFoundException; - public abstract Response testEndpointParameters(BigDecimal number,Double _double,String string,byte[] _byte,Integer integer,Integer int32,Long int64,Float _float,byte[] binary,Date date,Date dateTime,String password,SecurityContext securityContext) + 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,SecurityContext securityContext) throws NotFoundException; public abstract Response testEnumParameters(List enumFormStringArray,String enumFormString,List enumHeaderStringArray,String enumHeaderString,List enumQueryStringArray,String enumQueryString,BigDecimal enumQueryInteger,Double enumQueryDouble,SecurityContext securityContext) throws NotFoundException; 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 bd7a6532214..959f05a2d31 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 @@ -22,7 +22,7 @@ public class Model200Response { private Integer name = null; @JsonProperty("class") - private String PropertyClass = null; + private String propertyClass = null; public Model200Response name(Integer name) { this.name = name; @@ -42,22 +42,22 @@ public class Model200Response { this.name = name; } - public Model200Response PropertyClass(String PropertyClass) { - this.PropertyClass = PropertyClass; + public Model200Response propertyClass(String propertyClass) { + this.propertyClass = propertyClass; return this; } /** - * Get PropertyClass - * @return PropertyClass + * Get propertyClass + * @return propertyClass **/ @ApiModelProperty(value = "") public String getPropertyClass() { - return PropertyClass; + return propertyClass; } - public void setPropertyClass(String PropertyClass) { - this.PropertyClass = PropertyClass; + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; } @@ -71,12 +71,12 @@ public class Model200Response { } Model200Response _200Response = (Model200Response) o; return Objects.equals(this.name, _200Response.name) && - Objects.equals(this.PropertyClass, _200Response.PropertyClass); + Objects.equals(this.propertyClass, _200Response.propertyClass); } @Override public int hashCode() { - return Objects.hash(name, PropertyClass); + return Objects.hash(name, propertyClass); } @Override @@ -85,7 +85,7 @@ public class Model200Response { sb.append("class Model200Response {\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" PropertyClass: ").append(toIndentedString(PropertyClass)).append("\n"); + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); sb.append("}"); return sb.toString(); } 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 2bc673c0121..845681ed0f2 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 @@ -29,7 +29,7 @@ public class FakeApiServiceImpl extends FakeApiService { return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override - public Response testEndpointParameters(BigDecimal number, Double _double, String string, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, byte[] binary, Date date, Date dateTime, String password, SecurityContext securityContext) + 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, 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/gen/java/io/swagger/api/FakeApi.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/FakeApi.java index 939c0647213..a6a2fe0c9da 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 @@ -1,60 +1,60 @@ -package io.swagger.api; - -import io.swagger.model.*; -import io.swagger.api.FakeApiService; -import io.swagger.api.factories.FakeApiServiceFactory; - -import io.swagger.annotations.ApiParam; -import io.swagger.jaxrs.*; - -import io.swagger.model.Client; -import java.math.BigDecimal; -import java.util.Date; - -import java.util.List; -import io.swagger.api.NotFoundException; - -import java.io.InputStream; - -import org.glassfish.jersey.media.multipart.FormDataContentDisposition; -import org.glassfish.jersey.media.multipart.FormDataParam; - -import javax.ws.rs.core.Context; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.SecurityContext; -import javax.ws.rs.*; - -@Path("/fake") - - -@io.swagger.annotations.Api(description = "the fake API") - -public class FakeApi { - private final FakeApiService delegate = FakeApiServiceFactory.getFakeApi(); - - @PATCH - - @Consumes({ "application/json" }) - @Produces({ "application/json" }) - @io.swagger.annotations.ApiOperation(value = "To test \"client\" model", notes = "", response = Client.class, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Client.class) }) +package io.swagger.api; + +import io.swagger.model.*; +import io.swagger.api.FakeApiService; +import io.swagger.api.factories.FakeApiServiceFactory; + +import io.swagger.annotations.ApiParam; +import io.swagger.jaxrs.*; + +import io.swagger.model.Client; +import java.util.Date; +import java.math.BigDecimal; + +import java.util.List; +import io.swagger.api.NotFoundException; + +import java.io.InputStream; + +import org.glassfish.jersey.media.multipart.FormDataContentDisposition; +import org.glassfish.jersey.media.multipart.FormDataParam; + +import javax.ws.rs.core.Context; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; +import javax.ws.rs.*; + +@Path("/fake") + + +@io.swagger.annotations.Api(description = "the fake API") + +public class FakeApi { + private final FakeApiService delegate = FakeApiServiceFactory.getFakeApi(); + + @PATCH + + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + @io.swagger.annotations.ApiOperation(value = "To test \"client\" model", notes = "", 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 -,@Context SecurityContext securityContext) - throws NotFoundException { - return delegate.testClientModel(body,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.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) }) +,@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.testClientModel(body,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.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 @@ -68,19 +68,19 @@ public class FakeApi { ,@ApiParam(value = "None") @FormParam("date") Date date ,@ApiParam(value = "None") @FormParam("dateTime") Date dateTime ,@ApiParam(value = "None") @FormParam("password") String password -,@Context SecurityContext securityContext) - throws NotFoundException { - return delegate.testEndpointParameters(number,_double,patternWithoutDelimiter,_byte,integer,int32,int64,_float,string,binary,date,dateTime,password,securityContext); - } - @GET - - @Consumes({ "application/json" }) - @Produces({ "application/json" }) - @io.swagger.annotations.ApiOperation(value = "To test enum parameters", notes = "", 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) }) +,@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.testEndpointParameters(number,_double,patternWithoutDelimiter,_byte,integer,int32,int64,_float,string,binary,date,dateTime,password,securityContext); + } + @GET + + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + @io.swagger.annotations.ApiOperation(value = "To test enum parameters", notes = "", 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 @@ -89,8 +89,8 @@ public class FakeApi { ,@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)") @QueryParam("enum_query_integer") BigDecimal enumQueryInteger ,@ApiParam(value = "Query parameter enum test (double)") @FormParam("enum_query_double") Double enumQueryDouble -,@Context SecurityContext securityContext) - throws NotFoundException { - return delegate.testEnumParameters(enumFormStringArray,enumFormString,enumHeaderStringArray,enumHeaderString,enumQueryStringArray,enumQueryString,enumQueryInteger,enumQueryDouble,securityContext); - } -} +,@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.testEnumParameters(enumFormStringArray,enumFormString,enumHeaderStringArray,enumHeaderString,enumQueryStringArray,enumQueryString,enumQueryInteger,enumQueryDouble,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 a1546e6e8f6..61872e67acb 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 @@ -6,8 +6,8 @@ import io.swagger.model.*; import org.glassfish.jersey.media.multipart.FormDataContentDisposition; import io.swagger.model.Client; -import java.math.BigDecimal; import java.util.Date; +import java.math.BigDecimal; import java.util.List; import io.swagger.api.NotFoundException; 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 63d9fea595f..696755a2ba5 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 @@ -1,187 +1,187 @@ -package io.swagger.api; - -import io.swagger.model.*; -import io.swagger.api.PetApiService; -import io.swagger.api.factories.PetApiServiceFactory; - -import io.swagger.annotations.ApiParam; -import io.swagger.jaxrs.*; - -import io.swagger.model.Pet; -import io.swagger.model.ModelApiResponse; -import java.io.File; - -import java.util.List; -import io.swagger.api.NotFoundException; - -import java.io.InputStream; - -import org.glassfish.jersey.media.multipart.FormDataContentDisposition; -import org.glassfish.jersey.media.multipart.FormDataParam; - -import javax.ws.rs.core.Context; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.SecurityContext; -import javax.ws.rs.*; - -@Path("/pet") - - -@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.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = void.class) }) +package io.swagger.api; + +import io.swagger.model.*; +import io.swagger.api.PetApiService; +import io.swagger.api.factories.PetApiServiceFactory; + +import io.swagger.annotations.ApiParam; +import io.swagger.jaxrs.*; + +import io.swagger.model.Pet; +import java.io.File; +import io.swagger.model.ModelApiResponse; + +import java.util.List; +import io.swagger.api.NotFoundException; + +import java.io.InputStream; + +import org.glassfish.jersey.media.multipart.FormDataContentDisposition; +import org.glassfish.jersey.media.multipart.FormDataParam; + +import javax.ws.rs.core.Context; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; +import javax.ws.rs.*; + +@Path("/pet") + + +@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.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) - throws NotFoundException { - return delegate.addPet(body,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.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid pet value", response = void.class) }) +,@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.addPet(body,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.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 -,@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.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 = Pet.class, responseContainer = "List") }) +,@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.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 = Pet.class, responseContainer = "List") }) public Response findPetsByStatus(@ApiParam(value = "Status values that need to be considered for filter",required=true, allowableValues="available, pending, sold") @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.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 = Pet.class, responseContainer = "List") }) +,@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.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 = Pet.class, responseContainer = "List") }) public Response findPetsByTags(@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.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 = Pet.class), - - @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Pet.class) }) +,@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.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 = Pet.class), + + @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Pet.class) }) public Response getPetById(@ApiParam(value = "ID of pet to return",required=true) @PathParam("petId") Long petId -,@Context SecurityContext securityContext) - throws NotFoundException { - return delegate.getPetById(petId,securityContext); - } - @PUT - - @Consumes({ "application/json", "application/xml" }) - @Produces({ "application/xml", "application/json" }) - @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.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) }) +,@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.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) - throws NotFoundException { - return delegate.updatePet(body,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.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = void.class) }) +,@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.updatePet(body,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.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 -,@Context SecurityContext securityContext) - throws NotFoundException { - return delegate.updatePetWithForm(petId,name,status,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.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) +,@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.updatePetWithForm(petId,name,status,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.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 -,@Context SecurityContext securityContext) - throws NotFoundException { - return delegate.uploadFile(petId,additionalMetadata,fileInputStream, fileDetail,securityContext); - } -} +,@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.uploadFile(petId,additionalMetadata,fileInputStream, fileDetail,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 1b39321b392..fdd2296320d 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 @@ -6,8 +6,8 @@ import io.swagger.model.*; import org.glassfish.jersey.media.multipart.FormDataContentDisposition; import io.swagger.model.Pet; -import io.swagger.model.ModelApiResponse; import java.io.File; +import io.swagger.model.ModelApiResponse; import java.util.List; import io.swagger.api.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 9307886f15f..6c4c40b97cc 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 @@ -1,91 +1,91 @@ -package io.swagger.api; - -import io.swagger.model.*; -import io.swagger.api.StoreApiService; -import io.swagger.api.factories.StoreApiServiceFactory; - -import io.swagger.annotations.ApiParam; -import io.swagger.jaxrs.*; - -import java.util.Map; -import io.swagger.model.Order; - -import java.util.List; -import io.swagger.api.NotFoundException; - -import java.io.InputStream; - -import org.glassfish.jersey.media.multipart.FormDataContentDisposition; -import org.glassfish.jersey.media.multipart.FormDataParam; - -import javax.ws.rs.core.Context; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.SecurityContext; -import javax.ws.rs.*; - -@Path("/store") - - -@io.swagger.annotations.Api(description = "the store API") - -public class StoreApi { - private final StoreApiService delegate = StoreApiServiceFactory.getStoreApi(); - - @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) }) +package io.swagger.api; + +import io.swagger.model.*; +import io.swagger.api.StoreApiService; +import io.swagger.api.factories.StoreApiServiceFactory; + +import io.swagger.annotations.ApiParam; +import io.swagger.jaxrs.*; + +import java.util.Map; +import io.swagger.model.Order; + +import java.util.List; +import io.swagger.api.NotFoundException; + +import java.io.InputStream; + +import org.glassfish.jersey.media.multipart.FormDataContentDisposition; +import org.glassfish.jersey.media.multipart.FormDataParam; + +import javax.ws.rs.core.Context; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; +import javax.ws.rs.*; + +@Path("/store") + + +@io.swagger.annotations.Api(description = "the store API") + +public class StoreApi { + private final StoreApiService delegate = StoreApiServiceFactory.getStoreApi(); + + @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(@ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathParam("orderId") 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.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Integer.class, responseContainer = "Map") }) - public Response getInventory(@Context SecurityContext securityContext) - throws NotFoundException { - return delegate.getInventory(securityContext); - } - @GET - @Path("/order/{orderId}") - - @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.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 = Order.class), - - @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Order.class) }) +,@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.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Integer.class, responseContainer = "Map") }) + public Response getInventory(@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.getInventory(securityContext); + } + @GET + @Path("/order/{orderId}") + + @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.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 = Order.class), + + @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Order.class) }) public Response getOrderById(@ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathParam("orderId") Long orderId -,@Context SecurityContext securityContext) - throws NotFoundException { - return delegate.getOrderById(orderId,securityContext); - } - @POST - @Path("/order") - - @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 = Order.class) }) +,@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.getOrderById(orderId,securityContext); + } + @POST + @Path("/order") + + @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 = Order.class) }) public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true) Order body -,@Context SecurityContext securityContext) - throws NotFoundException { - return delegate.placeOrder(body,securityContext); - } -} +,@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.placeOrder(body,securityContext); + } +} 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 3360b54ff60..3c185f148cb 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 @@ -1,141 +1,141 @@ -package io.swagger.api; - -import io.swagger.model.*; -import io.swagger.api.UserApiService; -import io.swagger.api.factories.UserApiServiceFactory; - -import io.swagger.annotations.ApiParam; -import io.swagger.jaxrs.*; - -import io.swagger.model.User; -import java.util.List; - -import java.util.List; -import io.swagger.api.NotFoundException; - -import java.io.InputStream; - -import org.glassfish.jersey.media.multipart.FormDataContentDisposition; -import org.glassfish.jersey.media.multipart.FormDataParam; - -import javax.ws.rs.core.Context; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.SecurityContext; -import javax.ws.rs.*; - -@Path("/user") - - -@io.swagger.annotations.Api(description = "the user API") - -public class UserApi { - private final UserApiService delegate = UserApiServiceFactory.getUserApi(); - - @POST - - - @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) }) +package io.swagger.api; + +import io.swagger.model.*; +import io.swagger.api.UserApiService; +import io.swagger.api.factories.UserApiServiceFactory; + +import io.swagger.annotations.ApiParam; +import io.swagger.jaxrs.*; + +import io.swagger.model.User; +import java.util.List; + +import java.util.List; +import io.swagger.api.NotFoundException; + +import java.io.InputStream; + +import org.glassfish.jersey.media.multipart.FormDataContentDisposition; +import org.glassfish.jersey.media.multipart.FormDataParam; + +import javax.ws.rs.core.Context; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; +import javax.ws.rs.*; + +@Path("/user") + + +@io.swagger.annotations.Api(description = "the user API") + +public class UserApi { + private final UserApiService delegate = UserApiServiceFactory.getUserApi(); + + @POST + + + @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) - throws NotFoundException { - return delegate.createUser(body,securityContext); - } - @POST - @Path("/createWithArray") - - @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) }) +,@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.createUser(body,securityContext); + } + @POST + @Path("/createWithArray") + + @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) - throws NotFoundException { - return delegate.createUsersWithArrayInput(body,securityContext); - } - @POST - @Path("/createWithList") - - @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) }) +,@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.createUsersWithArrayInput(body,securityContext); + } + @POST + @Path("/createWithList") + + @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) - 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), - - @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = void.class) }) +,@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.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 -,@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.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 = User.class), - - @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = User.class) }) +,@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.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 = User.class), + + @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = User.class) }) public Response getUserByName(@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.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 = String.class) }) +,@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.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 = String.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 -,@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.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = void.class) }) - public Response logoutUser(@Context SecurityContext securityContext) - throws NotFoundException { - return delegate.logoutUser(securityContext); - } - @PUT - @Path("/{username}") - - @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) }) +,@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.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = void.class) }) + public Response logoutUser(@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.logoutUser(securityContext); + } + @PUT + @Path("/{username}") + + @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 -,@Context SecurityContext securityContext) - throws NotFoundException { - return delegate.updateUser(username,body,securityContext); - } -} +,@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.updateUser(username,body,securityContext); + } +} 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 254091d886c..067e840d45d 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 @@ -4,8 +4,8 @@ import io.swagger.api.*; import io.swagger.model.*; import io.swagger.model.Client; -import java.math.BigDecimal; import java.util.Date; +import java.math.BigDecimal; import java.util.List; import io.swagger.api.NotFoundException; 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 3eabed0d97e..6268083801c 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 @@ -4,8 +4,8 @@ import io.swagger.api.*; import io.swagger.model.*; import io.swagger.model.Pet; -import io.swagger.model.ModelApiResponse; import java.io.File; +import io.swagger.model.ModelApiResponse; import java.util.List; import io.swagger.api.NotFoundException; diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/FakeApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/FakeApi.java index 22625b22746..39bd2a95cb9 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/FakeApi.java @@ -62,7 +62,7 @@ public interface FakeApi { , -@ApiParam(value = "None", required=true ) @RequestPart(value="string", required=true) String string +@ApiParam(value = "None", required=true ) @RequestPart(value="patternWithoutDelimiter", required=true) String patternWithoutDelimiter , @@ -86,6 +86,10 @@ public interface FakeApi { , +@ApiParam(value = "None" ) @RequestPart(value="string", required=false) String string +, + + @ApiParam(value = "None" ) @RequestPart(value="binary", required=false) byte[] binary , @@ -116,13 +120,13 @@ public interface FakeApi { default CompletableFuture> testEnumParameters( -@ApiParam(value = "Form parameter enum test (string array)" ) @RequestPart(value="enumFormStringArray", required=false) List enumFormStringArray +@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enumFormStringArray", required=false) List enumFormStringArray , @ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enumFormString", required=false) String enumFormString , -@ApiParam(value = "Header parameter enum test (string array)" ) @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray +@ApiParam(value = "Header parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray , diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Model200Response.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Model200Response.java index bd7a6532214..959f05a2d31 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Model200Response.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Model200Response.java @@ -22,7 +22,7 @@ public class Model200Response { private Integer name = null; @JsonProperty("class") - private String PropertyClass = null; + private String propertyClass = null; public Model200Response name(Integer name) { this.name = name; @@ -42,22 +42,22 @@ public class Model200Response { this.name = name; } - public Model200Response PropertyClass(String PropertyClass) { - this.PropertyClass = PropertyClass; + public Model200Response propertyClass(String propertyClass) { + this.propertyClass = propertyClass; return this; } /** - * Get PropertyClass - * @return PropertyClass + * Get propertyClass + * @return propertyClass **/ @ApiModelProperty(value = "") public String getPropertyClass() { - return PropertyClass; + return propertyClass; } - public void setPropertyClass(String PropertyClass) { - this.PropertyClass = PropertyClass; + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; } @@ -71,12 +71,12 @@ public class Model200Response { } Model200Response _200Response = (Model200Response) o; return Objects.equals(this.name, _200Response.name) && - Objects.equals(this.PropertyClass, _200Response.PropertyClass); + Objects.equals(this.propertyClass, _200Response.propertyClass); } @Override public int hashCode() { - return Objects.hash(name, PropertyClass); + return Objects.hash(name, propertyClass); } @Override @@ -85,7 +85,7 @@ public class Model200Response { sb.append("class Model200Response {\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" PropertyClass: ").append(toIndentedString(PropertyClass)).append("\n"); + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/resources/swagger.properties b/samples/server/petstore/spring-mvc-j8-async/src/main/resources/swagger.properties index 858a5f007b5..8d3a7a8292b 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/resources/swagger.properties +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/resources/swagger.properties @@ -1,2 +1,2 @@ -springfox.documentation.swagger.v2.path=/api-docs -#server.port=8090 \ No newline at end of file +springfox.documentation.swagger.v2.path=/api-docs +#server.port=8090 diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeApi.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeApi.java index 7efee499d27..a9ed1dede00 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeApi.java @@ -57,7 +57,7 @@ public interface FakeApi { , -@ApiParam(value = "None", required=true ) @RequestPart(value="string", required=true) String string +@ApiParam(value = "None", required=true ) @RequestPart(value="patternWithoutDelimiter", required=true) String patternWithoutDelimiter , @@ -81,6 +81,10 @@ public interface FakeApi { , +@ApiParam(value = "None" ) @RequestPart(value="string", required=false) String string +, + + @ApiParam(value = "None" ) @RequestPart(value="binary", required=false) byte[] binary , @@ -108,13 +112,13 @@ public interface FakeApi { ResponseEntity testEnumParameters( -@ApiParam(value = "Form parameter enum test (string array)" ) @RequestPart(value="enumFormStringArray", required=false) List enumFormStringArray +@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enumFormStringArray", required=false) List enumFormStringArray , @ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enumFormString", required=false) String enumFormString , -@ApiParam(value = "Header parameter enum test (string array)" ) @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray +@ApiParam(value = "Header parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray , diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeApiController.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeApiController.java index 95b2a742008..722544de7d3 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeApiController.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeApiController.java @@ -46,7 +46,7 @@ public class FakeApiController implements FakeApi { -@ApiParam(value = "None", required=true ) @RequestPart(value="string", required=true) String string +@ApiParam(value = "None", required=true ) @RequestPart(value="patternWithoutDelimiter", required=true) String patternWithoutDelimiter , @@ -76,6 +76,11 @@ public class FakeApiController implements FakeApi { +@ApiParam(value = "None" ) @RequestPart(value="string", required=false) String string +, + + + @ApiParam(value = "None" ) @RequestPart(value="binary", required=false) byte[] binary , @@ -100,7 +105,7 @@ public class FakeApiController implements FakeApi { public ResponseEntity testEnumParameters( -@ApiParam(value = "Form parameter enum test (string array)" ) @RequestPart(value="enumFormStringArray", required=false) List enumFormStringArray +@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enumFormStringArray", required=false) List enumFormStringArray , @@ -108,7 +113,7 @@ public class FakeApiController implements FakeApi { @ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enumFormString", required=false) String enumFormString , -@ApiParam(value = "Header parameter enum test (string array)" ) @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray +@ApiParam(value = "Header parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray , diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Model200Response.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Model200Response.java index bd7a6532214..959f05a2d31 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Model200Response.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Model200Response.java @@ -22,7 +22,7 @@ public class Model200Response { private Integer name = null; @JsonProperty("class") - private String PropertyClass = null; + private String propertyClass = null; public Model200Response name(Integer name) { this.name = name; @@ -42,22 +42,22 @@ public class Model200Response { this.name = name; } - public Model200Response PropertyClass(String PropertyClass) { - this.PropertyClass = PropertyClass; + public Model200Response propertyClass(String propertyClass) { + this.propertyClass = propertyClass; return this; } /** - * Get PropertyClass - * @return PropertyClass + * Get propertyClass + * @return propertyClass **/ @ApiModelProperty(value = "") public String getPropertyClass() { - return PropertyClass; + return propertyClass; } - public void setPropertyClass(String PropertyClass) { - this.PropertyClass = PropertyClass; + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; } @@ -71,12 +71,12 @@ public class Model200Response { } Model200Response _200Response = (Model200Response) o; return Objects.equals(this.name, _200Response.name) && - Objects.equals(this.PropertyClass, _200Response.PropertyClass); + Objects.equals(this.propertyClass, _200Response.propertyClass); } @Override public int hashCode() { - return Objects.hash(name, PropertyClass); + return Objects.hash(name, propertyClass); } @Override @@ -85,7 +85,7 @@ public class Model200Response { sb.append("class Model200Response {\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" PropertyClass: ").append(toIndentedString(PropertyClass)).append("\n"); + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/server/petstore/spring-mvc/src/main/resources/swagger.properties b/samples/server/petstore/spring-mvc/src/main/resources/swagger.properties index 858a5f007b5..8d3a7a8292b 100644 --- a/samples/server/petstore/spring-mvc/src/main/resources/swagger.properties +++ b/samples/server/petstore/spring-mvc/src/main/resources/swagger.properties @@ -1,2 +1,2 @@ -springfox.documentation.swagger.v2.path=/api-docs -#server.port=8090 \ No newline at end of file +springfox.documentation.swagger.v2.path=/api-docs +#server.port=8090 diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/Swagger2SpringBoot.java b/samples/server/petstore/springboot/src/main/java/io/swagger/Swagger2SpringBoot.java index 2cc65db2b81..c06fbae3c7a 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/Swagger2SpringBoot.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/Swagger2SpringBoot.java @@ -1,36 +1,36 @@ -package io.swagger; - -import org.springframework.boot.CommandLineRunner; -import org.springframework.boot.ExitCodeGenerator; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.ComponentScan; - -import springfox.documentation.swagger2.annotations.EnableSwagger2; - -@SpringBootApplication -@EnableSwagger2 -@ComponentScan(basePackages = "io.swagger") -public class Swagger2SpringBoot implements CommandLineRunner { - - @Override - public void run(String... arg0) throws Exception { - if (arg0.length > 0 && arg0[0].equals("exitcode")) { - throw new ExitException(); - } - } - - public static void main(String[] args) throws Exception { - new SpringApplication(Swagger2SpringBoot.class).run(args); - } - - class ExitException extends RuntimeException implements ExitCodeGenerator { - private static final long serialVersionUID = 1L; - - @Override - public int getExitCode() { - return 10; - } - - } -} \ No newline at end of file +package io.swagger; + +import org.springframework.boot.CommandLineRunner; +import org.springframework.boot.ExitCodeGenerator; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +import springfox.documentation.swagger2.annotations.EnableSwagger2; + +@SpringBootApplication +@EnableSwagger2 +@ComponentScan(basePackages = "io.swagger") +public class Swagger2SpringBoot implements CommandLineRunner { + + @Override + public void run(String... arg0) throws Exception { + if (arg0.length > 0 && arg0[0].equals("exitcode")) { + throw new ExitException(); + } + } + + public static void main(String[] args) throws Exception { + new SpringApplication(Swagger2SpringBoot.class).run(args); + } + + class ExitException extends RuntimeException implements ExitCodeGenerator { + private static final long serialVersionUID = 1L; + + @Override + public int getExitCode() { + return 10; + } + + } +} diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeApi.java b/samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeApi.java index 7efee499d27..a9ed1dede00 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeApi.java @@ -57,7 +57,7 @@ public interface FakeApi { , -@ApiParam(value = "None", required=true ) @RequestPart(value="string", required=true) String string +@ApiParam(value = "None", required=true ) @RequestPart(value="patternWithoutDelimiter", required=true) String patternWithoutDelimiter , @@ -81,6 +81,10 @@ public interface FakeApi { , +@ApiParam(value = "None" ) @RequestPart(value="string", required=false) String string +, + + @ApiParam(value = "None" ) @RequestPart(value="binary", required=false) byte[] binary , @@ -108,13 +112,13 @@ public interface FakeApi { ResponseEntity testEnumParameters( -@ApiParam(value = "Form parameter enum test (string array)" ) @RequestPart(value="enumFormStringArray", required=false) List enumFormStringArray +@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enumFormStringArray", required=false) List enumFormStringArray , @ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enumFormString", required=false) String enumFormString , -@ApiParam(value = "Header parameter enum test (string array)" ) @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray +@ApiParam(value = "Header parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray , diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeApiController.java b/samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeApiController.java index 95b2a742008..722544de7d3 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeApiController.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeApiController.java @@ -46,7 +46,7 @@ public class FakeApiController implements FakeApi { -@ApiParam(value = "None", required=true ) @RequestPart(value="string", required=true) String string +@ApiParam(value = "None", required=true ) @RequestPart(value="patternWithoutDelimiter", required=true) String patternWithoutDelimiter , @@ -76,6 +76,11 @@ public class FakeApiController implements FakeApi { +@ApiParam(value = "None" ) @RequestPart(value="string", required=false) String string +, + + + @ApiParam(value = "None" ) @RequestPart(value="binary", required=false) byte[] binary , @@ -100,7 +105,7 @@ public class FakeApiController implements FakeApi { public ResponseEntity testEnumParameters( -@ApiParam(value = "Form parameter enum test (string array)" ) @RequestPart(value="enumFormStringArray", required=false) List enumFormStringArray +@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enumFormStringArray", required=false) List enumFormStringArray , @@ -108,7 +113,7 @@ public class FakeApiController implements FakeApi { @ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enumFormString", required=false) String enumFormString , -@ApiParam(value = "Header parameter enum test (string array)" ) @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray +@ApiParam(value = "Header parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray , diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/configuration/HomeController.java b/samples/server/petstore/springboot/src/main/java/io/swagger/configuration/HomeController.java index 14fcf37acff..d195523c1d3 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/configuration/HomeController.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/configuration/HomeController.java @@ -1,16 +1,16 @@ -package io.swagger.configuration; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; - -/** - * Home redirection to swagger api documentation - */ -@Controller -public class HomeController { - @RequestMapping(value = "/") - public String index() { - System.out.println("swagger-ui.html"); - return "redirect:swagger-ui.html"; - } -} \ No newline at end of file +package io.swagger.configuration; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; + +/** + * Home redirection to swagger api documentation + */ +@Controller +public class HomeController { + @RequestMapping(value = "/") + public String index() { + System.out.println("swagger-ui.html"); + return "redirect:swagger-ui.html"; + } +} diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/model/Model200Response.java b/samples/server/petstore/springboot/src/main/java/io/swagger/model/Model200Response.java index bd7a6532214..959f05a2d31 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/model/Model200Response.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/model/Model200Response.java @@ -22,7 +22,7 @@ public class Model200Response { private Integer name = null; @JsonProperty("class") - private String PropertyClass = null; + private String propertyClass = null; public Model200Response name(Integer name) { this.name = name; @@ -42,22 +42,22 @@ public class Model200Response { this.name = name; } - public Model200Response PropertyClass(String PropertyClass) { - this.PropertyClass = PropertyClass; + public Model200Response propertyClass(String propertyClass) { + this.propertyClass = propertyClass; return this; } /** - * Get PropertyClass - * @return PropertyClass + * Get propertyClass + * @return propertyClass **/ @ApiModelProperty(value = "") public String getPropertyClass() { - return PropertyClass; + return propertyClass; } - public void setPropertyClass(String PropertyClass) { - this.PropertyClass = PropertyClass; + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; } @@ -71,12 +71,12 @@ public class Model200Response { } Model200Response _200Response = (Model200Response) o; return Objects.equals(this.name, _200Response.name) && - Objects.equals(this.PropertyClass, _200Response.PropertyClass); + Objects.equals(this.propertyClass, _200Response.propertyClass); } @Override public int hashCode() { - return Objects.hash(name, PropertyClass); + return Objects.hash(name, propertyClass); } @Override @@ -85,7 +85,7 @@ public class Model200Response { sb.append("class Model200Response {\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" PropertyClass: ").append(toIndentedString(PropertyClass)).append("\n"); + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/server/petstore/undertow/dependency-reduced-pom.xml b/samples/server/petstore/undertow/dependency-reduced-pom.xml index 59481b75ae5..1a2b3705ce9 100644 --- a/samples/server/petstore/undertow/dependency-reduced-pom.xml +++ b/samples/server/petstore/undertow/dependency-reduced-pom.xml @@ -1,114 +1,114 @@ - - - - oss-parent - org.sonatype.oss - 5 - ../pom.xml/pom.xml - - 4.0.0 - io.swagger - swagger-undertow-server - swagger-undertow-server - 1.0.0 - - 2.2.0 - - - install - target - ${project.artifactId}-${project.version} - - - maven-shade-plugin - 2.4.3 - - - package - - shade - - - - - - - - - - - maven-jar-plugin - 2.6 - - - - com.networknt.server.Server - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.4.0 - - java - - -jar - target/${project.build.finalName}.jar - - - - - - - - - sonatype-snapshots - https://oss.sonatype.org/content/repositories/snapshots - - - - - junit - junit - 4.12 - test - - - hamcrest-core - org.hamcrest - - - - - org.apache.httpcomponents - httpclient - 4.5.2 - test - - - - 4.1.2 - 1.10 - 3.1.2 - 2.2.0 - UTF-8 - 1.2 - 4.5.2 - 1.4.0.Final - 0.5.2 - 2.6 - 1.8 - 2.8.2 - 0.1.1 - 1.5.10 - 2.1.0-beta.124 - 1.7.21 - 2.5 - 1.1.7 - 4.12 - 4.5.3 - - - + + + + oss-parent + org.sonatype.oss + 5 + ../pom.xml/pom.xml + + 4.0.0 + io.swagger + swagger-undertow-server + swagger-undertow-server + 1.0.0 + + 2.2.0 + + + install + target + ${project.artifactId}-${project.version} + + + maven-shade-plugin + 2.4.3 + + + package + + shade + + + + + + + + + + + maven-jar-plugin + 2.6 + + + + com.networknt.server.Server + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.4.0 + + java + + -jar + target/${project.build.finalName}.jar + + + + + + + + + sonatype-snapshots + https://oss.sonatype.org/content/repositories/snapshots + + + + + junit + junit + 4.12 + test + + + hamcrest-core + org.hamcrest + + + + + org.apache.httpcomponents + httpclient + 4.5.2 + test + + + + 4.1.2 + 1.10 + 3.1.2 + 2.2.0 + UTF-8 + 1.2 + 4.5.2 + 1.4.0.Final + 0.5.2 + 2.6 + 1.8 + 2.8.2 + 0.1.1 + 1.5.10 + 2.1.0-beta.124 + 1.7.21 + 2.5 + 1.1.7 + 4.12 + 4.5.3 + + + diff --git a/samples/server/petstore/undertow/src/main/java/io/swagger/model/Category.java b/samples/server/petstore/undertow/src/main/java/io/swagger/model/Category.java index 3009c443dd3..2bdbadca1fe 100644 --- a/samples/server/petstore/undertow/src/main/java/io/swagger/model/Category.java +++ b/samples/server/petstore/undertow/src/main/java/io/swagger/model/Category.java @@ -8,9 +8,12 @@ import io.swagger.annotations.ApiModelProperty; +/** + * A category for a pet + **/ - -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.UndertowCodegen", date = "2016-09-19T05:56:00.864-04:00") +@ApiModel(description = "A category for a pet") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.UndertowCodegen", date = "2016-09-26T16:15:27.984+08:00") public class Category { private Long id = null; diff --git a/samples/server/petstore/undertow/src/main/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/undertow/src/main/java/io/swagger/model/ModelApiResponse.java index 1525277a43c..8c76fdef562 100644 --- a/samples/server/petstore/undertow/src/main/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/undertow/src/main/java/io/swagger/model/ModelApiResponse.java @@ -8,9 +8,12 @@ import io.swagger.annotations.ApiModelProperty; +/** + * Describes the result of uploading an image resource + **/ - -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.UndertowCodegen", date = "2016-09-19T05:56:00.864-04:00") +@ApiModel(description = "Describes the result of uploading an image resource") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.UndertowCodegen", date = "2016-09-26T16:15:27.984+08:00") public class ModelApiResponse { private Integer code = null; diff --git a/samples/server/petstore/undertow/src/main/java/io/swagger/model/Order.java b/samples/server/petstore/undertow/src/main/java/io/swagger/model/Order.java index 0c449c82625..8d309ccf898 100644 --- a/samples/server/petstore/undertow/src/main/java/io/swagger/model/Order.java +++ b/samples/server/petstore/undertow/src/main/java/io/swagger/model/Order.java @@ -10,9 +10,12 @@ import java.util.Date; +/** + * An order for a pets from the pet store + **/ - -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.UndertowCodegen", date = "2016-09-19T05:56:00.864-04:00") +@ApiModel(description = "An order for a pets from the pet store") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.UndertowCodegen", date = "2016-09-26T16:15:27.984+08:00") public class Order { private Long id = null; diff --git a/samples/server/petstore/undertow/src/main/java/io/swagger/model/Pet.java b/samples/server/petstore/undertow/src/main/java/io/swagger/model/Pet.java index 54d5e1bb352..da6af3805e6 100644 --- a/samples/server/petstore/undertow/src/main/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/undertow/src/main/java/io/swagger/model/Pet.java @@ -13,9 +13,12 @@ import java.util.List; +/** + * A pet for sale in the pet store + **/ - -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.UndertowCodegen", date = "2016-09-19T05:56:00.864-04:00") +@ApiModel(description = "A pet for sale in the pet store") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.UndertowCodegen", date = "2016-09-26T16:15:27.984+08:00") public class Pet { private Long id = null; diff --git a/samples/server/petstore/undertow/src/main/java/io/swagger/model/Tag.java b/samples/server/petstore/undertow/src/main/java/io/swagger/model/Tag.java index 0bd33725ff0..c404fabc9bf 100644 --- a/samples/server/petstore/undertow/src/main/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/undertow/src/main/java/io/swagger/model/Tag.java @@ -8,9 +8,12 @@ import io.swagger.annotations.ApiModelProperty; +/** + * A tag for a pet + **/ - -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.UndertowCodegen", date = "2016-09-19T05:56:00.864-04:00") +@ApiModel(description = "A tag for a pet") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.UndertowCodegen", date = "2016-09-26T16:15:27.984+08:00") public class Tag { private Long id = null; diff --git a/samples/server/petstore/undertow/src/main/java/io/swagger/model/User.java b/samples/server/petstore/undertow/src/main/java/io/swagger/model/User.java index 1135fc1b379..bafd0663638 100644 --- a/samples/server/petstore/undertow/src/main/java/io/swagger/model/User.java +++ b/samples/server/petstore/undertow/src/main/java/io/swagger/model/User.java @@ -8,9 +8,12 @@ import io.swagger.annotations.ApiModelProperty; +/** + * A User who is purchasing from the pet store + **/ - -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.UndertowCodegen", date = "2016-09-19T05:56:00.864-04:00") +@ApiModel(description = "A User who is purchasing from the pet store") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.UndertowCodegen", date = "2016-09-26T16:15:27.984+08:00") public class User { private Long id = null; diff --git a/samples/server/petstore/undertow/src/main/resources/config/oauth/primary.crt b/samples/server/petstore/undertow/src/main/resources/config/oauth/primary.crt index 51ee3649759..34f9272f81e 100644 --- a/samples/server/petstore/undertow/src/main/resources/config/oauth/primary.crt +++ b/samples/server/petstore/undertow/src/main/resources/config/oauth/primary.crt @@ -1,19 +1,19 @@ -----BEGIN CERTIFICATE----- -MIIDmzCCAoOgAwIBAgIEHnAgtDANBgkqhkiG9w0BAQsFADB+MQswCQYDVQQGEwJDQTEQMA4GA1UE -CBMHT250YXJpbzEUMBIGA1UEBxMLTWlzc2lzc2F1Z2ExJjAkBgNVBAoTHU5ldHdvcmsgTmV3IFRl -Y2hub2xvZ2llcyBJbmMuMQwwCgYDVQQLEwNERVYxETAPBgNVBAMTCFN0ZXZlIEh1MB4XDTE2MDkw -MTE2MTYxNVoXDTI2MDcxMTE2MTYxNVowfjELMAkGA1UEBhMCQ0ExEDAOBgNVBAgTB09udGFyaW8x -FDASBgNVBAcTC01pc3Npc3NhdWdhMSYwJAYDVQQKEx1OZXR3b3JrIE5ldyBUZWNobm9sb2dpZXMg -SW5jLjEMMAoGA1UECxMDREVWMREwDwYDVQQDEwhTdGV2ZSBIdTCCASIwDQYJKoZIhvcNAQEBBQAD -ggEPADCCAQoCggEBALrlxMtDb60DogElf4TBz504tRheZimAE0dJL/Yby4nacJdqvc5l4z+WWpDf -rI9krQ2Yi9yvhwAP+PrR6gWcIqWP4cpNE7XIAUDgr4CtyI7CptT/lpjtbkz4DGCMmaeDn0jqHqJt -SeSZGfwVu5zAGm8n4sHatjnnxBI/iWzkTII3V4xv0WeK37szNTEd+ly2ag7n2IV5zNnYmqZTeMQm -J2ENS+IwAG3ENtiVtrVTx/2bGtqutJjtdxsN58/cUG/guRyMT6OPI8Yi3ZzevdvRbxadyhEl/Kaw -6vJcdxmJI3tp4lx+p6sAxOWa7aapJe4JxutAQqzv0GKdVjoHKQ1wB60CAwEAAaMhMB8wHQYDVR0O -BBYEFIPF9SBd06RWU1eDL73CKfy01lavMA0GCSqGSIb3DQEBCwUAA4IBAQAoaKZGOak3Upz/ordF -slZoJuZlCu7jnKQEjYwHf3DNxcd1WmgFPtMcna6pW0VUxPIfidEA6VCMsGoK1RvshB0SjrRdCht6 -5qPXs9kV3NW0WvMiwDSYZZ9HgaZ9efTe5E9Fzc7ltKrE43L6k8NJcaEEWEdpdjFbrAqH4I+j/Vro -K3OhIo062fXjas5ipL4gF+3ECImjWzirQP8UiAfM0/36x7rtAu3btH/qI9hSyx39LBPPE5AsDJZ4 -dSMwNTW1gqmBAZIj+zQ/RD5dyWfPwON7Q+t96YbK6WBuYo0xy+I+PjcUgrWYWP3N24hlq8ZBIei+ +MIIDmzCCAoOgAwIBAgIEHnAgtDANBgkqhkiG9w0BAQsFADB+MQswCQYDVQQGEwJDQTEQMA4GA1UE +CBMHT250YXJpbzEUMBIGA1UEBxMLTWlzc2lzc2F1Z2ExJjAkBgNVBAoTHU5ldHdvcmsgTmV3IFRl +Y2hub2xvZ2llcyBJbmMuMQwwCgYDVQQLEwNERVYxETAPBgNVBAMTCFN0ZXZlIEh1MB4XDTE2MDkw +MTE2MTYxNVoXDTI2MDcxMTE2MTYxNVowfjELMAkGA1UEBhMCQ0ExEDAOBgNVBAgTB09udGFyaW8x +FDASBgNVBAcTC01pc3Npc3NhdWdhMSYwJAYDVQQKEx1OZXR3b3JrIE5ldyBUZWNobm9sb2dpZXMg +SW5jLjEMMAoGA1UECxMDREVWMREwDwYDVQQDEwhTdGV2ZSBIdTCCASIwDQYJKoZIhvcNAQEBBQAD +ggEPADCCAQoCggEBALrlxMtDb60DogElf4TBz504tRheZimAE0dJL/Yby4nacJdqvc5l4z+WWpDf +rI9krQ2Yi9yvhwAP+PrR6gWcIqWP4cpNE7XIAUDgr4CtyI7CptT/lpjtbkz4DGCMmaeDn0jqHqJt +SeSZGfwVu5zAGm8n4sHatjnnxBI/iWzkTII3V4xv0WeK37szNTEd+ly2ag7n2IV5zNnYmqZTeMQm +J2ENS+IwAG3ENtiVtrVTx/2bGtqutJjtdxsN58/cUG/guRyMT6OPI8Yi3ZzevdvRbxadyhEl/Kaw +6vJcdxmJI3tp4lx+p6sAxOWa7aapJe4JxutAQqzv0GKdVjoHKQ1wB60CAwEAAaMhMB8wHQYDVR0O +BBYEFIPF9SBd06RWU1eDL73CKfy01lavMA0GCSqGSIb3DQEBCwUAA4IBAQAoaKZGOak3Upz/ordF +slZoJuZlCu7jnKQEjYwHf3DNxcd1WmgFPtMcna6pW0VUxPIfidEA6VCMsGoK1RvshB0SjrRdCht6 +5qPXs9kV3NW0WvMiwDSYZZ9HgaZ9efTe5E9Fzc7ltKrE43L6k8NJcaEEWEdpdjFbrAqH4I+j/Vro +K3OhIo062fXjas5ipL4gF+3ECImjWzirQP8UiAfM0/36x7rtAu3btH/qI9hSyx39LBPPE5AsDJZ4 +dSMwNTW1gqmBAZIj+zQ/RD5dyWfPwON7Q+t96YbK6WBuYo0xy+I+PjcUgrWYWP3N24hlq8ZBIei+ BudoEVJlIlmS0aRCuP8n -----END CERTIFICATE----- diff --git a/samples/server/petstore/undertow/src/main/resources/config/swagger.json b/samples/server/petstore/undertow/src/main/resources/config/swagger.json index 3e0f26ec144..a7b2b1871e6 100644 --- a/samples/server/petstore/undertow/src/main/resources/config/swagger.json +++ b/samples/server/petstore/undertow/src/main/resources/config/swagger.json @@ -60,8 +60,8 @@ "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], - "x-accepts" : "application/json", - "x-contentType" : "application/json" + "x-contentType" : "application/json", + "x-accepts" : "application/json" }, "put" : { "tags" : [ "pet" ], @@ -93,8 +93,8 @@ "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], - "x-accepts" : "application/json", - "x-contentType" : "application/json" + "x-contentType" : "application/json", + "x-accepts" : "application/json" } }, "/pet/findByStatus" : { @@ -112,10 +112,10 @@ "type" : "array", "items" : { "type" : "string", - "enum" : [ "available", "pending", "sold" ], - "default" : "available" + "default" : "available", + "enum" : [ "available", "pending", "sold" ] }, - "collectionFormat" : "multi" + "collectionFormat" : "csv" } ], "responses" : { "200" : { @@ -134,15 +134,15 @@ "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], - "x-accepts" : "application/json", - "x-contentType" : "application/json" + "x-contentType" : "application/json", + "x-accepts" : "application/json" } }, "/pet/findByTags" : { "get" : { "tags" : [ "pet" ], "summary" : "Finds Pets by tags", - "description" : "Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", + "description" : "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", "operationId" : "findPetsByTags", "produces" : [ "application/xml", "application/json" ], "parameters" : [ { @@ -154,7 +154,7 @@ "items" : { "type" : "string" }, - "collectionFormat" : "multi" + "collectionFormat" : "csv" } ], "responses" : { "200" : { @@ -173,9 +173,8 @@ "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], - "deprecated" : true, - "x-accepts" : "application/json", - "x-contentType" : "application/json" + "x-contentType" : "application/json", + "x-accepts" : "application/json" } }, "/pet/{petId}" : { @@ -210,8 +209,8 @@ "security" : [ { "api_key" : [ ] } ], - "x-accepts" : "application/json", - "x-contentType" : "application/json" + "x-contentType" : "application/json", + "x-accepts" : "application/json" }, "post" : { "tags" : [ "pet" ], @@ -248,8 +247,8 @@ "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], - "x-accepts" : "application/json", - "x-contentType" : "application/x-www-form-urlencoded" + "x-contentType" : "application/x-www-form-urlencoded", + "x-accepts" : "application/json" }, "delete" : { "tags" : [ "pet" ], @@ -272,17 +271,14 @@ } ], "responses" : { "400" : { - "description" : "Invalid ID supplied" - }, - "404" : { - "description" : "Pet not found" + "description" : "Invalid pet value" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], - "x-accepts" : "application/json", - "x-contentType" : "application/json" + "x-contentType" : "application/json", + "x-accepts" : "application/json" } }, "/pet/{petId}/uploadImage" : { @@ -324,8 +320,8 @@ "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], - "x-accepts" : "application/json", - "x-contentType" : "multipart/form-data" + "x-contentType" : "multipart/form-data", + "x-accepts" : "application/json" } }, "/store/inventory" : { @@ -351,8 +347,8 @@ "security" : [ { "api_key" : [ ] } ], - "x-accepts" : "application/json", - "x-contentType" : "application/json" + "x-contentType" : "application/json", + "x-accepts" : "application/json" } }, "/store/order" : { @@ -382,15 +378,15 @@ "description" : "Invalid Order" } }, - "x-accepts" : "application/json", - "x-contentType" : "application/json" + "x-contentType" : "application/json", + "x-accepts" : "application/json" } }, "/store/order/{orderId}" : { "get" : { "tags" : [ "store" ], "summary" : "Find purchase order by ID", - "description" : "For valid response try integer IDs with value >= 1 and <= 10. Other values will generated exceptions", + "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" : [ { @@ -399,7 +395,7 @@ "description" : "ID of pet that needs to be fetched", "required" : true, "type" : "integer", - "maximum" : 10.0, + "maximum" : 5.0, "minimum" : 1.0, "format" : "int64" } ], @@ -417,13 +413,13 @@ "description" : "Order not found" } }, - "x-accepts" : "application/json", - "x-contentType" : "application/json" + "x-contentType" : "application/json", + "x-accepts" : "application/json" }, "delete" : { "tags" : [ "store" ], "summary" : "Delete purchase order by ID", - "description" : "For valid response try integer IDs with positive integer value. Negative or non-integer values will generate API errors", + "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" : [ { @@ -431,9 +427,8 @@ "in" : "path", "description" : "ID of the order that needs to be deleted", "required" : true, - "type" : "integer", - "minimum" : 1.0, - "format" : "int64" + "type" : "string", + "minimum" : 1.0 } ], "responses" : { "400" : { @@ -443,8 +438,8 @@ "description" : "Order not found" } }, - "x-accepts" : "application/json", - "x-contentType" : "application/json" + "x-contentType" : "application/json", + "x-accepts" : "application/json" } }, "/user" : { @@ -468,8 +463,8 @@ "description" : "successful operation" } }, - "x-accepts" : "application/json", - "x-contentType" : "application/json" + "x-contentType" : "application/json", + "x-accepts" : "application/json" } }, "/user/createWithArray" : { @@ -496,8 +491,8 @@ "description" : "successful operation" } }, - "x-accepts" : "application/json", - "x-contentType" : "application/json" + "x-contentType" : "application/json", + "x-accepts" : "application/json" } }, "/user/createWithList" : { @@ -524,8 +519,8 @@ "description" : "successful operation" } }, - "x-accepts" : "application/json", - "x-contentType" : "application/json" + "x-contentType" : "application/json", + "x-accepts" : "application/json" } }, "/user/login" : { @@ -563,7 +558,7 @@ "X-Expires-After" : { "type" : "string", "format" : "date-time", - "description" : "date in UTC when token expires" + "description" : "date in UTC when toekn expires" } } }, @@ -571,8 +566,8 @@ "description" : "Invalid username/password supplied" } }, - "x-accepts" : "application/json", - "x-contentType" : "application/json" + "x-contentType" : "application/json", + "x-accepts" : "application/json" } }, "/user/logout" : { @@ -588,8 +583,8 @@ "description" : "successful operation" } }, - "x-accepts" : "application/json", - "x-contentType" : "application/json" + "x-contentType" : "application/json", + "x-accepts" : "application/json" } }, "/user/{username}" : { @@ -620,8 +615,8 @@ "description" : "User not found" } }, - "x-accepts" : "application/json", - "x-contentType" : "application/json" + "x-contentType" : "application/json", + "x-accepts" : "application/json" }, "put" : { "tags" : [ "user" ], @@ -632,7 +627,7 @@ "parameters" : [ { "name" : "username", "in" : "path", - "description" : "name that need to be updated", + "description" : "name that need to be deleted", "required" : true, "type" : "string" }, { @@ -652,8 +647,8 @@ "description" : "User not found" } }, - "x-accepts" : "application/json", - "x-contentType" : "application/json" + "x-contentType" : "application/json", + "x-accepts" : "application/json" }, "delete" : { "tags" : [ "user" ], @@ -676,25 +671,25 @@ "description" : "User not found" } }, - "x-accepts" : "application/json", - "x-contentType" : "application/json" + "x-contentType" : "application/json", + "x-accepts" : "application/json" } } }, "securityDefinitions" : { + "api_key" : { + "type" : "apiKey", + "name" : "api_key", + "in" : "header" + }, "petstore_auth" : { "type" : "oauth2", - "authorizationUrl" : "http://petstore.swagger.io/oauth/dialog", + "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" : { @@ -727,6 +722,8 @@ "default" : false } }, + "title" : "Pet Order", + "description" : "An order for a pets from the pet store", "xml" : { "name" : "Order" } @@ -742,6 +739,8 @@ "type" : "string" } }, + "title" : "Pet catehgry", + "description" : "A category for a pet", "xml" : { "name" : "Category" } @@ -777,6 +776,8 @@ "description" : "User Status" } }, + "title" : "a User", + "description" : "A User who is purchasing from the pet store", "xml" : { "name" : "User" } @@ -792,25 +793,12 @@ "type" : "string" } }, + "title" : "Pet Tag", + "description" : "A tag for a pet", "xml" : { "name" : "Tag" } }, - "ApiResponse" : { - "type" : "object", - "properties" : { - "code" : { - "type" : "integer", - "format" : "int32" - }, - "type" : { - "type" : "string" - }, - "message" : { - "type" : "string" - } - } - }, "Pet" : { "type" : "object", "required" : [ "name", "photoUrls" ], @@ -852,9 +840,28 @@ "enum" : [ "available", "pending", "sold" ] } }, + "title" : "a Pet", + "description" : "A pet for sale in the pet store", "xml" : { "name" : "Pet" } + }, + "ApiResponse" : { + "type" : "object", + "properties" : { + "code" : { + "type" : "integer", + "format" : "int32" + }, + "type" : { + "type" : "string" + }, + "message" : { + "type" : "string" + } + }, + "title" : "An uploaded response", + "description" : "Describes the result of uploading an image resource" } }, "externalDocs" : {