
[[_paths]]
== Paths

<<<

[[_addpet]]
=== Add a new pet to the store
....
POST /pets
....


==== Parameters

[options="header", cols=".^2a,.^3a,.^9a,.^4a"]
|===
|Type|Name|Description|Schema
|**Body**|**body** +
__optional__|Pet object that needs to be added to the store|<<_pet,Pet>>
|===


==== Responses

[options="header", cols=".^2a,.^14a,.^4a"]
|===
|HTTP Code|Description|Schema
|**405**|Invalid input|No Content
|===


==== Consumes

* `application/json`
* `application/xml`


==== Produces

* `application/json`
* `application/xml`


==== Tags

* pet


==== Security

[options="header", cols=".^3a,.^4a,.^13a"]
|===
|Type|Name|Scopes
|**oauth2**|**<<_petstore_auth,petstore_auth>>**|write_pets,read_pets
|===


<<<

==== Example HTTP request

===== Request path
[source,console]
----
curl -s -S -H "Content-Type: application/json" -X POST "https://example.com/v2/pets" -d "{\"id\":0,\"category\":{\"id\":0,\"name\":\"FoobarCategory\"},\"name\":\"doggie\",\"photoUrls\":[\"string\"],\"tags\":[{\"id\":0,\"name\":\"string\"}],\"status\":\"Dead\"}"
----


===== Request body
[source,json]
----
{
  "id" : 0,
  "category" : {
    "id" : 0,
    "name" : "FoobarCategory"
  },
  "name" : "doggie",
  "photoUrls" : [ "string" ],
  "tags" : [ {
    "id" : 0,
    "name" : "string"
  } ],
  "status" : "Dead"
}
----


<<<

[[_updatepet]]
=== Update an existing pet
....
PUT /pets
....


==== Parameters

[options="header", cols=".^2a,.^3a,.^9a,.^4a"]
|===
|Type|Name|Description|Schema
|**Body**|**body** +
__optional__|Pet object that needs to be added to the store|<<_pet,Pet>>
|===


==== Responses

[options="header", cols=".^2a,.^14a,.^4a"]
|===
|HTTP Code|Description|Schema
|**400**|Invalid ID supplied|No Content
|**404**|Pet not found|No Content
|**405**|Validation exception|No Content
|===


==== Consumes

* `application/json`
* `application/xml`


==== Produces

* `application/json`
* `application/xml`


==== Tags

* pet


==== Security

[options="header", cols=".^3a,.^4a,.^13a"]
|===
|Type|Name|Scopes
|**oauth2**|**<<_petstore_auth,petstore_auth>>**|write_pets,read_pets
|===


<<<

==== Example HTTP request

===== Request path
[source,console]
----
curl -s -S -H "Content-Type: application/json" -X PUT "https://example.com/v2/pets" -d "{\"id\":0,\"category\":{\"id\":0,\"name\":\"FoobarCategory\"},\"name\":\"doggie\",\"photoUrls\":[\"string\"],\"tags\":[{\"id\":0,\"name\":\"string\"}],\"status\":\"Dead\"}"
----


===== Request body
[source,json]
----
{
  "id" : 0,
  "category" : {
    "id" : 0,
    "name" : "FoobarCategory"
  },
  "name" : "doggie",
  "photoUrls" : [ "string" ],
  "tags" : [ {
    "id" : 0,
    "name" : "string"
  } ],
  "status" : "Dead"
}
----


<<<

[[_findpetsbystatus]]
=== Finds Pets by status
....
GET /pets/findByStatus
....


==== Description
Multiple status values can be provided with comma seperated strings


==== Parameters

[options="header", cols=".^2a,.^3a,.^9a,.^4a"]
|===
|Type|Name|Description|Schema
|**Query**|**status** +
__optional__|Status values that need to be considered for filter|< string > array(multi)
|===


==== Responses

