{
  "openapi": "3.0.1",
  "info": {
    "title": "API Разъяснений",
    "version": "v1"
  },
  "servers": [
    {
      "url": "/ExplainApi"
    }
  ],
  "paths": {
    "/v1/answers/categories/{id}": {
      "get": {
        "tags": [
          "Ответы на типовые запросы кредитных организаций по вопросам банковского регулирования и надзора основанные на html"
        ],
        "summary": "Получить подкатегории",
        "description": "Метод получения подкатегорий для указанной категории, если категория не указана, выдаётся список корневых категорий",
        "operationId": "AnswersGetCategories",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "id родительской категории",
            "allowEmptyValue": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AnswerCategory"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Родительская категория не найдена",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "500": {
            "description": "Внутренняя ошибка сервера",
            "content": {
              "text/plain": { }
            }
          }
        }
      }
    },
    "/v1/answers/categories/{id}/explains": {
      "get": {
        "tags": [
          "Ответы на типовые запросы кредитных организаций по вопросам банковского регулирования и надзора основанные на html"
        ],
        "summary": "Получить список разъяснений в категории с указанным идентификатором",
        "description": "Метод получения списка разъяснений в указанной категории, если категория является узловой, возвращается пустой список разъяснений (то есть разъяснения подкатегорий в этом случае не выводятся)",
        "operationId": "AnswersGetExplains",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "id категории",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Answer"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Категория не найдена",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "500": {
            "description": "Внутренняя ошибка сервера",
            "content": {
              "text/plain": { }
            }
          }
        }
      }
    },
    "/v1/answers/categories/explains/{id}": {
      "get": {
        "tags": [
          "Ответы на типовые запросы кредитных организаций по вопросам банковского регулирования и надзора основанные на html"
        ],
        "summary": "Получить разъяснение",
        "description": "Метод получения разъяснения по номеру",
        "operationId": "AnswersGetExplain",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "id разъяснения",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Answer"
                }
              }
            }
          },
          "404": {
            "description": "Разъяснение не найдено",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "500": {
            "description": "Внутренняя ошибка сервера",
            "content": {
              "text/plain": { }
            }
          }
        }
      }
    },
    "/v1/answers/categories/explains/latest": {
      "get": {
        "tags": [
          "Ответы на типовые запросы кредитных организаций по вопросам банковского регулирования и надзора основанные на html"
        ],
        "summary": "Получить список последних разъяснений",
        "description": "Метод получения списка указанного числа последних разъяснений, отсортированных в порядке уменьшения времени обновления",
        "operationId": "AnswersGetLatestExplains",
        "parameters": [
          {
            "name": "countPerPage",
            "in": "query",
            "description": "количество на странице (не более 100)",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageNumber",
            "in": "query",
            "description": "номер страницы",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnswerIPage"
                }
              }
            }
          },
          "400": {
            "description": "Запрошено недопустимое количество разъяснений",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "500": {
            "description": "Внутренняя ошибка сервера",
            "content": {
              "text/plain": { }
            }
          }
        }
      }
    },
    "/v1/answers/categories/explains/after": {
      "get": {
        "tags": [
          "Ответы на типовые запросы кредитных организаций по вопросам банковского регулирования и надзора основанные на html"
        ],
        "summary": "Получить список разъяснений, обновлённых после указанной даты",
        "description": "Метод получения списка разъяснений, обновлённых после указанной даты",
        "operationId": "AnswersGetExplainsAfter",
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "description": "дата (DD.MM.YYYY)",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "countPerPage",
            "in": "query",
            "description": "количество на странице (не более 100)",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageNumber",
            "in": "query",
            "description": "номер страницы",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnswerIPage"
                }
              }
            }
          },
          "400": {
            "description": "Неверный формат даты",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "500": {
            "description": "Внутренняя ошибка сервера",
            "content": {
              "text/plain": { }
            }
          }
        }
      }
    },
    "/v1/documents/categories/{id}": {
      "get": {
        "tags": [
          "Разъяснения основанные на документах"
        ],
        "summary": "Получить подкатегории",
        "description": "Метод получения подкатегорий для указанной категории, если категория не указана, выдаётся список корневых категорий",
        "operationId": "DocumentGetCategories",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "id родительской категории",
            "allowEmptyValue": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Category"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Родительская категория не найдена",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "500": {
            "description": "Внутренняя ошибка сервера",
            "content": {
              "text/plain": { }
            }
          }
        }
      }
    },
    "/v1/documents/categories/{id}/explains": {
      "get": {
        "tags": [
          "Разъяснения основанные на документах"
        ],
        "summary": "Получить список разъяснений в указанной категории",
        "description": "Метод получения списка разъяснений в указанной категории, если категория является узловой, возвращается пустой список разъяснений (то есть разъяснения подкатегорий в этом случае не выводятся)",
        "operationId": "DocumentGetExplains",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "id категории",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Document"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Категория не найдена",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "500": {
            "description": "Внутренняя ошибка сервера",
            "content": {
              "text/plain": { }
            }
          }
        }
      }
    },
    "/v1/documents/categories/explains/{id}": {
      "get": {
        "tags": [
          "Разъяснения основанные на документах"
        ],
        "summary": "Получить разъяснение",
        "description": "Метод получения разъяснения по номеру",
        "operationId": "DocumentGetExplain",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "id разъяснения",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Document"
                }
              }
            }
          },
          "404": {
            "description": "Разъяснение не найдено",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "500": {
            "description": "Внутренняя ошибка сервера",
            "content": {
              "text/plain": { }
            }
          }
        }
      }
    },
    "/v1/documents/categories/explains/latest": {
      "get": {
        "tags": [
          "Разъяснения основанные на документах"
        ],
        "summary": "Получить список последних разъяснений",
        "description": "Метод получения списка указанного числа последних разъяснений, отсортированных в порядке уменьшения времени обновления",
        "operationId": "DocumentGetLatestExplains",
        "parameters": [
          {
            "name": "countPerPage",
            "in": "query",
            "description": "количество на странице (не более 100)",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageNumber",
            "in": "query",
            "description": "номер страницы",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentIPage"
                }
              }
            }
          },
          "400": {
            "description": "Запрошено недопустимое количество разъяснений",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "500": {
            "description": "Внутренняя ошибка сервера",
            "content": {
              "text/plain": { }
            }
          }
        }
      }
    },
    "/v1/documents/categories/explains/after": {
      "get": {
        "tags": [
          "Разъяснения основанные на документах"
        ],
        "summary": "Получить список разъяснений, обновлённых после указанной даты",
        "description": "Метод получения списка разъяснений(на базе документов), обновлённых после указанной даты",
        "operationId": "DocumentGetExplainsAfter",
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "description": "дата (DD.MM.YYYY)",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "countPerPage",
            "in": "query",
            "description": "количество на странице (не более 100)",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageNumber",
            "in": "query",
            "description": "номер страницы",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentIPage"
                }
              }
            }
          },
          "400": {
            "description": "Неверный формат даты",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "500": {
            "description": "Внутренняя ошибка сервера",
            "content": {
              "text/plain": { }
            }
          }
        }
      }
    },
    "/v1/categories/{id}": {
      "get": {
        "tags": [
          "Разъяснения основанные на html"
        ],
        "summary": "Получить подкатегории",
        "description": "Метод получения подкатегорий для указанной категории, если категория не указана, выдаётся список корневых категорий",
        "operationId": "GetCategories",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "id родительской категории",
            "allowEmptyValue": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Category"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Родительская категория не найдена",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "500": {
            "description": "Внутренняя ошибка сервера",
            "content": {
              "text/plain": { }
            }
          }
        }
      }
    },
    "/v1/categories/{id}/explains": {
      "get": {
        "tags": [
          "Разъяснения основанные на html"
        ],
        "summary": "Получить список разъяснений в указанной категории",
        "description": "Метод получения списка разъяснений в указанной категории, если категория является узловой, возвращается пустой список разъяснений (то есть разъяснения подкатегорий в этом случае не выводятся)",
        "operationId": "GetExplains",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "id категории",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Explain"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Категория не найдена",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "500": {
            "description": "Внутренняя ошибка сервера",
            "content": {
              "text/plain": { }
            }
          }
        }
      }
    },
    "/v1/categories/explains/{id}": {
      "get": {
        "tags": [
          "Разъяснения основанные на html"
        ],
        "summary": "Получить разъяснение",
        "description": "Метод получения разъяснения по номеру",
        "operationId": "GetExplain",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "id разъяснения",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Explain"
                }
              }
            }
          },
          "404": {
            "description": "Разъяснение не найдено",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                }
              }
            }
          },
          "500": {
            "description": "Внутренняя ошибка сервера",
            "content": {
              "text/plain": { }
            }
          }
        }
      }
    },
    "/v1/categories/explains/latest": {
      "get": {
        "tags": [
          "Разъяснения основанные на html"
        ],
        "summary": "Получить список последних разъяснений",
        "description": "Метод получения списка указанного числа последних разъяснений, отсортированных в порядке уменьшения времени обновления",
        "operationId": "GetLatestExplains",
        "parameters": [
          {
            "name": "countPerPage",
            "in": "query",
            "description": "количество на странице (не более 100)",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageNumber",
            "in": "query",
            "description": "номер страницы",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExplainIPage"
                }
              }
            }
          },
          "400": {
            "description": "Запрошено недопустимое количество разъяснений",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "500": {
            "description": "Внутренняя ошибка сервера",
            "content": {
              "text/plain": { }
            }
          }
        }
      }
    },
    "/v1/categories/explains/after": {
      "get": {
        "tags": [
          "Разъяснения основанные на html"
        ],
        "summary": "Получить список разъяснений, обновлённых после указанной даты",
        "description": "Метод получения списка разъяснений, обновлённых после указанной даты",
        "operationId": "GetExplainsAfter",
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "description": "дата (DD.MM.YYYY)",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "countPerPage",
            "in": "query",
            "description": "количество на странице (не более 100)",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageNumber",
            "in": "query",
            "description": "номер страницы",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExplainIPage"
                }
              }
            }
          },
          "400": {
            "description": "Неверный формат даты",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              }
            }
          },
          "500": {
            "description": "Внутренняя ошибка сервера",
            "content": {
              "text/plain": { }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Answer": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Идентификатор разъяснения",
            "format": "int32"
          },
          "categoryId": {
            "type": "string",
            "description": "Идентификатор категории разъяснения"
          },
          "modification": {
            "type": "string",
            "description": "Дата последнего изменения разъяснения",
            "format": "date-time"
          },
          "title": {
            "type": "string",
            "description": "Заголовок"
          },
          "questionHtml": {
            "type": "string",
            "description": "Вопрос",
            "nullable": true
          },
          "answerHtml": {
            "type": "string",
            "description": "Ответ"
          },
          "file": {
            "$ref": "#/components/schemas/FileReference"
          }
        },
        "additionalProperties": false
      },
      "AnswerCategory": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Идентификатор категории"
          },
          "parentId": {
            "type": "string",
            "description": "Идентификатор родительской категории",
            "nullable": true
          },
          "title": {
            "type": "string",
            "description": "Заголовок"
          },
          "hasSubCategories": {
            "type": "boolean",
            "description": "Флаг, показывающий есть ли у категории подкатегории"
          }
        },
        "additionalProperties": false
      },
      "AnswerIPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Answer"
            },
            "description": "Коллекция элементов на странице",
            "nullable": true,
            "readOnly": true
          },
          "pageCount": {
            "type": "integer",
            "description": "Всего страниц",
            "format": "int32",
            "readOnly": true
          },
          "currentPage": {
            "type": "integer",
            "description": "Номер страницы, нумерация начинается с единицы",
            "format": "int32",
            "readOnly": true
          },
          "totalCount": {
            "type": "integer",
            "description": "Всего найдено элементов",
            "format": "int32",
            "readOnly": true
          }
        },
        "additionalProperties": false
      },
      "BadRequestError": {
        "type": "object",
        "properties": {
          "value": {
            "description": "Параметр запроса, вызвавший исключение",
            "nullable": true
          },
          "message": {
            "type": "string",
            "description": "Сообщение об ошибке",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Category": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Идентификатор категории",
            "format": "int32"
          },
          "parentId": {
            "type": "integer",
            "description": "Идентификатор родительской категории",
            "format": "int32",
            "nullable": true
          },
          "title": {
            "type": "string",
            "description": "Заголовок"
          },
          "hasSubCategories": {
            "type": "boolean",
            "description": "Флаг, показывающий есть ли у категории подкатегории"
          }
        },
        "additionalProperties": false
      },
      "Document": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Идентификатор разъяснения",
            "format": "int32"
          },
          "categoryId": {
            "type": "integer",
            "description": "Идентификатор категории разъяснения",
            "format": "int32"
          },
          "modification": {
            "type": "string",
            "description": "Дата последнего изменения разъяснения",
            "format": "date-time"
          },
          "title": {
            "type": "string",
            "description": "Заголовок"
          },
          "question": {
            "$ref": "#/components/schemas/FileReference"
          },
          "answer": {
            "$ref": "#/components/schemas/FileReference"
          }
        },
        "additionalProperties": false
      },
      "DocumentIPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Document"
            },
            "description": "Коллекция элементов на странице",
            "nullable": true,
            "readOnly": true
          },
          "pageCount": {
            "type": "integer",
            "description": "Всего страниц",
            "format": "int32",
            "readOnly": true
          },
          "currentPage": {
            "type": "integer",
            "description": "Номер страницы, нумерация начинается с единицы",
            "format": "int32",
            "readOnly": true
          },
          "totalCount": {
            "type": "integer",
            "description": "Всего найдено элементов",
            "format": "int32",
            "readOnly": true
          }
        },
        "additionalProperties": false
      },
      "Explain": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Идентификатор разъяснения",
            "format": "int32"
          },
          "categoryId": {
            "type": "integer",
            "description": "Идентификатор категории разъяснения",
            "format": "int32"
          },
          "modification": {
            "type": "string",
            "description": "Дата последнего изменения разъяснения",
            "format": "date-time"
          },
          "questionHtml": {
            "type": "string",
            "description": "Вопрос"
          },
          "answerHtml": {
            "type": "string",
            "description": "Ответ"
          }
        },
        "additionalProperties": false
      },
      "ExplainIPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Explain"
            },
            "description": "Коллекция элементов на странице",
            "nullable": true,
            "readOnly": true
          },
          "pageCount": {
            "type": "integer",
            "description": "Всего страниц",
            "format": "int32",
            "readOnly": true
          },
          "currentPage": {
            "type": "integer",
            "description": "Номер страницы, нумерация начинается с единицы",
            "format": "int32",
            "readOnly": true
          },
          "totalCount": {
            "type": "integer",
            "description": "Всего найдено элементов",
            "format": "int32",
            "readOnly": true
          }
        },
        "additionalProperties": false
      },
      "FileReference": {
        "type": "object",
        "properties": {
          "fileName": {
            "type": "string",
            "description": "Наименование файла"
          },
          "extension": {
            "type": "string",
            "description": "Расширение файла"
          },
          "reference": {
            "type": "string",
            "description": "Ссылка на скачивание файла",
            "readOnly": true
          }
        },
        "additionalProperties": false
      },
      "NotFoundError": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Идентификатор объекта, по которому производился поиск"
          },
          "message": {
            "type": "string",
            "description": "Сообщение об ошибке",
            "nullable": true
          }
        },
        "additionalProperties": false
      }
    }
  }
}