class JsonSchemaTypeFactory extends JsonSchema implements JsonSchema (View source)

Constants

MAX_NODES

The maximum number of schema fragments that may be expanded when deserializing or building rules.

Methods

static Type
fromArray(array $schema)

Build a type from a raw array of the Laravel-supported JSON Schema subset.

static array
rules(Type|array $schema)

Get the Laravel validation rules for the properties of the given object schema.

static Type
__callStatic(string $name, mixed $arguments)

Dynamically pass static methods to the schema instance.

object(Type> $properties = [])

Create a new object schema instance.

integer()

Create a new integer property instance.

number()

Create a new number property instance.

string()

Create a new string property instance.

boolean()

Create a new boolean property instance.

array()

Create a new array property instance.

union(string> $types)

Create a new multi-type union instance.

Details

static Type fromArray(array $schema)

Build a type from a raw array of the Laravel-supported JSON Schema subset.

Parameters

array $schema

Return Value

Type

Exceptions

InvalidArgumentException

static array rules(Type|array $schema)

Get the Laravel validation rules for the properties of the given object schema.

Parameters

Type|array $schema

Return Value

array

Exceptions

InvalidArgumentException

static Type __callStatic(string $name, mixed $arguments)

Dynamically pass static methods to the schema instance.

Parameters

string $name
mixed $arguments

Return Value

Type

ObjectType object(Type> $properties = [])

Create a new object schema instance.

Parameters

Type> $properties

Return Value

ObjectType

IntegerType integer()

Create a new integer property instance.

Return Value

IntegerType

NumberType number()

Create a new number property instance.

Return Value

NumberType

StringType string()

Create a new string property instance.

Return Value

StringType

BooleanType boolean()

Create a new boolean property instance.

Return Value

BooleanType

ArrayType array()

Create a new array property instance.

Return Value

ArrayType

UnionType union(string> $types)

Create a new multi-type union instance.

Parameters

string> $types

Return Value

UnionType