diff --git a/docs/api/store.oas.json b/docs/api/store.oas.json index ec1f53dee2..4f9274338d 100644 --- a/docs/api/store.oas.json +++ b/docs/api/store.oas.json @@ -4517,36 +4517,17 @@ "operationId": "PostProductsSearch", "summary": "Search Products", "description": "Run a search query on products using the search engine installed on Medusa", - "parameters": [ - { - "in": "query", - "name": "q", - "required": true, - "description": "The query to run the search with.", - "schema": { - "type": "string" - } - }, - { - "in": "query", - "name": "offset", - "description": "How many products to skip in the result.", - "schema": { - "type": "integer" - } - }, - { - "in": "query", - "name": "limit", - "description": "Limit the number of products returned.", - "schema": { - "type": "integer" + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StorePostSearchReq" + } } } - ], + }, "x-codegen": { - "method": "search", - "queryParams": "StorePostSearchReq" + "method": "search" }, "x-codeSamples": [ { @@ -4557,7 +4538,7 @@ { "lang": "Shell", "label": "cURL", - "source": "curl --location --request POST 'https://medusa-url.com/store/products/search?q=Shirt'\n" + "source": "curl --location --request POST 'https://medusa-url.com/store/products/search' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"q\": \"Shirt\"\n}'\n" } ], "tags": [ @@ -14618,6 +14599,26 @@ } } }, + "StorePostSearchReq": { + "type": "object", + "properties": { + "q": { + "type": "string", + "description": "The query to run the search with." + }, + "offset": { + "type": "number", + "description": "How many products to skip in the result." + }, + "limit": { + "type": "number", + "description": "Limit the number of products returned." + }, + "filter": { + "description": "Filter based on the search engine." + } + } + }, "StorePostSearchRes": { "allOf": [ { diff --git a/docs/api/store/code_samples/Shell/store_products_search/post.sh b/docs/api/store/code_samples/Shell/store_products_search/post.sh index acbe915089..5bb73b0210 100644 --- a/docs/api/store/code_samples/Shell/store_products_search/post.sh +++ b/docs/api/store/code_samples/Shell/store_products_search/post.sh @@ -1 +1,5 @@ -curl --location --request POST 'https://medusa-url.com/store/products/search?q=Shirt' +curl --location --request POST 'https://medusa-url.com/store/products/search' \ +--header 'Content-Type: application/json' \ +--data-raw '{ + "q": "Shirt" +}' diff --git a/docs/api/store/components/schemas/StorePostSearchReq.yaml b/docs/api/store/components/schemas/StorePostSearchReq.yaml new file mode 100644 index 0000000000..1dc8b0219b --- /dev/null +++ b/docs/api/store/components/schemas/StorePostSearchReq.yaml @@ -0,0 +1,13 @@ +type: object +properties: + q: + type: string + description: The query to run the search with. + offset: + type: number + description: How many products to skip in the result. + limit: + type: number + description: Limit the number of products returned. + filter: + description: Filter based on the search engine. diff --git a/docs/api/store/paths/store_products_search.yaml b/docs/api/store/paths/store_products_search.yaml index 733b0dcb8d..d1cec1b314 100644 --- a/docs/api/store/paths/store_products_search.yaml +++ b/docs/api/store/paths/store_products_search.yaml @@ -2,26 +2,13 @@ post: operationId: PostProductsSearch summary: Search Products description: Run a search query on products using the search engine installed on Medusa - parameters: - - in: query - name: q - required: true - description: The query to run the search with. - schema: - type: string - - in: query - name: offset - description: How many products to skip in the result. - schema: - type: integer - - in: query - name: limit - description: Limit the number of products returned. - schema: - type: integer + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/StorePostSearchReq.yaml x-codegen: method: search - queryParams: StorePostSearchReq x-codeSamples: - lang: JavaScript label: JS Client