info = new FieldInfo("block", "Block editor", FieldType::JSON); } public function format(array $input, array $output): array { $value = $input[$this->name] ?? null; if (is_string($value)) { $value = json_decode($value, true); } $output[$this->name] = (new Nullable($this->nullable, $value, []))->value(); return $output; } public function failRequired(mixed $value): bool { return empty($value); } public function isRequired(): bool { return $this->required; } public function toJsonSchema(): Property { return new TypeProperty( type: PropertyType::STRING, id: $this->name, title: Option::fromValue($this->label), description: Option::fromValue($this->help, ""), default: Option::fromValue($this->default, ""), minLength: none(), maxLength: none(), readOnly: Option::fromValue($this->readonly, false), enum: none(), comment: Option::fromValue($this->group, ""), format: none(), ); } }