-
Notifications
You must be signed in to change notification settings - Fork 440
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
Unable to declare ImageField as required #332
Comments
A request body can only contain files when it has the multipart content type. You need to set the view parser_classes to |
@axnsan12 It sounds like This SO post explains the problem and |
That is indeed the case. The field you linked breaks the contract of FileField by making it accept a string instead of an UploadedFile. You can work around this with a custom |
@axnsan12 I'd like to try to fix this for Thanks! |
PR with doc fix for this issue: #445 |
Cross posted from Hipo/drf-extra-fields#66
My model:
My serializer:
My swagger view:
How can I make the
ImageField
as required in swagger POST request?In the other thread we seem to have narrowed the problem down to
drf-yasg
, testing withdrf-yasg==1.13.0
.The text was updated successfully, but these errors were encountered: