diff --git a/.flake8 b/.flake8 index 302b8a9..aa1ae33 100644 --- a/.flake8 +++ b/.flake8 @@ -40,13 +40,7 @@ ignore = WPS473, ; Found too many arguments WPS211, - ; Found local folder import - WPS300, - ; multiple statements on one line (colon) - E701, - ; Found incorrect node inside `class` body - WPS604, - + per-file-ignores = ; all tests test_*.py,tests.py,tests_*.py,*/tests/*,conftest.py: diff --git a/app/v1/routers/__init__.py b/app/v1/routers/__init__.py index 5f6e1d7..ad4ee1d 100644 --- a/app/v1/routers/__init__.py +++ b/app/v1/routers/__init__.py @@ -1,4 +1,3 @@ -from .base import router +__all__ = ["router"] - -__all__ = ("router",) +from app.v1.routers.base import router diff --git a/app/v1/routers/base.py b/app/v1/routers/base.py index 1c117d7..279eabf 100644 --- a/app/v1/routers/base.py +++ b/app/v1/routers/base.py @@ -1,6 +1,6 @@ from fastapi import APIRouter -from .dummy import router as dummy_router +from app.v1.routers.dummy import router as dummy_router router = APIRouter(prefix="/v1") diff --git a/app/v1/routers/dummy.py b/app/v1/routers/dummy.py index f7d0b1a..58e78df 100644 --- a/app/v1/routers/dummy.py +++ b/app/v1/routers/dummy.py @@ -6,6 +6,6 @@ router = APIRouter() -@router.post("/capitalize", response_model=dummy_serializer.CapitalizeOut) -async def capitalize(request: dummy_serializer.CapitalizeIn) -> dict[str, str]: - return {"text": request.text.upper()} +@router.post("/capitalize") +async def capitalize(request: dummy_serializer.Capitalize) -> dummy_serializer.Capitalize: + return dummy_serializer.Capitalize(text=request.text.upper()) diff --git a/app/v1/serializers/__init__.py b/app/v1/serializers/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/app/v1/serializers/dummy.py b/app/v1/serializers/dummy.py index 2ace97f..f9a32a1 100644 --- a/app/v1/serializers/dummy.py +++ b/app/v1/serializers/dummy.py @@ -1,11 +1,5 @@ from pydantic import BaseModel -class BaseCapitalize(BaseModel): +class Capitalize(BaseModel): text: str - - -class CapitalizeIn(BaseCapitalize): ... - - -class CapitalizeOut(BaseCapitalize): ...