diff --git a/composer.json b/composer.json index 03001c2..7a4c466 100644 --- a/composer.json +++ b/composer.json @@ -20,8 +20,8 @@ "illuminate/http": "^9.0 || ^10.0", "illuminate/support": "^9.0 || ^10.0", "nyholm/psr7": "^1.8", - "membrane/membrane": "^0.6.0", - "membrane/openapi-router": "0.2.1", + "membrane/membrane": "^0.8", + "membrane/openapi-router": "^0.4.0", "symfony/psr-http-message-bridge": "^2.1" }, "require-dev": { diff --git a/src/Middleware/RequestValidation.php b/src/Middleware/RequestValidation.php index dc0bdbb..0516c2d 100644 --- a/src/Middleware/RequestValidation.php +++ b/src/Middleware/RequestValidation.php @@ -10,7 +10,6 @@ use Membrane\Laravel\ApiProblemBuilder; use Membrane\Laravel\ToPsr7; use Membrane\Membrane; -use Membrane\OpenAPI\Exception\CannotProcessRequest; use Membrane\OpenAPI\Exception\CannotProcessSpecification; use Membrane\OpenAPI\Specification\Request as MembraneRequestSpec; use Membrane\Result\Result; diff --git a/tests/Middleware/RequestValidationTest.php b/tests/Middleware/RequestValidationTest.php index 4d5a2ba..c060b5b 100644 --- a/tests/Middleware/RequestValidationTest.php +++ b/tests/Middleware/RequestValidationTest.php @@ -12,7 +12,7 @@ use Membrane\Laravel\ToPsr7; use Membrane\Laravel\ToSymfony; use Membrane\OpenAPI\Exception\CannotProcessSpecification; -use Membrane\OpenAPI\Method; +use Membrane\OpenAPIReader\ValueObject\Valid\Enum\Method; use Membrane\Result\Result; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; @@ -29,11 +29,17 @@ class RequestValidationTest extends TestCase #[Test] public function registersResultInstanceInContainer(): void { - $url = '/pets?limit=5&tags[]=cat&tags[]=tabby'; + $url = '/pets?limit=5&tags=cat&tags=tabby'; $expected = Result::valid([ 'path' => [], 'query' => ['limit' => 5, 'tags' => ['cat', 'tabby']], - 'header' => [], + 'header' => [ + 'host' => ['localhost'], + 'user-agent' => ['Symfony'], + 'accept' => ['text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'], + 'accept-language' => ['en-us,en;q=0.5'], + 'accept-charset' => ['ISO-8859-1,utf-8;q=0.7,*;q=0.7'], + ], 'cookie' => [], 'body' => '', 'request' => ['method' => 'get', 'operationId' => 'findPets'],