Skip to content

Fix drf-spectacular schema generation warnings #951

@krmax44

Description

@krmax44

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.

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