├── settings.gradle ├── src └── docs │ ├── asciidoc │ ├── manual_content2.adoc │ ├── extensions │ │ ├── paths │ │ │ ├── document-end-text.adoc │ │ │ ├── addPet │ │ │ │ ├── operation-end-text.adoc │ │ │ │ └── operation-begin-text.adoc │ │ │ ├── document-begin-text.adoc │ │ │ └── updatePet │ │ │ │ ├── operation-end-text.adoc │ │ │ │ └── operation-begin-text.adoc │ │ ├── overview │ │ │ ├── document-end-text.adoc │ │ │ └── document-begin-text.adoc │ │ ├── security │ │ │ ├── document-end-text.adoc │ │ │ └── document-begin-text.adoc │ │ └── definitions │ │ │ ├── document-end-text.adoc │ │ │ ├── document-begin-text.adoc │ │ │ └── Pet │ │ │ ├── definition-end-text.adoc │ │ │ └── definition-begin-text.adoc │ ├── manual_content1.adoc │ └── index.adoc │ └── swagger │ └── swagger_petstore.yaml ├── .travis.yml ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── README.adoc ├── gradlew.bat └── gradlew /settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'swagger2markup-gradle-project-template' 2 | 3 | -------------------------------------------------------------------------------- /src/docs/asciidoc/manual_content2.adoc: -------------------------------------------------------------------------------- 1 | == Chapter of manual content 2 2 | 3 | This is some dummy text 4 | 5 | -------------------------------------------------------------------------------- /src/docs/asciidoc/extensions/paths/document-end-text.adoc: -------------------------------------------------------------------------------- 1 | == Document end hook 2 | 3 | Dummy text in document end hook 4 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | jdk: 3 | - oraclejdk8 4 | before_install: 5 | - chmod +x gradlew 6 | script: ./gradlew asciidoctor -------------------------------------------------------------------------------- /src/docs/asciidoc/extensions/overview/document-end-text.adoc: -------------------------------------------------------------------------------- 1 | == Document end hook 2 | 3 | Dummy text in document end hook 4 | -------------------------------------------------------------------------------- /src/docs/asciidoc/extensions/security/document-end-text.adoc: -------------------------------------------------------------------------------- 1 | == Document end hook 2 | 3 | Dummy text in document end hook 4 | -------------------------------------------------------------------------------- /src/docs/asciidoc/extensions/definitions/document-end-text.adoc: -------------------------------------------------------------------------------- 1 | == Document end hook 2 | 3 | Dummy text in document end hook 4 | -------------------------------------------------------------------------------- /src/docs/asciidoc/extensions/overview/document-begin-text.adoc: -------------------------------------------------------------------------------- 1 | == Document begin hook 2 | 3 | Dummy text in document begin hook 4 | -------------------------------------------------------------------------------- /src/docs/asciidoc/extensions/paths/addPet/operation-end-text.adoc: -------------------------------------------------------------------------------- 1 | == Operation end hook 2 | 3 | Dummy text in operation end hook 4 | -------------------------------------------------------------------------------- /src/docs/asciidoc/extensions/paths/document-begin-text.adoc: -------------------------------------------------------------------------------- 1 | == Document begin hook 2 | 3 | Dummy text in document begin hook 4 | -------------------------------------------------------------------------------- /src/docs/asciidoc/extensions/security/document-begin-text.adoc: -------------------------------------------------------------------------------- 1 | == Document begin hook 2 | 3 | Dummy text in document begin hook 4 | -------------------------------------------------------------------------------- /src/docs/asciidoc/extensions/definitions/document-begin-text.adoc: -------------------------------------------------------------------------------- 1 | == Document begin hook 2 | 3 | Dummy text in document begin hook 4 | -------------------------------------------------------------------------------- /src/docs/asciidoc/extensions/paths/updatePet/operation-end-text.adoc: -------------------------------------------------------------------------------- 1 | == Operation end hook 2 | 3 | Dummy text in operation end hook 4 | -------------------------------------------------------------------------------- /src/docs/asciidoc/extensions/definitions/Pet/definition-end-text.adoc: -------------------------------------------------------------------------------- 1 | == Definition end hook 2 | 3 | Dummy text in definition end hook 4 | -------------------------------------------------------------------------------- /src/docs/asciidoc/extensions/paths/addPet/operation-begin-text.adoc: -------------------------------------------------------------------------------- 1 | == Operation begin hook 2 | 3 | Dummy text in operation begin hook 4 | -------------------------------------------------------------------------------- /src/docs/asciidoc/extensions/paths/updatePet/operation-begin-text.adoc: -------------------------------------------------------------------------------- 1 | == Operation begin hook 2 | 3 | Dummy text in operation begin hook 4 | -------------------------------------------------------------------------------- /src/docs/asciidoc/extensions/definitions/Pet/definition-begin-text.adoc: -------------------------------------------------------------------------------- 1 | == Definition before hook 2 | 3 | Dummy text in definition before hook 4 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Swagger2Markup/swagger2markup-gradle-project-template/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /src/docs/asciidoc/manual_content1.adoc: -------------------------------------------------------------------------------- 1 | == Chapter of manual content 1 2 | 3 | This is some dummy text 4 | 5 | === Sub chapter 6 | 7 | Dummy text of sub chapter 8 | 9 | 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | build/ 3 | .idea 4 | *.iml 5 | *.iws 6 | *.ipr 7 | 8 | 9 | # OS generated files # 10 | .DS_Store 11 | .DS_Store? 12 | ._* 13 | .Spotlight-V100 14 | .Trashes 15 | ehthumbs.db 16 | Thumbs.db 17 | 18 | -------------------------------------------------------------------------------- /src/docs/asciidoc/index.adoc: -------------------------------------------------------------------------------- 1 | include::{generated}/overview.adoc[] 2 | include::manual_content1.adoc[] 3 | include::manual_content2.adoc[] 4 | include::{generated}/security.adoc[] 5 | include::{generated}/paths.adoc[] 6 | include::{generated}/definitions.adoc[] 7 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Thu Jul 20 10:52:24 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-bin.zip 7 | -------------------------------------------------------------------------------- /README.adoc: -------------------------------------------------------------------------------- 1 | = Swagger2Markup Gradle template project 2 | 3 | This is a Swagger2Markup Gradle template project which uses the swagger2markup-gradle-plugin to convert a contract-first Swagger specification into an AsciiDoctor-based HTML documentation. 4 | 5 | == Usage guide 6 | 7 | === Swagger Specification 8 | 9 | Copy your Swagger Specification (JSON or YAML) file into the folder `src/docs/swagger`. 10 | 11 | === Add hand-written content 12 | 13 | Add hand-written AsciiDoc content into the folder `src/docs/asciidoc` and include the files in `src/docs/asciidoc/index.adoc`. 14 | 15 | ``` 16 | \include::{generated}/overview.adoc[] 17 | \include::manual_content1.adoc[] 18 | \include::manual_content2.adoc[] 19 | \include::{generated}/paths.adoc[] 20 | \include::{generated}/definitions.adoc[] 21 | ``` 22 | 23 | The Asciidoctor attribute `{generated}` is set by the Gradle script to `build/asciidoc`. By default the Swagger2Markup Gradle plugin creates the the generated AsciiDoc files into the `build/asciidoc` folder. 24 | 25 | 26 | === Convert AsciiDoc to HTML 27 | 28 | [source] 29 | ---- 30 | gradlew asciidoctor 31 | ---- 32 | 33 | Check `build/asciidoc/html5/index.html` to see the generated HTML report. 34 | 35 | === Watch AsciiDoc files 36 | 37 | [source] 38 | ---- 39 | gradlew watch 40 | ---- 41 | 42 | === Start LiveReload 43 | [source] 44 | ---- 45 | gradlew liveReload 46 | ---- 47 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn ( ) { 37 | echo "$*" 38 | } 39 | 40 | die ( ) { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Escape application args 158 | save ( ) { 159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 160 | echo " " 161 | } 162 | APP_ARGS=$(save "$@") 163 | 164 | # Collect all arguments for the java command, following the shell quoting and substitution rules 165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 166 | 167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong 168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then 169 | cd "$(dirname "$0")" 170 | fi 171 | 172 | exec "$JAVACMD" "$@" 173 | -------------------------------------------------------------------------------- /src/docs/swagger/swagger_petstore.yaml: -------------------------------------------------------------------------------- 1 | swagger: "2.0" 2 | info: 3 | description: | 4 | This is a sample server Petstore server. 5 | 6 | [Learn about Swagger](http://swagger.io) or join the IRC channel `#swagger` on irc.freenode.net. 7 | 8 | For this sample, you can use the api key `special-key` to test the authorization filters 9 | version: "1.0.0" 10 | title: Swagger Petstore 11 | termsOfService: http://helloreverb.com/terms/ 12 | contact: 13 | name: apiteam@swagger.io 14 | license: 15 | name: Apache 2.0 16 | url: http://www.apache.org/licenses/LICENSE-2.0.html 17 | host: petstore.swagger.io 18 | basePath: /v2 19 | schemes: 20 | - http 21 | tags: 22 | - name: pet 23 | description: Pet resource 24 | - name: store 25 | description: Store resource 26 | - name: user 27 | description: User resource 28 | paths: 29 | /pets: 30 | post: 31 | tags: 32 | - pet 33 | summary: Add a new pet to the store 34 | description: "" 35 | operationId: addPet 36 | consumes: 37 | - application/json 38 | - application/xml 39 | produces: 40 | - application/json 41 | - application/xml 42 | parameters: 43 | - $ref: "#/parameters/PetBody" 44 | responses: 45 | "405": 46 | description: Invalid input 47 | security: 48 | - petstore_auth: 49 | - write_pets 50 | - read_pets 51 | put: 52 | tags: 53 | - pet 54 | summary: Update an existing pet 55 | description: "" 56 | operationId: updatePet 57 | consumes: 58 | - application/json 59 | - application/xml 60 | produces: 61 | - application/json 62 | - application/xml 63 | parameters: 64 | - $ref: "#/parameters/PetBody" 65 | responses: 66 | "405": 67 | description: Validation exception 68 | "404": 69 | description: Pet not found 70 | "400": 71 | $ref: "#/responses/InvalidId" 72 | security: 73 | - petstore_auth: 74 | - write_pets 75 | - read_pets 76 | /pets/findByStatus: 77 | get: 78 | tags: 79 | - pet 80 | summary: Finds Pets by status 81 | description: Multiple status values can be provided with comma seperated strings 82 | operationId: findPetsByStatus 83 | produces: 84 | - application/json 85 | - application/xml 86 | parameters: 87 | - in: query 88 | name: status 89 | description: Status values that need to be considered for filter 90 | required: false 91 | type: array 92 | items: 93 | type: string 94 | collectionFormat: multi 95 | responses: 96 | "200": 97 | description: successful operation 98 | schema: 99 | type: array 100 | items: 101 | $ref: "#/definitions/Pet" 102 | headers: 103 | X-Rate-Limit-Limit: 104 | description: The number of allowed requests in the current period 105 | type: integer 106 | X-Rate-Limit-Remaining: 107 | description: The number of remaining requests in the current period 108 | type: integer 109 | X-Rate-Limit-Reset: 110 | description: The number of seconds left in the current period 111 | type: integer 112 | "400": 113 | description: Invalid status value 114 | security: 115 | - petstore_auth: 116 | - write_pets 117 | - read_pets 118 | /pets/findByTags: 119 | get: 120 | tags: 121 | - pet 122 | summary: Finds Pets by tags 123 | description: Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. 124 | operationId: findPetsByTags 125 | produces: 126 | - application/json 127 | - application/xml 128 | parameters: 129 | - in: query 130 | name: tags 131 | description: Tags to filter by 132 | required: false 133 | type: array 134 | items: 135 | type: string 136 | collectionFormat: multi 137 | responses: 138 | "200": 139 | description: successful operation 140 | schema: 141 | type: array 142 | items: 143 | $ref: "#/definitions/Pet" 144 | headers: 145 | X-Rate-Limit-Limit: 146 | description: The number of allowed requests in the current period 147 | type: integer 148 | X-Rate-Limit-Remaining: 149 | description: The number of remaining requests in the current period 150 | type: integer 151 | X-Rate-Limit-Reset: 152 | description: The number of seconds left in the current period 153 | type: integer 154 | "400": 155 | description: Invalid tag value 156 | security: 157 | - petstore_auth: 158 | - write_pets 159 | - read_pets 160 | /pets/{petId}: 161 | get: 162 | tags: 163 | - pet 164 | summary: Find pet by ID 165 | description: Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions 166 | operationId: getPetById 167 | produces: 168 | - application/json 169 | - application/xml 170 | parameters: 171 | - in: path 172 | name: petId 173 | description: ID of pet that needs to be fetched 174 | required: true 175 | type: integer 176 | format: int64 177 | responses: 178 | "404": 179 | description: Pet not found 180 | "200": 181 | description: successful operation 182 | schema: 183 | $ref: "#/definitions/Pet" 184 | headers: 185 | X-Rate-Limit-Limit: 186 | description: The number of allowed requests in the current period 187 | type: integer 188 | X-Rate-Limit-Remaining: 189 | description: The number of remaining requests in the current period 190 | type: integer 191 | X-Rate-Limit-Reset: 192 | description: The number of seconds left in the current period 193 | type: integer 194 | "400": 195 | $ref: "#/responses/InvalidId" 196 | security: 197 | - api_key: [] 198 | - petstore_auth: 199 | - write_pets 200 | - read_pets 201 | post: 202 | tags: 203 | - pet 204 | summary: Updates a pet in the store with form data 205 | description: "" 206 | operationId: updatePetWithForm 207 | consumes: 208 | - application/x-www-form-urlencoded 209 | produces: 210 | - application/json 211 | - application/xml 212 | parameters: 213 | - in: path 214 | name: petId 215 | description: ID of pet that needs to be updated 216 | required: true 217 | type: string 218 | - in: formData 219 | name: name 220 | description: Updated name of the pet 221 | required: true 222 | type: string 223 | - in: formData 224 | name: status 225 | description: Updated status of the pet 226 | required: true 227 | type: string 228 | responses: 229 | "405": 230 | description: Invalid input 231 | security: 232 | - petstore_auth: 233 | - write_pets 234 | - read_pets 235 | delete: 236 | tags: 237 | - pet 238 | summary: Deletes a pet 239 | description: "" 240 | operationId: deletePet 241 | produces: 242 | - application/json 243 | - application/xml 244 | parameters: 245 | - in: header 246 | name: api_key 247 | description: "" 248 | required: true 249 | type: string 250 | - in: path 251 | name: petId 252 | description: Pet id to delete 253 | required: true 254 | type: integer 255 | format: int64 256 | responses: 257 | "400": 258 | description: Invalid pet value 259 | security: 260 | - petstore_auth: 261 | - write_pets 262 | - read_pets 263 | /stores/order: 264 | post: 265 | tags: 266 | - store 267 | summary: Place an order for a pet 268 | description: "" 269 | operationId: placeOrder 270 | produces: 271 | - application/json 272 | - application/xml 273 | parameters: 274 | - in: body 275 | name: body 276 | description: order placed for purchasing the pet 277 | required: false 278 | schema: 279 | $ref: "#/definitions/Order" 280 | responses: 281 | "200": 282 | description: successful operation 283 | schema: 284 | $ref: "#/definitions/Order" 285 | headers: 286 | X-Rate-Limit-Limit: 287 | description: The number of allowed requests in the current period 288 | type: integer 289 | X-Rate-Limit-Remaining: 290 | description: The number of remaining requests in the current period 291 | type: integer 292 | X-Rate-Limit-Reset: 293 | description: The number of seconds left in the current period 294 | type: integer 295 | "400": 296 | description: Invalid Order 297 | /stores/order/{orderId}: 298 | get: 299 | tags: 300 | - store 301 | summary: Find purchase order by ID 302 | description: For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions 303 | operationId: getOrderById 304 | produces: 305 | - application/json 306 | - application/xml 307 | parameters: 308 | - in: path 309 | name: orderId 310 | description: ID of pet that needs to be fetched 311 | required: true 312 | type: string 313 | responses: 314 | "404": 315 | description: Order not found 316 | "200": 317 | description: successful operation 318 | schema: 319 | $ref: "#/definitions/Order" 320 | headers: 321 | X-Rate-Limit-Limit: 322 | description: The number of allowed requests in the current period 323 | type: integer 324 | X-Rate-Limit-Remaining: 325 | description: The number of remaining requests in the current period 326 | type: integer 327 | X-Rate-Limit-Reset: 328 | description: The number of seconds left in the current period 329 | type: integer 330 | "400": 331 | $ref: "#/responses/InvalidId" 332 | delete: 333 | tags: 334 | - store 335 | summary: Delete purchase order by ID 336 | description: For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors 337 | operationId: deleteOrder 338 | produces: 339 | - application/json 340 | - application/xml 341 | parameters: 342 | - in: path 343 | name: orderId 344 | description: ID of the order that needs to be deleted 345 | required: true 346 | type: string 347 | responses: 348 | "404": 349 | description: Order not found 350 | "400": 351 | $ref: "#/responses/InvalidId" 352 | /users: 353 | post: 354 | tags: 355 | - user 356 | summary: Create user 357 | description: This can only be done by the logged in user. 358 | operationId: createUser 359 | produces: 360 | - application/json 361 | - application/xml 362 | parameters: 363 | - in: body 364 | name: body 365 | description: Created user object 366 | required: false 367 | schema: 368 | $ref: "#/definitions/User" 369 | responses: 370 | default: 371 | description: successful operation 372 | /users/createWithArray: 373 | post: 374 | tags: 375 | - user 376 | summary: Creates list of users with given input array 377 | description: "" 378 | operationId: createUsersWithArrayInput 379 | produces: 380 | - application/json 381 | - application/xml 382 | parameters: 383 | - in: body 384 | name: body 385 | description: List of user object 386 | required: false 387 | schema: 388 | type: array 389 | items: 390 | $ref: "#/definitions/User" 391 | responses: 392 | default: 393 | description: successful operation 394 | /users/createWithList: 395 | post: 396 | tags: 397 | - user 398 | summary: Creates list of users with given input array 399 | description: "" 400 | operationId: createUsersWithListInput 401 | produces: 402 | - application/json 403 | - application/xml 404 | parameters: 405 | - in: body 406 | name: body 407 | description: List of user object 408 | required: false 409 | schema: 410 | type: array 411 | items: 412 | $ref: "#/definitions/User" 413 | responses: 414 | default: 415 | description: successful operation 416 | /users/login: 417 | get: 418 | tags: 419 | - user 420 | summary: Logs user into the system 421 | description: "" 422 | operationId: loginUser 423 | produces: 424 | - application/json 425 | - application/xml 426 | parameters: 427 | - in: query 428 | name: username 429 | description: The user name for login 430 | required: false 431 | type: string 432 | - in: query 433 | name: password 434 | description: The password for login in clear text 435 | required: false 436 | type: string 437 | responses: 438 | "200": 439 | description: successful operation 440 | schema: 441 | type: string 442 | headers: 443 | X-Rate-Limit-Limit: 444 | description: The number of allowed requests in the current period 445 | type: integer 446 | X-Rate-Limit-Remaining: 447 | description: The number of remaining requests in the current period 448 | type: integer 449 | X-Rate-Limit-Reset: 450 | description: The number of seconds left in the current period 451 | type: integer 452 | "400": 453 | description: Invalid username/password supplied 454 | /users/logout: 455 | get: 456 | tags: 457 | - user 458 | summary: Logs out current logged in user session 459 | description: "" 460 | operationId: logoutUser 461 | produces: 462 | - application/json 463 | - application/xml 464 | responses: 465 | default: 466 | description: successful operation 467 | /users/{username}: 468 | get: 469 | tags: 470 | - user 471 | summary: Get user by user name 472 | description: "" 473 | operationId: getUserByName 474 | produces: 475 | - application/json 476 | - application/xml 477 | parameters: 478 | - in: path 479 | name: username 480 | description: The name that needs to be fetched. Use user1 for testing. 481 | required: true 482 | type: string 483 | responses: 484 | "404": 485 | description: User not found 486 | "200": 487 | description: successful operation 488 | schema: 489 | $ref: "#/definitions/User" 490 | headers: 491 | X-Rate-Limit-Limit: 492 | description: The number of allowed requests in the current period 493 | type: integer 494 | X-Rate-Limit-Remaining: 495 | description: The number of remaining requests in the current period 496 | type: integer 497 | X-Rate-Limit-Reset: 498 | description: The number of seconds left in the current period 499 | type: integer 500 | "400": 501 | description: Invalid username supplied 502 | put: 503 | tags: 504 | - user 505 | summary: Updated user 506 | description: This can only be done by the logged in user. 507 | operationId: updateUser 508 | produces: 509 | - application/json 510 | - application/xml 511 | parameters: 512 | - in: path 513 | name: username 514 | description: name that need to be deleted 515 | required: true 516 | type: string 517 | - in: body 518 | name: body 519 | description: Updated user object 520 | required: false 521 | schema: 522 | $ref: "#/definitions/User" 523 | responses: 524 | "404": 525 | description: User not found 526 | "400": 527 | description: Invalid user supplied 528 | delete: 529 | tags: 530 | - user 531 | summary: Delete user 532 | description: This can only be done by the logged in user. 533 | operationId: deleteUser 534 | produces: 535 | - application/json 536 | - application/xml 537 | parameters: 538 | - in: path 539 | name: username 540 | description: The name that needs to be deleted 541 | required: true 542 | type: string 543 | responses: 544 | "404": 545 | description: User not found 546 | "400": 547 | description: Invalid username supplied 548 | parameters: 549 | PetBody: 550 | in: body 551 | name: body 552 | description: Pet object that needs to be added to the store 553 | required: false 554 | schema: 555 | $ref: "#/definitions/Pet" 556 | responses: 557 | InvalidId: 558 | description: Invalid ID supplied 559 | securityDefinitions: 560 | api_key: 561 | type: apiKey 562 | name: api_key 563 | in: header 564 | petstore_auth: 565 | type: oauth2 566 | authorizationUrl: http://petstore.swagger.io/api/oauth/dialog 567 | flow: implicit 568 | scopes: 569 | write_pets: modify pets in your account 570 | read_pets: read your pets 571 | definitions: 572 | User: 573 | type: object 574 | properties: 575 | id: 576 | type: integer 577 | format: int64 578 | username: 579 | type: string 580 | firstName: 581 | type: string 582 | lastName: 583 | type: string 584 | email: 585 | type: string 586 | password: 587 | type: string 588 | phone: 589 | type: string 590 | userStatus: 591 | type: integer 592 | format: int32 593 | description: User Status 594 | Category: 595 | type: object 596 | required: 597 | - id 598 | properties: 599 | id: 600 | type: integer 601 | format: int64 602 | description: The id of the category 603 | example: 0 604 | name: 605 | type: string 606 | description: The name of the category 607 | default: DefaultCategory 608 | example: FoobarCategory 609 | Pet: 610 | type: object 611 | required: 612 | - name 613 | - photoUrls 614 | properties: 615 | id: 616 | type: integer 617 | format: int64 618 | category: 619 | $ref: "#/definitions/Category" 620 | name: 621 | type: string 622 | description: The name of the pet 623 | example: doggie 624 | photoUrls: 625 | type: array 626 | items: 627 | type: string 628 | tags: 629 | type: array 630 | items: 631 | $ref: "#/definitions/Tag" 632 | status: 633 | type: string 634 | description: pet status in the store 635 | Tag: 636 | type: object 637 | properties: 638 | id: 639 | type: integer 640 | format: int64 641 | name: 642 | type: string 643 | description: "Sample string with range 0-2 and a pattern" 644 | minLength: 0 645 | maxLength: 2 646 | pattern: "[A-Z0-9]{0,2}" 647 | Order: 648 | type: object 649 | properties: 650 | id: 651 | type: integer 652 | format: int64 653 | petId: 654 | type: integer 655 | format: int64 656 | quantity: 657 | type: integer 658 | format: int32 659 | shipDate: 660 | type: string 661 | format: date-time 662 | status: 663 | type: string 664 | description: Order Status 665 | complete: 666 | type: boolean 667 | --------------------------------------------------------------------------------