Программный интерфейс
/web_api/custom_property_value/add
/web_api/custom_property_value/add
Страница собрана из снимка JSON Schema в репозитории документации. Снимок обновляется отдельной командой из каталога основного приложения и при сборке сайта не переписывается.
Запрос
main-app://schemas/api_elements/custom_property_value/add.request.json
REQUEST /web_api/custom_property_value/add
| Имя | Тип | Обязательное | Ограничение |
|---|---|---|---|
custom_property_id | integer | Да | minimum 1 |
element_type | enum | Да | "test_case", "bug", "autotest_case", "autotest_run", "object_repository_page", "object_repository_element", "object_repository_folder", "test_run", "test_run_result", "test_account", "execution_context", "text_document", "checklist_id", "checklist_result_id" |
element_id | integer | Да | minimum 1 |
checkbox_value | any | Нет | - |
date_value | any | Нет | - |
integer_value | any | Нет | - |
option_id | any | Нет | - |
string_value | any | Нет | - |
text_value | any | Нет | - |
url | any | Нет | - |
user_id_value | any | Нет | - |
value | - | Нет | - |
Другие поля верхнего уровня допустимы.
Ответ
main-app://schemas/api_elements/custom_property_value/add.response.json
POST /web_api/custom_property_value/add success
| Имя | Тип | Обязательное | Ограничение |
|---|---|---|---|
api_code | integer | Да | const 200 |
api_result | object | Да | другие поля допустимы |
empty | boolean | Нет | - |
Другие поля верхнего уровня запрещены.
Исходная схема
Файлы ниже скопированы из снимка без изменений. Фрагмент по $ref приведён отдельным блоком, схемы не сливаются.
Запрос: main-app://schemas/api_elements/custom_property_value/add.request.json
json
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "main-app://schemas/api_elements/custom_property_value/add.request.json",
"title": "REQUEST /web_api/custom_property_value/add",
"$comment": "Generated from CustomPropertyValueType and the value writers. Edit those, then run node fill-from-structure-scheme.mjs.",
"type": "object",
"additionalProperties": true,
"required": [
"custom_property_id",
"element_type",
"element_id"
],
"properties": {
"custom_property_id": {
"type": "integer",
"minimum": 1
},
"element_type": {
"type": "string",
"enum": [
"test_case",
"bug",
"autotest_case",
"autotest_run",
"object_repository_page",
"object_repository_element",
"object_repository_folder",
"test_run",
"test_run_result",
"test_account",
"execution_context",
"text_document",
"checklist_id",
"checklist_result_id"
]
},
"element_id": {
"type": "integer",
"minimum": 1
},
"checkbox_value": true,
"date_value": true,
"integer_value": true,
"option_id": true,
"string_value": true,
"text_value": true,
"url": true,
"user_id_value": true,
"value": {
"description": "Same value as the typed column for this value_type."
}
}
}Ответ: main-app://schemas/api_elements/custom_property_value/add.response.json
json
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "main-app://schemas/api_elements/custom_property_value/add.response.json",
"title": "POST /web_api/custom_property_value/add success",
"allOf": [
{
"$ref": "main-app://schemas/_shared/envelope-success.json"
},
{
"type": "object",
"properties": {
"api_result": {
"type": "object",
"additionalProperties": true
}
}
}
]
}Фрагмент: 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
}Страница не помогла?