if (!$this->controller->getRequest()->accepts('application/vnd.api+json')) {
return parent::_outputMessage($template);
}
This assumes that the usage of this renderer can only apply to jsonapi requests. However, this makes it somewhat inflexible.
It might be better to add a method like shouldBeBypassed, which can then be overridden to allow finer control of this logic.