Skip to content

Commit

Permalink
ACP-4047 Fixed CR comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
stereomon committed Nov 25, 2024
1 parent d19934b commit 246111c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 4 additions & 4 deletions resources/api/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ paths:
components:
securitySchemes:
Bearer:
type: apiKey
in: header
name: Authorization
type: http
scheme: bearer
bearerFormat: JWT
description: >-
Enter the token with the `Bearer: ` prefix, e.g. "Bearer abcde12345".
Enter the token with the `Bearer ` prefix, e.g. "Bearer abcde12345".
schemas:
ConfigurationApiRequest:
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@
use League\OpenAPIValidation\PSR7\Exception\Validation\InvalidBody;
use League\OpenAPIValidation\PSR7\ValidatorBuilder;
use Spryker\Glue\AppKernel\AppKernelConfig;
use Spryker\Shared\Log\LoggerTrait;
use Symfony\Component\HttpFoundation\Response;
use Throwable;

class OpenApiRequestSchemaValidator
{
use LoggerTrait;

public function __construct(protected AppKernelConfig $appKernelConfig)
{
}
Expand Down Expand Up @@ -50,6 +53,11 @@ public function validate(GlueRequestTransfer $glueRequestTransfer): GlueRequestV
try {
$validator->validate($psr7Request);
} catch (Throwable $throwable) {
$this->getLogger()->error(
$this->getMessageFromThrowable($throwable),
$glueRequestTransfer->getMeta(),
);

$glueErrorTransfer = new GlueErrorTransfer();
$glueErrorTransfer
->setMessage($this->getMessageFromThrowable($throwable));
Expand Down

0 comments on commit 246111c

Please sign in to comment.