{
  "specVersion": "1.0",
  "entries": [
    {
      "identifier": "urn:air:23gifts.ru:product-catalog",
      "displayName": "Каталог товаров 23GIFTS",
      "type": "application/vnd.oai.openapi+json",
      "description": "Публичный поиск товаров 23GIFTS и просмотр категорий каталога.",
      "capabilities": [
        "ProductSearch",
        "ProductCategoryListing"
      ],
      "representativeQueries": [
        "Найти дождевики в каталоге 23GIFTS",
        "Показать категории товаров 23GIFTS"
      ],
      "data": {
        "openapi": "3.1.0",
        "info": {
          "title": "Публичный каталог 23GIFTS",
          "version": "1.0.0",
          "description": "Поиск опубликованных товаров и просмотр категорий 23GIFTS."
        },
        "servers": [
          {
            "url": "https://23gifts.ru/wp-json/wc/store/v1"
          }
        ],
        "paths": {
          "/products": {
            "get": {
              "operationId": "listProducts",
              "summary": "Найти товары",
              "parameters": [
                {
                  "name": "search",
                  "in": "query",
                  "description": "Текст для поиска товаров.",
                  "schema": {
                    "type": "string"
                  }
                },
                {
                  "name": "category",
                  "in": "query",
                  "description": "Идентификатор или слаг категории.",
                  "schema": {
                    "type": "string"
                  }
                },
                {
                  "name": "page",
                  "in": "query",
                  "description": "Номер страницы результатов.",
                  "schema": {
                    "type": "integer",
                    "minimum": 1,
                    "default": 1
                  }
                },
                {
                  "name": "per_page",
                  "in": "query",
                  "description": "Количество записей на странице.",
                  "schema": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100,
                    "default": 10
                  }
                }
              ],
              "responses": {
                "200": {
                  "description": "Опубликованные товары, соответствующие запросу.",
                  "content": {
                    "application/json": {
                      "schema": {
                        "type": "array",
                        "items": {
                          "$ref": "#/components/schemas/Product"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "/products/categories": {
            "get": {
              "operationId": "listProductCategories",
              "summary": "Посмотреть категории товаров",
              "parameters": [
                {
                  "name": "page",
                  "in": "query",
                  "description": "Номер страницы результатов.",
                  "schema": {
                    "type": "integer",
                    "minimum": 1,
                    "default": 1
                  }
                },
                {
                  "name": "per_page",
                  "in": "query",
                  "description": "Количество записей на странице.",
                  "schema": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100,
                    "default": 10
                  }
                }
              ],
              "responses": {
                "200": {
                  "description": "Категории каталога.",
                  "content": {
                    "application/json": {
                      "schema": {
                        "type": "array",
                        "items": {
                          "$ref": "#/components/schemas/Category"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "components": {
          "schemas": {
            "Product": {
              "type": "object",
              "required": [
                "id",
                "name",
                "permalink"
              ],
              "properties": {
                "id": {
                  "type": "integer"
                },
                "name": {
                  "type": "string"
                },
                "sku": {
                  "type": "string"
                },
                "permalink": {
                  "type": "string",
                  "format": "uri"
                },
                "is_in_stock": {
                  "type": "boolean"
                },
                "prices": {
                  "type": "object",
                  "properties": {
                    "price": {
                      "type": "string",
                      "description": "Цена в минимальных единицах валюты."
                    },
                    "currency_code": {
                      "type": "string"
                    },
                    "currency_minor_unit": {
                      "type": "integer"
                    }
                  }
                }
              }
            },
            "Category": {
              "type": "object",
              "required": [
                "id",
                "name",
                "slug"
              ],
              "properties": {
                "id": {
                  "type": "integer"
                },
                "name": {
                  "type": "string"
                },
                "slug": {
                  "type": "string"
                },
                "permalink": {
                  "type": "string",
                  "format": "uri"
                },
                "parent": {
                  "type": "integer"
                },
                "count": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    }
  ]
}
