File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 1313use cebe \openapi \json \JsonReference ;
1414use cebe \openapi \spec \Reference ;
1515use cebe \openapi \spec \Type ;
16+ use \JsonSerializable ;
1617
1718/**
1819 * Base class for all spec objects.
1920 *
2021 * Implements property management and validation basics.
2122 *
2223 */
23- abstract class SpecBaseObject implements SpecObjectInterface, DocumentContextInterface
24+ abstract class SpecBaseObject implements SpecObjectInterface, DocumentContextInterface, JsonSerializable
2425{
2526 private $ _properties = [];
2627 private $ _errors = [];
@@ -525,4 +526,8 @@ public function getExtensions(): array
525526 }
526527 return $ extensions ;
527528 }
529+
530+ public function jsonSerialize () {
531+ return $ this ->getSerializableData ();
532+ }
528533}
Original file line number Diff line number Diff line change 99
1010use cebe \openapi \exceptions \TypeErrorException ;
1111use cebe \openapi \SpecBaseObject ;
12- use \JsonSerializable ;
1312
1413/**
1514 * This is the root document object of the OpenAPI document.
2625 * @property ExternalDocumentation|null $externalDocs
2726 *
2827 */
29- class OpenApi extends SpecBaseObject implements JsonSerializable
28+ class OpenApi extends SpecBaseObject
3029{
3130 /**
3231 * @return array array of attributes available in this object.
@@ -80,8 +79,4 @@ public function performValidation()
8079 $ this ->addError ('Unsupported openapi version: ' . $ this ->openapi );
8180 }
8281 }
83-
84- public function jsonSerialize () {
85- return $ this ->getSerializableData ();
86- }
8782}
You can’t perform that action at this time.
0 commit comments