[options="header", cols=".^2a,.^14a,.^4a"]
|===
|HTTP Code|Description|Schema
|**200**|successful operation +
**Headers** :  +
`X-Rate-Limit-Limit` (integer) : The number of allowed requests in the current period. +
`X-Rate-Limit-Remaining` (integer) : The number of remaining requests in the current period. +
`X-Rate-Limit-Reset` (integer) : The number of seconds left in the current period.|< <<_pet,Pet>> > array
|**400**|Invalid status value|No Content
|===


==== Produces

* `application/json`
* `application/xml`


==== Tags

* pet


==== Security

[options="header", cols=".^3a,.^4a,.^13a"]
|===
|Type|Name|Scopes
|**oauth2**|**<<_petstore_auth,petstore_auth>>**|write_pets,read_pets
|===


<<<

==== Example HTTP request

===== Request path
[source,console]
----
curl -s -S -X GET "https://example.com/v2/pets/findByStatus?status[]=string1&status[]=string2" 
----


==== Example HTTP response

===== Response 200
[source,json]
----
[ {
  "id" : 0,
  "category" : {
    "id" : 0,
    "name" : "FoobarCategory"
  },
  "name" : "doggie",
  "photoUrls" : [ "string" ],
  "tags" : [ {
    "id" : 0,
    "name" : "string"
  } ],
  "status" : "Dead"
} ]
----


<<<

[[_findpetsbytags]]
=== Finds Pets by tags
....
GET /pets/findByTags
....


==== Description
Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.


==== Parameters

[options="header", cols=".^2a,.^3a,.^9a,.^4a"]
|===
|Type|Name|Description|Schema
|**Query**|**tags** +
__optional__|Tags to filter by|< string > array(multi)
|===


==== Responses

[options="header", cols=".^2a,.^14a,.^4a"]
|===
|HTTP Code|Description|Schema
|**200**|successful operation +
**Headers** :  +
`X-Rate-Limit-Limit` (integer) : The number of allowed requests in the current period. +
`X-Rate-Limit-Remaining` (integer) : The number of remaining requests in the current period. +
`X-Rate-Limit-Reset` (integer) : The number of seconds left in the current period.|< <<_pet,Pet>> > array
|**400**|Invalid tag value|No Content
|===


==== Produces

* `application/json`
* `application/xml`


==== Tags

* pet


==== Security

[options="header", cols=".^3a,.^4a,.^13a"]
|===
|Type|Name|Scopes
|**oauth2**|**<<_petstore_auth,petstore_auth>>**|write_pets,read_pets
|===


<<<

==== Example HTTP request

===== Request path
[source,console]
----
curl -s -S -X GET "https://example.com/v2/pets/findByTags?tags[]=adorable1&tags[]=adorable2" 
----


==== Example HTTP response

===== Response 200
[source,json]
----
[ {
  "id" : 0,
  "category" : {
    "id" : 0,
    "name" : "FoobarCategory"
  },
  "name" : "doggie",
  "photoUrls" : [ "string" ],
  "tags" : [ {
    "id" : 0,
    "name" : "string"
  } ],
  "status" : "Dead"
} ]
----


<<<

[[_updatepetwithform]]
=== Updates a pet in the store with form data
....
POST /pets/{petId}
....


==== Parameters

[options="header", cols=".^2a,.^3a,.^9a,.^4a"]
|===
|Type|Name|Description|Schema
|**Path**|**petId** +
__required__|ID of pet that needs to be updated|string
|**FormData**|**name** +
__required__|Updated name of the pet|string
|**FormData**|**status** +
__required__|Updated status of the pet|string
|===


==== Responses

[options="header", cols=".^2a,.^14a,.^4a"]
|===
|HTTP Code|Description|Schema
|**405**|Invalid input|No Content
|===


==== Consumes

* `application/x-www-form-urlencoded`


==== Produces

* `application/json`
* `application/xml`


==== Tags

* pet


==== Security

[options="header", cols=".^3a,.^4a,.^13a"]
|===
|Type|Name|Scopes
|**oauth2**|**<<_petstore_auth,petstore_auth>>**|write_pets,read_pets
|===


