Skip to content

AttributeError: 'foo' object has no attribute 'required_scopes' #26

@jayvdb

Description

@jayvdb

I am seeing a lot of occurrences of this

  File "/usr/local/lib/python3.6/site-packages/drf_spectacular/openapi.py", line 265, in get_auth
    auths.append(scheme.get_security_requirement(self.view))
  File "/usr/local/lib/python3.6/site-packages/drf_spectacular/contrib/authentication.py", line 32, in get_security_requirement
    return {self.name: view.required_scopes}
AttributeError: 'api_root' object has no attribute 'required_scopes'

That is the django-oscar-api, but it is so many others also.

Would it be possible for this to trigger a warning, and affected parts of the API to be discarded from the schema?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions