Type
abstract class Type extends JsonSchema (View source)
Properties
| protected | $required | Whether the type is required. |
|
| protected | $title | The type's title. |
|
| protected | $description | The type's description. |
|
| protected | $default | The default value for the type. |
|
| protected array<int,mixed>|null | $enum | The set of allowed values for the type. |
|
| protected | $nullable | Indicates if the type is nullable. |
Methods
Dynamically pass static methods to the schema instance.
Set the type's description.
Convert the type to an array.
Convert the type to its string representation.
Convert the type to its string representation.
Details
static Type
__callStatic(string $name, mixed $arguments)
Dynamically pass static methods to the schema instance.
Type
required(bool $required = true)
Indicate that the type is required.
Type
nullable(bool $nullable = true)
Indicate that the type is optional.
Type
title(string $value)
Set the type's title.
Type
description(string $value)
Set the type's description.
Type
enum(array $values)
Restrict the value to one of the provided enumerated values.
array
toArray()
Convert the type to an array.
string
toString()
Convert the type to its string representation.
string
__toString()
Convert the type to its string representation.