diff --git a/src/Annotations/AbstractAnnotation.php b/src/Annotations/AbstractAnnotation.php index c3f2af6d..a6e27785 100644 --- a/src/Annotations/AbstractAnnotation.php +++ b/src/Annotations/AbstractAnnotation.php @@ -165,8 +165,7 @@ public function __set(string $property, $value): void foreach (static::$_blacklist as $_property) { unset($fields[$_property]); } - $this->_context->logger->warning('Unexpected field "' . $property . '" for ' . $this->identity() . ', expecting "' . implode('", "', array_keys($fields)) . '" in ' . $this->_context); - $this->{$property} = $value; + $this->_context->logger->warning('Ignoring unexpected property "' . $property . '" for ' . $this->identity() . ', expecting "' . implode('", "', array_keys($fields)) . '" in ' . $this->_context); } /** diff --git a/tests/Annotations/AbstractAnnotationTest.php b/tests/Annotations/AbstractAnnotationTest.php index 935ed0ff..43ed5522 100644 --- a/tests/Annotations/AbstractAnnotationTest.php +++ b/tests/Annotations/AbstractAnnotationTest.php @@ -25,7 +25,7 @@ public function testVendorFields(): void */ public function testInvalidField(): void { - $this->assertOpenApiLogEntryContains('Unexpected field "doesnot" for @OA\Get(), expecting'); + $this->assertOpenApiLogEntryContains('Ignoring unexpected property "doesnot" for @OA\Get(), expecting'); $this->annotationsFromDocBlockParser('@OA\Get(doesnot="exist")'); }