code: @Override
      public void aroundWriteTo(final WriterInterceptorContext context) throws IOException, WebApplicationException {
          final Object entity = context.getEntity();
  
          if (!(entity instanceof Viewable) && resourceInfoProvider.get().getResourceMethod() != null) {
              final Template template = TemplateHelper.getTemplateAnnotation(context.getAnnotations());
              if (template != null) {
                  context.setType(Viewable.class);
                  context.setEntity(new Viewable(template.name(), entity));
              }
          }
  
          context.proceed();
      }
docs: {@inheritDoc}