class ObjectSchema extends Schema

Methods

__construct(Type $schema, string $name = 'schema_definition', bool $strict = false)

Create a new output schema.

string
name()

Get the name of the schema.

from  Schema
withName(string $name)

Create a new output schema with the given name.

from  Schema
array
toArray()

Get the array representation of the schema.

from  Schema
array
toSchema()

Get the array representation of the schema with additional properties disabled on all nested objects.

static array
disableAdditionalProperties(array $schema)

Recursively set "additionalProperties" to false on all object nodes.

string
schemaType()

Get the schema type.

Details

at line 15
__construct(Type $schema, string $name = 'schema_definition', bool $strict = false)

Create a new output schema.

Parameters

Type $schema
string $name
bool $strict

in Schema at line 25
string name()

Get the name of the schema.

Return Value

string

in Schema at line 33
Schema withName(string $name)

Create a new output schema with the given name.

Parameters

string $name

Return Value

Schema

in Schema at line 47
array toArray()

Get the array representation of the schema.

Return Value

array

at line 32
array toSchema()

Get the array representation of the schema with additional properties disabled on all nested objects.

Return Value

array

at line 44
static protected array disableAdditionalProperties(array $schema)

Recursively set "additionalProperties" to false on all object nodes.

Parameters

array $schema

Return Value

array

at line 74
string schemaType()

Get the schema type.

Return Value

string