Files
Nicolò Boschi ef3ccdba3a fix(api): type the list and graph rows instead of returning bare dicts (#4218) (#4233)
* fix(api): type the list and graph rows instead of returning bare dicts (#4218)

`list_memories`, `list_documents`, `get_graph` and `get_entity_graph` declared
their rows as `dict[str, Any]`, so every generated SDK handed callers untyped
dicts while the single-fetch siblings returned real models — `listing.items[0].id`
failed with an `AttributeError` and a server-side rename became a runtime
`KeyError` rather than a build error.

Each row now has a model (`DocumentListItem`, `MemoryUnitListItem`, the Cytoscape
node/edge envelopes and `MemoryGraphTableRow`), sharing an `OpenRowModel` base
that keeps the wire byte-identical:

- `extra="allow"`, so a key the server emits and the model does not declare still
  reaches the client — a memories store that owns its own document or entity
  registry builds these rows itself.
- the routes keep emitting nulls. `ExcludeNoneRoute` was already enabling
  `response_model_exclude_none` for them, but `exclude_none` never reached inside
  a `dict` value, so the rows' nulls were always on the wire; typing them would
  have started dropping those keys.

`additionalProperties` is stripped from the published schema: openapi-generator
7.10.0's Python generator crashes on a schema pairing it with a nullable `anyOf`
property, which every row here has.

The CLI moves to attribute access, which exposes a latent bug in `bank graph`:
its node lookups read `node["type"]`/`node["id"]` through the Cytoscape `data`
envelope, so the sample always printed "unknown [unknown]" with no text.

* docs(examples): read list rows by attribute now that they are typed
2026-09-08 18:48:52 +02:00
..