def process_record(self, new, old=None):
        """Validate records against collection schema, if any."""
        new = super(Record, self).process_record(new, old)

        schema = self._collection.get('schema')
        settings = self.request.registry.settings
        schema_validation = 'experimental_collection_schema_validation'
        if not schema or not asbool(settings.get(schema_validation)):
            return new

        collection_timestamp = self._collection[self.model.modified_field]

        try:
            stripped = copy.deepcopy(new)
            stripped.pop(self.model.id_field, None)
            stripped.pop(self.model.modified_field, None)
            stripped.pop(self.model.permissions_field, None)
            stripped.pop(self.schema_field, None)
            jsonschema.validate(stripped, schema)
        except jsonschema_exceptions.ValidationError as e:
            try:
                field = e.path.pop() if e.path else e.validator_value.pop()
            except __HOLE__:
                field = None
            raise_invalid(self.request, name=field, description=e.message)

        new[self.schema_field] = collection_timestamp
        return new
dataset/ETHPy150Open Kinto/kinto/kinto/views/records.py/Record.process_record