code: def serialize(self, value, **kwargs):
          
          kwargs.update({'include_class': kwargs.get('include_class', True)})
          if self.serializer is not None:
              return self.serializer(value, **kwargs)
          if value is None:
              return None
          for prop in self.props:
              try:
                  prop.validate(None, value)
              except GENERIC_ERRORS:
                  continue
              return prop.serialize(value, **kwargs)
          return self.to_json(value, **kwargs)
docs: Return a serialized value
  
          If no serializer is provided, it uses the serialize method of the
          prop corresponding to the value