docs(openapi): standardize array query parameter names without brackets and enable spectator validation
This commit is contained in:
parent
00aff9bf63
commit
5b2c0e58ce
3 changed files with 47 additions and 2 deletions
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue