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