Spaces:
Sleeping
Sleeping
Download docs/openapi.json from fmbishu/image-search-api: direct link, hf CLI and curl.
- Browser
- Download file 12.5 kB
-
https://huggingface.co/spaces/fmbishu/image-search-api/resolve/main/docs/openapi.json
- Command line
-
hf download hf://spaces/fmbishu/image-search-api/docs/openapi.json
-
curl -L -o openapi.json https://huggingface.co/spaces/fmbishu/image-search-api/resolve/main/docs/openapi.json
12.5 kB
| {"openapi":"3.1.0","info":{"title":"Image Search Demo","version":"0.1.0"},"paths":{"/":{"get":{"summary":"Root","operationId":"root__get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/catalog":{"get":{"summary":"Catalog","operationId":"catalog_catalog_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/search":{"post":{"summary":"Search","operationId":"search_search_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_search_search_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/reindex":{"post":{"summary":"Admin Reindex","operationId":"admin_reindex_admin_reindex_post","parameters":[{"name":"force","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Force"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Reindex Admin Reindex Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/config":{"get":{"summary":"Get Config","operationId":"get_config_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Config Config Get"}}}}}}},"/health":{"get":{"summary":"Health","description":"Health check endpoint for Hugging Face Spaces and other platforms.\n\nAlways returns HTTP 200 to indicate the server is running.\nHugging Face Spaces checks for 200 status to determine if the app is healthy.","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Health Health Get"}}}}}}},"/metrics":{"get":{"summary":"Metrics","operationId":"metrics_metrics_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"string","title":"Response Metrics Metrics Get"}}}}}}},"/products":{"get":{"summary":"Get Products","description":"Get products with optional filtering.","operationId":"get_products_products_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"}},{"name":"brand","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Brand"}},{"name":"min_price","in":"query","required":false,"schema":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}],"title":"Min Price"}},{"name":"max_price","in":"query","required":false,"schema":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}],"title":"Max Price"}},{"name":"availability","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Availability"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Products Products Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Create Product","description":"Create a new product.","operationId":"create_product_products_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Product Products Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/products/{product_id}":{"get":{"summary":"Get Product","description":"Get a specific product by ID.","operationId":"get_product_products__product_id__get","parameters":[{"name":"product_id","in":"path","required":true,"schema":{"type":"string","title":"Product Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Product Products Product Id Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"summary":"Update Product","description":"Update an existing product.","operationId":"update_product_products__product_id__put","parameters":[{"name":"product_id","in":"path","required":true,"schema":{"type":"string","title":"Product Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Product Products Product Id Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Product","description":"Delete a product.","operationId":"delete_product_products__product_id__delete","parameters":[{"name":"product_id","in":"path","required":true,"schema":{"type":"string","title":"Product Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Product Products Product Id Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/products/search/text":{"get":{"summary":"Search Products Text","description":"Search products by text query.","operationId":"search_products_text_products_search_text_get","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":1,"title":"Q"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Search Products Text Products Search Text Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/categories":{"get":{"summary":"Get Categories","description":"Get all product categories.","operationId":"get_categories_categories_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Categories Categories Get"}}}}}}},"/brands":{"get":{"summary":"Get Brands","description":"Get all product brands.","operationId":"get_brands_brands_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Brands Brands Get"}}}}}}},"/admin/stats":{"get":{"summary":"Get Admin Stats","description":"Get database statistics.","operationId":"get_admin_stats_admin_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Admin Stats Admin Stats Get"}}}}}}},"/admin/metrics":{"get":{"summary":"Admin Metrics","description":"Get search performance metrics.","operationId":"admin_metrics_admin_metrics_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Admin Metrics Admin Metrics Get"}}}}}}},"/admin/analytics":{"get":{"summary":"Admin Analytics","description":"Get detailed search analytics.","operationId":"admin_analytics_admin_analytics_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Admin Analytics Admin Analytics Get"}}}}}}},"/admin/report":{"get":{"summary":"Admin Report","description":"Get search performance report.","operationId":"admin_report_admin_report_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"string","title":"Response Admin Report Admin Report Get"}}}}}}}},"components":{"schemas":{"Body_search_search_post":{"properties":{"file":{"anyOf":[{"type":"string","format":"binary"},{"type":"null"}],"title":"File"},"query":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Query"},"top_k":{"type":"integer","title":"Top K"},"min_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Min Price"},"max_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max Price"},"title_substr":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title Substr"}},"type":"object","title":"Body_search_search_post"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ProductCreate":{"properties":{"title":{"type":"string","maxLength":255,"minLength":1,"title":"Title"},"description":{"type":"string","maxLength":10000,"title":"Description","default":""},"price":{"type":"number","minimum":0.0,"title":"Price"},"currency":{"type":"string","maxLength":10,"minLength":1,"title":"Currency","default":"XAF"},"category":{"type":"string","maxLength":255,"minLength":1,"title":"Category"},"brand":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Brand"},"image_url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Image Url"},"availability":{"type":"string","maxLength":255,"minLength":1,"title":"Availability","default":"in_stock"},"rating":{"anyOf":[{"type":"number","maximum":5.0,"minimum":0.0},{"type":"null"}],"title":"Rating"},"review_count":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Review Count"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"},"id":{"type":"string","maxLength":255,"minLength":1,"title":"Id"}},"type":"object","required":["title","price","category","image_url","id"],"title":"ProductCreate","description":"Schema for creating a new product."},"ProductUpdate":{"properties":{"title":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Title"},"description":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}],"title":"Description"},"price":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Price"},"currency":{"anyOf":[{"type":"string","maxLength":10,"minLength":1},{"type":"null"}],"title":"Currency"},"category":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Category"},"brand":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Brand"},"image_url":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Image Url"},"availability":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Availability"},"rating":{"anyOf":[{"type":"number","maximum":5.0,"minimum":0.0},{"type":"null"}],"title":"Rating"},"review_count":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Review Count"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"}},"type":"object","title":"ProductUpdate","description":"Schema for partial updates to a product."},"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"}}}} |