Skip to content

Fix drf-spectacular schema generation warnings #951

Open
@krmax44

Description

We get a lot of warnings when generating OpenAPI schema with drf-spectacular:

Schema generation summary:
Warnings: 85 (77 unique)
Errors:   0 (0 unique)

Example:

Warning [FoiAttachmentViewSet > FoiAttachmentSerializer]: unable to resolve type hint for function "is_image". Consider using a type hint or @extend_schema_field. Defaulting to string.

Adding some type hints and applying @extend_schema should to the trick.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions