Skip to content

Commit cdd2eb0

Browse files
authored
Merge pull request vyuldashev#28 from happyDemon/patch-1
Update to route parameter annotations
2 parents 5a49539 + c5f4a28 commit cdd2eb0

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/Builders/Paths/Operation/ParametersBuilder.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,12 @@ protected function buildPath(RouteInformation $route): Collection
3434
->first(static function (ReflectionParameter $reflectionParameter) use ($parameter) {
3535
return $reflectionParameter->name === $parameter['name'];
3636
});
37-
37+
3838
if ($reflectionParameter) {
39+
// The reflected param has no type, so ignore (should be defined in a ParametersFactory instead)
40+
if ($reflectionParameter->getType() == null) {
41+
return null;
42+
}
3943
$schema = SchemaHelpers::guessFromReflectionType($reflectionParameter->getType());
4044
}
4145

@@ -49,7 +53,8 @@ protected function buildPath(RouteInformation $route): Collection
4953
->required()
5054
->description(optional(optional($description)->getDescription())->render())
5155
->schema($schema);
52-
});
56+
})
57+
->filter();
5358
}
5459

5560
protected function buildAnnotation(RouteInformation $route): Collection

0 commit comments

Comments
 (0)