Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/5.0.0' into 5.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
byjg committed Dec 30, 2023
2 parents d4b7218 + caa4b94 commit bfbc666
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Base/Body.php
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ protected function matchSchema($name, $schemaArray, $body)
}

if(!isset($schemaArray['$ref']) && isset($schemaArray['content'])) {
$schemaArray['$ref'] = $schemaArray['content'][key($schemaArray['content'])]['schema']['$ref'];
$schemaArray = $schemaArray['content'][key($schemaArray['content'])]['schema'];
}

// Get References and try to match it again
Expand Down
2 changes: 1 addition & 1 deletion src/OpenApi/OpenApiSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ protected function validateArguments($parameterIn, $parameters, $arguments)
}
if (!isset($this->jsonFile[self::SWAGGER_COMPONENTS][self::SWAGGER_PARAMETERS][$paramParts[3]])) {
throw new DefinitionNotFoundException(
"Not find reference #/components/parameters/${paramParts[3]}"
"Not find reference #/components/parameters/{$paramParts[3]}"
);
}
$parameter = $this->jsonFile[self::SWAGGER_COMPONENTS][self::SWAGGER_PARAMETERS][$paramParts[3]];
Expand Down
4 changes: 2 additions & 2 deletions src/Swagger/SwaggerRequestBody.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ public function match($body)
if ($parameter['in'] === "formData") {
$hasFormData = true;
if (isset($parameter['required']) && $parameter['required'] === true && !isset($body[$parameter['name']])) {
throw new RequiredArgumentNotFound("The formData parameter '${parameter['name']}' is required but it isn't found. ");
throw new RequiredArgumentNotFound("The formData parameter '{$parameter['name']}' is required but it isn't found. ");
}
if (!$this->matchTypes($parameter['name'], $parameter, (isset($body[$parameter['name']]) ? $body[$parameter['name']] : null))) {
throw new NotMatchedException("The formData parameter '${parameter['name']}' not match with the specification");
throw new NotMatchedException("The formData parameter '{$parameter['name']}' not match with the specification");
}
}
}
Expand Down

0 comments on commit bfbc666

Please sign in to comment.