Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix drf-spectacular schema generation warnings #951

Open
krmax44 opened this issue Feb 17, 2025 · 0 comments
Open

Fix drf-spectacular schema generation warnings #951

krmax44 opened this issue Feb 17, 2025 · 0 comments

Comments

@krmax44
Copy link
Member

krmax44 commented Feb 17, 2025

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.

@krmax44 krmax44 closed this as completed Feb 24, 2025
@krmax44 krmax44 reopened this Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant