{"openapi":"3.1.0","info":{"title":"Demo Shop API","description":"The Skyramp Demo Shop mimics a very simple e-commerce setup where             users can create, update, and manage a catalog of products and handle orders.             <br/>It will be used throughout the Skyramp Documentation to demonstrate Skyramp's             functionality and provide a playground to test out the tool.             <br/> <br/> Additional information on this API can be found             <a href=\"https://www.skyramp.dev/docs/references/demo-shop\">here</a>.","version":"1.0.0"},"servers":[{"url":"https://demoshop.skyramp.dev","description":"Demoshop server"}],"paths":{"/api/v1/products":{"post":{"tags":["products"],"summary":"Create a new product","description":"Create a new product in the catalog with the provided details","operationId":"create_product_api_v1_products_post","security":[{"Authorize using Bearer Token":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductCreate","description":"Represents a product creation instance.\n\nThis class inherits from the `ProductBase` class and is used to define the attributes\nrequired to create a new product.","properties":{"name":{"examples":["bigbear","monkey"],"minLength":1,"pattern":"^[A-Za-z]+.*\\s*$","title":"Name","type":"string"},"description":{"examples":["Bear Soft Toy","Monkey Soft Toy"],"minLength":1,"pattern":"^[A-Za-z]+.*\\s*$","title":"Description","type":"string"},"price":{"examples":[9.99,29.99],"minimum":0,"title":"Price","type":"number"},"image_url":{"examples":["https://images.app.goo.gl/cgcHpeehRdu5osot8","https://images.app.goo.gl/cgcHpeehRdu5osot8"],"minLength":1,"pattern":"^[A-Za-z]+.*\\s*$","title":"Image Url","type":"string"},"category":{"examples":["Toys","Stuffed Animals"],"minLength":1,"pattern":"^[A-Za-z]+.*\\s*$","title":"Category","type":"string"},"in_stock":{"default":false,"examples":[true,false],"title":"In Stock","type":"boolean"}},"required":["name","description","price","image_url","category"],"title":"ProductCreate","type":"object"}},"application/x-www-form-urlencoded":{"schema":{"description":"Represents a product creation instance.\n\nThis class inherits from the `ProductBase` class and is used to define the attributes\nrequired to create a new product.","properties":{"name":{"examples":["bigbear","monkey"],"minLength":1,"pattern":"^[A-Za-z]+.*\\s*$","title":"Name","type":"string"},"description":{"examples":["Bear Soft Toy","Monkey Soft Toy"],"minLength":1,"pattern":"^[A-Za-z]+.*\\s*$","title":"Description","type":"string"},"price":{"examples":[9.99,29.99],"minimum":0,"title":"Price","type":"number"},"image_url":{"examples":["https://images.app.goo.gl/cgcHpeehRdu5osot8","https://images.app.goo.gl/cgcHpeehRdu5osot8"],"minLength":1,"pattern":"^[A-Za-z]+.*\\s*$","title":"Image Url","type":"string"},"category":{"examples":["Toys","Stuffed Animals"],"minLength":1,"pattern":"^[A-Za-z]+.*\\s*$","title":"Category","type":"string"},"in_stock":{"default":false,"examples":[true,false],"title":"In Stock","type":"boolean"}},"required":["name","description","price","image_url","category"],"title":"ProductCreate","type":"object"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["products"],"summary":"Get a list of products","description":"Get all products from the database.","operationId":"get_products_api_v1_products_get","security":[{"Authorize using Bearer Token":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":10,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"order","in":"query","required":false,"schema":{"enum":["asc","desc"],"type":"string","default":"asc","title":"Order"}},{"name":"orderBy","in":"query","required":false,"schema":{"type":"string","pattern":"^[a-zA-Z]+[A-Za-z:/._0-9- ]*$","title":"Orderby"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ProductResponse"},"title":"Response Get Products Api V1 Products Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/products/{product_id}":{"get":{"tags":["products"],"summary":"Get a product by ID","description":"Get a single product by its ID.","operationId":"get_product_api_v1_products__product_id__get","security":[{"Authorize using Bearer Token":[]}],"parameters":[{"name":"product_id","in":"path","required":true,"schema":{"type":"integer","example":0,"title":"Product Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["products"],"summary":"Update a product by ID","description":"Update a product's details by its ID.","operationId":"update_product_api_v1_products__product_id__put","security":[{"Authorize using Bearer Token":[]}],"parameters":[{"name":"product_id","in":"path","required":true,"schema":{"type":"integer","example":0,"title":"Product Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductUpdateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["products"],"summary":"Delete a product by ID","description":"Delete a product by its ID.","operationId":"delete_product_api_v1_products__product_id__delete","security":[{"Authorize using Bearer Token":[]}],"parameters":[{"name":"product_id","in":"path","required":true,"schema":{"type":"integer","example":0,"title":"Product Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/products/{product_id}/reviews":{"get":{"tags":["products"],"summary":"Get all reviews for selected product","description":"Get all reviews for selected product","operationId":"get_reviews_api_v1_products__product_id__reviews_get","security":[{"Authorize using Bearer Token":[]}],"parameters":[{"name":"product_id","in":"path","required":true,"schema":{"type":"integer","example":0,"title":"Product Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":10,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"order","in":"query","required":false,"schema":{"enum":["asc","desc"],"type":"string","default":"asc","title":"Order"}},{"name":"orderBy","in":"query","required":false,"schema":{"type":"string","pattern":"^[a-zA-Z]+[A-Za-z:/._0-9- ]*$","title":"Orderby"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ReviewResponse"},"title":"Response Get Reviews Api V1 Products  Product Id  Reviews Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["products"],"summary":"Create a review","description":"Create a review for a product","operationId":"create_review_api_v1_products__product_id__reviews_post","security":[{"Authorize using Bearer Token":[]}],"parameters":[{"name":"product_id","in":"path","required":true,"schema":{"type":"integer","example":0,"title":"Product Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/orders":{"post":{"tags":["orders"],"summary":"Create a new order","description":"Create a new order with the specified products and quantities","operationId":"create_order_api_v1_orders_post","security":[{"Authorize using Bearer Token":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["orders"],"summary":"Get all orders","description":"Retrieve all orders with optional filtering","operationId":"get_orders_api_v1_orders_get","security":[{"Authorize using Bearer Token":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":10,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"order","in":"query","required":false,"schema":{"enum":["asc","desc"],"type":"string","default":"asc","title":"Order"}},{"name":"orderBy","in":"query","required":false,"schema":{"type":"string","pattern":"^[a-zA-Z]+[A-Za-z:/._0-9- ]*$","title":"Orderby"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OrderRead"},"title":"Response Get Orders Api V1 Orders Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/orders/{order_id}":{"get":{"tags":["orders"],"summary":"Get order by ID","description":"Retrieve a specific order by its ID","operationId":"get_order_api_v1_orders__order_id__get","security":[{"Authorize using Bearer Token":[]}],"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"integer","example":0,"title":"Order Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["orders"],"summary":"Cancel order","description":"Cancel an existing order","operationId":"cancel_order_api_v1_orders__order_id__delete","security":[{"Authorize using Bearer Token":[]}],"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"integer","example":0,"title":"Order Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderCancel"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/reset":{"post":{"tags":["reset"],"summary":"Reset data","description":"Reset data for session","operationId":"reset_api_v1_reset_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"Authorize using Bearer Token":[]}]}},"/":{"get":{"tags":["status"],"summary":"Root endpoint","description":"Returns basic API information","operationId":"root__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health":{"get":{"tags":["status"],"summary":"Health check","description":"Returns the health status of the API","operationId":"health_check_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"OrderCancel":{"properties":{"message":{"type":"string","title":"Message","default":"Order cancelled successfully"}},"type":"object","title":"OrderCancel","description":"Model for cancelling an order."},"OrderCreate":{"properties":{"customer_email":{"type":"string","maxLength":255,"format":"email","title":"Customer Email"},"items":{"items":{"$ref":"#/components/schemas/OrderItemCreate"},"type":"array","title":"Items"}},"type":"object","required":["customer_email","items"],"title":"OrderCreate","description":"Model for creating new orders in DB.","example":{"customer_email":"abc@mail.com","items":[{"product_id":1,"quantity":2}]}},"OrderItemCreate":{"properties":{"quantity":{"type":"integer","minimum":0.0,"title":"Quantity"},"product_id":{"type":"integer","minimum":1.0,"title":"Product Id"}},"type":"object","required":["quantity","product_id"],"title":"OrderItemCreate","description":"Model for creating new order items in DB."},"OrderItemRead":{"properties":{"quantity":{"type":"integer","minimum":0.0,"title":"Quantity"},"product_id":{"type":"integer","minimum":1.0,"title":"Product Id"},"order_item_id":{"type":"integer","minimum":1.0,"title":"Order Item Id"},"order_id":{"type":"integer","minimum":1.0,"title":"Order Id"}},"type":"object","required":["quantity","product_id","order_item_id","order_id"],"title":"OrderItemRead","description":"Model for fetching order items from DB."},"OrderRead":{"properties":{"customer_email":{"type":"string","maxLength":255,"format":"email","title":"Customer Email"},"status":{"$ref":"#/components/schemas/OrderStatus","default":"pending"},"total_amount":{"type":"number","title":"Total Amount","default":0.0},"order_id":{"type":"integer","title":"Order Id"},"items":{"items":{"$ref":"#/components/schemas/OrderItemRead"},"type":"array","title":"Items"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["customer_email","order_id","items"],"title":"OrderRead","description":"Model for fetching order details from DB.","example":{"created_at":"2022-01-01T00:00:00","customer_email":"abc@mail.com","items":[{"order_item_id":1,"product_id":1,"quantity":2}],"order_id":1,"status":"pending","total_amount":19.98,"updated_at":"2022-01-01T00:00:00"}},"OrderStatus":{"type":"string","enum":["pending","confirmed","shipped","delivered","cancelled"],"title":"OrderStatus","description":"Order status enumeration."},"ProductCreate":{"properties":{"name":{"type":"string","minLength":1,"pattern":"^[A-Za-z]+.*\\s*$","title":"Name","examples":["bigbear","monkey"]},"description":{"type":"string","minLength":1,"pattern":"^[A-Za-z]+.*\\s*$","title":"Description","examples":["Bear Soft Toy","Monkey Soft Toy"]},"price":{"type":"number","minimum":0.0,"title":"Price","examples":[9.99,29.99]},"image_url":{"type":"string","minLength":1,"pattern":"^[A-Za-z]+.*\\s*$","title":"Image Url","examples":["https://images.app.goo.gl/cgcHpeehRdu5osot8","https://images.app.goo.gl/cgcHpeehRdu5osot8"]},"category":{"type":"string","minLength":1,"pattern":"^[A-Za-z]+.*\\s*$","title":"Category","examples":["Toys","Stuffed Animals"]},"in_stock":{"type":"boolean","title":"In Stock","default":false,"examples":[true,false]}},"type":"object","required":["name","description","price","image_url","category"],"title":"ProductCreate","description":"Represents a product creation instance.\n\nThis class inherits from the `ProductBase` class and is used to define the attributes\nrequired to create a new product."},"ProductResponse":{"properties":{"name":{"type":"string","minLength":1,"pattern":"^[A-Za-z]+.*\\s*$","title":"Name","examples":["bigbear","monkey"]},"description":{"type":"string","minLength":1,"pattern":"^[A-Za-z]+.*\\s*$","title":"Description","examples":["Bear Soft Toy","Monkey Soft Toy"]},"price":{"type":"number","minimum":0.0,"title":"Price","examples":[9.99,29.99]},"image_url":{"type":"string","minLength":1,"pattern":"^[A-Za-z]+.*\\s*$","title":"Image Url","examples":["https://images.app.goo.gl/cgcHpeehRdu5osot8","https://images.app.goo.gl/cgcHpeehRdu5osot8"]},"category":{"type":"string","minLength":1,"pattern":"^[A-Za-z]+.*\\s*$","title":"Category","examples":["Toys","Stuffed Animals"]},"in_stock":{"type":"boolean","title":"In Stock","default":false,"examples":[true,false]},"product_id":{"type":"integer","title":"Product Id","examples":[1]},"created_at":{"type":"string","format":"date-time","title":"Created At","examples":["2025-02-25T10:54:22-05:00","2025-02-26T10:54:22-05:00"]},"updated_at":{"type":"string","format":"date-time","title":"Updated At","examples":["2025-02-25T10:54:22-05:00","2025-02-26T10:54:22-05:00"]}},"type":"object","required":["name","description","price","image_url","category","product_id","created_at","updated_at"],"title":"ProductResponse","description":"Represents a product response instance.\n\nThis class inherits from the `ProductBase` class and is used to define the attributes\nreturned in the response when a product is retrieved.\n\nAttributes:\n    id (int): The ID of the product."},"ProductUpdate":{"properties":{"name":{"type":"string","minLength":1,"pattern":"^[A-Za-z]+.*\\s*$","title":"Name","example":"bigbear"},"description":{"type":"string","minLength":1,"pattern":"^[A-Za-z]+.*\\s*$","title":"Description","example":"Bear Soft Toy"},"price":{"type":"number","minimum":0.0,"title":"Price","example":29.99},"image_url":{"type":"string","minLength":1,"pattern":"^[A-Za-z]+.*\\s*$","title":"Image Url","example":"https://images.app.goo.gl/cgcHpeehRdu5osot8"},"category":{"type":"string","minLength":1,"pattern":"^[A-Za-z]+.*\\s*$","title":"Category","example":"Toys"},"in_stock":{"type":"boolean","title":"In Stock","default":false,"example":true}},"type":"object","title":"ProductUpdate","description":"Represents an update for a product.\n\nAttributes:\n    name (str): The updated name of the product.\n    description (str): The updated description of the product.\n    price (float): The updated price of the product.\n    image_url (str): The updated URL of the product image.\n    category (str): The updated category of the product.\n    in_stock (bool): The updated stock availability of the product."},"ProductUpdateResponse":{"properties":{"name":{"type":"string","minLength":1,"pattern":"^[A-Za-z]+.*\\s*$","title":"Name","examples":["bigbear","monkey"]},"description":{"type":"string","minLength":1,"pattern":"^[A-Za-z]+.*\\s*$","title":"Description","examples":["Bear Soft Toy","Monkey Soft Toy"]},"price":{"type":"number","minimum":0.0,"title":"Price","example":29.99},"image_url":{"type":"string","minLength":1,"pattern":"^[A-Za-z]+.*\\s*$","title":"Image Url","examples":["https://images.app.goo.gl/cgcHpeehRdu5osot8","https://images.app.goo.gl/cgcHpeehRdu5osot8"]},"category":{"type":"string","minLength":1,"pattern":"^[A-Za-z]+.*\\s*$","title":"Category","examples":["Toys","Stuffed Animals"]},"in_stock":{"type":"boolean","title":"In Stock","default":false,"examples":[true,false]},"product_id":{"type":"integer","title":"Product Id","examples":[1]},"created_at":{"type":"string","format":"date-time","title":"Created At","examples":["2025-02-25T10:54:22-05:00","2025-02-26T10:54:22-05:00"]},"updated_at":{"type":"string","format":"date-time","title":"Updated At","examples":["2025-02-25T10:54:22-05:00","2025-02-26T10:54:22-05:00"]}},"type":"object","required":["name","description","image_url","category","product_id","created_at","updated_at"],"title":"ProductUpdateResponse","description":"Represents a product update response instance.\n\nThis class inherits from the `ProductBase` class and is used to define the attributes\nreturned in the response when a product is updated."},"ReviewCreate":{"properties":{"rating":{"type":"integer","minimum":0.0,"title":"Rating"},"comment":{"type":"string","pattern":"^[A-Za-z]+.*\\s*$","title":"Comment"}},"type":"object","required":["rating","comment"],"title":"ReviewCreate","description":"Review create model","examples":[{"comment":"Great product!","rating":5},{"comment":"Good quality, but could be better.","rating":4}]},"ReviewResponse":{"properties":{"rating":{"type":"integer","minimum":0.0,"title":"Rating"},"comment":{"type":"string","pattern":"^[A-Za-z]+.*\\s*$","title":"Comment"}},"type":"object","required":["rating","comment"],"title":"ReviewResponse","description":"Review response model","examples":[{"comment":"Great product!","rating":5},{"comment":"Good quality, but could be better.","rating":4}]},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"Authorize using Bearer Token":{"type":"http","description":"Provide the session_id in the box below.\n        To generate a session_id, please use \n        <b> https://demoshop.skyramp.dev/api/v1/generate </b>\n        endpoint.\n        ","scheme":"bearer"}}}}