getEntityType(); // @todo Only for entity node - should we add other entities as well? if ($entityType->id() === 'node' && \Drupal::currentUser()->hasPermission('use jsonapi operation link')) { // Build the url. $url = Url::fromRoute(sprintf('jsonapi.%s--%s.individual', $entityType->id(), $entity->bundle()), ['entity' => $entity->uuid()] ); $operations['view-jsonapi-output'] = [ 'title' => t('jsonapi Output'), 'weight' => 50, 'url' => $url, ]; } return $operations; }