src/Leevel/Http/JsonResponse.php
public function setJson($json): IResponse
    {
        if ($this->checkFlowControl()) {
            return $this;
        }

        if (!$this->isJsonData($json)) {
            throw new InvalidArgumentException('The method setJson need a json data.');
        }

        $this->data = $json;

        return $this->updateContent();
    }
public function setJson($json): IResponse
    {
        if ($this->checkFlowControl()) {
            return $this;
        }

        if (!$this->isJsonData($json)) {
            throw new InvalidArgumentException('The method setJson need a json data.');
        }

        $this->data = $json;

        return $this->updateContent();
    }
设置原生 JSON 数据.

@param mixed $json

@return $this