Skip to content

Incorrect type hinting for settings.SERVERS #648

Open
@WoosterInitiative

Description

Bug report

What's wrong

When trying to specify SPECTACULAR_SETTINGS["SERVERS"] per Settings mypy complains Error: List item 0 has incompatible type "dict[str, Any]"; expected "str" [list-item]. Per the docs this setting should be a list of dicts.

How is that should be

SPECTACULAR_SETTINGS["SERVERS"] = [{'url': 'https://example.com/v1', 'description': 'Text'}, ...]

That is example from the docs.

System information

  • OS:
  • python version: 3.12.4
  • django version: 4.2.15
  • mypy version: 1.7.1
  • django-stubs version: 5.0.4

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions