Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions src/Metadata/Exception/BadRequestException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

/*
* This file is part of the API Platform project.
*
* (c) Kévin Dunglas <dunglas@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace ApiPlatform\Metadata\Exception;

/**
* Framework-agnostic 400 Bad Request, mapped by both the Symfony and Laravel error handlers.
*/
class BadRequestException extends \RuntimeException implements ExceptionInterface, HttpExceptionInterface
{
public function getStatusCode(): int
{
return 400;
}

/**
* @return array<string, string>
*/
public function getHeaders(): array
{
return [];
}
}
2 changes: 1 addition & 1 deletion tests/Functional/McpTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ public function testToolsList(): void
'id' => ['type' => 'integer'],
'title' => ['type' => 'string'],
'isbn' => ['type' => 'string'],
'status' => ['type' => ['string', 'null']],
'status' => ['anyOf' => [['type' => 'string'], ['type' => 'null']]],
],
],
],
Expand Down
Loading