<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def validate_type(self, data):
 """Performs field validation against the schema context if values have been provided to SWAGManager via the swag.schema_context config object. If the schema context for a given field is empty, then we assume any value is valid for the given schema field. """

        fields_to_validate = ['type', 'environment', 'owner']
        for field in fields_to_validate:
            value = data.get(field)
            allowed_values = self.context.get(field)
            if allowed_values and value not in allowed_values:
                raise ValidationError('Must be one of {}'.format(allowed_values), field_names=field)