vyuldashev / laravel-openapi

Generate OpenAPI specification for Laravel Applications
MIT License
413 stars 96 forks source link

PHP7 -> PHP8 (0.x -> 1.0) migration #32

Open genesiscz opened 3 years ago

genesiscz commented 3 years ago

For anyone wondering how to migrate the docblocks into PHP8 Attributes quickly, this one worked for me:

regex replace: \* @OA\\Operation\(tags=(.*?)\)\n.*?\*/ to */\n#[OA\\Operation(tags: [$1])]

\* @OA\\PathItem\(\)\n .*?\/ to */\n#[OA\\PathItem()]

Maybe it would be a good idea to include this (or maybe even better some modified version that would work in all cases) in a readme/doc somewhere?

HeathNaylor commented 3 years ago

If we want to use PHP 7, we need to use the 0.x tags?

genesiscz commented 3 years ago

Yes

guergana commented 2 years ago

If we want to use PHP 7, we need to use the 0.x tags?

Hello. I am currently developing an app that uses PHP 7. How are 0.x tags used? Could you provide an example?

genesiscz commented 2 years ago

If we want to use PHP 7, we need to use the 0.x tags?

Hello. I am currently developing an app that uses PHP 7. How are 0.x tags used? Could you provide an example?

DocBlocks.

/**
 * @OA\Operation(tags="first")
 */
afraazali commented 2 years ago

Is security on operations supported in 0.x?

EDIT: I’ve added a security scheme and it’s in the spec document, but none of the operations have a security property in the spec document.

Is there an example for adding security to operations?