from rest_framework import serializers

from .models import Upload


class UploadSerializer(serializers.ModelSerializer):
    class Meta:
        model = Upload
        fields = '__all__'

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.fields['guid'].required = True

from rest_framework import serializers

from .models import Upload


class UploadSerializer(serializers.ModelSerializer):
    class Meta:
        model = Upload
        fields = '__all__'

    def __init__(self, *args, **kwargs):
        '''
        Add required marker, so OpenAPI schema generator can remove it again
        -.-
        '''
        super().__init__(*args, **kwargs)
        self.fields['guid'].required = True

Add some documentation for weird init
Add some documentation for weird init
  from rest_framework import serializers
  
  from .models import Upload
  
  
  class UploadSerializer(serializers.ModelSerializer):
      class Meta:
          model = Upload
          fields = '__all__'
  
      def __init__(self, *args, **kwargs):
+         '''
+         Add required marker, so OpenAPI schema generator can remove it again
+         -.-
+         '''
          super().__init__(*args, **kwargs)
          self.fields['guid'].required = True
  
Add some documentation for weird init
## Code Before:
from rest_framework import serializers

from .models import Upload


class UploadSerializer(serializers.ModelSerializer):
    class Meta:
        model = Upload
        fields = '__all__'

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.fields['guid'].required = True

## Instruction:
Add some documentation for weird init
## Code After:
from rest_framework import serializers

from .models import Upload


class UploadSerializer(serializers.ModelSerializer):
    class Meta:
        model = Upload
        fields = '__all__'

    def __init__(self, *args, **kwargs):
        '''
        Add required marker, so OpenAPI schema generator can remove it again
        -.-
        '''
        super().__init__(*args, **kwargs)
        self.fields['guid'].required = True
