 jsonapi.link_relation_types.yml |  5 +++++
 jsonapi.module                  | 13 +++++++++++++
 src/Routing/Routes.php          |  3 +++
 3 files changed, 21 insertions(+)

diff --git a/jsonapi.link_relation_types.yml b/jsonapi.link_relation_types.yml
new file mode 100644
index 0000000..820a875
--- /dev/null
+++ b/jsonapi.link_relation_types.yml
@@ -0,0 +1,5 @@
+# JSON API's extension relation types.
+# See https://tools.ietf.org/html/rfc5988#section-4.2.
+jsonapi:
+  uri: http://jsonapi.org/
+  description: A JSON API representation of this resource.
diff --git a/jsonapi.module b/jsonapi.module
index df5bc5c..1232998 100644
--- a/jsonapi.module
+++ b/jsonapi.module
@@ -33,6 +33,19 @@ function jsonapi_help($route_name, RouteMatchInterface $route_match) {
 }
 
 /**
+ * Implements hook_entity_type_alter().
+ */
+function jsonapi_entity_type_alter(array &$entity_types) {
+  /** @var $entity_types \Drupal\Core\Entity\EntityTypeInterface[] */
+  foreach ($entity_types as $entity_type) {
+    $jsonapi_path = $entity_type->getBundleEntityType()
+      ? sprintf('/jsonapi/%s/{%s}/{%s}', $entity_type->id(), $entity_type->getBundleEntityType(), $entity_type->id())
+      : sprintf('/jsonapi/%s/%s/{%s}', $entity_type->id(), $entity_type->id(), $entity_type->id());
+    $entity_type->setLinkTemplate('jsonapi', $jsonapi_path);
+  }
+}
+
+/**
  * Implements hook_entity_base_field_info().
  *
  * @todo This should probably live in core, but for now we will keep it as a
diff --git a/src/Routing/Routes.php b/src/Routing/Routes.php
index 00b49b7..3fe3ea2 100644
--- a/src/Routing/Routes.php
+++ b/src/Routing/Routes.php
@@ -139,6 +139,9 @@ class Routes implements ContainerInjectionInterface {
         ->setMethods(['GET', 'PATCH', 'DELETE']);
       $route_individual->addOptions($options);
       $collection->add($build_route_name('individual'), $route_individual);
+      // Enable generating this URL by doing $entity->toUrl('jsonapi').
+      // @see jsonapi.link_relation_types.yml
+      $collection->add(sprintf('entity.%s.jsonapi', $resource_type->getEntityTypeId()), $route_individual);
 
       // Related resource, like /jsonapi/file/photo/123/comments.
       $route_related = (new Route(sprintf('%s/{%s}/{related}', $route_base_path, $resource_type->getEntityTypeId()), $defaults))
