cognee_http_server/dto/mod.rs
1//! Data Transfer Objects (DTOs) for the cognee HTTP server.
2//!
3//! Each file corresponds to one router family.
4//!
5//! # Wire-convention contract (Decision 10, polarity-corrected 2026-04-29)
6//!
7//! Every request/response DTO whose Python counterpart inherits
8//! `cognee.api.DTO.InDTO` or `OutDTO` uses `#[serde(rename_all = "camelCase")]`
9//! because Python's `alias_generator=to_camel` emits camelCase on the wire.
10//! Request DTOs additionally apply `#[serde(alias = "<snake_form>")]` per
11//! multi-word field for input compatibility with Python's
12//! `populate_by_name=True`.
13//!
14//! The rule does **not** apply to:
15//!
16//! - **Plain-dict response bodies** built via `JSONResponse(content={...})` or
17//! returned as raw `dict[str, Any]` from a handler (e.g. the `forget`
18//! response variants, `RememberResultDTO`, the permissions response DTOs,
19//! `pipeline_run` info dicts, `auth` user/token responses). Their wire
20//! shape is the literal Python key names — usually snake_case — because
21//! FastAPI's `jsonable_encoder` does not synthesize aliases for plain
22//! dicts.
23//! - **Bare `BaseModel` subclasses** (no alias_generator applied) such as the
24//! `responses` module helpers (`Function`, `ToolCall`, `ChatUsage`, …),
25//! the notebooks `NotebookCell`, the `pipelines.PipelineRunInfo` family,
26//! etc. These keep snake_case literal field names on the wire.
27//! - **Third-party Pydantic models** from `fastapi-users` (`BaseUser`,
28//! `BaseUserUpdate`, `BearerResponse`, …): they have no alias_generator
29//! and emit snake_case literal field names.
30//! - **Query parameters** declared at the FastAPI function signature — FastAPI
31//! does not apply `alias_generator` here. Wire name equals the Python
32//! parameter name.
33//! - **Multipart form fields** declared at the function signature — wire name
34//! equals the literal Python parameter name (Python intentionally mixes
35//! camelCase and snake_case for these).
36//! - **HTTP headers and URL path parameters** — always literal.
37//!
38//! The convention is enforced by the workspace test
39//! `crates/http-server/tests/test_openapi_camelcase.rs`, which walks every
40//! component schema in the generated OpenAPI document and asserts each
41//! property name is camelCase. The whitelist there enumerates every
42//! exception above.
43
44pub mod activity;
45pub mod add;
46pub mod api_keys;
47pub mod auth;
48pub mod auth_register;
49pub mod auth_reset_password;
50pub mod auth_verify;
51pub mod checks;
52pub mod cognify;
53pub mod configuration;
54pub mod datasets;
55pub mod delete;
56pub mod forget;
57pub mod improve;
58pub mod llm;
59pub mod memify;
60pub mod notebooks;
61pub mod ontologies;
62pub mod permissions;
63pub mod pipeline_run;
64pub mod recall;
65pub mod remember;
66pub mod remember_entry;
67pub mod responses;
68pub mod search;
69pub mod sessions;
70pub mod settings;
71pub mod sync;
72pub mod update;
73pub mod users;
74pub mod users_by_email;
75pub mod util;
76pub mod visualize;