fix: use official Shopify API specs repo, move lru_cache error handling to caller

This commit is contained in:
Ishaan Jaffer 2026-03-10 11:21:06 -07:00
parent a2537d2ed2
commit ffbd7ef525
2 changed files with 10 additions and 10 deletions

View file

@ -1373,14 +1373,8 @@ if MCP_AVAILABLE:
@functools.lru_cache(maxsize=1)
def _load_openapi_registry() -> Dict[str, Any]:
try:
with open(_OPENAPI_REGISTRY_PATH, "r") as f:
data: Dict[str, Any] = json.load(f)
except Exception as e:
verbose_proxy_logger.warning(
f"Failed to load OpenAPI registry from {_OPENAPI_REGISTRY_PATH}: {e}"
)
data = {"apis": []}
with open(_OPENAPI_REGISTRY_PATH, "r") as f:
data: Dict[str, Any] = json.load(f)
return data
@router.get(
@ -1399,4 +1393,10 @@ if MCP_AVAILABLE:
)
},
)
return _load_openapi_registry()
try:
return _load_openapi_registry()
except Exception as e:
verbose_proxy_logger.warning(
f"Failed to load OpenAPI registry from {_OPENAPI_REGISTRY_PATH}: {e}"
)
return {"apis": []}

View file

@ -189,7 +189,7 @@
"title": "Shopify",
"description": "Products, orders, customers, and store management (requires your store subdomain)",
"icon_url": "https://cdn.simpleicons.org/shopify",
"spec_url": "https://raw.githubusercontent.com/allengrant/shopify_openapi/master/shopify_openapi.json",
"spec_url": "https://raw.githubusercontent.com/Shopify/shopify-api-specs/main/admin/rest/2024-01/openapi.json",
"oauth": {
"authorization_url": "https://your-store.myshopify.com/admin/oauth/authorize",
"token_url": "https://your-store.myshopify.com/admin/oauth/access_token",