public function jsonSerialize(): array
    {
        $field = [
            'id' => $this->id,
            'name' => $this->name,
            'type' => $this->type,
            'required' => $this->required,
            'localized' => $this->localized,
        ];

        if ($this->disabled) {
            $field['disabled'] = true;
        }

        if (null !== $this->linkType) {
            $field['linkType'] = $this->linkType;
        }

        if ('Array' === $this->type) {
            $field['items'] = [
                'type' => $this->itemsType,
            ];
            if ('Link' === $this->itemsType) {
                $field['items']['linkType'] = $this->itemsLinkType;
            }
        }

        return $field;
    }
public function jsonSerialize(): array
    {
        $field = [
            'id' => $this->id,
            'name' => $this->name,
            'type' => $this->type,
            'required' => $this->required,
            'localized' => $this->localized,
        ];

        if ($this->disabled) {
            $field['disabled'] = true;
        }

        if (null !== $this->linkType) {
            $field['linkType'] = $this->linkType;
        }

        if ('Array' === $this->type) {
            $field['items'] = [
                'type' => $this->itemsType,
            ];
            if ('Link' === $this->itemsType) {
                $field['items']['linkType'] = $this->itemsLinkType;
            }
        }

        return $field;
    }
{@inheritdoc}