Skip to content

Commit

Permalink
Fixed generation of parameters with $ref schema
Browse files Browse the repository at this point in the history
  • Loading branch information
kocsismate committed Oct 25, 2014
1 parent b94e097 commit bb93a78
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Swagger2/Parameters/SchemaParameter.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
namespace WoohooLabs\SpecGenerator\Swagger2\Parameters;

use WoohooLabs\SpecGenerator\Swagger2\Schema\SchemaInterface;
use WoohooLabs\SpecGenerator\Utilities\Generator;

class SchemaParameter extends AbstractParameter
{
Expand Down Expand Up @@ -39,9 +40,10 @@ public function __construct($name = null, $in = null, $required = null, SchemaIn
*/
public function generate()
{
$objectSchema= $this->schema !== null ? $this->schema->generate() : [];
$result= [];
$result= Generator::addGeneratableToArrayIfNotEmpty($result, "schema", $this->schema);

return array_merge($this->generateBasicParameter(), $objectSchema);
return array_merge($this->generateBasicParameter(), $result);
}

/**
Expand Down

0 comments on commit bb93a78

Please sign in to comment.