Skip to content

Падать при ворнингах в генерации свагера #2626

Open
@f213

Description

@f213

Сейчас, если зайти в свагер, можно увидеть ошибки при его генерации:

[20/May/2025 20:30:18] "GET /api/v2/docs/swagger/ HTTP/1.1" 200 16898
/Users/f213/prj/education/backend/src/apps/a12n/api/views.py: Error [ObtainJSONWebTokenViaUserId]: unable to guess serializer. This is graceful fallback handling for APIViews. Consider using GenericAPIView as view base class, if view is under your control. Either way you may want to add a serializer_class (or method). Ignoring view for now.
/Users/f213/prj/education/backend/src/apps/a12n/api/views.py: Error [ObtainJSONWebTokenViaPasswordlessToken]: unable to guess serializer. This is graceful fallback handling for APIViews. Consider using GenericAPIView as view base class, if view is under your control. Either way you may want to add a serializer_class (or method). Ignoring view for now.
/Users/f213/prj/education/backend/src/apps/a12n/api/views.py: Error [RequestPasswordLessToken]: unable to guess serializer. This is graceful fallback handling for APIViews. Consider using GenericAPIView as view base class, if view is under your control. Either way you may want to add a serializer_class (or method). Ignoring view for now.
/Users/f213/prj/education/backend/src/apps/tinkoff/api/views.py: Error [DolyameNotificationsView]: unable to guess serializer. This is graceful fallback handling for APIViews. Consider using GenericAPIView as view base class, if view is under your control. Either way you may want to add a serializer_class (or method). Ignoring view for now.
/Users/f213/prj/education/backend/src/apps/stripebank/api/views.py: Error [StripeWebhookUSDView]: unable to guess serializer. This is graceful fallback handling for APIViews. Consider using GenericAPIView as view base class, if view is under your control. Either way you may want to add a serializer_class (or method). Ignoring view for now.
/Users/f213/prj/education/backend/src/apps/stripebank/api/views.py: Error [StripeWebhookKZTView]: unable to guess serializer. This is graceful fallback handling for APIViews. Consider using GenericAPIView as view base class, if view is under your control. Either way you may want to add a serializer_class (or method). Ignoring view for now.
/Users/f213/prj/education/backend/src/apps/tinkoff/api/views.py: Error [TinkoffPaymentNotificationsView]: unable to guess serializer. This is graceful fallback handling for APIViews. Consider using GenericAPIView as view base class, if view is under your control. Either way you may want to add a serializer_class (or method). Ignoring view for now.
/Users/f213/prj/education/backend/src/apps/orders/api/views.py: Error [OrderConfirmationView]: exception raised while getting serializer. Hint: Is get_serializer_class() returning None or is get_queryset() not working without a request? Ignoring the view for now. (Exception: 'OrderConfirmationView' should either include a `serializer_class` attribute, or override the `get_serializer_class()` method.)
[20/May/2025 20:30:19] "GET /api/v2/docs/schema/ HTTP/1.1" 200 118576

Эти ошибки копятся — бывает, забываешь посмотреть в свагер, когда добавляешь вьюху, особенно служебную. Надо либо написать тест, либо отдельную команду, который падал бы при появлении таких ворнингов — чтобы в мастер нельзя было запушить код, который генерит ошибки в свагере.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions