-
Notifications
You must be signed in to change notification settings - Fork 433
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
ReDoc ImageField not displayed #95
Comments
Without the generated swagger YAML or JSON, I couldn't tell. However given that |
In definitions I could find AvatarUpdate:
type: object
properties:
avatar:
title: Avatar
type: string
readOnly: true
format: uri That means it's ReDoc issue I suppose. |
Actually, no. It seems to be a problem with the swagger generation (this library) - the field is marked as To get |
I tried that, with no success. Could it be because of generics? I could be using this completely wrong class UpdateAvatarView(generics.UpdateAPIView):
""" Upload users avatar """
serializer_class = AvatarUpdateSerializer
http_method_names = ['patch']
permission_classes = (
permissions.IsAuthenticated,
client_permissions.IsClient)
def get_object(self, *args, **kwargs):
return self.request.user
@swagger_auto_schema(responses={200: UserSerializer()})
@detail_route(methods=['patch'], parser_classes=(MultiPartParser,))
def patch(self, request, *args, **kwargs):
return self.update(request, *args, **kwargs) |
Yes, you are 😄 . You should just set |
This worked: @parser_classes((MultiPartParser,))
class UpdateAvatarView(generics.UpdateAPIView): I don't actually use any Thanks for your help |
Decorating the class is not necessary
|
Yeah, that's an even better solution. Thanks |
I have the following serializer, which will show
avatar
field in Swagger, but not ReDocScreenshots
Is this an issue with this library or ReDoc?
The text was updated successfully, but these errors were encountered: