public function toArray(): array
    {
        if (empty($this->output)) {
            $problem = [
                'type' => $this->type ? (string)$this->type : 'about:blank'
            ];
            if ($this->title) {
                $problem['title'] = $this->title;
            }
            if ($this->status) {
                $problem['status'] = $this->status;
            }
            if ($this->detail) {
                $problem['detail'] = $this->detail;
            }
            if ($this->instance) {
                $problem['instance'] = (string)$this->instance;
            }
            $this->output = array_merge($problem, $this->extensions);
        }
        return $this->output;
    }