-
Notifications
You must be signed in to change notification settings - Fork 937
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
Warning skipping .... errors even with bootstrap option specified. #1682
Comments
Well, it's still the autoloading. Putting a class Two ways to make your test work:
{
"require": {
"zircote/swagger-php": "^4.11"
},
"autoload": {
"files": [
"src/openapi.php"
]
}
} After this change you will also need to run
./vendor/bin/openapi -b src/openapi.php src -o openapi.yaml Hope this helps. |
I wasn't really aware of the PSR autoload standard. So that helped somewhat. I put the classes into their own files named after the class name following the standard. I added an autoload to the composer.json. I modified the two files:
and
But now when I run openapi I get this error:
I had a bit of a read about attribute classes and added something to the OpenApi file. Specifically
But it didn't resolve the problem. Do you have a small working example? I'm from PHP of 10+ years ago and so much of what I'm learning here is new to me, including PSR standards. |
Solved it! thankyou @DerManoMann . As a bit of feedback it would be good to have some basic documentation around this for those coming from other languages or who like me were a bit out of date in using more recent PHP features. I'm happy to help in that regard. |
30 years as a software engineer and I simply must be too dumb to get this working.
I followed this:
https://zircote.github.io/swagger-php/guide/faq.html#warning-required-oa-info-not-found
When things don't work out I usually go to a minimal example. So I took one from your doc pages:
I named this file openapi.php and placed it into my src directory.
Put that into a directory called OpenApiTest\src (it's the only file in there)
Then in the OpenApiTest directory containing only the src folder
Maybe the bootstrap option will make it work?
And several other attempts all resulting in failure with the exact same error every single time. When I tried to get this working
with my project it was the same error messages and the same "skipping unknown" errors for all my classes. Despite having autoload running, or even providing the bootstrap option. No difference.
The version installed of swagger-php and PHP
I also tried the older style annotations and installed the doctrine requirement. Again, the result was identical.
So it's not that. I'm just not sure how to make this project produce anything useful.
How do I get this working?
What am I doing wrong? This error seems to occur a lot and your documentation and examples all look to be old and certainly don't work. If I can't get it working I'm not sure how a complete beginner is meant to.
Is it perhaps a bug in the most recent version or some key missing step?
I would have expected it to produce something meaningful but all that it produced was a file container
To clarify.
The directory structure is
The text was updated successfully, but these errors were encountered: