Skip to content

Commit

Permalink
Bug fix on inline path params
Browse files Browse the repository at this point in the history
  • Loading branch information
andrevanzuydam committed Jun 30, 2024
1 parent cee59af commit 7e3802c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Tina4/Api/Swagger.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,6 @@ public function __construct($root = null, $title = "Open API", $apiDescription =
$description = "None";
$tags = [];
$queryParams = [];


$addParams = [];
$security = [];
$example = null;
foreach ($annotations as $annotationName => $annotationValue) {
Expand Down Expand Up @@ -152,14 +149,17 @@ public function __construct($root = null, $title = "Open API", $apiDescription =
$summary = $description;
}

$arguments = $reflection->getParameters();
$params = json_decode(json_encode($arguments));
$params = array_merge($params, $addParams);
$regEx = '/\{(.*)\}/mU';
preg_match_all($regEx, $route["routePath"], $matches, PREG_SET_ORDER, 0);
$params = [];

$propertyIn = "in";
$propertyType = "type";
$propertyName = "name";

foreach ($matches as $match) {
$params[] = (object)[ $propertyName => $match[1]];
}

foreach ($params as $pid => $param) {
if (!isset($params[$pid]->{$propertyIn})) {
Expand Down

0 comments on commit 7e3802c

Please sign in to comment.