{ "openapi": "3.0.1", "info": { "title": "API Разъяснений", "version": "v1" }, "servers": [ { "url": "/ExplainApi" } ], "paths": { "/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": { } } } } } }, "/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": { } } } } } } }, "components": { "schemas": { "BadRequestError": { "type": "object", "properties": { "value": { "nullable": true }, "message": { "type": "string", "nullable": true } }, "additionalProperties": false }, "Category": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "parentId": { "type": "integer", "format": "int32", "nullable": true }, "title": { "type": "string", "nullable": true }, "hasSubCategories": { "type": "boolean" } }, "additionalProperties": false }, "Document": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "categoryId": { "type": "integer", "format": "int32" }, "modification": { "type": "string", "format": "date-time" }, "title": { "type": "string", "nullable": true }, "question": { "$ref": "#/components/schemas/FileReference" }, "answer": { "$ref": "#/components/schemas/FileReference" } }, "additionalProperties": false }, "DocumentIPage": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/Document" }, "nullable": true, "readOnly": true }, "pageCount": { "type": "integer", "format": "int32", "readOnly": true }, "currentPage": { "type": "integer", "format": "int32", "readOnly": true } }, "additionalProperties": false }, "Explain": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "categoryId": { "type": "integer", "format": "int32" }, "modification": { "type": "string", "format": "date-time" }, "questionHtml": { "type": "string", "nullable": true }, "answerHtml": { "type": "string", "nullable": true } }, "additionalProperties": false }, "ExplainIPage": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/Explain" }, "nullable": true, "readOnly": true }, "pageCount": { "type": "integer", "format": "int32", "readOnly": true }, "currentPage": { "type": "integer", "format": "int32", "readOnly": true } }, "additionalProperties": false }, "FileReference": { "type": "object", "properties": { "fileName": { "type": "string", "nullable": true }, "extension": { "type": "string", "nullable": true }, "reference": { "type": "string", "nullable": true, "readOnly": true } }, "additionalProperties": false }, "NotFoundError": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "message": { "type": "string", "nullable": true } }, "additionalProperties": false } } } }