Builder
in package
Builder for creating schema objects.
See: https://developer.wordpress.org/rest-api/extending-the-rest-api/schema/
Table of Contents
- any_of() : Any_Of_Schema
- Creates a schema that allows a value to match any of the given schemas.
- array() : Array_Schema
- Creates a schema for an array.
- boolean() : Boolean_Schema
- Creates a schema for a boolean.
- integer() : Integer_Schema
- Creates a schema for an integer.
- null() : Null_Schema
- Creates a schema for null.
- number() : Number_Schema
- Creates a schema for a number.
- object() : Object_Schema
- Creates a schema for an object.
- one_of() : One_Of_Schema
- Creates a schema that allows a value to match one of the given schemas.
- string() : String_Schema
- Creates a schema for a string.
Methods
any_of()
Creates a schema that allows a value to match any of the given schemas.
public
static any_of(array<string|int, Schema> $schemas) : Any_Of_Schema
Parameters
- $schemas : array<string|int, Schema>
-
List of schemas.
Return values
Any_Of_Schema —array()
Creates a schema for an array.
public
static array([Schema|null $items = null ]) : Array_Schema
Parameters
- $items : Schema|null = null
-
Schema of the items in the array.
Return values
Array_Schema —boolean()
Creates a schema for a boolean.
public
static boolean() : Boolean_Schema
Return values
Boolean_Schema —integer()
Creates a schema for an integer.
public
static integer() : Integer_Schema
Return values
Integer_Schema —null()
Creates a schema for null.
public
static null() : Null_Schema
Return values
Null_Schema —number()
Creates a schema for a number.
public
static number() : Number_Schema
Return values
Number_Schema —object()
Creates a schema for an object.
public
static object([array<string, Schema>|null $properties = null ]) : Object_Schema
Parameters
- $properties : array<string, Schema>|null = null
-
Properties of the object.
Return values
Object_Schema —one_of()
Creates a schema that allows a value to match one of the given schemas.
public
static one_of(array<string|int, Schema> $schemas) : One_Of_Schema
Parameters
- $schemas : array<string|int, Schema>
-
List of schemas.
Return values
One_Of_Schema —string()
Creates a schema for a string.
public
static string() : String_Schema