Last active
February 19, 2024 13:43
-
-
Save atlance/7b03a1cb117de10c7fd2cf829e9cce89 to your computer and use it in GitHub Desktop.
Revisions
-
atlance renamed this gist
May 27, 2022 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
atlance revised this gist
May 27, 2022 . 1 changed file with 1 addition and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -26,10 +26,9 @@ use Symfony\Component\Routing\Annotation\Route; description: 'code 201, example single object.', content: new OA\JsonContent(ref: new Model(type: UserIdentity::class, groups: ['full'])) ), new OA\Response( response: Response::HTTP_ACCEPTED, description: 'code 202, example custom object without model.', content: new OA\JsonContent( type: 'object', properties: [ -
atlance revised this gist
May 27, 2022 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,6 @@ declare(strict_types=1); // ... use OpenApi\Attributes as OA; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; -
atlance revised this gist
May 27, 2022 . 1 changed file with 16 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,12 @@ <?php declare(strict_types=1); // ... use OpenApi\Attributes as OA; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; #[OA\Get( tags: ['foo-bar'], description: 'Oh Yeah!!!', @@ -6,21 +15,22 @@ ], responses: [ new OA\Response( response: Response::HTTP_OK, description: 'code 200, example array of objects.', content: new OA\JsonContent( type: 'array', items: new OA\Items(ref: new Model(type: UserIdentity::class, groups: ['full'])) ) ), new OA\Response( response: Response::HTTP_CREATED, description: 'code 201, example single object.', content: new OA\JsonContent(ref: new Model(type: UserIdentity::class, groups: ['full'])) ), // example custom object. new OA\Response( response: Response::HTTP_ACCEPTED, description: 'code 202, object without model.', content: new OA\JsonContent( type: 'object', properties: [ @@ -34,8 +44,8 @@ ] ) ), new OA\Response(response: Response::HTTP_BAD_REQUEST, description: 'code 400, sorry =('), new OA\Response(response: Response::HTTP_INTERNAL_SERVER_ERROR, description: 'code 500, ooops!'), ] )] #[Route(path: '/get/endpoint', name: 'get_endpoint', methods: ['GET'])] -
atlance revised this gist
May 27, 2022 . 1 changed file with 1 addition and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -18,10 +18,9 @@ description: 'code 201, example single object.', content: new OA\JsonContent(ref: new Model(type: UserIdentity::class, groups: ['full'])) ), new OA\Response( response: 202, description: 'code 202, example custom object without model.', content: new OA\JsonContent( type: 'object', properties: [ -
atlance created this gist
May 27, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,42 @@ #[OA\Get( tags: ['foo-bar'], description: 'Oh Yeah!!!', parameters: [ new OA\Parameter(ref: '#/components/parameters/version'), ], responses: [ new OA\Response( response: 200, description: 'code 200, example array of objects.', content: new OA\JsonContent( type: 'array', items: new OA\Items(ref: new Model(type: UserIdentity::class, groups: ['full'])) ) ), new OA\Response( response: 201, description: 'code 201, example single object.', content: new OA\JsonContent(ref: new Model(type: UserIdentity::class, groups: ['full'])) ), // example custom object. new OA\Response( response: 202, description: 'code 202, object without model.', content: new OA\JsonContent( type: 'object', properties: [ new OA\Property(property: 'foo', type: 'string'), new OA\Property(property: 'bar', type: 'integer'), new OA\Property( property: 'baz', type: 'array', items: new OA\Items(ref: new Model(type: UserIdentity::class, groups: ['full'])) ), ] ) ), new OA\Response(response: 400, description: 'code 400, sorry =('), new OA\Response(response: 500, description: 'code 500, ooops!'), ] )] #[Route(path: '/get/endpoint', name: 'get_endpoint', methods: ['GET'])]