Index

schemas

MMO.schemas · 12 symbols · generated 30 Sep 2026

function

extractTypes

schemas.js:134

Extract the types of a raw schema (stored in an array)

function MMO.schemas.extractTypes(schema)
Namespace
MMO.schemas
schema
returns
function

makePattern

schemas.js:167

Create a regular expression from a string

function MMO.schemas.makePattern(reg)
Namespace
MMO.schemas
regstring
returnsRegExp
function

createAnnotation

schemas.js:177

Create an annotation from a value

function MMO.schemas.createAnnotation(value, path)
Namespace
MMO.schemas
value*
pathstringthe absolute path of the value
returnsMMO.schemas.Annotation
function

validatePrimitiveType

schemas.js:191

Validate primitive type

function MMO.schemas.validatePrimitiveType(value, type)
Namespace
MMO.schemas
value*
typestringone of json schema's primiotive type
returnsbool
throwswhen type is unknown
function

typeof

schemas.js:223

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*
returnsstring
throwsMMO.TypeErroron a value json cannot carry (a function, undefined, a symbol)
function

register

schemas.js:331

Register a schema so it can be looked up by id.

function MMO.schemas.register(id, schema)
Namespace
MMO.schemas
idstring
schemaMMO.schemas.Schema
throwsstringon anything that is not a Schema
function

unregister

schemas.js:342

Forget a registered schema.

function MMO.schemas.unregister(id)
Namespace
MMO.schemas
idstring
function

exists

schemas.js:351
function MMO.schemas.exists(id)
Namespace
MMO.schemas
idstring
returnsbooleantrue when a schema is registered under this id
function

getById

schemas.js:360
function MMO.schemas.getById(id)
Namespace
MMO.schemas
idstring
returnsMMO.schemas.Schema
throwsMMO.Errorwhen nothing is registered under this id
function

fetch

schemas.js:369

Fetch a schema by url

function MMO.schemas.fetch(url)
Namespace
MMO.schemas
urlstringvalid http url
returns
function

fetchClassSchemas

schemas.js:390

Fetch all schemas defined in the framework

function MMO.schemas.fetchClassSchemas()
Namespace
MMO.schemas
returns
function

classSchema

schemas.js:399

Get a schema for a php class

function MMO.schemas.classSchema(classname)
Namespace
MMO.schemas
classnamestringphp classname
returns