diff --git a/resources/api/openapi.yml b/resources/api/openapi.yml index 69ca69b..2500df0 100644 --- a/resources/api/openapi.yml +++ b/resources/api/openapi.yml @@ -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: diff --git a/src/Spryker/Glue/AppKernel/Validator/OpenApiRequestSchemaValidator.php b/src/Spryker/Glue/AppKernel/Validator/OpenApiRequestSchemaValidator.php index 2314e14..d746644 100644 --- a/src/Spryker/Glue/AppKernel/Validator/OpenApiRequestSchemaValidator.php +++ b/src/Spryker/Glue/AppKernel/Validator/OpenApiRequestSchemaValidator.php @@ -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) { } @@ -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));