From a5383f95a320c25f73449b1885bc740e28e3f7c2 Mon Sep 17 00:00:00 2001 From: DerManoMann Date: Thu, 17 Aug 2023 09:35:33 +1200 Subject: [PATCH 1/3] Baseline test --- .../Scratch/CustomPropertyAttribute.php | 31 +++++++++++++++++++ .../Scratch/CustomPropertyAttribute.yaml | 18 +++++++++++ 2 files changed, 49 insertions(+) create mode 100644 tests/Fixtures/Scratch/CustomPropertyAttribute.php create mode 100644 tests/Fixtures/Scratch/CustomPropertyAttribute.yaml diff --git a/tests/Fixtures/Scratch/CustomPropertyAttribute.php b/tests/Fixtures/Scratch/CustomPropertyAttribute.php new file mode 100644 index 00000000..3bd637c2 --- /dev/null +++ b/tests/Fixtures/Scratch/CustomPropertyAttribute.php @@ -0,0 +1,31 @@ + Date: Thu, 17 Aug 2023 09:40:18 +1200 Subject: [PATCH 2/3] Use custom property attribute --- tests/Fixtures/Scratch/CustomPropertyAttribute.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/Fixtures/Scratch/CustomPropertyAttribute.php b/tests/Fixtures/Scratch/CustomPropertyAttribute.php index 3bd637c2..a161339d 100644 --- a/tests/Fixtures/Scratch/CustomPropertyAttribute.php +++ b/tests/Fixtures/Scratch/CustomPropertyAttribute.php @@ -8,6 +8,7 @@ use OpenApi\Attributes as OAT; +#[\Attribute(\Attribute::TARGET_METHOD | \Attribute::TARGET_PROPERTY | \Attribute::TARGET_PARAMETER | \Attribute::TARGET_CLASS_CONSTANT | \Attribute::IS_REPEATABLE)] final class CustomOpenApiProperty extends OAT\Property { } @@ -24,7 +25,7 @@ class Controller class CustomPropertyAttribute { public function __construct( - #[OAT\Property()] + #[CustomOpenApiProperty()] public ?int $number, ) { } From 3ab0fb932a849d1cf0672aeb1ef5dba9ed15d1c0 Mon Sep 17 00:00:00 2001 From: DerManoMann Date: Thu, 17 Aug 2023 09:42:40 +1200 Subject: [PATCH 3/3] . --- tests/Fixtures/Scratch/CustomPropertyAttribute.php | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/Fixtures/Scratch/CustomPropertyAttribute.php b/tests/Fixtures/Scratch/CustomPropertyAttribute.php index a161339d..63e1c7fb 100644 --- a/tests/Fixtures/Scratch/CustomPropertyAttribute.php +++ b/tests/Fixtures/Scratch/CustomPropertyAttribute.php @@ -18,7 +18,6 @@ final class CustomOpenApiProperty extends OAT\Property #[OAT\Response(response: 200, description: 'All good')] class Controller { - } #[OAT\Schema]