Class JsonSchema
JSON Schema generation utilities
Provides static methods to generate JSON Schema for objects and resources
Methods summary
public static
|
#
generate( $type, $url )
Valid resource names
Var
array
|
public static
mixed
|
#
typeSchema( string $type )
Schema of a resource or object type
Schema of a resource or object type
Parameters
- $type
- Resource or object type name
Returns
mixed
Throws
Cake\Http\Exception\NotFoundException if no type is found
|
protected static
array|boolean
|
#
addRevision( array|boolean $schema )
Add revision information to schema
Add revision information to schema
Parameters
- $schema
- Schema array or
false
Returns
array|boolean Schema with revision or false
|
public static
string|boolean
|
#
schemaRevision( string $type )
Get current revision of a type schema
Get current revision of a type schema
Parameters
- $type
- Resource or object type name
Returns
string|boolean Schema revision or false if no schema is found
Throws
Cake\Http\Exception\NotFoundException if no type is found
|
public static
array
|
#
resourceSchema( string $resource )
Build resource properties directly from a db table
Build resource properties directly from a db table
Parameters
- $resource
- Resource type name
Returns
array JSON Schema array with properties and required
|
public static
mixed
|
#
objectSchema( BEdita\Core\Model\Entity\ObjectType $objectType )
Object type properties representation as array
Object type properties representation as array
Parameters
- $objectType
- Object type to represent
Returns
mixed JSON Schema array with properties and required
|