Default topic description to an empty string instead of null
Not using nulls makes things more type safe.
This commit is contained in:
parent
07b6ee58fe
commit
74a7ffbf7a
2 changed files with 2 additions and 4 deletions
|
@ -1696,12 +1696,9 @@ App::post('/v1/messaging/topics')
|
|||
$topic = new Document([
|
||||
'$id' => $topicId,
|
||||
'name' => $name,
|
||||
'description' => $description
|
||||
]);
|
||||
|
||||
if ($description) {
|
||||
$topic->setAttribute('description', $description);
|
||||
}
|
||||
|
||||
try {
|
||||
$topic = $dbForProject->createDocument('topics', $topic);
|
||||
} catch (DuplicateException) {
|
||||
|
|
|
@ -245,6 +245,7 @@ trait MessagingBase
|
|||
]);
|
||||
$this->assertEquals(201, $response['headers']['status-code']);
|
||||
$this->assertEquals('my-app', $response['body']['name']);
|
||||
$this->assertEquals('', $response['body']['description']);
|
||||
|
||||
return $response['body'];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue