{
    "swagger": "2.0",
    "info": {
        "description": "Публичное HTTP API sinde.ru. Мутирующие запросы аутентифицированной зоны требуют cookie-сессию и заголовок X-CSRF-Token.",
        "title": "SINDE API",
        "contact": {},
        "version": "1.0"
    },
    "basePath": "/",
    "paths": {
        "/api/v1/admin/minerals": {
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "minerals"
                ],
                "summary": "Создать минерал",
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/admin/minerals/{database_id}": {
            "put": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "minerals"
                ],
                "summary": "Обновить минерал",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "ID минерала в базе",
                        "name": "database_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "minerals"
                ],
                "summary": "Удалить минерал",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "ID минерала в базе",
                        "name": "database_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/admin/minerals/{database_id}/images": {
            "post": {
                "consumes": [
                    "multipart/form-data"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "minerals"
                ],
                "summary": "Загрузить изображение в галерею минерала",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "ID минерала в базе",
                        "name": "database_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "file",
                        "description": "Исходное изображение",
                        "name": "file",
                        "in": "formData",
                        "required": true
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "minerals"
                ],
                "summary": "Удалить изображение из галереи минерала",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "ID минерала в базе",
                        "name": "database_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Имя файла в галерее",
                        "name": "file",
                        "in": "query",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/admin/minerals/{database_id}/images/order": {
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "minerals"
                ],
                "summary": "Изменить порядок изображений в галерее минерала",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "ID минерала в базе",
                        "name": "database_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/admin/substances": {
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "substances"
                ],
                "summary": "Создать вещество",
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/admin/substances/{slug}": {
            "put": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "substances"
                ],
                "summary": "Обновить вещество",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Slug вещества",
                        "name": "slug",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "substances"
                ],
                "summary": "Удалить вещество",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Slug вещества",
                        "name": "slug",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/admin/substances/{slug}/images": {
            "post": {
                "consumes": [
                    "multipart/form-data"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "substances"
                ],
                "summary": "Загрузить изображение в галерею вещества",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Slug вещества",
                        "name": "slug",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "file",
                        "description": "Исходное изображение",
                        "name": "file",
                        "in": "formData",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Название снимка",
                        "name": "title",
                        "in": "formData"
                    },
                    {
                        "type": "string",
                        "description": "Ссылка на источник",
                        "name": "source_url",
                        "in": "formData"
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "substances"
                ],
                "summary": "Удалить изображение из галереи вещества",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Slug вещества",
                        "name": "slug",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Имя файла в галерее",
                        "name": "file",
                        "in": "query",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            },
            "patch": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "substances"
                ],
                "summary": "Обновить подписи изображения",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Slug вещества",
                        "name": "slug",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/admin/substances/{slug}/images/order": {
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "substances"
                ],
                "summary": "Изменить порядок изображений в галерее вещества",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Slug вещества",
                        "name": "slug",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/auth/admin/keys/meta/update": {
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "keys"
                ],
                "summary": "Обновить meta ключа по ID (только администратор)",
                "parameters": [
                    {
                        "description": "id, meta",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "type": "object"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/auth/admin/keys/{keyId}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "auth-admin"
                ],
                "summary": "Ключ особенности по ID (только администратор)",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "ID ключа",
                        "name": "keyId",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/auth/admin/keys/{keyId}/merge": {
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "auth-admin"
                ],
                "summary": "Слить ключ-дубликат в канонический (только администратор)",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "ID удаляемого ключа-дубликата",
                        "name": "keyId",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "target_key_id, dry_run",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "type": "object"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/auth/admin/mail/messages": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "mail"
                ],
                "summary": "Список входящих писем",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Фильтр по ящику",
                        "name": "mailbox",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Лимит",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Смещение",
                        "name": "offset",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/auth/admin/mail/messages/{message_id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "mail"
                ],
                "summary": "Письмо целиком",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID письма",
                        "name": "message_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/auth/admin/mail/messages/{message_id}/attachments/{object_id}": {
            "get": {
                "produces": [
                    "application/octet-stream"
                ],
                "tags": [
                    "mail"
                ],
                "summary": "Скачать вложение письма",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID письма",
                        "name": "message_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "ID объекта вложения",
                        "name": "object_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "file"
                        }
                    }
                }
            }
        },
        "/api/v1/auth/admin/sets": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "auth-admin"
                ],
                "summary": "Наборы особенностей (только администратор)",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Универсальный поиск: UUID, сохранения, содержимое",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Размер страницы",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Смещение",
                        "name": "offset",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/auth/admin/sets/{uuid}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "auth-admin"
                ],
                "summary": "Узел DAG наборов со всеми связями (только администратор)",
                "parameters": [
                    {
                        "type": "string",
                        "description": "UUID узла (набор или значение)",
                        "name": "uuid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/auth/admin/values": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "auth-admin"
                ],
                "summary": "Значения особенностей плоским списком (только администратор)",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Подстрока значения или названия ключа",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Ограничить одним ключом",
                        "name": "key",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Фильтр по метке ключа: verified|unverified",
                        "name": "verified",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Размер страницы",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Смещение",
                        "name": "offset",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/chemistry/elements": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "chemistry"
                ],
                "summary": "Список химических элементов",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/keys/enum/options": {
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "keys"
                ],
                "summary": "Enum-опции по syn",
                "parameters": [
                    {
                        "description": "syn",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "type": "object"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/keys/meta": {
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "keys"
                ],
                "summary": "Meta ключа по одному syn",
                "parameters": [
                    {
                        "description": "syn",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "type": "object"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/keys/meta/all": {
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "keys"
                ],
                "summary": "Все meta по списку syn",
                "parameters": [
                    {
                        "description": "syns: список синонимов",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "type": "object"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/keys/meta/bulk": {
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "keys"
                ],
                "summary": "Meta по списку ID",
                "parameters": [
                    {
                        "description": "ids: список ID ключей",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "type": "object"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/materials": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "materials"
                ],
                "summary": "Список материалов: поиск и фильтры",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Поисковая строка",
                        "name": "q",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/materials/meta": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "materials"
                ],
                "summary": "Свойства и категории материалов",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/materials/{slug}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "materials"
                ],
                "summary": "Карточка материала",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Slug материала",
                        "name": "slug",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/minerals": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "minerals"
                ],
                "summary": "Список минералов: поиск и фильтры",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Поисковая строка",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Страница",
                        "name": "page",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Доп. поля через запятую: preview_image, crystal_systems",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Считать фасеты по химическим элементам",
                        "name": "facets",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/minerals/{database_id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "minerals"
                ],
                "summary": "Карточка минерала",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID минерала в базе",
                        "name": "database_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/sets": {
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "sets"
                ],
                "summary": "Создать набор особенностей",
                "parameters": [
                    {
                        "description": "childs: список t_uuid",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "type": "object"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/sets/find": {
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "sets"
                ],
                "summary": "Найти или создать набор по списку особенностей",
                "parameters": [
                    {
                        "description": "childs: список t_uuid",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "type": "object"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/sets/{uuid}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "sets"
                ],
                "summary": "Получить набор по UUID",
                "parameters": [
                    {
                        "type": "string",
                        "description": "UUID набора",
                        "name": "uuid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/sets/{uuid}/stream": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "sets"
                ],
                "summary": "Потоковая выдача набора (NDJSON)",
                "parameters": [
                    {
                        "type": "string",
                        "description": "UUID набора",
                        "name": "uuid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/substances": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "substances"
                ],
                "summary": "Список веществ: поиск и фильтры",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Поисковая строка",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Классы веществ через запятую",
                        "name": "kind",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Верхний уровень классификации: pure или mixture",
                        "name": "group",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/substances/{slug}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "substances"
                ],
                "summary": "Карточка вещества",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Slug вещества",
                        "name": "slug",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/traits": {
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "traits"
                ],
                "summary": "Создать особенность или вернуть существующую",
                "parameters": [
                    {
                        "description": "t_key, t_value, meta (опционально)",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "type": "object"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/traits/resolve/{uuid}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "traits"
                ],
                "summary": "Разрешить UUID в особенность или набор",
                "parameters": [
                    {
                        "type": "string",
                        "description": "UUID особенности или набора",
                        "name": "uuid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/v1/traits/{uuid}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "traits"
                ],
                "summary": "Получить особенность по UUID",
                "parameters": [
                    {
                        "type": "string",
                        "description": "UUID особенности",
                        "name": "uuid",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/healthz": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "health"
                ],
                "summary": "Liveness-проба",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/internal/mail/ingest": {
            "post": {
                "consumes": [
                    "application/octet-stream"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "mail"
                ],
                "summary": "Приём письма от postfix-inbound (внутренний)",
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/readyz": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "health"
                ],
                "summary": "Readiness-проба (Postgres, Redis)",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "503": {
                        "description": "Service Unavailable",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        }
    }
}