schemas
MMO.schemas · 12 symbols · generated 30 Sep 2026
Create a regular expression from a string
function MMO.schemas.makePattern(reg)- Namespace
MMO.schemas
Create an annotation from a value
function MMO.schemas.createAnnotation(value, path)- Namespace
MMO.schemas
Validate primitive type
function MMO.schemas.validatePrimitiveType(value, type)- Namespace
MMO.schemas
| value | * | |
| type | string | one of json schema's primiotive type |
| returns | bool | |
| throws | | when type is unknown |
Get the JSON-Schema type name of a value.
function MMO.schemas.typeof(value)- Namespace
MMO.schemas
NOTE: unlike javascript's `typeof`, null is 'null', an array is 'array', and a whole
number is 'integer' rather than 'number'.| value | * | |
| returns | string | |
| throws | MMO.TypeError | on a value json cannot carry (a function, undefined, a symbol) |
Register a schema so it can be looked up by id.
function MMO.schemas.register(id, schema)- Namespace
MMO.schemas
Forget a registered schema.
function MMO.schemas.unregister(id)- Namespace
MMO.schemas
function MMO.schemas.exists(id)- Namespace
MMO.schemas
| id | string | |
| returns | boolean | true when a schema is registered under this id |
function MMO.schemas.getById(id)- Namespace
MMO.schemas
Fetch a schema by url
function MMO.schemas.fetch(url)- Namespace
MMO.schemas
| url | string | valid http url |
| returns | | |
Fetch all schemas defined in the framework
function MMO.schemas.fetchClassSchemas()- Namespace
MMO.schemas
Get a schema for a php class
function MMO.schemas.classSchema(classname)- Namespace
MMO.schemas
| classname | string | php classname |
| returns | | |