docs(openapi): standardize array query parameter names without brackets and enable spectator validation

This commit is contained in:
Jérémy Munsch 2026-09-17 18:12:32 +02:00
parent 00aff9bf63
commit 5b2c0e58ce
Signed by: forge-joniko
GPG key ID: D7EFE2F5CB6CC0E4
3 changed files with 47 additions and 2 deletions

View file

@ -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.

View file

@ -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 */

View file

@ -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 */