Endpoint: GET /
Returns all items data as a dictionary.
Endpoint: GET /items/{item_id}
Parameters:
- item_id: integer representing the id of the item to be queried.
If no item corresponds to the provided item_id, raises a 404 Not Found error.
Endpoint: GET /items/
Query parameters:
- name: (optional) string representing the name of the item to be queried.
- price: (optional) float representing the price of the item to be queried.
- count: (optional) integer representing the count of the item to be queried.
- category: (optional) string representing the category of the item to be queried.
If no item matches the query parameters, returns an empty selection.
If no query parameters are provided, returns all items.
Endpoint: POST /
Parameters:
- item: JSON data representing an item to be added.
If the item ID already exists in the data, raises a 400 Bad Request error.
Endpoint: PUT /update/{item_id}
Path parameter:
- item_id: integer representing the id of the item to be updated.
- name: string representing the new name of the item.
- price: float representing the new price of the item.
- count: integer representing the new count of the item.
If the item with the provided item_id does not exist in the data, raises a 404 Not Found error.
If no update parameters are provided, raises a 400 Bad Request error.
Endpoint: DELETE /delete/{item_id}
Parameters:
- item_id: integer representing the id of the item to be deleted.
If the item with the provided item_id does not exist in the data, raises a 404 Not Found error.