<<<

==== Example HTTP request

===== Request path
[source,console]
----
curl -s -S -X POST "https://example.com/v2/pets/string" 
----


===== Request formData
[source,json]
----
"string"
----


<<<

[[_getpetbyid]]
=== Find pet by ID
....
GET /pets/{petId}
....


==== Description
Returns a pet when ID &lt; 10. ID &gt; 10 or nonintegers will simulate API error conditions


==== Parameters

[options="header", cols=".^2a,.^3a,.^9a,.^4a"]
|===
|Type|Name|Description|Schema
|**Path**|**petId** +
__required__|ID of pet that needs to be fetched|integer (int64)
|===


==== Responses

[options="header", cols=".^2a,.^14a,.^4a"]
|===
|HTTP Code|Description|Schema
|**200**|successful operation +
**Headers** :  +
`X-Rate-Limit-Limit` (integer) : The number of allowed requests in the current period. +
`X-Rate-Limit-Remaining` (integer) : The number of remaining requests in the current period. +
`X-Rate-Limit-Reset` (integer) : The number of seconds left in the current period.|<<_pet,Pet>>
|**400**|Invalid ID supplied|No Content
|**404**|Pet not found|No Content
|===


==== Produces

* `application/json`
* `application/xml`


==== Tags

* pet


==== Security

[options="header", cols=".^3a,.^4a,.^13a"]
|===
|Type|Name|Scopes
|**apiKey**|**<<_api_key,api_key>>**|
|**oauth2**|**<<_petstore_auth,petstore_auth>>**|write_pets,read_pets
|===


<<<

==== Example HTTP request

===== Request path
[source,console]
----
curl -s -S -X GET "https://example.com/v2/pets/30" 
----


==== Example HTTP response

===== Response 200
[source,json]
----
{
  "id" : 0,
  "category" : {
    "id" : 0,
    "name" : "FoobarCategory"
  },
  "name" : "doggie",
  "photoUrls" : [ "string" ],
  "tags" : [ {
    "id" : 0,
    "name" : "string"
  } ],
  "status" : "Dead"
}
----


<<<

[[_deletepet]]
=== Deletes a pet
....
DELETE /pets/{petId}
....


==== Parameters

[options="header", cols=".^2a,.^3a,.^9a,.^4a"]
|===
|Type|Name|Description|Schema
|**Header**|**api_key** +
__required__||string
|**Path**|**petId** +
__required__|Pet id to delete|integer (int64)
|===


==== Responses

[options="header", cols=".^2a,.^14a,.^4a"]
|===
|HTTP Code|Description|Schema
|**400**|Invalid pet value|No Content
|===


==== Produces

* `application/json`
* `application/xml`


==== Tags

* pet


==== Security

[options="header", cols=".^3a,.^4a,.^13a"]
|===
|Type|Name|Scopes
|**oauth2**|**<<_petstore_auth,petstore_auth>>**|write_pets,read_pets
|===


<<<

==== Example HTTP request

===== Request path
[source,console]
----
curl -s -S -H "api_key: string" -X DELETE "https://example.com/v2/pets/0" 
----


<<<

[[_placeorder]]
=== Place an order for a pet
....
POST /stores/order
....


==== Parameters

[options="header", cols=".^2a,.^3a,.^9a,.^4a"]
|===
|Type|Name|Description|Schema
|**Body**|**body** +
__optional__|order placed for purchasing the pet|<<_order,Order>>
|===


==== Responses

[options="header", cols=".^2a,.^14a,.^4a"]
|===
|HTTP Code|Description|Schema
|**200**|successful operation +
**Headers** :  +
`X-Rate-Limit-Limit` (integer) : The number of allowed requests in the current period. +
`X-Rate-Limit-Remaining` (integer) : The number of remaining requests in the current period. +
`X-Rate-Limit-Reset` (integer) : The number of seconds left in the current period.|<<_order,Order>>
|**400**|Invalid Order|No Content
|===


==== Produces

