diff --git a/src/Extracting/Strategies/UrlParameters/GetFromLaravelAPI.php b/src/Extracting/Strategies/UrlParameters/GetFromLaravelAPI.php index 37563e0d..b11d7a19 100644 --- a/src/Extracting/Strategies/UrlParameters/GetFromLaravelAPI.php +++ b/src/Extracting/Strategies/UrlParameters/GetFromLaravelAPI.php @@ -66,7 +66,9 @@ public function __invoke(ExtractedEndpointData $endpointData, array $routeRules) 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