S.U 4 years ago
parent
commit
49ab18ab26
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/Extracting/Strategies/UrlParameters/GetFromLaravelAPI.php

+ 3 - 1
src/Extracting/Strategies/UrlParameters/GetFromLaravelAPI.php

@@ -66,7 +66,9 @@ class GetFromLaravelAPI extends Strategy
                         continue;
                     }
 
-                    $type = $this->normalizeTypeName($argumentInstance->getKeyType());
+                    $typeName = $argumentInstance->getKeyName() === $argumentInstance->getRouteKeyName()
+                        ? $argumentInstance->getKeyType() : 'string';
+                    $type = $this->normalizeTypeName($typeName);
                     $parameters[$paramName]['type'] = $type;
 
                     // If the user explicitly set a `where()` constraint, use that to refine examples