jsonSerialize() public method

Customize the way json_encode() renders the annotations.
public jsonSerialize ( ) : array
return array
示例#1
0
文件: Items.php 项目: Lazybin/huisa
 public function jsonSerialize()
 {
     if (Swagger::isPrimitive($this->type)) {
         return parent::jsonSerialize();
     }
     return array('$ref' => $this->type);
 }
示例#2
0
 public function jsonSerialize()
 {
     $data = parent::jsonSerialize();
     if (count($this->responseMessages) === 0) {
         unset($data['responseMessages']);
     }
     if (count($this->parameters) === 0) {
         unset($data['parameters']);
     }
     return $data;
 }
示例#3
0
 public function jsonSerialize()
 {
     $data = parent::jsonSerialize();
     unset($data['description']);
     if (count($this->models) === 0) {
         unset($data['models']);
     }
     return $data;
 }
示例#4
0
文件: Model.php 项目: Lazybin/huisa
 /**
  * @return array
  */
 public function jsonSerialize()
 {
     $data = parent::jsonSerialize($this);
     $data['properties'] = array();
     foreach ($this->properties as $property) {
         $data['properties'][$property->name] = $property->jsonSerialize();
     }
     return $data;
 }
示例#5
0
 /** @inheritdoc */
 public function jsonSerialize()
 {
     $data = parent::jsonSerialize();
     unset($data->method);
     unset($data->path);
     return $data;
 }