Closed boesing closed 7 months ago
Hi! Thanks for information :) Looks like some edge case issues that was not spotted before. Feel free to create PR with the fix. Let me know if you'd need any help with that.
Best, scyzoryck.
I'll provide a patch for this, just need to find some time. 🤙🏼
With 3.28.0, something has changed so that we now end up having an error at runtime due to missing attributes. We do use OpenAPI attributes to generate API documentation during CI and since we do not need these attributes on production, we do have these in
require-dev
section of composer. That worked pretty well until 3.27.0 and stopped working with 3.28.0.The problem is, that there is no check if an attribute actually exists:
https://github.com/schmittjoh/serializer/blob/f24027583f8ad3c1789bff412b039013132316ac/src/Metadata/Driver/AnnotationOrAttributeDriver.php#L331C3-L336
We had something similar with
cuyz/valinor
(https://github.com/CuyZ/Valinor/issues/393), but that was only related to cache files and was not affecting runtime (without caches). That was due to the fact thatcuyz/valinor
already kinda handled missing attributes:https://github.com/romm/Valinor/blob/af98753ba93c2a1ff8b717a5ecfbe3424a41b99f/src/Definition/NativeAttributes.php#L34-L41
Steps required to reproduce the problem
#[Test]
)Expected Result
Actual Result
Error: Attribute class "Application\Test\TestAsset\Test" not found