protected function checkMissingFields(Resource $resource)
    {
        $missing = array_diff(
            $resource->model_class::getRequiredColumns(),
            array_keys($resource->data)
        );

        if (!empty($missing)) {
            $message = "Resource '$resource->name' requires the following "
                . "missing fields: '" . implode("', '", $missing) . "'";
            $this->sendError(static::ERROR_INVALID_PAYLOAD, $message);
        }
    }