* `application/json`
* `application/xml`


==== Tags

* store


<<<

==== Example HTTP request

===== Request path
[source,console]
----
curl -s -S -X POST "https://example.com/v2/stores/order" -d "{\"id\":0,\"petId\":0,\"quantity\":10,\"shipDate\":\"1970-01-01T00:00:00Z\",\"status\":\"Ordered\",\"complete\":true}"
----


===== Request body
[source,json]
----
{
  "id" : 0,
  "petId" : 0,
  "quantity" : 10,
  "shipDate" : "1970-01-01T00:00:00Z",
  "status" : "Ordered",
  "complete" : true
}
----


==== Example HTTP response

===== Response 200
[source,json]
----
{
  "id" : 0,
  "petId" : 0,
  "quantity" : 10,
  "shipDate" : "1970-01-01T00:00:00Z",
  "status" : "Ordered",
  "complete" : true
}
----


<<<

[[_getorderbyid]]
=== Find purchase order by ID
....
GET /stores/order/{orderId}
....


==== Description
For valid response try integer IDs with value &lt;= 5 or &gt; 10. Other values will generated exceptions


==== Parameters

[options="header", cols=".^2a,.^3a,.^9a,.^4a"]
|===
|Type|Name|Description|Schema
|**Path**|**orderId** +
__required__|ID of pet that needs to be fetched|string
|===


==== Responses

[options="header", cols=".^2a,.^14a,.^4a"]
|===
|HTTP Code|Description|Schema
|**200**|successful operation +
**Headers** :  +
`X-Rate-Limit-Limit` (integer) : The number of allowed requests in the current period. +
`X-Rate-Limit-Remaining` (integer) : The number of remaining requests in the current period. +
`X-Rate-Limit-Reset` (integer) : The number of seconds left in the current period.|<<_order,Order>>
|**400**|Invalid ID supplied|No Content
|**404**|Order not found|No Content
|===


==== Produces

* `application/json`
* `application/xml`


==== Tags

* store


<<<

==== Example HTTP request

===== Request path
[source,console]
----
curl -s -S -X GET "https://example.com/v2/stores/order/string" 
----


==== Example HTTP response

===== Response 200
[source,json]
----
{
  "id" : 0,
  "petId" : 0,
  "quantity" : 10,
  "shipDate" : "1970-01-01T00:00:00Z",
  "status" : "Ordered",
  "complete" : true
}
----


<<<

[[_deleteorder]]
=== Delete purchase order by ID
....
DELETE /stores/order/{orderId}
....


==== Description
For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors


==== Parameters

[options="header", cols=".^2a,.^3a,.^9a,.^4a"]
|===
|Type|Name|Description|Schema
|**Path**|**orderId** +
__required__|ID of the order that needs to be deleted|string
|===


==== Responses

[options="header", cols=".^2a,.^14a,.^4a"]
|===
|HTTP Code|Description|Schema
|**400**|Invalid ID supplied|No Content
|**404**|Order not found|No Content
|===


==== Produces

* `application/json`
* `application/xml`


==== Tags

* store


<<<

==== Example HTTP request

===== Request path
[source,console]
----
curl -s -S -X DELETE "https://example.com/v2/stores/order/string" 
----


<<<

[[_createuser]]
=== Create user
....
POST /users
....


==== Description
This can only be done by the logged in user.


==== Parameters

[options="header", cols=".^2a,.^3a,.^9a,.^4a"]
|===
|Type|Name|Description|Schema
|**Body**|**body** +
__optional__|Created user object|<<_user,User>>
|===


==== Responses

[options="header", cols=".^2a,.^14a,.^4a"]
|===
|HTTP Code|Description|Schema
|**default**|successful operation|No Content
|===


==== Produces

* `application/json`
* `application/xml`


==== Tags

* user


<<<

==== Example HTTP request

