AbstractSchemaDefinition implements JsonSerializable
AbstractYes
Base class for schema definitions in elicitation requests.
Tags
Table of Contents
Interfaces
- JsonSerializable
Properties
- $description : string|null
- $title : string|null
Methods
- __construct() : mixed
- getDefault() : mixed
- The value the field is pre-filled with, or null when it declares none.
- jsonSerialize() : array<string, mixed>
- buildBaseJson() : array{type: string, title?: string, description?: string}
- Build the base JSON structure with type, optional title and description.
- validateTitle() : void
- Reject a title that is present but not a string.
Properties
$description read-only
public
string|null
$description
= null
$title read-only
public
string|null
$title
= null
Methods
__construct()
public
__construct([string|null $title = null ][, string|null $description = null ]) : mixed
Parameters
- $title : string|null = null
- $description : string|null = null
getDefault()
The value the field is pre-filled with, or null when it declares none.
public
abstract getDefault() : mixed
jsonSerialize()
public
abstract jsonSerialize() : array<string, mixed>
Return values
array<string, mixed>buildBaseJson()
Build the base JSON structure with type, optional title and description.
protected
buildBaseJson(string $type) : array{type: string, title?: string, description?: string}
Parameters
- $type : string
Return values
array{type: string, title?: string, description?: string}validateTitle()
Reject a title that is present but not a string.
protected
static validateTitle(array<string, mixed> $data, string $schemaType) : void
Parameters
- $data : array<string, mixed>
- $schemaType : string