Skip to content

Commit 8527803

Browse files
omars44yuval9313
andauthored
docs: remove refs to InferringRouter as it is deprecated (#239)
* docs: remove references to inferring router as it was replaced by APIRouter * docs/src: fix missing import --------- Co-authored-by: Yuval Levi <[email protected]>
1 parent 270b995 commit 8527803

File tree

5 files changed

+2
-85
lines changed

5 files changed

+2
-85
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ This package includes a number of utilities to help reduce boilerplate and reuse
4141

4242
* **Resource Class**: Create CRUD with ease the OOP way with `Resource` base class that lets you implement methods quick.
4343
* **Class Based Views**: Stop repeating the same dependencies over and over in the signature of related endpoints.
44-
* **Response-Model Inferring Router**: Let FastAPI infer the `response_model` to use based on your return type annotation.
4544
* **Repeated Tasks**: Easily trigger periodic tasks on server startup
4645
* **Timing Middleware**: Log basic timing information for every request
4746
* **OpenAPI Spec Simplification**: Simplify your OpenAPI Operation IDs for cleaner output from OpenAPI Generator

docs/src/class_based_views2.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@
22
from uuid import UUID
33

44
import sqlalchemy as sa
5-
from fastapi import Depends, FastAPI, Header, HTTPException
5+
from fastapi import Depends, FastAPI, Header, HTTPException, APIRouter
66
from sqlalchemy.orm import Session, declarative_base
77
from starlette.status import HTTP_403_FORBIDDEN, HTTP_404_NOT_FOUND
88

99
from fastapi_restful.api_model import APIMessage, APIModel
1010
from fastapi_restful.cbv import cbv
1111
from fastapi_restful.guid_type import GUID
12-
from fastapi_restful.inferring_router import InferringRouter
1312

1413
# Begin Setup
1514
UserID = NewType("UserID", UUID)
@@ -54,7 +53,7 @@ def get_owned_item(session: Session, owner: UserID, item_id: ItemID) -> ItemORM:
5453

5554
# End Setup
5655
app = FastAPI()
57-
router = InferringRouter() # Step 1: Create a router
56+
router = APIRouter() # Step 1: Create a router
5857

5958

6059
@cbv(router) # Step 2: Create and decorate a class to hold the endpoints

docs/src/inferring_router2.py

Lines changed: 0 additions & 33 deletions
This file was deleted.

docs/user-guide/inferring-router.md

Lines changed: 0 additions & 47 deletions
This file was deleted.

mkdocs.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ nav:
1818
- User Guide:
1919
- Class Resource: 'user-guide/class-resource.md'
2020
- Class Based Views: 'user-guide/class-based-views.md'
21-
- Inferring Router: 'user-guide/inferring-router.md'
2221
- Repeated Tasks: 'user-guide/repeated-tasks.md'
2322
- Timing Middleware: 'user-guide/timing-middleware.md'
2423
- SQLAlchemy Sessions: 'user-guide/session.md'

0 commit comments

Comments
 (0)