-
Notifications
You must be signed in to change notification settings - Fork 5
Add zircote/swagger-php attributes support #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sonrac
wants to merge
7
commits into
Tobion:master
Choose a base branch
from
sonrac:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
42ec8f7
add swagger-php attributes support and supports symfony with version …
sonrac 84095e6
Create php.yml
sonrac 0bd46da
remove unusages workflow
sonrac 69e78a2
Merge remote-tracking branch 'origin/master' into add_swagger_attribu…
sonrac 68dadee
remove double slashes
sonrac fa7fa35
fix tests
sonrac 68ccbbc
add php attributes support
sonrac File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 characters
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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env bash | ||
|
||
export COMPOSER_HOME=/tmp/composer | ||
|
||
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" | ||
php -r "if (hash_file('sha384', 'composer-setup.php') === '906a84df04cea2aa72f40b5f787e49f22d4c2f19492ac310e8cba5b96ac8b64115ac402c8cd292b8a03482574915d1a8') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" | ||
php composer-setup.php | ||
php -r "unlink('composer-setup.php');" | ||
chmod +x composer.phar | ||
mv composer.phar composer |
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 characters
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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
services: | ||
php7: | ||
image: php:7.2-fpm | ||
user: "1000:1000" | ||
working_dir: /var/www/html | ||
volumes: | ||
- ./:/var/www/html | ||
php8.0: | ||
image: php:8.0-fpm | ||
user: "1000:1000" | ||
working_dir: /var/www/html | ||
volumes: | ||
- ./:/var/www/html | ||
php8.1: | ||
image: php:8.1-fpm | ||
working_dir: /var/www/html | ||
user: "1000:1000" | ||
volumes: | ||
- ./:/var/www/html | ||
|
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 characters
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 characters
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 characters
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 characters
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 characters
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 characters
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 characters
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 characters
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 characters
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 characters
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 characters
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 characters
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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Tobion\OpenApiSymfonyRouting\Tests\Attributes\Fixtures\Basic; | ||
|
||
use OpenApi\Attributes as OA; | ||
|
||
#[OA\Info(version: "1.0", title: "My API")] | ||
class Controller | ||
{ | ||
#[OA\Get(path: "/foobar")] | ||
#[OA\Response(response: 200, description: "OK")] | ||
public function __invoke(): void | ||
{ | ||
} | ||
} |
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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Tobion\OpenApiSymfonyRouting\Tests\Attributes\Fixtures\FormatSuffix; | ||
|
||
use OpenApi\Attributes as OA; | ||
|
||
#[OA\OpenApi( | ||
info: new OA\Info( | ||
title: "My API", | ||
version: "1.0" | ||
), | ||
x: [ | ||
"format-suffix" => [ | ||
"enabled" => true | ||
] | ||
] | ||
)] | ||
class Controller | ||
{ | ||
#[OA\Get(path: "/a",)] | ||
#[OA\Response(response: "200", description: "Success")] | ||
public function inheritEnabledFormatSuffix(): void | ||
{ | ||
} | ||
|
||
#[OA\Get(path: "/b", x: ["format-suffix" => ["pattern" => "json|xml"]])] | ||
#[OA\Response(response: "200", description: "Success")] | ||
public function defineFormatPattern(): void | ||
{ | ||
} | ||
|
||
#[OA\Get(path: "/c", x: ["format-suffix" => false])] | ||
#[OA\Response(response: "200", description: "Success")] | ||
public function disableFormatSuffix(): void | ||
{ | ||
} | ||
} |
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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Tobion\OpenApiSymfonyRouting\Tests\Attributes\Fixtures\OperationId; | ||
|
||
use OpenApi\Attributes as OA; | ||
|
||
#[OA\Info(title: "My API", version: "1.0")] | ||
class Controller | ||
{ | ||
#[OA\Get(path: "/foobar", operationId: "my-name")] | ||
#[OA\Response(response: "200", description: "Success")] | ||
public function __invoke(): void | ||
{ | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
tests/Attributes/Fixtures/PathParameterPattern/Controller.php
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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Tobion\OpenApiSymfonyRouting\Tests\Attributes\Fixtures\PathParameterPattern; | ||
|
||
use mysql_xdevapi\Schema; | ||
use OpenApi\Attributes as OA; | ||
|
||
#[OA\Info(title: "My API", version: "1.0")] | ||
class Controller | ||
{ | ||
#[OA\Get(path: "/foo/{id}")] | ||
#[OA\Response(response:"200", description:"Success")] | ||
public function noPattern( | ||
#[OA\Parameter]string $id | ||
): void | ||
{ | ||
} | ||
|
||
#[OA\Get(path: "/baz/{id}")] | ||
#[OA\Response(response:"200", description:"Success")] | ||
public function noSchema( | ||
#[OA\Parameter]string $id | ||
): void | ||
{ | ||
} | ||
|
||
#[OA\Get(path: "/bar/{id}/{type}")] | ||
#[OA\Response(response:"200", description:"Success")] | ||
public function withPattern( | ||
#[OA\PathParameter(required: true, schema: new OA\Schema(pattern:"^[a-zA-Z0-9]+$"))] | ||
string $id, | ||
#[OA\PathParameter(required: true, schema: new OA\Schema(enum: ["internal", "external"]))] | ||
string $type | ||
): void | ||
{ | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.