{
   "openapi": "3.0.1",
   "info": {
      "title": "Shop",
      "description": "Search for millions of products from the world's greatest brands.",
      "version": "v1"
   },
   "servers": [
      {
         "url": "https://server.shop.app"
      }
   ],
   "paths": {
      "/openai/search": {
         "get": {
            "operationId": "search",
            "summary": "Search for products",
            "parameters": [
               {
                  "in": "query",
                  "name": "query",
                  "description": "Query string to search for items.",
                  "required": false,
                  "schema": {
                     "type": "string"
                  }
               },
               {
                  "in": "query",
                  "name": "price_min",
                  "description": "The minimum price to filter by.",
                  "required": false,
                  "schema": {
                     "type": "number"
                  }
               },
               {
                  "in": "query",
                  "name": "price_max",
                  "description": "The maximum price to filter by.",
                  "required": false,
                  "schema": {
                     "type": "number"
                  }
               },
               {
                  "in": "query",
                  "name": "similar_to_id",
                  "description": "A product id that you want to find similar products for. (Only include one)",
                  "required": false,
                  "schema": {
                     "type": "string"
                  }
               },
               {
                  "in": "query",
                  "name": "num_results",
                  "description": "How many results to return. Defaults to 5. It can be a number between 1 and 10.",
                  "required": false,
                  "schema": {
                     "type": "string"
                  }
               }
            ],
            "responses": {
               "200": {
                  "description": "OK",
                  "content": {
                     "application/json": {
                        "schema": {
                           "$ref": "#/components/schemas/searchResponse"
                        }
                     }
                  }
               },
               "503": {
                  "description": "Service Unavailable"
               }
            }
         }
      },
      "/openai/details": {
         "get": {
            "operationId": "details",
            "summary": "Return more details about a list of products.",
            "parameters": [
               {
                  "in": "query",
                  "name": "ids",
                  "description": "Comma separated list of product ids",
                  "required": true,
                  "schema": {
                     "type": "string"
                  }
               }
            ],
            "responses": {
               "200": {
                  "description": "OK",
                  "content": {
                     "application/json": {
                        "schema": {
                           "$ref": "#/components/schemas/searchResponse"
                        }
                     }
                  }
               },
               "503": {
                  "description": "Service Unavailable"
               }
            }
         }
      }
   },
   "components": {
      "schemas": {
         "searchResponse": {
            "type": "object",
            "properties": {
               "results": {
                  "type": "array",
                  "items": {
                     "type": "object",
                     "properties": {
                        "title": {
                           "type": "string",
                           "description": "The title of the product"
                        },
                        "price": {
                           "type": "number",
                           "format": "string",
                           "description": "The price of the product"
                        },
                        "currency_code": {
                           "type": "string",
                           "description": "The currency that the price is in"
                        },
                        "url": {
                           "type": "string",
                           "description": "The url of the product page for this product"
                        },
                        "description": {
                           "type": "string",
                           "description": "The description of the product"
                        }
                     },
                     "description": "The list of products matching the search"
                  }
               }
            }
         }
      }
   }
}