Skip to content

Commit 5fb4067

Browse files
author
Masiukevich Maksim
committed
Add content type
1 parent 322d3c2 commit 5fb4067

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/MessageEncoder.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,9 @@ public function encode(object $message): string;
3232
* @throws \ServiceBus\MessageSerializer\Exceptions\NormalizationFailed Unexpected normalize result
3333
*/
3434
public function normalize(object $message): array;
35+
36+
/**
37+
* Receive encoded data content type.
38+
*/
39+
public function contentType(): string;
3540
}

src/Symfony/SymfonySerializer.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,4 +146,9 @@ public function normalize(object $message): array
146146
throw new NormalizationFailed($throwable->getMessage(), (int) $throwable->getCode(), $throwable);
147147
}
148148
}
149+
150+
public function contentType(): string
151+
{
152+
return 'application/json';
153+
}
149154
}

0 commit comments

Comments
 (0)