-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
227 additions
and
168 deletions.
There are no files selected for viewing
This file contains 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,22 @@ | ||
<?php | ||
|
||
namespace Pimcore\Bundle\StudioApiBundle\Attributes\Parameters\Path; | ||
|
||
use Attribute; | ||
use OpenApi\Attributes\PathParameter; | ||
use OpenApi\Attributes\Schema; | ||
|
||
#[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)] | ||
final class IdParameter extends PathParameter | ||
{ | ||
public function __construct(string $type = 'element') | ||
{ | ||
parent::__construct( | ||
name: 'id', | ||
description: 'Id of the ' . $type, | ||
in: 'path', | ||
required: true, | ||
schema: new Schema(type: 'integer', example: 83), | ||
); | ||
} | ||
} |
This file contains 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,22 @@ | ||
<?php | ||
|
||
namespace Pimcore\Bundle\StudioApiBundle\Attributes\Parameters\Query; | ||
|
||
use Attribute; | ||
use OpenApi\Attributes\QueryParameter; | ||
use OpenApi\Attributes\Schema; | ||
|
||
#[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)] | ||
final class LimitParameter extends QueryParameter | ||
{ | ||
public function __construct() | ||
{ | ||
parent::__construct( | ||
name: 'limit', | ||
description: 'Number of items per page', | ||
in: 'query', | ||
required: true, | ||
schema: new Schema(type: 'integer', example: 10), | ||
); | ||
} | ||
} |
This file contains 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,22 @@ | ||
<?php | ||
|
||
namespace Pimcore\Bundle\StudioApiBundle\Attributes\Parameters\Query; | ||
|
||
use Attribute; | ||
use OpenApi\Attributes\QueryParameter; | ||
use OpenApi\Attributes\Schema; | ||
|
||
#[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)] | ||
final class PageParameter extends QueryParameter | ||
{ | ||
public function __construct() | ||
{ | ||
parent::__construct( | ||
name: 'page', | ||
description: 'Page number', | ||
in: 'query', | ||
required: true, | ||
schema: new Schema(type: 'integer', example: 1), | ||
); | ||
} | ||
} |
This file contains 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 @@ | ||
<?php | ||
|
||
namespace Pimcore\Bundle\StudioApiBundle\Attributes\Request; | ||
|
||
use Attribute; | ||
use OpenApi\Attributes\JsonContent; | ||
use OpenApi\Attributes\RequestBody; | ||
use Pimcore\Bundle\StudioApiBundle\Dto\Credentials; | ||
|
||
#[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)] | ||
final class CredentialsRequestBody extends RequestBody | ||
{ | ||
public function __construct() | ||
{ | ||
parent::__construct( | ||
required: true, | ||
content: new JsonContent(ref: Credentials::class) | ||
); | ||
} | ||
} |
This file contains 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 @@ | ||
<?php | ||
|
||
namespace Pimcore\Bundle\StudioApiBundle\Attributes\Request; | ||
|
||
use Attribute; | ||
use OpenApi\Attributes\JsonContent; | ||
use OpenApi\Attributes\RequestBody; | ||
use Pimcore\Bundle\StudioApiBundle\Dto\Token\Refresh; | ||
|
||
#[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)] | ||
final class TokenRequestBody extends RequestBody | ||
{ | ||
public function __construct() | ||
{ | ||
parent::__construct( | ||
required: true, | ||
content: new JsonContent(ref: Refresh::class) | ||
); | ||
} | ||
} |
This file contains 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 @@ | ||
<?php | ||
|
||
namespace Pimcore\Bundle\StudioApiBundle\Attributes\Request; | ||
|
||
use Attribute; | ||
use OpenApi\Attributes\JsonContent; | ||
use OpenApi\Attributes\RequestBody; | ||
use Pimcore\Bundle\StudioApiBundle\Dto\Translation; | ||
|
||
#[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)] | ||
final class TranslationRequestBody extends RequestBody | ||
{ | ||
public function __construct() | ||
{ | ||
parent::__construct( | ||
required: true, | ||
content: new JsonContent(ref: Translation::class) | ||
); | ||
} | ||
} |
This file contains 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,19 @@ | ||
<?php | ||
|
||
namespace Pimcore\Bundle\StudioApiBundle\Attributes\Response; | ||
|
||
use Attribute; | ||
use OpenApi\Attributes\Response; | ||
|
||
#[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)] | ||
final class SuccessResponse extends Response | ||
{ | ||
public function __construct(string $description = 'Success', mixed $content = null) | ||
{ | ||
parent::__construct( | ||
response: 200, | ||
description: $description, | ||
content: $content | ||
); | ||
} | ||
} |
This file contains 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,21 @@ | ||
<?php | ||
|
||
namespace Pimcore\Bundle\StudioApiBundle\Attributes\Response; | ||
|
||
use Attribute; | ||
use OpenApi\Attributes\JsonContent; | ||
use OpenApi\Attributes\Response; | ||
use Pimcore\Bundle\StudioApiBundle\Dto\Unauthorized; | ||
|
||
#[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)] | ||
final class UnauthorizedResponse extends Response | ||
{ | ||
public function __construct() | ||
{ | ||
parent::__construct( | ||
response: 401, | ||
description: 'Unauthorized', | ||
content: new JsonContent(ref: Unauthorized::class) | ||
); | ||
} | ||
} |
This file contains 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 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
Oops, something went wrong.