diff --git a/openapi_jsonapi.info.yml b/openapi_jsonapi.info.yml
index 6b5d94f..6d4973e 100644
--- a/openapi_jsonapi.info.yml
+++ b/openapi_jsonapi.info.yml
@@ -2,7 +2,7 @@ name: OpenAPI JSON:API
 description: OpenAPI support for the JSON:API module.
 type: module
 package: Web Services
-core_version_requirement: ^10 || ^11
+core_version_requirement: ^10.1 || ^11 || ^12
 dependencies:
   - openapi:openapi
   - schemata:schemata
diff --git a/src/Plugin/openapi/OpenApiGenerator/JsonApiGenerator.php b/src/Plugin/openapi/OpenApiGenerator/JsonApiGenerator.php
index 7185ce2..99aa8f3 100644
--- a/src/Plugin/openapi/OpenApiGenerator/JsonApiGenerator.php
+++ b/src/Plugin/openapi/OpenApiGenerator/JsonApiGenerator.php
@@ -645,7 +645,7 @@ class JsonApiGenerator extends OpenApiGeneratorBase {
   /**
    * {@inheritdoc}
    */
-  protected function getEntityResponsesJsonApi($entity_type_id, $method, $bundle_name, $route_name, Route $route = NULL) {
+  protected function getEntityResponsesJsonApi($entity_type_id, $method, $bundle_name, $route_name, ?Route $route = NULL) {
     $route_type = $this->getRoutTypeFromName($route_name);
     if ($route_type === 'collection') {
       if ($method === 'get') {
@@ -702,7 +702,7 @@ class JsonApiGenerator extends OpenApiGeneratorBase {
       else {
         // Fake a route name that will yield the expected results for the related
         // responses.
-        $target_route_name = Routes::getRouteName($target_resource_type, $is_multiple ? 'collection' : 'individual');
+        $target_route_name = JsonApiRoutes::getRouteName($target_resource_type, $is_multiple ? 'collection' : 'individual');
         return $this->getEntityResponsesJsonApi(
           $target_resource_type->getEntityTypeId(),
           $method,
