Skip to content

Support for integration with drf-spectacular #221

@DvaMishkiLapa

Description

@DvaMishkiLapa

I've seen a lot of references to drf-spectacular:

But, using the latest version of drf-spectacular in my project, in conjunction with django-trench, I get a lot of warnings about lack of serializers:

/usr/local/lib/python3.11/site-packages/trench/views/base.py: Error [MFAMethodActivationView]: 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.
/usr/local/lib/python3.11/site-packages/trench/views/base.py: Error [MFAMethodConfirmActivationView]: 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.
/usr/local/lib/python3.11/site-packages/trench/views/base.py: Error [MFAMethodBackupCodesRegenerationView]: 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.
/usr/local/lib/python3.11/site-packages/trench/views/base.py: Error [MFAMethodDeactivationView]: 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.
/usr/local/lib/python3.11/site-packages/trench/views/base.py: Error [MFAMethodRequestCodeView]: 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.
/usr/local/lib/python3.11/site-packages/trench/views/jwt.py: Error [MFAFirstStepJWTView]: 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.
/usr/local/lib/python3.11/site-packages/trench/views/jwt.py: Error [MFASecondStepJWTView]: 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.
/usr/local/lib/python3.11/site-packages/trench/views/base.py: Error [MFAPrimaryMethodChangeView]: 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.
/usr/local/lib/python3.11/site-packages/trench/views/base.py: Error [MFAConfigView]: 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.

I see the needed changes in Swagger UI, but they are not fully customized - missing request bodies, any description.
How much drf-spectacular support is there now? Are there any solutions to the problem I've encountered?

My approximate environment, to understand the situation:

dj-rest-auth==5.0.0
Django==4.2.5
django-allauth==0.55.2
django-cors-headers==4.2.0
django-extensions==3.2.3
django-otp==1.2.2
django-trench==0.3.1
djangorestframework==3.14.0
djangorestframework-simplejwt==5.3.0
drf-spectacular==0.26.4
jsonschema==4.19.0
jsonschema-specifications==2023.7.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions