Skip to content
7 changes: 6 additions & 1 deletion src/SpecBaseObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@
use cebe\openapi\json\JsonReference;
use cebe\openapi\spec\Reference;
use cebe\openapi\spec\Type;
use \JsonSerializable;

/**
* Base class for all spec objects.
*
* Implements property management and validation basics.
*
*/
abstract class SpecBaseObject implements SpecObjectInterface, DocumentContextInterface, RawSpecDataInterface
abstract class SpecBaseObject implements SpecObjectInterface, DocumentContextInterface, JsonSerializable, RawSpecDataInterface
{
private $_rawSpec;
private $_properties = [];
Expand Down Expand Up @@ -528,6 +529,10 @@ public function getExtensions(): array
return $extensions;
}

public function jsonSerialize() {
return $this->getSerializableData();
}

public function getRawSpecData(): array
{
return $this->_rawSpec;
Expand Down