laravel-openapi icon indicating copy to clipboard operation
laravel-openapi copied to clipboard

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

Open genesiscz opened this issue 4 years ago • 5 comments

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?

genesiscz avatar Feb 17 '21 16:02 genesiscz

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

HeathNaylor avatar Mar 17 '21 03:03 HeathNaylor

Yes

genesiscz avatar Mar 17 '21 12:03 genesiscz

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?

guergana avatar Nov 19 '21 14:11 guergana

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")
 */

genesiscz avatar Nov 23 '21 18:11 genesiscz

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?

afraazali avatar Feb 26 '22 04:02 afraazali