{
  "openapi": "3.1.0",
  "info": {
    "title": "API словаря агентной коммерции",
    "version": "1.0.0",
    "description": "Определения терминов агентной коммерции в машиночитаемом виде. Только чтение, без ключей и ограничений.",
    "contact": {
      "name": "ООО «САРМАТЕХ»",
      "email": "info@a2acommerce.ru",
      "url": "https://a2acommerce.ru/"
    },
    "license": {
      "name": "Свободное цитирование со ссылкой на источник"
    }
  },
  "servers": [
    {
      "url": "https://a2acommerce.ru"
    }
  ],
  "paths": {
    "/api/terms.json": {
      "get": {
        "summary": "Все статьи словаря",
        "operationId": "listTerms",
        "responses": {
          "200": {
            "description": "Перечень терминов с определениями",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TermList"
                }
              }
            }
          }
        }
      }
    },
    "/api/categories.json": {
      "get": {
        "summary": "Разделы словаря",
        "operationId": "listCategories",
        "responses": {
          "200": {
            "description": "Разделы и состав каждого"
          }
        }
      }
    },
    "/api/terms/{slug}.json": {
      "get": {
        "summary": "Одна статья по адресу",
        "operationId": "getTerm",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Адрес статьи, например mcp или ai-d2c"
          }
        ],
        "responses": {
          "200": {
            "description": "Статья словаря",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Term"
                }
              }
            }
          },
          "404": {
            "description": "Статьи нет"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Term": {
        "type": "object",
        "required": [
          "id",
          "term",
          "definition"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "term": {
            "type": "string"
          },
          "fullName": {
            "type": "string"
          },
          "category": {
            "type": "object"
          },
          "definition": {
            "type": "string"
          },
          "body": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "holder": {
            "type": "string"
          },
          "publisherTerm": {
            "type": "boolean"
          },
          "year": {
            "type": "string"
          },
          "source": {
            "type": [
              "string",
              "null"
            ]
          },
          "related": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "url": {
            "type": "string"
          },
          "markdown": {
            "type": "string"
          },
          "checked": {
            "type": "string"
          }
        }
      },
      "TermList": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer"
          },
          "terms": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Term"
            }
          }
        }
      }
    }
  }
}
