Type
abstract class Type extends JsonSchema
Properties
| protected bool|null | $required | Whether the type is required. |
|
| protected string|null | $title | The type's title. |
|
| protected string|null | $description | The type's description. |
|
| protected mixed | $default | The default value for the type. |
|
| protected null|array<int, mixed> | $enum | The set of allowed values for the type. |
|
| protected bool|null | $nullable | Indicates if the type is nullable. |
Methods
Dynamically pass static methods to the schema instance.
No description
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
in
JsonSchema at line 23
static Type
__callStatic(string $name, array $arguments)
Dynamically pass static methods to the schema instance.
in
JsonSchema at line 18
static ObjectType
object(Closure|array<string $, Type> $properties = '[]')
No description
in
JsonSchema at line 18
static IntegerType
integer()
No description
in
JsonSchema at line 18
static NumberType
number()
No description
in
JsonSchema at line 18
static StringType
string()
No description
in
JsonSchema at line 18
static BooleanType
boolean()
No description
in
JsonSchema at line 18
static ArrayType
array()
No description
at line 49
Type
required(bool $required = true)
Indicate that the type is required.
at line 61
Type
nullable(bool $nullable = true)
Indicate that the type is optional.
at line 73
Type
title(string $value)
Set the type's title.
at line 83
Type
description(string $value)
Set the type's description.
at line 97
Type
enum(array|string $values)
Restrict the value to one of the provided enumerated values.
at line 118
array
toArray()
Convert the type to an array.
at line 126
string
toString()
Convert the type to its string representation.
at line 134
string
__toString()
Convert the type to its string representation.