Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/45_fix_exception_when_setting_in…
Browse files Browse the repository at this point in the history
…valid_additional_path' into 45_fix_exception_when_setting_invalid_additional_path
  • Loading branch information
Goodmain committed Sep 25, 2023
2 parents b672b96 + de6fefb commit 2b05267
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
7 changes: 5 additions & 2 deletions src/Validators/SwaggerSpecValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,9 @@ protected function validateResponse(array $response, string $statusCode, string

if (!empty($response['schema'])) {
$this->validateType(
$response['schema'], array_merge(self::SCHEMA_TYPES, ['file']), "{$responseId}.schema"
$response['schema'],
array_merge(self::SCHEMA_TYPES, ['file']),
"{$responseId}.schema"
);
}

Expand All @@ -198,7 +200,8 @@ protected function validateParameters(array $operation, string $path, string $op

$this->validateFieldValue("{$paramId}.in", self::ALLOWED_VALUES['parameter_in']);
$this->validateFieldValue(
"{$paramId}.collectionFormat", self::ALLOWED_VALUES['parameter_collection_format']
"{$paramId}.collectionFormat",
self::ALLOWED_VALUES['parameter_collection_format']
);

$this->validateParameterType($param, $operation, $paramId, $operationId);
Expand Down
3 changes: 2 additions & 1 deletion tests/AutoDocControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ public function testGetElementsAssetFile()
$response->assertStatus(Response::HTTP_OK);

$this->assertEquals(
$response->getContent(), file_get_contents(resource_path('/assets/elements/web-components.min.js'))
$response->getContent(),
file_get_contents(resource_path('/assets/elements/web-components.min.js'))
);

$response->assertHeader('Content-Type', 'text/html; charset=UTF-8');
Expand Down
3 changes: 2 additions & 1 deletion tests/SwaggerServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,8 @@ public function testAddDataRequestWithEmptyDataAndInfo()
config(['auto-doc.info' => []]);

$this->mockDriverGetEmptyAndSaveTpmData(
[], $this->getJsonFixture('tmp_data_request_with_empty_data_and_info')
[],
$this->getJsonFixture('tmp_data_request_with_empty_data_and_info')
);

app(SwaggerService::class);
Expand Down

0 comments on commit 2b05267

Please sign in to comment.