Skip to content
This repository has been archived by the owner on Nov 10, 2024. It is now read-only.

Commit

Permalink
docs: remove refs to InferringRouter as it is deprecated (#239)
Browse files Browse the repository at this point in the history
* docs: remove references to inferring router as it was replaced by APIRouter

* docs/src: fix missing import

---------

Co-authored-by: Yuval Levi <[email protected]>
  • Loading branch information
omars44 and yuval9313 authored Oct 11, 2023
1 parent 270b995 commit 8527803
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 85 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ This package includes a number of utilities to help reduce boilerplate and reuse

* **Resource Class**: Create CRUD with ease the OOP way with `Resource` base class that lets you implement methods quick.
* **Class Based Views**: Stop repeating the same dependencies over and over in the signature of related endpoints.
* **Response-Model Inferring Router**: Let FastAPI infer the `response_model` to use based on your return type annotation.
* **Repeated Tasks**: Easily trigger periodic tasks on server startup
* **Timing Middleware**: Log basic timing information for every request
* **OpenAPI Spec Simplification**: Simplify your OpenAPI Operation IDs for cleaner output from OpenAPI Generator
Expand Down
5 changes: 2 additions & 3 deletions docs/src/class_based_views2.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@
from uuid import UUID

import sqlalchemy as sa
from fastapi import Depends, FastAPI, Header, HTTPException
from fastapi import Depends, FastAPI, Header, HTTPException, APIRouter
from sqlalchemy.orm import Session, declarative_base
from starlette.status import HTTP_403_FORBIDDEN, HTTP_404_NOT_FOUND

from fastapi_restful.api_model import APIMessage, APIModel
from fastapi_restful.cbv import cbv
from fastapi_restful.guid_type import GUID
from fastapi_restful.inferring_router import InferringRouter

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

# End Setup
app = FastAPI()
router = InferringRouter() # Step 1: Create a router
router = APIRouter() # Step 1: Create a router


@cbv(router) # Step 2: Create and decorate a class to hold the endpoints
Expand Down
33 changes: 0 additions & 33 deletions docs/src/inferring_router2.py

This file was deleted.

47 changes: 0 additions & 47 deletions docs/user-guide/inferring-router.md

This file was deleted.

1 change: 0 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ nav:
- User Guide:
- Class Resource: 'user-guide/class-resource.md'
- Class Based Views: 'user-guide/class-based-views.md'
- Inferring Router: 'user-guide/inferring-router.md'
- Repeated Tasks: 'user-guide/repeated-tasks.md'
- Timing Middleware: 'user-guide/timing-middleware.md'
- SQLAlchemy Sessions: 'user-guide/session.md'
Expand Down

0 comments on commit 8527803

Please sign in to comment.