diff --git a/source/services/shopping/mcp.openrpc.json b/source/services/shopping/mcp.openrpc.json index 2908d8d45..979036070 100644 --- a/source/services/shopping/mcp.openrpc.json +++ b/source/services/shopping/mcp.openrpc.json @@ -68,6 +68,28 @@ } } } + }, + "errors": { + "authentication_failed": { + "code": -32002, + "message": "Authentication failed", + "data": { "$ref": "../../schemas/common/types/error_response.json" } + }, + "invalid_params": { + "code": -32602, + "message": "Invalid params", + "data": { "$ref": "../../schemas/common/types/error_response.json" } + }, + "not_found": { + "code": -32001, + "message": "Resource not found", + "data": { "$ref": "../../schemas/common/types/error_response.json" } + }, + "idempotency_conflict": { + "code": -32003, + "message": "Idempotency conflict", + "data": { "$ref": "../../schemas/common/types/error_response.json" } + } } }, "methods": [ @@ -79,18 +101,23 @@ { "name": "meta", "required": true, - "schema": {"$ref": "#/components/schemas/meta"} + "schema": { "$ref": "#/components/schemas/meta" } }, { "name": "checkout", "required": true, - "schema": {"$ref": "../../schemas/shopping/checkout.json"} + "schema": { "$ref": "../../schemas/shopping/checkout.json" } } ], "result": { "name": "checkout", - "schema": {"$ref": "#/components/schemas/checkout_result"} - } + "schema": { "$ref": "#/components/schemas/checkout_result" } + }, + "errors": [ + { "$ref": "#/components/errors/authentication_failed" }, + { "$ref": "#/components/errors/invalid_params" }, + { "$ref": "#/components/errors/idempotency_conflict" } + ] }, { "name": "get_checkout", @@ -99,18 +126,25 @@ { "name": "meta", "required": true, - "schema": {"$ref": "#/components/schemas/meta"} + "schema": { "$ref": "#/components/schemas/meta" } }, { "name": "id", "required": true, - "schema": {"type": "string"} + "schema": { + "type": "string" + } } ], "result": { "name": "checkout", - "schema": {"$ref": "#/components/schemas/checkout_result"} - } + "schema": { "$ref": "#/components/schemas/checkout_result" } + }, + "errors": [ + { "$ref": "#/components/errors/authentication_failed" }, + { "$ref": "#/components/errors/invalid_params" }, + { "$ref": "#/components/errors/not_found" } + ] }, { "name": "update_checkout", @@ -119,23 +153,31 @@ { "name": "meta", "required": true, - "schema": {"$ref": "#/components/schemas/meta"} + "schema": { "$ref": "#/components/schemas/meta" } }, { "name": "id", "required": true, - "schema": {"type": "string"} + "schema": { + "type": "string" + } }, { "name": "checkout", "required": true, - "schema": {"$ref": "../../schemas/shopping/checkout.json"} + "schema": { "$ref": "../../schemas/shopping/checkout.json" } } ], "result": { "name": "checkout", - "schema": {"$ref": "#/components/schemas/checkout_result"} - } + "schema": { "$ref": "#/components/schemas/checkout_result" } + }, + "errors": [ + { "$ref": "#/components/errors/authentication_failed" }, + { "$ref": "#/components/errors/invalid_params" }, + { "$ref": "#/components/errors/not_found" }, + { "$ref": "#/components/errors/idempotency_conflict" } + ] }, { "name": "complete_checkout", @@ -146,26 +188,39 @@ "required": true, "schema": { "allOf": [ - {"$ref": "#/components/schemas/meta"}, - {"required": ["ucp-agent", "idempotency-key"]} + { "$ref": "#/components/schemas/meta" }, + { + "required": [ + "ucp-agent", + "idempotency-key" + ] + } ] } }, { "name": "id", "required": true, - "schema": {"type": "string"} + "schema": { + "type": "string" + } }, { "name": "checkout", "required": true, - "schema": {"$ref": "../../schemas/shopping/checkout.json"} + "schema": { "$ref": "../../schemas/shopping/checkout.json" } } ], "result": { "name": "checkout", - "schema": {"$ref": "#/components/schemas/checkout_result"} - } + "schema": { "$ref": "#/components/schemas/checkout_result" } + }, + "errors": [ + { "$ref": "#/components/errors/authentication_failed" }, + { "$ref": "#/components/errors/invalid_params" }, + { "$ref": "#/components/errors/not_found" }, + { "$ref": "#/components/errors/idempotency_conflict" } + ] }, { "name": "cancel_checkout", @@ -176,21 +231,34 @@ "required": true, "schema": { "allOf": [ - {"$ref": "#/components/schemas/meta"}, - {"required": ["ucp-agent", "idempotency-key"]} + { "$ref": "#/components/schemas/meta" }, + { + "required": [ + "ucp-agent", + "idempotency-key" + ] + } ] } }, { "name": "id", "required": true, - "schema": {"type": "string"} + "schema": { + "type": "string" + } } ], "result": { "name": "checkout", - "schema": {"$ref": "#/components/schemas/checkout_result"} - } + "schema": { "$ref": "#/components/schemas/checkout_result" } + }, + "errors": [ + { "$ref": "#/components/errors/authentication_failed" }, + { "$ref": "#/components/errors/invalid_params" }, + { "$ref": "#/components/errors/not_found" }, + { "$ref": "#/components/errors/idempotency_conflict" } + ] }, { "name": "create_cart", @@ -200,18 +268,23 @@ { "name": "meta", "required": true, - "schema": {"$ref": "#/components/schemas/meta"} + "schema": { "$ref": "#/components/schemas/meta" } }, { "name": "cart", "required": true, - "schema": {"$ref": "../../schemas/shopping/cart.json"} + "schema": { "$ref": "../../schemas/shopping/cart.json" } } ], "result": { "name": "cart", - "schema": {"$ref": "#/components/schemas/cart_result"} - } + "schema": { "$ref": "#/components/schemas/cart_result" } + }, + "errors": [ + { "$ref": "#/components/errors/authentication_failed" }, + { "$ref": "#/components/errors/invalid_params" }, + { "$ref": "#/components/errors/idempotency_conflict" } + ] }, { "name": "get_cart", @@ -220,18 +293,25 @@ { "name": "meta", "required": true, - "schema": {"$ref": "#/components/schemas/meta"} + "schema": { "$ref": "#/components/schemas/meta" } }, { "name": "id", "required": true, - "schema": {"type": "string"} + "schema": { + "type": "string" + } } ], "result": { "name": "cart", - "schema": {"$ref": "#/components/schemas/cart_result"} - } + "schema": { "$ref": "#/components/schemas/cart_result" } + }, + "errors": [ + { "$ref": "#/components/errors/authentication_failed" }, + { "$ref": "#/components/errors/invalid_params" }, + { "$ref": "#/components/errors/not_found" } + ] }, { "name": "update_cart", @@ -240,23 +320,31 @@ { "name": "meta", "required": true, - "schema": {"$ref": "#/components/schemas/meta"} + "schema": { "$ref": "#/components/schemas/meta" } }, { "name": "id", "required": true, - "schema": {"type": "string"} + "schema": { + "type": "string" + } }, { "name": "cart", "required": true, - "schema": {"$ref": "../../schemas/shopping/cart.json"} + "schema": { "$ref": "../../schemas/shopping/cart.json" } } ], "result": { "name": "cart", - "schema": {"$ref": "#/components/schemas/cart_result"} - } + "schema": { "$ref": "#/components/schemas/cart_result" } + }, + "errors": [ + { "$ref": "#/components/errors/authentication_failed" }, + { "$ref": "#/components/errors/invalid_params" }, + { "$ref": "#/components/errors/not_found" }, + { "$ref": "#/components/errors/idempotency_conflict" } + ] }, { "name": "cancel_cart", @@ -267,21 +355,34 @@ "required": true, "schema": { "allOf": [ - {"$ref": "#/components/schemas/meta"}, - {"required": ["ucp-agent", "idempotency-key"]} + { "$ref": "#/components/schemas/meta" }, + { + "required": [ + "ucp-agent", + "idempotency-key" + ] + } ] } }, { "name": "id", "required": true, - "schema": {"type": "string"} + "schema": { + "type": "string" + } } ], "result": { "name": "cart", - "schema": {"$ref": "#/components/schemas/cart_result"} - } + "schema": { "$ref": "#/components/schemas/cart_result" } + }, + "errors": [ + { "$ref": "#/components/errors/authentication_failed" }, + { "$ref": "#/components/errors/invalid_params" }, + { "$ref": "#/components/errors/not_found" }, + { "$ref": "#/components/errors/idempotency_conflict" } + ] }, { "name": "search_catalog", @@ -291,18 +392,22 @@ { "name": "meta", "required": true, - "schema": {"$ref": "#/components/schemas/meta"} + "schema": { "$ref": "#/components/schemas/meta" } }, { "name": "catalog", "required": true, - "schema": {"$ref": "../../schemas/shopping/catalog_search.json#/$defs/search_request"} + "schema": { "$ref": "../../schemas/shopping/catalog_search.json#/$defs/search_request" } } ], "result": { "name": "response", - "schema": {"$ref": "../../schemas/shopping/catalog_search.json#/$defs/search_response"} - } + "schema": { "$ref": "../../schemas/shopping/catalog_search.json#/$defs/search_response" } + }, + "errors": [ + { "$ref": "#/components/errors/authentication_failed" }, + { "$ref": "#/components/errors/invalid_params" } + ] }, { "name": "lookup_catalog", @@ -312,18 +417,22 @@ { "name": "meta", "required": true, - "schema": {"$ref": "#/components/schemas/meta"} + "schema": { "$ref": "#/components/schemas/meta" } }, { "name": "catalog", "required": true, - "schema": {"$ref": "../../schemas/shopping/catalog_lookup.json#/$defs/lookup_request"} + "schema": { "$ref": "../../schemas/shopping/catalog_lookup.json#/$defs/lookup_request" } } ], "result": { "name": "response", - "schema": {"$ref": "../../schemas/shopping/catalog_lookup.json#/$defs/lookup_response"} - } + "schema": { "$ref": "../../schemas/shopping/catalog_lookup.json#/$defs/lookup_response" } + }, + "errors": [ + { "$ref": "#/components/errors/authentication_failed" }, + { "$ref": "#/components/errors/invalid_params" } + ] }, { "name": "get_order", @@ -333,18 +442,26 @@ { "name": "meta", "required": true, - "schema": {"$ref": "#/components/schemas/meta"} + "schema": { "$ref": "#/components/schemas/meta" } }, { "name": "id", "required": true, - "schema": {"type": "string", "description": "The unique identifier of the order."} + "schema": { + "type": "string", + "description": "The unique identifier of the order." + } } ], "result": { "name": "order", - "schema": {"$ref": "#/components/schemas/order_result"} - } + "schema": { "$ref": "#/components/schemas/order_result" } + }, + "errors": [ + { "$ref": "#/components/errors/authentication_failed" }, + { "$ref": "#/components/errors/invalid_params" }, + { "$ref": "#/components/errors/not_found" } + ] }, { "name": "get_product", @@ -354,18 +471,22 @@ { "name": "meta", "required": true, - "schema": {"$ref": "#/components/schemas/meta"} + "schema": { "$ref": "#/components/schemas/meta" } }, { "name": "catalog", "required": true, - "schema": {"$ref": "../../schemas/shopping/catalog_lookup.json#/$defs/get_product_request"} + "schema": { "$ref": "../../schemas/shopping/catalog_lookup.json#/$defs/get_product_request" } } ], "result": { "name": "response", - "schema": {"$ref": "#/components/schemas/catalog_get_product_result"} - } + "schema": { "$ref": "#/components/schemas/catalog_get_product_result" } + }, + "errors": [ + { "$ref": "#/components/errors/authentication_failed" }, + { "$ref": "#/components/errors/invalid_params" } + ] } ] } diff --git a/source/services/shopping/rest.openapi.json b/source/services/shopping/rest.openapi.json index 4ea716214..5a2219b8b 100644 --- a/source/services/shopping/rest.openapi.json +++ b/source/services/shopping/rest.openapi.json @@ -92,6 +92,36 @@ } } } + }, + "400": { + "description": "Request body failed validation.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error_response" + } + } + } + }, + "401": { + "description": "Authentication failed or missing credentials.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error_response" + } + } + } + }, + "409": { + "description": "Idempotency conflict. A request with this Idempotency-Key was already processed with different parameters.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error_response" + } + } + } } } } @@ -160,6 +190,26 @@ } } } + }, + "401": { + "description": "Authentication failed or missing credentials.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error_response" + } + } + } + }, + "404": { + "description": "Resource not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error_response" + } + } + } } } }, @@ -237,6 +287,46 @@ } } } + }, + "400": { + "description": "Request body failed validation.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error_response" + } + } + } + }, + "401": { + "description": "Authentication failed or missing credentials.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error_response" + } + } + } + }, + "404": { + "description": "Resource not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error_response" + } + } + } + }, + "409": { + "description": "Idempotency conflict. A request with this Idempotency-Key was already processed with different parameters.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error_response" + } + } + } } } } @@ -317,6 +407,46 @@ "schema": { "$ref": "#/components/schemas/checkout_response" } } } + }, + "400": { + "description": "Request body failed validation.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error_response" + } + } + } + }, + "401": { + "description": "Authentication failed or missing credentials.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error_response" + } + } + } + }, + "404": { + "description": "Resource not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error_response" + } + } + } + }, + "409": { + "description": "Idempotency conflict. A request with this Idempotency-Key was already processed with different parameters.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error_response" + } + } + } } } } @@ -391,6 +521,36 @@ } } } + }, + "401": { + "description": "Authentication failed or missing credentials.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error_response" + } + } + } + }, + "404": { + "description": "Resource not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error_response" + } + } + } + }, + "409": { + "description": "Idempotency conflict. A request with this Idempotency-Key was already processed with different parameters.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error_response" + } + } + } } } } @@ -436,6 +596,36 @@ "schema": { "$ref": "#/components/schemas/cart_response" } } } + }, + "400": { + "description": "Request body failed validation.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error_response" + } + } + } + }, + "401": { + "description": "Authentication failed or missing credentials.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error_response" + } + } + } + }, + "409": { + "description": "Idempotency conflict. A request with this Idempotency-Key was already processed with different parameters.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error_response" + } + } + } } } } @@ -474,6 +664,26 @@ "schema": { "$ref": "#/components/schemas/cart_response" } } } + }, + "401": { + "description": "Authentication failed or missing credentials.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error_response" + } + } + } + }, + "404": { + "description": "Resource not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error_response" + } + } + } } } }, @@ -517,6 +727,46 @@ "schema": { "$ref": "#/components/schemas/cart_response" } } } + }, + "400": { + "description": "Request body failed validation.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error_response" + } + } + } + }, + "401": { + "description": "Authentication failed or missing credentials.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error_response" + } + } + } + }, + "404": { + "description": "Resource not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error_response" + } + } + } + }, + "409": { + "description": "Idempotency conflict. A request with this Idempotency-Key was already processed with different parameters.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error_response" + } + } + } } } } @@ -557,6 +807,36 @@ "schema": { "$ref": "#/components/schemas/cart_response" } } } + }, + "401": { + "description": "Authentication failed or missing credentials.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error_response" + } + } + } + }, + "404": { + "description": "Resource not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error_response" + } + } + } + }, + "409": { + "description": "Idempotency conflict. A request with this Idempotency-Key was already processed with different parameters.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error_response" + } + } + } } } } @@ -601,6 +881,26 @@ "schema": { "$ref": "#/components/schemas/catalog_search_response" } } } + }, + "400": { + "description": "Request body failed validation.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error_response" + } + } + } + }, + "401": { + "description": "Authentication failed or missing credentials.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error_response" + } + } + } } } } @@ -645,6 +945,26 @@ "schema": { "$ref": "#/components/schemas/catalog_lookup_response" } } } + }, + "400": { + "description": "Request body failed validation.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error_response" + } + } + } + }, + "401": { + "description": "Authentication failed or missing credentials.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error_response" + } + } + } } } } @@ -683,6 +1003,26 @@ "schema": { "$ref": "#/components/schemas/order_response" } } } + }, + "401": { + "description": "Authentication failed or missing credentials.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error_response" + } + } + } + }, + "404": { + "description": "Resource not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error_response" + } + } + } } } } @@ -727,6 +1067,26 @@ "schema": { "$ref": "#/components/schemas/catalog_get_product_response" } } } + }, + "400": { + "description": "Request body failed validation.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error_response" + } + } + } + }, + "401": { + "description": "Authentication failed or missing credentials.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error_response" + } + } + } } } } @@ -1021,6 +1381,9 @@ { "$ref": "../../schemas/shopping/catalog_lookup.json#/$defs/get_product_response" }, { "$ref": "../../schemas/common/types/error_response.json" } ] + }, + "error_response": { + "$ref": "../../schemas/common/types/error_response.json" } } }