Persons

Describes methods to work with Person objects



Response

Json-serialized list of Persons objects


Response body example



Response codes

200 OK. On successfull result.

Returns Person object by specified id.


Request Parameters

Parameter Type Required Description
id Integer True Id of the Person

Response

Json-serialized Person object


Response body example



Response codes

200 OK. On successful result.
404 Not Found. When person with specified id was not found.

Adds new Person.


Request

Json-serialized Person object


Request body example



Response

Json-serialized Person object with assigned id


Response body example



Response codes

200 OK. When person was successfully added.
400 Bad request. When incorrect data were passed.
400 Bad request. When passed Person object already contains assigned Id.

Updates person with specified id.


Request Parameters

Parameter Type Required Description
id Integer True Id of the Person

Request

Json-serialized Person object to be updated.


Request body example



Response

Updated Json-serialized Person object.


Response body example



Response codes

200 OK. On successful update
400 Bad request. When incorrect data were passed.
404 Not Found. When person with specified Id was not found.

Deletes person with specified id.


Request Parameters

Parameter Type Required Description
id Integer True Id of the Person

Response codes

200 OK. When person was deleted successful.
404 Not Found. When person with specified Id was not found.

Pets

Describes methods to work with Pet objects


Returns list of all pets in the database.


Response

Json-serialized list of Pets objects


Response body example



Response codes

200 OK. On successfull result.

Returns Pet object by specified id.


Request Parameters

Parameter Type Required Description
id Integer True Id of the Pet

Response

Json-serialized Pet object


Response body example



Response codes

200 OK. On successful result.
404 Not Found. When pet with specified id was not found.

Get all pets for the person with specified id.


Request Parameters

Parameter Type Required Description
id Integer True Id of the Person

Response

Json-serialized list of pets for the specified person


Response body example



Response codes

200 OK. On successful result.
404 Not Found. When person with specified Id was not found.

Adds new Pet to the Person with specified id.


Request Parameters

Parameter Type Required Description
id Integer True Id of the person

Request

Json-serialized Pet object


Request body example



Response

Json-serialized Pet object with assigned id


Response body example



Response codes

200 OK. When pet was successfully added.
400 Bad request. When incorrect data were passed.
400 Bad request. When passed pet object already contains assigned Id.
404 Not Found. When person with specified Id was not found.

Updates pet with specified id.


Request Parameters

Parameter Type Required Description
id Integer True Id of the Pet

Request

Json-serialized Pet object to be updated.


Request body example



Response

Updated Json-serialized Pet object.


Response body example



Response codes

200 OK. On successful update
400 Bad request. When incorrect data were passed.
404 Not Found. When person with specified Id was not found.
404 Not Found. When pet with specified Id was not found.

Deletes pet with specified id.


Request Parameters

Parameter Type Required Description
id Integer True Id of the Pet

Response codes

200 OK. When pet was deleted successful.
404 Not Found. When pet with specified Id was not found.