===== Request path
[source,console]
----
curl -s -S -X POST "https://example.com/v2/users" -d "{\"application/json\":\"{ \\"id\\" : 0, \\"username\\" : \\"string\\" }\",\"application/xml\":\"<?xml version=\\"1.0\\" encoding=\\"UTF-8\\" standalone=\\"yes\\"?><user><id>0</id><username>string</username></user>\"}"
----


===== Request body
[source,json]
----
{ "id" : 0, "username" : "string" }
----

[source,xml]
----
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><user><id>0</id><username>string</username></user>
----


<<<

[[_createuserswitharrayinput]]
=== Creates list of users with given input array
....
POST /users/createWithArray
....


==== Parameters

[options="header", cols=".^2a,.^3a,.^9a,.^4a"]
|===
|Type|Name|Description|Schema
|**Body**|**body** +
__optional__|List of user object|< <<_user,User>> > array
|===


==== Responses

[options="header", cols=".^2a,.^14a,.^4a"]
|===
|HTTP Code|Description|Schema
|**default**|successful operation|No Content
|===


==== Produces

* `application/json`
* `application/xml`


==== Tags

* user


<<<

==== Example HTTP request

===== Request path
[source,console]
----
curl -s -S -X POST "https://example.com/v2/users/createWithArray" -d "[{\"id\":0,\"username\":\"string\",\"firstName\":\"string\",\"lastName\":\"string\",\"email\":\"string\",\"password\":\"string\",\"phone\":\"string\",\"userStatus\":0}]"
----


===== Request body
[source,json]
----
[ {
  "id" : 0,
  "username" : "string",
  "firstName" : "string",
  "lastName" : "string",
  "email" : "string",
  "password" : "string",
  "phone" : "string",
  "userStatus" : 0
} ]
----


<<<

[[_createuserswithlistinput]]
=== Creates list of users with given input array
....
POST /users/createWithList
....


==== Parameters

[options="header", cols=".^2a,.^3a,.^9a,.^4a"]
|===
|Type|Name|Description|Schema
|**Body**|**body** +
__optional__|List of user object|< <<_user,User>> > array
|===


==== Responses

[options="header", cols=".^2a,.^14a,.^4a"]
|===
|HTTP Code|Description|Schema
|**default**|successful operation|No Content
|===


==== Produces

* `application/json`
* `application/xml`


==== Tags

* user


<<<

==== Example HTTP request

===== Request path
[source,console]
----
curl -s -S -X POST "https://example.com/v2/users/createWithList" -d "[{\"id\":0,\"username\":\"string\",\"firstName\":\"string\",\"lastName\":\"string\",\"email\":\"string\",\"password\":\"string\",\"phone\":\"string\",\"userStatus\":0}]"
----


===== Request body
[source,json]
----
[ {
  "id" : 0,
  "username" : "string",
  "firstName" : "string",
  "lastName" : "string",
  "email" : "string",
  "password" : "string",
  "phone" : "string",
  "userStatus" : 0
} ]
----


<<<

[[_loginuser]]
=== Logs user into the system
....
GET /users/login
....


==== Parameters

[options="header", cols=".^2a,.^3a,.^9a,.^4a"]
|===
|Type|Name|Description|Schema
|**Query**|**password** +
__optional__|The password for login in clear text|string
|**Query**|**username** +
__optional__|The user name for login|string
|===


==== Responses

[options="header", cols=".^2a,.^14a,.^4a"]
|===
|HTTP Code|Description|Schema
|**200**|successful operation +
**Headers** :  +
`X-Rate-Limit-Limit` (integer) : The number of allowed requests in the current period. +
`X-Rate-Limit-Remaining` (integer) : The number of remaining requests in the current period. +
`X-Rate-Limit-Reset` (integer) : The number of seconds left in the current period.|string
|**400**|Invalid username/password supplied|No Content
|===


==== Produces

* `application/json`
* `application/xml`


==== Tags

* user


<<<

==== Example HTTP request

===== Request path
[source,console]
----
curl -s -S -X GET "https://example.com/v2/users/login?password=string&username=string" 
----


==== Example HTTP response

===== Response 200
[source,json]
----
"string"
----


<<<

[[_logoutuser]]
=== Logs out current logged in user session
....
GET /users/logout
....


==== Responses

[options="header", cols=".^2a,.^14a,.^4a"]
|===
|HTTP Code|Description|Schema
|**default**|successful operation|No Content
|===


==== Produces

* `application/json`
* `application/xml`


==== Tags

* user


<<<

==== Example HTTP request

===== Request path
[source,console]
----
curl -s -S -X GET "https://example.com/v2/users/logout" 
----


<<<

[[_getuserbyname]]
=== Get user by user name
....
GET /users/{username}
....


==== Parameters

[options="header", cols=".^2a,.^3a,.^9a,.^4a"]
|===
|Type|Name|Description|Schema
|**Path**|**username** +
__required__|The name that needs to be fetched. Use user1 for testing.|string
|===


==== Responses

[options="header", cols=".^2a,.^14a,.^4a"]
|===
|HTTP Code|Description|Schema
|**200**|successful operation +
**Headers** :  +
`X-Rate-Limit-Limit` (integer) : The number of allowed requests in the current period. +
`X-Rate-Limit-Remaining` (integer) : The number of remaining requests in the current period. +
`X-Rate-Limit-Reset` (integer) : The number of seconds left in the current period.|<<_user,User>>
|**400**|Invalid username supplied|No Content
|**404**|User not found|No Content
|===


==== Produces

* `application/json`
* `application/xml`


==== Tags

* user


<<<

==== Example HTTP request

===== Request path
[source,console]
----
curl -s -S -X GET "https://example.com/v2/users/string" 
----


==== Example HTTP response

===== Response 200
[source,json]
----
{
  "id" : 0,
  "username" : "string",
  "firstName" : "string",
  "lastName" : "string",
  "email" : "string",
  "password" : "string",
  "phone" : "string",
  "userStatus" : 0
}
----


<<<

[[_updateuser]]
=== Updated user
....
PUT /users/{username}
....


==== Description
This can only be done by the logged in user.


==== Parameters

[options="header", cols=".^2a,.^3a,.^9a,.^4a"]
|===
|Type|Name|Description|Schema
|**Path**|**username** +
__required__|name that need to be deleted|string
|**Body**|**body** +
__optional__|Updated user object|<<_user,User>>
|===


==== Responses

[options="header", cols=".^2a,.^14a,.^4a"]
|===
|HTTP Code|Description|Schema
|**400**|Invalid user supplied|No Content
|**404**|User not found|No Content
|===


==== Produces

* `application/json`
* `application/xml`


==== Tags

* user


<<<

==== Example HTTP request

===== Request path
[source,console]
----
curl -s -S -X PUT "https://example.com/v2/users/string" -d "{\"id\":0,\"username\":\"string\",\"firstName\":\"string\",\"lastName\":\"string\",\"email\":\"string\",\"password\":\"string\",\"phone\":\"string\",\"userStatus\":0}"
----


===== Request body
[source,json]
----
{
  "id" : 0,
  "username" : "string",
  "firstName" : "string",
  "lastName" : "string",
  "email" : "string",
  "password" : "string",
  "phone" : "string",
  "userStatus" : 0
}
----


<<<

[[_deleteuser]]
=== Delete user
....
DELETE /users/{username}
....


==== Description
This can only be done by the logged in user.


==== Parameters

[options="header", cols=".^2a,.^3a,.^9a,.^4a"]
|===
|Type|Name|Description|Schema
|**Path**|**username** +
__required__|The name that needs to be deleted|string
|===


==== Responses

[options="header", cols=".^2a,.^14a,.^4a"]
|===
|HTTP Code|Description|Schema
|**400**|Invalid username supplied|No Content
|**404**|User not found|No Content
|===


==== Produces

* `application/json`
* `application/xml`


==== Tags

* user


<<<

==== Example HTTP request

===== Request path
[source,console]
----
curl -s -S -X DELETE "https://example.com/v2/users/string" 
----



