Skip to content

Commit

Permalink
Fix broken discriminator
Browse files Browse the repository at this point in the history
  • Loading branch information
ackintosh committed Apr 1, 2018
1 parent 24db65b commit 7daa2ec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,8 @@ public void setUnescapedDescription(String unescapedDescription) {
this.unescapedDescription = unescapedDescription;
}

public Discriminator getDiscriminator() {
return discriminator;
public String getDiscriminator() {
return discriminator == null ? null : discriminator.getPropertyName();
}

public void setDiscriminator(Discriminator discriminator) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
*/
class Animal implements ModelInterface, ArrayAccess
{
const DISCRIMINATOR = 'Discriminator{propertyName='className', mapping=null}';
const DISCRIMINATOR = 'className';

/**
* The original name of the model.
Expand Down Expand Up @@ -186,7 +186,7 @@ public function __construct(array $data = null)
$this->container['color'] = isset($data['color']) ? $data['color'] : 'red';

// Initialize discriminator property with the model name.
$discriminator = array_search('Discriminator{propertyName='className', mapping=null}', self::$attributeMap);
$discriminator = array_search('className', self::$attributeMap);
$this->container[$discriminator] = static::$swaggerModelName;
}

Expand Down

0 comments on commit 7daa2ec

Please # to comment.