mirror of
https://github.com/d3vyce/fastapi-toolsets.git
synced 2026-03-02 09:20:47 +01:00
chore: documentation (#76)
* chore: update docstring example to use python code block * docs: add documentation * feat: add docs build + fix other workdlows * fix: add missing return type
This commit is contained in:
@@ -38,12 +38,14 @@ def PathDependency(
|
||||
NotFoundError: If no matching record is found
|
||||
|
||||
Example:
|
||||
```python
|
||||
UserDep = PathDependency(User, User.id, session_dep=get_db)
|
||||
|
||||
@router.get("/user/{id}")
|
||||
async def get(
|
||||
user: User = UserDep,
|
||||
): ...
|
||||
```
|
||||
"""
|
||||
crud = CrudFactory(model)
|
||||
name = (
|
||||
@@ -102,6 +104,7 @@ def BodyDependency(
|
||||
NotFoundError: If no matching record is found
|
||||
|
||||
Example:
|
||||
```python
|
||||
UserDep = BodyDependency(
|
||||
User, User.ctfd_id, session_dep=get_db, body_field="user_id"
|
||||
)
|
||||
@@ -110,6 +113,7 @@ def BodyDependency(
|
||||
async def assign(
|
||||
user: User = UserDep,
|
||||
): ...
|
||||
```
|
||||
"""
|
||||
crud = CrudFactory(model)
|
||||
python_type = field.type.python_type
|
||||
|
||||
Reference in New Issue
Block a user