From 479a7ec2222ac77432475cb98658a887a2c2f5f6 Mon Sep 17 00:00:00 2001 From: mattamon Date: Mon, 2 Dec 2024 14:29:54 +0100 Subject: [PATCH 1/3] Language is nullable --- src/Version/Schema/CustomMetadataVersion.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Version/Schema/CustomMetadataVersion.php b/src/Version/Schema/CustomMetadataVersion.php index fee45c176..9dd6ce879 100644 --- a/src/Version/Schema/CustomMetadataVersion.php +++ b/src/Version/Schema/CustomMetadataVersion.php @@ -24,7 +24,7 @@ */ #[Schema( title: 'CustomMetadataVersion', - required: ['name', 'language', 'type', 'data'], + required: ['name', 'type', 'data'], type: 'object' )] final readonly class CustomMetadataVersion @@ -32,8 +32,8 @@ public function __construct( #[Property(description: 'Name', type: 'string', example: 'custom_metadata')] private string $name, - #[Property(description: 'Language', type: 'string', example: 'en')] - private string $language, + #[Property(description: 'Language', type: 'string', example: 'en', nullable: true)] + private ?string $language, #[Property(description: 'Type', type: 'string', example: 'input')] private string $type, #[Property(description: 'Data', type: 'string', example: 'data')] From 8b9cc53c9955314e16ce66feafdcfeabf2ab4536 Mon Sep 17 00:00:00 2001 From: mattamon Date: Mon, 2 Dec 2024 14:55:07 +0100 Subject: [PATCH 2/3] Updating getter --- src/Version/Schema/CustomMetadataVersion.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Version/Schema/CustomMetadataVersion.php b/src/Version/Schema/CustomMetadataVersion.php index 9dd6ce879..b17511294 100644 --- a/src/Version/Schema/CustomMetadataVersion.php +++ b/src/Version/Schema/CustomMetadataVersion.php @@ -24,7 +24,7 @@ */ #[Schema( title: 'CustomMetadataVersion', - required: ['name', 'type', 'data'], + required: ['name', 'language', 'type', 'data'], type: 'object' )] final readonly class CustomMetadataVersion @@ -32,7 +32,7 @@ public function __construct( #[Property(description: 'Name', type: 'string', example: 'custom_metadata')] private string $name, - #[Property(description: 'Language', type: 'string', example: 'en', nullable: true)] + #[Property(description: 'Language', type: 'string', example: 'en')] private ?string $language, #[Property(description: 'Type', type: 'string', example: 'input')] private string $type, @@ -46,7 +46,7 @@ public function getName(): string return $this->name; } - public function getLanguage(): string + public function getLanguage(): ?string { return $this->language; } From 8ea907fd8b8946b99147bcc89e21b2086fa41b42 Mon Sep 17 00:00:00 2001 From: mattamon Date: Mon, 2 Dec 2024 15:01:24 +0100 Subject: [PATCH 3/3] Remove required --- src/Version/Schema/CustomMetadataVersion.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Version/Schema/CustomMetadataVersion.php b/src/Version/Schema/CustomMetadataVersion.php index b17511294..18bb8ff0e 100644 --- a/src/Version/Schema/CustomMetadataVersion.php +++ b/src/Version/Schema/CustomMetadataVersion.php @@ -24,7 +24,7 @@ */ #[Schema( title: 'CustomMetadataVersion', - required: ['name', 'language', 'type', 'data'], + required: ['name', 'type', 'data'], type: 'object' )] final readonly class CustomMetadataVersion