Программный интерфейс
/web_api/custom_property_option/update_property
/web_api/custom_property_option/update_property
Страница собрана из снимка JSON Schema в репозитории документации. Снимок обновляется отдельной командой из каталога основного приложения и при сборке сайта не переписывается.
Запрос
main-app://schemas/api_elements/custom_property_option/update_property.request.json
REQUEST /web_api/custom_property_option/update_property
| Имя | Тип | Обязательное | Ограничение |
|---|---|---|---|
custom_property_option_id | integer | Да | minimum 1 |
key | enum | Да | "option_key", "label", "sort_order", "is_enabled" |
value | any | Да | - |
Другие поля верхнего уровня запрещены.
Ответ
main-app://schemas/api_elements/custom_property_option/update_property.response.json
RESPONSE /web_api/custom_property_option/update_property
| Имя | Тип | Обязательное | Ограничение |
|---|---|---|---|
api_code | integer | Да | const 200 |
api_result | object | Да | другие поля допустимы |
empty | boolean | Нет | - |
Другие поля верхнего уровня запрещены.
api_result
| Имя | Тип | Обязательное | Ограничение |
|---|---|---|---|
custom_property_option_id | integer | Нет | minimum 0 |
custom_property_id | integer | Нет | minimum 0 |
option_key | string | Нет | maxLength 64; pattern [1][A-Z0-9_]*$ |
label | string | Нет | maxLength 120 |
sort_order | integer | Нет | - |
is_enabled | integer | Нет | - |
created_at | string | Нет | - |
updated_at | string | Нет | - |
Исходная схема
Файлы ниже скопированы из снимка без изменений. Фрагмент по $ref приведён отдельным блоком, схемы не сливаются.
Запрос: main-app://schemas/api_elements/custom_property_option/update_property.request.json
json
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "main-app://schemas/api_elements/custom_property_option/update_property.request.json",
"title": "REQUEST /web_api/custom_property_option/update_property",
"$comment": "Generated from the DB model structure_scheme. Edit the model, then run node fill-from-structure-scheme.mjs.",
"type": "object",
"additionalProperties": false,
"required": [
"custom_property_option_id",
"key",
"value"
],
"properties": {
"custom_property_option_id": {
"type": "integer",
"minimum": 1
},
"key": {
"type": "string",
"enum": [
"option_key",
"label",
"sort_order",
"is_enabled"
]
},
"value": true
}
}Ответ: main-app://schemas/api_elements/custom_property_option/update_property.response.json
json
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "main-app://schemas/api_elements/custom_property_option/update_property.response.json",
"title": "RESPONSE /web_api/custom_property_option/update_property",
"$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/custom_property_option/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/custom_property_option/row.json
json
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "main-app://schemas/api_elements/custom_property_option/row.json",
"title": "Row custom_property_option",
"$comment": "Generated from the DB model structure_scheme. Edit the model, then run node fill-from-structure-scheme.mjs.",
"type": "object",
"additionalProperties": true,
"properties": {
"custom_property_option_id": {
"type": "integer",
"minimum": 0
},
"custom_property_id": {
"type": "integer",
"minimum": 0
},
"option_key": {
"type": "string",
"maxLength": 64,
"pattern": "^[A-Z][A-Z0-9_]*$",
"description": "Latin letters, digits, underscore, uppercase. Unique for the team and element_type."
},
"label": {
"type": "string",
"maxLength": 120
},
"sort_order": {
"type": "integer"
},
"is_enabled": {
"type": "integer"
},
"created_at": {
"type": "string",
"description": "timestamp Y-m-d H:i:s"
},
"updated_at": {
"type": "string",
"description": "timestamp Y-m-d H:i:s"
}
}
}A-Z ↩︎
Страница не помогла?