Программный интерфейс

/web_api/attachment/create

/web_api/attachment/create ​

Страница собрана из снимка JSON Schema в репозитории документации. Снимок обновляется отдельной командой из каталога основного приложения и при сборке сайта не переписывается.

Запрос ​

main-app://schemas/api_elements/attachment/create.request.json

REQUEST /web_api/attachment/create

ИмяТипОбязательноеОграничение
team_idintegerДаminimum 0
project_idintegerДаminimum 0
element_typeenumДа"bug", "autotest_result"
element_idintegerДа-
file_uuidstringДаmaxLength 36
captionstring | nullНетmaxLength 512
sort_orderintegerНет-
user_idinteger | nullНет-
created_atstringНет-
updated_atstringНет-

Другие поля верхнего уровня запрещены.

Ответ ​

main-app://schemas/api_elements/attachment/create.response.json

RESPONSE /web_api/attachment/create

ИмяТипОбязательноеОграничение
api_codeintegerДаconst 200
api_resultobjectДадругие поля допустимы
emptybooleanНет-

Другие поля верхнего уровня запрещены.

api_result ​

ИмяТипОбязательноеОграничение
attachment_idintegerНетminimum 0
team_idintegerНетminimum 0
project_idintegerНетminimum 0
element_typeenumНет"bug", "autotest_result"
element_idintegerНет-
file_uuidstringНетmaxLength 36
captionstring | nullНетmaxLength 512
sort_orderintegerНет-
user_idinteger | nullНет-
created_atstringНет-
updated_atstringНет-

Исходная схема ​

Файлы ниже скопированы из снимка без изменений. Фрагмент по $ref приведён отдельным блоком, схемы не сливаются.

Запрос: main-app://schemas/api_elements/attachment/create.request.json
json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "main-app://schemas/api_elements/attachment/create.request.json",
  "title": "REQUEST /web_api/attachment/create",
  "$comment": "Generated from the DB model structure_scheme. Edit the model, then run node fill-from-structure-scheme.mjs.",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "team_id": {
      "type": "integer",
      "minimum": 0
    },
    "project_id": {
      "type": "integer",
      "minimum": 0
    },
    "element_type": {
      "type": "string",
      "enum": [
        "bug",
        "autotest_result"
      ]
    },
    "element_id": {
      "type": "integer"
    },
    "file_uuid": {
      "type": "string",
      "maxLength": 36
    },
    "caption": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 512
    },
    "sort_order": {
      "type": "integer"
    },
    "user_id": {
      "type": [
        "integer",
        "null"
      ]
    },
    "created_at": {
      "type": "string",
      "description": "timestamp Y-m-d H:i:s"
    },
    "updated_at": {
      "type": "string",
      "description": "timestamp Y-m-d H:i:s"
    }
  },
  "required": [
    "team_id",
    "project_id",
    "element_type",
    "element_id",
    "file_uuid"
  ]
}
Ответ: main-app://schemas/api_elements/attachment/create.response.json
json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "main-app://schemas/api_elements/attachment/create.response.json",
  "title": "RESPONSE /web_api/attachment/create",
  "$comment": "Generated from the DB model structure_scheme. Edit the model, then run node fill-from-structure-scheme.mjs.",
  "allOf": [
    {
      "$ref": "main-app://schemas/_shared/envelope-success.json"
    },
    {
      "type": "object",
      "properties": {
        "api_result": {
          "$ref": "main-app://schemas/api_elements/attachment/row.json"
        }
      }
    }
  ]
}
Фрагмент: main-app://schemas/_shared/envelope-success.json
json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "main-app://schemas/_shared/envelope-success.json",
  "title": "Canonical success envelope",
  "type": "object",
  "required": ["api_code", "api_result"],
  "properties": {
    "api_code": { "const": 200 },
    "api_result": true,
    "empty": { "type": "boolean" }
  },
  "additionalProperties": false
}
Фрагмент: main-app://schemas/api_elements/attachment/row.json
json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "main-app://schemas/api_elements/attachment/row.json",
  "title": "Row attachment",
  "$comment": "Generated from the DB model structure_scheme. Edit the model, then run node fill-from-structure-scheme.mjs.",
  "type": "object",
  "additionalProperties": true,
  "properties": {
    "attachment_id": {
      "type": "integer",
      "minimum": 0
    },
    "team_id": {
      "type": "integer",
      "minimum": 0
    },
    "project_id": {
      "type": "integer",
      "minimum": 0
    },
    "element_type": {
      "type": "string",
      "enum": [
        "bug",
        "autotest_result"
      ]
    },
    "element_id": {
      "type": "integer"
    },
    "file_uuid": {
      "type": "string",
      "maxLength": 36
    },
    "caption": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 512
    },
    "sort_order": {
      "type": "integer"
    },
    "user_id": {
      "type": [
        "integer",
        "null"
      ]
    },
    "created_at": {
      "type": "string",
      "description": "timestamp Y-m-d H:i:s"
    },
    "updated_at": {
      "type": "string",
      "description": "timestamp Y-m-d H:i:s"
    }
  }
}

Версия 1.0.0 · Последнее изменение 2026-10-07

Страница не помогла?