= OpenAPI Petstore team@openapitools.org 1.0.0 :toc: left :numbered: :toclevels: 3 :source-highlighter: highlightjs :keywords: openapi, rest, OpenAPI Petstore :specDir: modules/openapi-generator/src/main/resources/asciidoc-documentation :snippetDir: . :generator-template: v1 2019-09-03 :info-url: https://openapi-generator.tech :app-name: OpenAPI Petstore [abstract] .Abstract This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. // markup not found, no include ::intro.adoc[] == Endpoints [.Pet] === Pet [.addPet] ==== addPet `POST /pet` Add a new pet to the store ===== Description // markup not found, no include ::pet/POST/spec.adoc[] ===== Parameters ===== Body Parameter [cols="2,3,1,1,1"] |=== |Name| Description| Required| Default| Pattern | body | Pet object that needs to be added to the store <> | X | | |=== ===== Return Type - ===== Responses .http response codes [cols="2,3,1"] |=== | Code | Message | Datatype | 405 | Invalid input | <<>> |=== ===== Samples // markup not found, no include ::pet/POST/http-request.adoc[] // markup not found, no include ::pet/POST/http-response.adoc[] // file not found, no * wiremock data link :pet/POST/POST.json[] ifdef::internal-generation[] ===== Implementation // markup not found, no include ::pet/POST/implementation.adoc[] endif::internal-generation[] [.deletePet] ==== deletePet `DELETE /pet/{petId}` Deletes a pet ===== Description // markup not found, no include ::pet/{petId}/DELETE/spec.adoc[] ===== Parameters ====== Path Parameters [cols="2,3,1,1,1"] |=== |Name| Description| Required| Default| Pattern | petId | Pet id to delete | X | null | |=== ====== Header Parameters [cols="2,3,1,1,1"] |=== |Name| Description| Required| Default| Pattern | apiKey | | - | null | |=== ===== Return Type - ===== Responses .http response codes [cols="2,3,1"] |=== | Code | Message | Datatype | 400 | Invalid pet value | <<>> |=== ===== Samples // markup not found, no include ::pet/{petId}/DELETE/http-request.adoc[] // markup not found, no include ::pet/{petId}/DELETE/http-response.adoc[] // file not found, no * wiremock data link :pet/{petId}/DELETE/DELETE.json[] ifdef::internal-generation[] ===== Implementation // markup not found, no include ::pet/{petId}/DELETE/implementation.adoc[] endif::internal-generation[] [.findPetsByStatus] ==== findPetsByStatus `GET /pet/findByStatus` Finds Pets by status ===== Description Multiple status values can be provided with comma separated strings // markup not found, no include ::pet/findByStatus/GET/spec.adoc[] ===== Parameters ====== Query Parameters [cols="2,3,1,1,1"] |=== |Name| Description| Required| Default| Pattern | status | Status values that need to be considered for filter <> | X | null | |=== ===== Return Type array[<>] ===== Content Type * application/xml * application/json ===== Responses .http response codes [cols="2,3,1"] |=== | Code | Message | Datatype | 200 | successful operation | List[<>] | 400 | Invalid status value | <<>> |=== ===== Samples // markup not found, no include ::pet/findByStatus/GET/http-request.adoc[] // markup not found, no include ::pet/findByStatus/GET/http-response.adoc[] // file not found, no * wiremock data link :pet/findByStatus/GET/GET.json[] ifdef::internal-generation[] ===== Implementation // markup not found, no include ::pet/findByStatus/GET/implementation.adoc[] endif::internal-generation[] [.findPetsByTags] ==== findPetsByTags `GET /pet/findByTags` Finds Pets by tags ===== Description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. // markup not found, no include ::pet/findByTags/GET/spec.adoc[] ===== Parameters ====== Query Parameters [cols="2,3,1,1,1"] |=== |Name| Description| Required| Default| Pattern | tags | Tags to filter by <> | X | null | |=== ===== Return Type array[<>] ===== Content Type * application/xml * application/json ===== Responses .http response codes [cols="2,3,1"] |=== | Code | Message | Datatype | 200 | successful operation | List[<>] | 400 | Invalid tag value | <<>> |=== ===== Samples // markup not found, no include ::pet/findByTags/GET/http-request.adoc[] // markup not found, no include ::pet/findByTags/GET/http-response.adoc[] // file not found, no * wiremock data link :pet/findByTags/GET/GET.json[] ifdef::internal-generation[] ===== Implementation // markup not found, no include ::pet/findByTags/GET/implementation.adoc[] endif::internal-generation[] [.getPetById] ==== getPetById `GET /pet/{petId}` Find pet by ID ===== Description Returns a single pet // markup not found, no include ::pet/{petId}/GET/spec.adoc[] ===== Parameters ====== Path Parameters [cols="2,3,1,1,1"] |=== |Name| Description| Required| Default| Pattern | petId | ID of pet to return | X | null | |=== ===== Return Type <> ===== Content Type * application/xml * application/json ===== Responses .http response codes [cols="2,3,1"] |=== | Code | Message | Datatype | 200 | successful operation | <> | 400 | Invalid ID supplied | <<>> | 404 | Pet not found | <<>> |=== ===== Samples // markup not found, no include ::pet/{petId}/GET/http-request.adoc[] // markup not found, no include ::pet/{petId}/GET/http-response.adoc[] // file not found, no * wiremock data link :pet/{petId}/GET/GET.json[] ifdef::internal-generation[] ===== Implementation // markup not found, no include ::pet/{petId}/GET/implementation.adoc[] endif::internal-generation[] [.updatePet] ==== updatePet `PUT /pet` Update an existing pet ===== Description // markup not found, no include ::pet/PUT/spec.adoc[] ===== Parameters ===== Body Parameter [cols="2,3,1,1,1"] |=== |Name| Description| Required| Default| Pattern | body | Pet object that needs to be added to the store <> | X | | |=== ===== Return Type - ===== Responses .http response codes [cols="2,3,1"] |=== | Code | Message | Datatype | 400 | Invalid ID supplied | <<>> | 404 | Pet not found | <<>> | 405 | Validation exception | <<>> |=== ===== Samples // markup not found, no include ::pet/PUT/http-request.adoc[] // markup not found, no include ::pet/PUT/http-response.adoc[] // file not found, no * wiremock data link :pet/PUT/PUT.json[] ifdef::internal-generation[] ===== Implementation // markup not found, no include ::pet/PUT/implementation.adoc[] endif::internal-generation[] [.updatePetWithForm] ==== updatePetWithForm `POST /pet/{petId}` Updates a pet in the store with form data ===== Description // markup not found, no include ::pet/{petId}/POST/spec.adoc[] ===== Parameters ====== Path Parameters [cols="2,3,1,1,1"] |=== |Name| Description| Required| Default| Pattern | petId | ID of pet that needs to be updated | X | null | |=== ===== Return Type - ===== Responses .http response codes [cols="2,3,1"] |=== | Code | Message | Datatype | 405 | Invalid input | <<>> |=== ===== Samples // markup not found, no include ::pet/{petId}/POST/http-request.adoc[] // markup not found, no include ::pet/{petId}/POST/http-response.adoc[] // file not found, no * wiremock data link :pet/{petId}/POST/POST.json[] ifdef::internal-generation[] ===== Implementation // markup not found, no include ::pet/{petId}/POST/implementation.adoc[] endif::internal-generation[] [.uploadFile] ==== uploadFile `POST /pet/{petId}/uploadImage` uploads an image ===== Description // markup not found, no include ::pet/{petId}/uploadImage/POST/spec.adoc[] ===== Parameters ====== Path Parameters [cols="2,3,1,1,1"] |=== |Name| Description| Required| Default| Pattern | petId | ID of pet to update | X | null | |=== ===== Return Type <> ===== Content Type * application/json ===== Responses .http response codes [cols="2,3,1"] |=== | Code | Message | Datatype | 200 | successful operation | <> |=== ===== Samples // markup not found, no include ::pet/{petId}/uploadImage/POST/http-request.adoc[] // markup not found, no include ::pet/{petId}/uploadImage/POST/http-response.adoc[] // file not found, no * wiremock data link :pet/{petId}/uploadImage/POST/POST.json[] ifdef::internal-generation[] ===== Implementation // markup not found, no include ::pet/{petId}/uploadImage/POST/implementation.adoc[] endif::internal-generation[] [.Store] === Store [.deleteOrder] ==== deleteOrder `DELETE /store/order/{orderId}` Delete purchase order by ID ===== Description For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors // markup not found, no include ::store/order/{orderId}/DELETE/spec.adoc[] ===== Parameters ====== Path Parameters [cols="2,3,1,1,1"] |=== |Name| Description| Required| Default| Pattern | orderId | ID of the order that needs to be deleted | X | null | |=== ===== Return Type - ===== Responses .http response codes [cols="2,3,1"] |=== | Code | Message | Datatype | 400 | Invalid ID supplied | <<>> | 404 | Order not found | <<>> |=== ===== Samples // markup not found, no include ::store/order/{orderId}/DELETE/http-request.adoc[] // markup not found, no include ::store/order/{orderId}/DELETE/http-response.adoc[] // file not found, no * wiremock data link :store/order/{orderId}/DELETE/DELETE.json[] ifdef::internal-generation[] ===== Implementation // markup not found, no include ::store/order/{orderId}/DELETE/implementation.adoc[] endif::internal-generation[] [.getInventory] ==== getInventory `GET /store/inventory` Returns pet inventories by status ===== Description Returns a map of status codes to quantities // markup not found, no include ::store/inventory/GET/spec.adoc[] ===== Parameters ===== Return Type <> ===== Content Type * application/json ===== Responses .http response codes [cols="2,3,1"] |=== | Code | Message | Datatype | 200 | successful operation | Map[<>] |=== ===== Samples // markup not found, no include ::store/inventory/GET/http-request.adoc[] // markup not found, no include ::store/inventory/GET/http-response.adoc[] // file not found, no * wiremock data link :store/inventory/GET/GET.json[] ifdef::internal-generation[] ===== Implementation // markup not found, no include ::store/inventory/GET/implementation.adoc[] endif::internal-generation[] [.getOrderById] ==== getOrderById `GET /store/order/{orderId}` Find purchase order by ID ===== Description For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions // markup not found, no include ::store/order/{orderId}/GET/spec.adoc[] ===== Parameters ====== Path Parameters [cols="2,3,1,1,1"] |=== |Name| Description| Required| Default| Pattern | orderId | ID of pet that needs to be fetched | X | null | |=== ===== Return Type <> ===== Content Type * application/xml * application/json ===== Responses .http response codes [cols="2,3,1"] |=== | Code | Message | Datatype | 200 | successful operation | <> | 400 | Invalid ID supplied | <<>> | 404 | Order not found | <<>> |=== ===== Samples // markup not found, no include ::store/order/{orderId}/GET/http-request.adoc[] // markup not found, no include ::store/order/{orderId}/GET/http-response.adoc[] // file not found, no * wiremock data link :store/order/{orderId}/GET/GET.json[] ifdef::internal-generation[] ===== Implementation // markup not found, no include ::store/order/{orderId}/GET/implementation.adoc[] endif::internal-generation[] [.placeOrder] ==== placeOrder `POST /store/order` Place an order for a pet ===== Description // markup not found, no include ::store/order/POST/spec.adoc[] ===== Parameters ===== Body Parameter [cols="2,3,1,1,1"] |=== |Name| Description| Required| Default| Pattern | body | order placed for purchasing the pet <> | X | | |=== ===== Return Type <> ===== Content Type * application/xml * application/json ===== Responses .http response codes [cols="2,3,1"] |=== | Code | Message | Datatype | 200 | successful operation | <> | 400 | Invalid Order | <<>> |=== ===== Samples // markup not found, no include ::store/order/POST/http-request.adoc[] // markup not found, no include ::store/order/POST/http-response.adoc[] // file not found, no * wiremock data link :store/order/POST/POST.json[] ifdef::internal-generation[] ===== Implementation // markup not found, no include ::store/order/POST/implementation.adoc[] endif::internal-generation[] [.User] === User [.createUser] ==== createUser `POST /user` Create user ===== Description This can only be done by the logged in user. // markup not found, no include ::user/POST/spec.adoc[] ===== Parameters ===== Body Parameter [cols="2,3,1,1,1"] |=== |Name| Description| Required| Default| Pattern | body | Created user object <> | X | | |=== ===== Return Type - ===== Responses .http response codes [cols="2,3,1"] |=== | Code | Message | Datatype | 0 | successful operation | <<>> |=== ===== Samples // markup not found, no include ::user/POST/http-request.adoc[] // markup not found, no include ::user/POST/http-response.adoc[] // file not found, no * wiremock data link :user/POST/POST.json[] ifdef::internal-generation[] ===== Implementation // markup not found, no include ::user/POST/implementation.adoc[] endif::internal-generation[] [.createUsersWithArrayInput] ==== createUsersWithArrayInput `POST /user/createWithArray` Creates list of users with given input array ===== Description // markup not found, no include ::user/createWithArray/POST/spec.adoc[] ===== Parameters ===== Body Parameter [cols="2,3,1,1,1"] |=== |Name| Description| Required| Default| Pattern | body | List of user object <> | X | | |=== ===== Return Type - ===== Responses .http response codes [cols="2,3,1"] |=== | Code | Message | Datatype | 0 | successful operation | <<>> |=== ===== Samples // markup not found, no include ::user/createWithArray/POST/http-request.adoc[] // markup not found, no include ::user/createWithArray/POST/http-response.adoc[] // file not found, no * wiremock data link :user/createWithArray/POST/POST.json[] ifdef::internal-generation[] ===== Implementation // markup not found, no include ::user/createWithArray/POST/implementation.adoc[] endif::internal-generation[] [.createUsersWithListInput] ==== createUsersWithListInput `POST /user/createWithList` Creates list of users with given input array ===== Description // markup not found, no include ::user/createWithList/POST/spec.adoc[] ===== Parameters ===== Body Parameter [cols="2,3,1,1,1"] |=== |Name| Description| Required| Default| Pattern | body | List of user object <> | X | | |=== ===== Return Type - ===== Responses .http response codes [cols="2,3,1"] |=== | Code | Message | Datatype | 0 | successful operation | <<>> |=== ===== Samples // markup not found, no include ::user/createWithList/POST/http-request.adoc[] // markup not found, no include ::user/createWithList/POST/http-response.adoc[] // file not found, no * wiremock data link :user/createWithList/POST/POST.json[] ifdef::internal-generation[] ===== Implementation // markup not found, no include ::user/createWithList/POST/implementation.adoc[] endif::internal-generation[] [.deleteUser] ==== deleteUser `DELETE /user/{username}` Delete user ===== Description This can only be done by the logged in user. // markup not found, no include ::user/{username}/DELETE/spec.adoc[] ===== Parameters ====== Path Parameters [cols="2,3,1,1,1"] |=== |Name| Description| Required| Default| Pattern | username | The name that needs to be deleted | X | null | |=== ===== Return Type - ===== Responses .http response codes [cols="2,3,1"] |=== | Code | Message | Datatype | 400 | Invalid username supplied | <<>> | 404 | User not found | <<>> |=== ===== Samples // markup not found, no include ::user/{username}/DELETE/http-request.adoc[] // markup not found, no include ::user/{username}/DELETE/http-response.adoc[] // file not found, no * wiremock data link :user/{username}/DELETE/DELETE.json[] ifdef::internal-generation[] ===== Implementation // markup not found, no include ::user/{username}/DELETE/implementation.adoc[] endif::internal-generation[] [.getUserByName] ==== getUserByName `GET /user/{username}` Get user by user name ===== Description // markup not found, no include ::user/{username}/GET/spec.adoc[] ===== Parameters ====== Path Parameters [cols="2,3,1,1,1"] |=== |Name| Description| Required| Default| Pattern | username | The name that needs to be fetched. Use user1 for testing. | X | null | |=== ===== Return Type <> ===== Content Type * application/xml * application/json ===== Responses .http response codes [cols="2,3,1"] |=== | Code | Message | Datatype | 200 | successful operation | <> | 400 | Invalid username supplied | <<>> | 404 | User not found | <<>> |=== ===== Samples // markup not found, no include ::user/{username}/GET/http-request.adoc[] // markup not found, no include ::user/{username}/GET/http-response.adoc[] // file not found, no * wiremock data link :user/{username}/GET/GET.json[] ifdef::internal-generation[] ===== Implementation // markup not found, no include ::user/{username}/GET/implementation.adoc[] endif::internal-generation[] [.loginUser] ==== loginUser `GET /user/login` Logs user into the system ===== Description // markup not found, no include ::user/login/GET/spec.adoc[] ===== Parameters ====== Query Parameters [cols="2,3,1,1,1"] |=== |Name| Description| Required| Default| Pattern | username | The user name for login | X | null | | password | The password for login in clear text | X | null | |=== ===== Return Type <> ===== Content Type * application/xml * application/json ===== Responses .http response codes [cols="2,3,1"] |=== | Code | Message | Datatype | 200 | successful operation | <> | 400 | Invalid username/password supplied | <<>> |=== ===== Samples // markup not found, no include ::user/login/GET/http-request.adoc[] // markup not found, no include ::user/login/GET/http-response.adoc[] // file not found, no * wiremock data link :user/login/GET/GET.json[] ifdef::internal-generation[] ===== Implementation // markup not found, no include ::user/login/GET/implementation.adoc[] endif::internal-generation[] [.logoutUser] ==== logoutUser `GET /user/logout` Logs out current logged in user session ===== Description // markup not found, no include ::user/logout/GET/spec.adoc[] ===== Parameters ===== Return Type - ===== Responses .http response codes [cols="2,3,1"] |=== | Code | Message | Datatype | 0 | successful operation | <<>> |=== ===== Samples // markup not found, no include ::user/logout/GET/http-request.adoc[] // markup not found, no include ::user/logout/GET/http-response.adoc[] // file not found, no * wiremock data link :user/logout/GET/GET.json[] ifdef::internal-generation[] ===== Implementation // markup not found, no include ::user/logout/GET/implementation.adoc[] endif::internal-generation[] [.updateUser] ==== updateUser `PUT /user/{username}` Updated user ===== Description This can only be done by the logged in user. // markup not found, no include ::user/{username}/PUT/spec.adoc[] ===== Parameters ====== Path Parameters [cols="2,3,1,1,1"] |=== |Name| Description| Required| Default| Pattern | username | name that need to be deleted | X | null | |=== ===== Body Parameter [cols="2,3,1,1,1"] |=== |Name| Description| Required| Default| Pattern | body | Updated user object <> | X | | |=== ===== Return Type - ===== Responses .http response codes [cols="2,3,1"] |=== | Code | Message | Datatype | 400 | Invalid user supplied | <<>> | 404 | User not found | <<>> |=== ===== Samples // markup not found, no include ::user/{username}/PUT/http-request.adoc[] // markup not found, no include ::user/{username}/PUT/http-response.adoc[] // file not found, no * wiremock data link :user/{username}/PUT/PUT.json[] ifdef::internal-generation[] ===== Implementation // markup not found, no include ::user/{username}/PUT/implementation.adoc[] endif::internal-generation[] [#models] == Models [#ApiResponse] ==== _ApiResponse_ An uploaded response Describes the result of uploading an image resource [.fields-ApiResponse] [cols="2,1,2,4,1"] |=== | Field Name| Required| Type| Description| Format | code | | Integer | | int32 _ | type | | String | | _ | message | | String | | _ |=== [#Category] ==== _Category_ Pet category A category for a pet [.fields-Category] [cols="2,1,2,4,1"] |=== | Field Name| Required| Type| Description| Format | id | | Long | | int64 _ | name | | String | | _ |=== [#Order] ==== _Order_ Pet Order An order for a pets from the pet store [.fields-Order] [cols="2,1,2,4,1"] |=== | Field Name| Required| Type| Description| Format | id | | Long | | int64 _ | petId | | Long | | int64 _ | quantity | | Integer | | int32 _ | shipDate | | Date | | date-time _ | status | | String | Order Status | Enum: _ placed, approved, delivered, _ | complete | | Boolean | | _ |=== [#Pet] ==== _Pet_ a Pet A pet for sale in the pet store [.fields-Pet] [cols="2,1,2,4,1"] |=== | Field Name| Required| Type| Description| Format | id | | Long | | int64 _ | category | | Category | | _ | name | X | String | | _ | photoUrls | X | List of <> | | _ | tags | | List of <> | | _ | status | | String | pet status in the store | Enum: _ available, pending, sold, _ |=== [#Tag] ==== _Tag_ Pet Tag A tag for a pet [.fields-Tag] [cols="2,1,2,4,1"] |=== | Field Name| Required| Type| Description| Format | id | | Long | | int64 _ | name | | String | | _ |=== [#User] ==== _User_ a User A User who is purchasing from the pet store [.fields-User] [cols="2,1,2,4,1"] |=== | Field Name| Required| Type| Description| Format | id | | Long | | int64 _ | username | | String | | _ | firstName | | String | | _ | lastName | | String | | _ | email | | String | | _ | password | | String | | _ | phone | | String | | _ | userStatus | | Integer | User Status | int32 _ |===