Skip to content

Commit

Permalink
conditionally return description
Browse files Browse the repository at this point in the history
  • Loading branch information
cnizzardini committed May 1, 2020
1 parent e3db51a commit 5e36ba9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Lib/OpenApi/Parameter.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ public function toArray() : array

public function jsonSerialize()
{
return $this->toArray();
$vars = $this->toArray();
if (empty($vars['description'])) {
unset($vars['description']);
}
return $vars;
}

/**
Expand Down

0 comments on commit 5e36ba9

Please sign in to comment.