Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(microservices): change isNotKafkaMessage validation condition #13375

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
refactor(microservices): Fix isNotKafkaMessage validation condition
  • Loading branch information
jochongs committed Mar 29, 2024
commit 0209a9146931298ab0f24aa6cdf27fd7ae9a4b6b
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ export class KafkaRequestSerializer
{
serialize(value: any) {
const isNotKafkaMessage =
isNil(value) ||
!isObject(value) ||
(!('key' in value) && !('value' in value));
isNil(value) || !isObject(value) || !('key' in value && 'value' in value);

if (isNotKafkaMessage) {
value = { value };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ describe('KafkaRequestSerializer', () => {
}),
).to.deep.eq({
headers: {},
value: 'string',
value: JSON.stringify({
value: 'string',
}),
});
});

Expand Down