# Frontend конфигурация
VITE_DIRECTORY_SCHEMA_TYPES=string,number,integer,boolean
# Backend конфигурация
app.schema-validator.types.directory-allowed-types=string,number,integer,boolean
# Валидация включена по умолчанию
VITE_DIRECTORY_SCHEMA_ENABLE_VALIDATION=true
app.schema-validator.types.directory-allowed-types=string,number,integer,boolean
Проверки на сервере:
• Соответствие типов данных списку разрешенных
• Отсутствие вложенных объектов и массивов
• Отсутствие FK связей
• Валидность индекса
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"title": "Department",
"description": "Справочник отделов компании",
"properties": {
"id": {
"type": "string",
"description": "Уникальный идентификатор отдела",
"x-index": "single_field"
},
"name": {
"type": "string",
"minLength": 1,
"maxLength": 100,
"description": "Название отдела",
"x-index": "text"
},
"code": {
"type": "string",
"pattern": "^[A-Z]{2,10}$",
"description": "Код отдела",
"x-index": "single_field"
},
"active": {
"type": "boolean",
"description": "Активность отдела",
"x-index": "single_field"
},
"order": {
"type": "integer",
"minimum": 0,
"description": "Порядок сортировки"
}
},
"required": ["id", "name", "code"],
"additionalProperties": false
}
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"title": "Status",
"description": "Справочник статусов документов",
"properties": {
"id": {
"type": "string",
"description": "Идентификатор статуса",
"x-index": "single_field"
},
"name": {
"type": "string",
"minLength": 1,
"maxLength": 50,
"description": "Название статуса",
"x-index": "text"
},
"category": {
"type": "string",
"enum": ["draft", "review", "approved", "archived"],
"description": "Категория статуса",
"x-index": "single_field"
},
"priority": {
"type": "integer",
"minimum": 1,
"maximum": 10,
"description": "Приоритет статуса"
},
"final": {
"type": "boolean",
"description": "Финальный статус",
"x-index": "single_field"
}
},
"required": ["id", "name", "category"],
"additionalProperties": false
}
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"title": "Currency",
"description": "Справочник валют",
"properties": {
"code": {
"type": "string",
"pattern": "^[A-Z]{3}$",
"description": "ISO код валюты",
"x-index": "single_field"
},
"name": {
"type": "string",
"minLength": 1,
"maxLength": 100,
"description": "Название валюты",
"x-index": "text"
},
"symbol": {
"type": "string",
"maxLength": 5,
"description": "Символ валюты"
},
"rate": {
"type": "number",
"minimum": 0,
"description": "Курс к базовой валюте"
},
"precision": {
"type": "integer",
"minimum": 0,
"maximum": 4,
"description": "Количество знаков после запятой"
},
"active": {
"type": "boolean",
"description": "Активность валюты",
"x-index": "single_field"
}
},
"required": ["code", "name", "rate", "precision"],
"additionalProperties": false
}
// В схеме документа Employee
"departmentId": {
"type": "string",
"x-directory-collection": "departments",
"x-directory-param": "id",
"description": "Ссылка на справочник отделов"
}
// Поиск по названию отдела
"departmentName": {
"type": "string",
"x-directory-collection": "departments",
"x-directory-param": "name",
"description": "Поиск по названию отдела"
}
POST /sbrs-schema/get-directory-property
Content-Type: application/json
SBRS-Correlation-Id: unique-id
SBRS-Originator: client-name
SBRS-Message-Id: message-id
{
"collectionName": "departments"
}
Response:
{
"id": "string",
"name": "string",
"code": "string"
}
// В схеме документа Order
"status": {
"type": "string",
"x-directory-collection": "statuses",
"x-directory-param": "id",
"description": "ID статуса из справочника"
}
"statusName": {
"type": "string",
"x-directory-collection": "statuses",
"x-directory-param": "name",
"description": "Название статуса для отображения"
}
// Получение доступных параметров справочника
GET /sbrs-schema/get-directory-property
{
"collectionName": "departments"
}
// Ответ содержит список доступных полей:
{
"id": "string",
"name": "string",
"code": "string",
"active": "boolean"
}