Closed savedario closed 9 months ago
The spec ifself just describes endpoints. Whether those endpoints exist or not does not really matter here. They might be password protected, behind a firewall or not yet exist.
However, for an OpenAPI spec to make sense it needs to contain endpoints (as that is the main point).
If you already have other annotations that describe yet to be developed features, why not also add a (simple/dummy) endpoint to get things going?
My original intention was not to ask a question but to signal an issue that could be fixed by either:
league/openapi-psr7-validator
) allows to define an API with no endpoints (whether that make sense or not) and leave that part of the page just... empty ?I did add a dummy endpoint, but it took a while to figure out that was "the problem".
Upgrading from 4.7.16 to 4.8.1 produces the same problem on our Laravel installation but all PHP files have a @OA<method>
...
I tried to find from where comes this problem but without any success 😢
Do you have an advice to help us find where is the file causing a problem?
As of 4.8 the doctrine/annotations package is optional, which also causes this error - as no annotations are parsed. Maybe the error message could be improved.
Thank you @DerManoMann, indeed, adding "doctrine/annotations": "^2.0"
to our composer.json
works 🎉
If there are no endpoints defined either with @OA\ or with @OA\PathItem, the swagger page shows no output and the application logs the exception:
Required @OA\PathItem() not found at /project/vendor/zircote/swagger-php/src/Loggers/DefaultLogger.php:31
which is a rather misleading message.
Note: other annotations are in use (Info, Server, SecurityScheme, Flow) that were obviously referring to yet-to-be-developed endpoints, but that does not seem to be a problem just to generate the swagger page.