Skip to content

Commit dab0ecb

Browse files
committed
Removed set additionalProperties to false
Documentation states “Consistent with JSON Schema, additionalProperties defaults to true.”
1 parent dd2b05e commit dab0ecb

File tree

3 files changed

+3
-8
lines changed

3 files changed

+3
-8
lines changed

src/OpenApiValidation.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,6 @@ private function validateProperties(array $properties, $in = null) : ?array
360360

361361
private function validateObject(array $schema, array $value) : array
362362
{
363-
$schema = SchemaHelper::addRecursive($schema, 'additionalProperties', false);
364363
$errors = [];
365364
foreach (SchemaHelper::getFormats($schema) as $f) {
366365
$this->checkFormat($f['type'], $f['format']);

tests/RequestBodyTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,8 @@ public function testRequestBody()
6666
$this->assertSame('error_type', $errors[1]['code']);
6767
$this->assertSame('error_required', $errors[2]['code']);
6868
$this->assertSame('error_format', $errors[3]['code']);
69-
$this->assertSame('error_additional', $errors[4]['code']);
70-
$this->assertSame('error_format', $errors[5]['code']);
71-
$this->assertSame('customFormat', $errors[5]['format']);
69+
$this->assertSame('error_format', $errors[4]['code']);
70+
$this->assertSame('customFormat', $errors[4]['format']);
7271
}
7372

7473
public function testEmptyRequestBody()

tests/ResponsesTest.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@ public function testExampleResponse()
2323
'exampleResponse' => true,
2424
],
2525
]);
26-
$this->assertSame(500, $response->getStatusCode());
27-
$error = $this->json($response)['errors'][0];
28-
$this->assertSame('extra', $error['name']);
29-
$this->assertSame('error_additional', $error['code']);
26+
$this->assertSame(200, $response->getStatusCode());
3027
}
3128

3229
public function testExampleResponsePost()

0 commit comments

Comments
 (0)