Open
Description
https://fastapi-crudrouter.awtkns.com/routing
"Working"
from pydantic import BaseModel
from fastapi import FastAPI
from fastapi_crudrouter import MemoryCRUDRouter as CRUDRouter
class Potato(BaseModel):
id: int
color: str
mass: float
app = FastAPI()
router = CRUDRouter(schema=Potato)
@router.get('')
def overloaded_get_all():
return 'My overloaded route that returns all the items'
@router.get('/{item_id}')
def overloaded_get_one():
return 'My overloaded route that returns one item'
app.include_router(router)
Is it possible to provide an exemple to show what to do with MemoryCRUDRouter instead of a string ?
Regards