Skip to content

Commit 3b26534

Browse files
committed
Fix: message format options
1 parent 890acdb commit 3b26534

2 files changed

Lines changed: 6 additions & 13 deletions

File tree

src/Messaging/Request/Message/MessageFormatRequest.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,6 @@
1919
enum: ['html', 'text', 'invite'],
2020
example: 'html'
2121
),
22-
new OA\Property(
23-
property: 'format_options',
24-
type: 'array',
25-
items: new OA\Items(type: 'string', enum: ['text', 'html', 'pdf']),
26-
example: ['html']
27-
),
2822
],
2923
type: 'object'
3024
)]
@@ -36,18 +30,11 @@ class MessageFormatRequest implements RequestDtoInterface
3630
#[Assert\Choice(['html', 'text', 'invite'])]
3731
public string $sendFormat;
3832

39-
#[Assert\All([
40-
new Assert\Type('string'),
41-
new Assert\Choice(['text', 'html', 'pdf']),
42-
])]
43-
public array $formatOptions;
44-
4533
public function getDto(): MessageFormatDto
4634
{
4735
return new MessageFormatDto(
4836
htmlFormated: $this->htmlFormated,
4937
sendFormat: $this->sendFormat,
50-
formatOptions: $this->formatOptions,
5138
);
5239
}
5340
}

src/Messaging/Serializer/MessageNormalizer.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636
new OA\Property(property: 'send_format', type: 'string', example: 'text', nullable: true),
3737
new OA\Property(property: 'as_text', type: 'integer', example: 12),
3838
new OA\Property(property: 'as_html', type: 'integer', example: 12),
39+
new OA\Property(property: 'as_text_and_html', type: 'integer', example: 12),
40+
new OA\Property(property: 'as_pdf', type: 'integer', example: 12),
41+
new OA\Property(property: 'as_text_and_pdf', type: 'integer', example: 12),
3942
],
4043
type: 'object'
4144
),
@@ -112,6 +115,9 @@ public function normalize($object, string $format = null, array $context = []):
112115
'send_format' => $object->getFormat()->getSendFormat(),
113116
'as_text' => $object->getFormat()->getAsText(),
114117
'as_html' => $object->getFormat()->getAsHtml(),
118+
'as_text_and_html' => $object->getFormat()->getAsTextAndHtml(),
119+
'as_pdf' => $object->getFormat()->getAsPdf(),
120+
'as_text_and_pdf' => $object->getFormat()->getAsTextAndHtml(),
115121
],
116122
'message_metadata' => [
117123
'status' => $object->getMetadata()->getStatus()->value,

0 commit comments

Comments
 (0)