-
Notifications
You must be signed in to change notification settings - Fork 183
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
MPP-3786: Add type hints, make changes for browsable API #4590
Conversation
These properties are used in the API, and the hints are used by drf_spectacular for documentation. This includes the suggest change in Profile.emails_replied to use the default=0 parameter available in Django 4.2.
Add type annotations and return Model.objects.none(), so that drf_spectacular can determine the QuerySet type outside of an authenticated request.
65a07b9
to
518bba9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question (blocking): are you sure it's the drf_spectacular.W002
warnings that are supposed to go away? When I ran the check
on this branch, all the drf_spectacular.W001
warnings went away, but the W002
warnings are still there.
🤦 yep, you are correct, it is the |
@@ -0,0 +1,39 @@ | |||
"""Schema Extensions for drf-spectacular""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make changes to make
drf_spectacular
a bit happier.How to test:
./manage.py check --deploy
onmain
. See lots ofdrf_spectacular.W001
anddrf_spectacular.W002
warnings../manage.py check --deploy
on this branch. See nodrf_spectacular.W001
warnings, butdrf_spectacular.W002
warnings remain.