Upgraded from Laravel 8 to 9 and I received this message on swagger docs.
"Unable to render this definition The provided definition does not specify a valid version field".
Please indicate a valid Swagger or OpenAPI version field.
Supported version fields are swagger: "2.0" and those that match OpenAPI : 3.0.n (for example, OpenAPI : 3.0.0)."
Some suggested adding
- openapi="3.0.0"
line but where can I add? When I add in
- @OA\Info()
it still throws an error like
- Unexpected field "openapi" for @OA\Info()
Well, it is an invalid property on
@OA\Info.Are you sure you do not have a second annotation with that field somewhere?
It might be interesting to try run
swagger-phpon the command line against your codebase and see what that returns. Something likeAlso, what happens if you remove
@OA\Infoaltogether. I would expect an error about it missing...?