diff --git a/src/Hook/ViewsJsonSourceViewsHooks.php b/src/Hook/ViewsJsonSourceViewsHooks.php
new file mode 100644
index 0000000..30a0ce9
--- /dev/null
+++ b/src/Hook/ViewsJsonSourceViewsHooks.php
@@ -0,0 +1,65 @@
+<?php
+
+namespace Drupal\views_json_source\Hook;
+
+use Drupal\Core\Hook\Attribute\Hook;
+use Drupal\Core\StringTranslation\StringTranslationTrait;
+
+/**
+ * Hook implementations for views_json_source.
+ */
+class ViewsJsonSourceViewsHooks {
+  use StringTranslationTrait;
+  /**
+   * @file
+   * Views related hooks for views_json_source.
+   */
+
+  /**
+   * Implements hook_views_data().
+   */
+  #[Hook('views_data')]
+  public function viewsData() {
+    $data = [];
+    $data['json']['table']['group'] = $this->t('JSON');
+    $data['json']['table']['base'] = [
+      'title' => $this->t('JSON'),
+      'help' => $this->t('Queries an JSON.'),
+      'query_id' => 'views_json_source_query',
+    ];
+    $data['json']['value'] = [
+      'title' => $this->t('JSON Field'),
+      'help' => $this->t('Name of the key in the JSON.'),
+      'field' => [
+        'id' => 'views_json_source_field',
+      ],
+      'sort' => [
+        'id' => 'views_json_source_sort',
+      ],
+      'filter' => [
+        'id' => 'views_json_source_filter',
+      ],
+      'argument' => [
+        'id' => 'views_json_source_argument',
+      ],
+    ];
+    // Contextual filter required to replace the "%" placeholder in the apath.
+    $data['json']['parameter'] = [
+      'title' => $this->t('Apath Replacement.'),
+      'help' => $this->t('Replacement for placeholder text in apath.'),
+      'argument' => [
+        'id' => 'views_json_source_parameter',
+      ],
+    ];
+    // Contextual filter required to replace the "%" placeholder in the url.
+    $data['json']['param'] = [
+      'title' => $this->t('URL Parameter.'),
+      'help' => $this->t('Replacement for placeholder in URL.'),
+      'argument' => [
+        'id' => 'views_json_source_uri_param',
+      ],
+    ];
+    return $data;
+  }
+
+}
diff --git a/views_json_source.services.yml b/views_json_source.services.yml
index 4dec3d1..1d4ed19 100644
--- a/views_json_source.services.yml
+++ b/views_json_source.services.yml
@@ -2,3 +2,7 @@ services:
   logger.channel.views_json_source:
     parent: logger.channel_base
     arguments: ['views_json_source']
+
+  Drupal\views_json_source\Hook\ViewsJsonSourceViewsHooks:
+    class: Drupal\views_json_source\Hook\ViewsJsonSourceViewsHooks
+    autowire: true
diff --git a/views_json_source.views.inc b/views_json_source.views.inc
index 9f730eb..aa4dc65 100644
--- a/views_json_source.views.inc
+++ b/views_json_source.views.inc
@@ -1,5 +1,12 @@
 <?php
 
+/**
+ * @file
+ */
+
+use Drupal\Core\Hook\Attribute\LegacyHook;
+use Drupal\views_json_source\Hook\ViewsJsonSourceViewsHooks;
+
 /**
  * @file
  * Views related hooks for views_json_source.
@@ -8,50 +15,7 @@
 /**
  * Implements hook_views_data().
  */
+#[LegacyHook]
 function views_json_source_views_data() {
-  $data = [];
-  $data['json']['table']['group'] = t('JSON');
-
-  $data['json']['table']['base'] = [
-    'title' => t('JSON'),
-    'help' => t('Queries an JSON.'),
-    'query_id' => 'views_json_source_query',
-  ];
-
-  $data['json']['value'] = [
-    'title' => t('JSON Field'),
-    'help' => t('Name of the key in the JSON.'),
-    'field' => [
-      'id' => 'views_json_source_field',
-    ],
-    'sort' => [
-      'id' => 'views_json_source_sort',
-    ],
-    'filter' => [
-      'id' => 'views_json_source_filter',
-    ],
-    'argument' => [
-      'id' => 'views_json_source_argument',
-    ],
-  ];
-
-  // Contextual filter required to replace the "%" placeholder in the apath.
-  $data['json']['parameter'] = [
-    'title' => t('Apath Replacement.'),
-    'help' => t('Replacement for placeholder text in apath.'),
-    'argument' => [
-      'id' => 'views_json_source_parameter',
-    ],
-  ];
-
-  // Contextual filter required to replace the "%" placeholder in the url.
-  $data['json']['param'] = [
-    'title' => t('URL Parameter.'),
-    'help' => t('Replacement for placeholder in URL.'),
-    'argument' => [
-      'id' => 'views_json_source_uri_param',
-    ],
-  ];
-
-  return $data;
+  return \Drupal::service(ViewsJsonSourceViewsHooks::class)->viewsData();
 }
