-
Notifications
You must be signed in to change notification settings - Fork 938
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hard to find out problem with invalid attribute #1267
Comments
I guess this depends on whether you are using a 3rd party tool or swagger-php directly. You can always pass a custom |
I suppose https://github.com/zircote/swagger-php/blob/master/src/Analysers/AttributeAnnotationFactory.php#L52 could be conditional depending on whether the attribute class was OpenApi related or not. Not being able to instantiate unrelated attributes (for example |
Maybe it should be more explicitly mentioned in the docs. Because I need to spend quite a lot of time to figure out the problem |
Maybe. Where would you expect that to documented then? |
Docs are awesome. I have only this issue with ignoring exception. Thanks for this project, I am using it on many own projects. I will create pr if I have time ) as usual time is most valuable thing |
The error catching made it hard to find the reason for "ignored" attributes. This change addresses the issues zircote#1267 and zircote#1162. Instead of catching errors of non existing attribute classes, the existence of the class is checked before the attribute is tried to instantiate. This reveals invalid attribute definitions, but there won't be shown errors for attributes whose class definitions do not exist.
I had the same issue and it took me several hours to find the reason why a property wasn't added to the spec. I hope my PR gets merged to prevent this kind of issues. |
Right now, invalid attribute is logged with DEBUG level.
Default logger just ignores this level.
So it is impossible to know if something whent wrong f.e.when instantiating OA\Get(...) attribute throws excpeption, it is silently dropped.
Don't know how to improve, just point this issue.
The text was updated successfully, but these errors were encountered: