code: def extract_value(self, data):
          
          errors = []
          if 'id' not in data:
              errors.append('Must have an `id` field')
          if 'type' not in data:
              errors.append('Must have a `type` field')
          elif data['type'] != self.type_:
              errors.append('Invalid `type` specified')
  
          if errors:
              raise ValidationError(errors)
  
          # If ``attributes`` is set, we've folded included data into this
          # relationship. Unserialize it if we have a schema set; otherwise we
          # fall back below to old behaviour of only IDs.
          if 'attributes' in data and self.__schema:
              result = self.schema.load({'data': data, 'included': self.root.included_data})
              return result.data if _MARSHMALLOW_VERSION_INFO[0] < 3 else result
  
          id_value = data.get('id')
  
          if self.__schema:
              id_value = self.schema.fields['id'].deserialize(id_value)
  
          return id_value
docs: Extract the id key and validate the request structure.