Skip to content

drf-spectacular support #13

@jayvdb

Description

@jayvdb

https://github.com/tfranzel/drf-spectacular does a good job of openapi schema generation, however it has a few errors and warnings for django-rest-invitations . They all relate to using APIView, and the DRF decorators for it like @api_view. These can be fixed by using the DRF GenericAPIView.

Error #5: Unable to guess serializer for accept_invitation. This is graceful fallback handling for APIViews. Consider using GenericAPIView as view base class, if view is under your control. ignoring view for now. 
Warning #10: could not derive type of path parameter "key" because <class 'rest_invitations.views.WrappedAPIView'> has no queryset. consider annotating the parameter type with @extend_schema. defaulting to "string".
Warning #11: could not resolve "None" for GET /email-invite/invitations/accept-invite/{key}/. Expected either a serializer or some supported override mechanism. defaulting to generic free-form object.
Warning #12: could not resolve request body for POST /email-invite/invitations/accept-invite/{key}/. defaulting to generic free-form object. (maybe annotate a Serializer class?)
Warning #13: could not resolve "None" for POST /email-invite/invitations/accept-invite/{key}/. Expected either a serializer or some supported override mechanism. defaulting to generic free-form object.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions