Yet another Swagger generator
๐ก drf_yasg
ํ๋ผ๋ฏธํฐ๊ฐ ํ์ํ GET์์ฒญ์ ํ ๋๋ ์คํค๋ง๋ฅผ ์์ฑํด์ฃผ์ด์ผ ํ๋ค๊ณ ํ๋ค.
๋ง์ฝ, ํ๋ง๋ฆฌํฐ๊ฐ ๋ฐ๋ก ์๋ค๋ฉด, class ์ def ์ฌ์ด์ ์๋ ์ฝ๋๋ ์์ฑํ์ง ์์๋ ๋๋ค.
์์๋ฐ๋ ํด๋์ค๋ APIView์ด์ด์ผ ํ๋ค. (APIView๋ฅผ ์์๋ฐ๋ ํด๋์ค๋ ๊ฐ๋ฅ)
class VerifyEmail(views.APIView):
serializer_class = EmailVerificationSerializer
# ํ๋ผ๋ฏธํฐ ์ค์ .
token_param_config = openapi.Parameter(
'token',
in_=openapi.IN_QUERY,
description='Bearer token',
type=openapi.TYPE_STRING
)
@swagger_auto_schema(manual_parameters=[token_param_config])
def get(self, request):
pass