Skip to content

Commit cb62975

Browse files
committed
ISSUE-345: template property naming
1 parent 0d367ef commit cb62975

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/OpenApi/SwaggerSchemasResponseEntity.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@
8787
properties: [
8888
new OA\Property(property: 'id', type: 'integer', example: 1),
8989
new OA\Property(property: 'title', type: 'string', example: 'Newsletter'),
90-
new OA\Property(property: 'template', type: 'string', example: 'Hello World!', nullable: true),
91-
new OA\Property(property: 'template_text', type: 'string', nullable: true),
90+
new OA\Property(property: 'content', type: 'string', example: 'Hello World!', nullable: true),
91+
new OA\Property(property: 'text', type: 'string', nullable: true),
9292
new OA\Property(property: 'order', type: 'integer', nullable: true),
9393
new OA\Property(
9494
property: 'images',

src/Serializer/TemplateNormalizer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ public function normalize($object, string $format = null, array $context = []):
2626
return [
2727
'id' => $object->getId(),
2828
'title' => $object->getTitle(),
29-
'template' => $object->getTemplate(),
30-
'template_text' => $object->getTemplateText(),
29+
'content' => $object->getContent(),
30+
'text' => $object->getText(),
3131
'order' => $object->getListOrder(),
3232
'images' => $object->getImages()->toArray() ? array_map(function (TemplateImage $image) {
3333
return $this->templateImageNormalizer->normalize($image);

tests/Unit/Serializer/MessageNormalizerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ public function testNormalizeReturnsExpectedArray(): void
3939
$template = $this->createConfiguredMock(Template::class, [
4040
'getId' => 5,
4141
'getTitle' => 'Test Template',
42-
'getTemplate' => '<html>Hello</html>',
43-
'getTemplateText' => 'Hello',
42+
'getContent' => '<html>Hello</html>',
43+
'getText' => 'Hello',
4444
'getListOrder' => 1,
4545
]);
4646

0 commit comments

Comments
 (0)