Skip to content

docs: fix FromDI facts in README - #62

Merged
lesnik512 merged 1 commit into
mainfrom
docs/fix-facts
Oct 3, 2026
Merged

lesnik512 merged 1 commit into
mainfrom
docs/fix-facts

Conversation

@lesnik512

Copy link
Copy Markdown
Member

Summary

Fix README statements that do not match the code.

Changes

  • Usage intro said setup_di "builds a per-connection child container automatically". setup_di (modern_di_fastapi/main.py:54-58) only stores the container, registers the context providers and composes the lifespan. The child is built on demand by Depends(build_di_container) inside FromDI (main.py:74-77), so only routes that use FromDI get one.
  • API table: FromDI(provider, ...) -> FromDI(dependency, ...), matching the signature at main.py:80.
  • API table: removed an em dash in the build_di_container row; added the scope to the fastapi_request_provider (REQUEST) and fastapi_websocket_provider (SESSION) rows (main.py:14-15), as the aiohttp and starlette READMEs do.
  • Footer: "with IoC container" -> "with an IoC container"; replaced the em dash in the org link line.

Checklist

  • Lint and format pass (ruff)
  • Type check passes (ty)
  • Tests pass and new behavior is covered (docs only, no behavior change)
  • Build succeeds (uv build) if packaging or build config changed
  • Repo metadata stays consistent across the three surfaces (GitHub description, pyproject description, profile blurb) if this touches packaging

- setup_di does not build child containers; FromDI builds one on demand
- FromDI parameter is named dependency
- add scopes to context-provider rows, drop em dash
- footer wording
@lesnik512
lesnik512 merged commit 4cf89f7 into main Oct 3, 2026
14 checks passed
@lesnik512
lesnik512 deleted the docs/fix-facts branch October 3, 2026 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant