Skip to content

Commit 50e9d2c

Browse files
committed
Fix failing test in CI
1 parent 56a48eb commit 50e9d2c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/SpecBaseObject.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use cebe\openapi\json\JsonPointer;
1313
use cebe\openapi\json\JsonReference;
1414
use cebe\openapi\spec\Reference;
15+
use cebe\openapi\spec\Schema;
1516
use cebe\openapi\spec\Type;
1617

1718
/**
@@ -235,6 +236,9 @@ public function validate(): bool
235236
$this->_recursingValidate = true;
236237
$valid = true;
237238
$allowedFields = array_keys($this->attributes());
239+
if (static::class === Schema::class) {
240+
$allowedFields[] = 'additionalProperties';
241+
}
238242
foreach ($this->_properties as $k => $v) {
239243
if ($allowedFields && !in_array($k, $allowedFields, true) && substr($k, 0, 2) !== 'x-') {
240244
$valid = false;

tests/spec/PathTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ public function testPathItemReference()
176176
$this->assertInstanceOf(Response::class, $path200);
177177
$this->assertEquals('A bar', $path200->description);
178178

179-
unset($openapi);
180179
/** @var $openapi OpenApi */
181180
$openapi = Reader::readFromYamlFile($file, \cebe\openapi\spec\OpenApi::class, true);
182181

0 commit comments

Comments
 (0)