add swagger docs to signin and signup endooints

This commit is contained in:
Timur Kh.
2025-02-28 21:51:19 +03:00
parent 5fece08457
commit a066c9a8b5
9 changed files with 82 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
from ninja import Router
from api.v1.users.schemas import LoginSchema, RegisterSchema, TokenSchema
from api.v1.schemas import BadRequestError, ForbiddenError
from apps.users.models import User
router = Router(tags=["users"])
@router.post(
path="/sign-up",
response={
201: TokenSchema,
400: BadRequestError,
}
)
def sign_up(data: RegisterSchema):
...
@router.post(
path="/sign-in",
response={
200: TokenSchema,
400: BadRequestError,
403: ForbiddenError,
}
)
def sign_in(data: LoginSchema):
...