How can I define in my rest framework API that a models receives an ImageField attribute and Swagger recognize it when I generate the client services (typescript-angular)?
I have this model:
class User(models.Model):
avatar = models.ImageField(upload_to='avatars')
name = models.CharField(max_length=20)
this serializer:
class UserSerializer(serializers.ModelSerializer):
class Meta:
model = User
fields = '__all__'
this viewset:
class UserViewSet(viewsets.ModelViewSet):
queryset = User.objects.all()
serializer_class = UserSerializer
How can I define in my rest framework API that a models receives an ImageField attribute and Swagger recognize it when I generate the client services (typescript-angular)? I have this model:
this serializer:
this viewset: