diff --git a/documentation/OpenApi/openapi.yaml b/documentation/OpenApi/openapi.yaml index a3f25ad..417c75d 100644 --- a/documentation/OpenApi/openapi.yaml +++ b/documentation/OpenApi/openapi.yaml @@ -469,7 +469,7 @@ components: example: "LDCSER" SiteIds: - name: 'siteIds[]' + name: siteIds in: query required: false description: "Filtrer par un ou plusieurs codes site (ex: siteIds[]=LDCSER&siteIds[]=SLELA)." @@ -543,7 +543,7 @@ components: example: "123%" Brands: - name: 'brands[]' + name: brands in: query required: false description: Filtrer par un ou plusieurs codes marque. diff --git a/tests/Feature/OpenApi/V1/Employees/EmployeeOpenApiTest.php b/tests/Feature/OpenApi/V1/Employees/EmployeeOpenApiTest.php index b28ec51..bba404c 100644 --- a/tests/Feature/OpenApi/V1/Employees/EmployeeOpenApiTest.php +++ b/tests/Feature/OpenApi/V1/Employees/EmployeeOpenApiTest.php @@ -56,6 +56,21 @@ describe('Employee OpenAPI Conformance', function (): void { $response->assertValidResponse(200); }); + it('validates GET /api/v1/employees list response with standard RFC repeated siteIds filter against openapi spec', function (): void { + // GIVEN + /** @var \Tests\TestCase $test */ + $test = $this; + + // WHEN + /** @var \Illuminate\Testing\TestResponse<\Symfony\Component\HttpFoundation\Response> $response */ + $response = $test->getJson('/api/v1/employees?siteIds=LDCSER&siteIds=SLELA'); + + // THEN + $response->assertStatus(200); + $response->assertValidRequest(); + $response->assertValidResponse(200); + }); + it('validates GET /api/v1/employees/{id} detail response against openapi spec', function (): void { // GIVEN /** @var \Tests\TestCase $test */ diff --git a/tests/Feature/OpenApi/V1/IncoSheets/IncoSheetOpenApiTest.php b/tests/Feature/OpenApi/V1/IncoSheets/IncoSheetOpenApiTest.php index 56f7829..7db0640 100644 --- a/tests/Feature/OpenApi/V1/IncoSheets/IncoSheetOpenApiTest.php +++ b/tests/Feature/OpenApi/V1/IncoSheets/IncoSheetOpenApiTest.php @@ -56,6 +56,36 @@ describe('IncoSheet OpenAPI Conformance', function (): void { $response->assertValidResponse(200); }); + it('validates GET /api/v1/inco-sheets list response with brands filter against openapi spec', function (): void { + // GIVEN + /** @var \Tests\TestCase $test */ + $test = $this; + + // WHEN + /** @var \Illuminate\Testing\TestResponse<\Symfony\Component\HttpFoundation\Response> $response */ + $response = $test->getJson('/api/v1/inco-sheets?brands=LGL01'); + + // THEN + $response->assertStatus(200); + $response->assertValidRequest(); + $response->assertValidResponse(200); + }); + + it('validates GET /api/v1/inco-sheets list response with bracket brands filter against openapi spec', function (): void { + // GIVEN + /** @var \Tests\TestCase $test */ + $test = $this; + + // WHEN + /** @var \Illuminate\Testing\TestResponse<\Symfony\Component\HttpFoundation\Response> $response */ + $response = $test->getJson('/api/v1/inco-sheets?brands[]=LGL01'); + + // THEN + $response->assertStatus(200); + $response->assertValidRequest(); + $response->assertValidResponse(200); + }); + it('validates GET /api/v1/inco-sheets/{incoId} detail response against openapi spec', function (): void { // GIVEN /** @var \Tests\TestCase $test */