Annotation
MMO.schemas · 1 symbol · generated 30 Sep 2026
Annotation
Annotation.js:22The result of validating one value against a schema: whether it passed, and why not.
- Namespace
MMO.schemas
Index
| valid readonly accessor | ||
| constructor(value, path) | ||
| addError(type, vars, schemaPath) | Record a failure, rendering its message from the catalogue. | |
| getErrors() | ||
| pushErrors(anno) | Adopt another annotation's errors. | |
| merge(anno, withErrors) | Fold a sub validation's outcome into this one. | |
| makeInvalid(schemaPath) | Make sub annotation invalid | |
| toJSON() | Serialise in the standard JSON-Schema "basic" output format. |
Properties1
valid
readonlyaccessorAnnotation.js:34- Type
boolean
Methods7
constructor(value, path)
Annotation.js:23| value | ||
| path = '' |
addError(type, vars, schemaPath)
Annotation.js:45Record a failure, rendering its message from the catalogue.
| type | string | the message key MMO.schemas.MESSAGES |
| vars | Object | injected into the message; value and # are filled in |
| schemaPath = '' | string | the keyword's location in the schema |
| returns | this |
getErrors()
Annotation.js:56| returns | Array<string> | the messages of THIS annotation, without the children's |
pushErrors(anno)
Annotation.js:70Adopt another annotation's errors.
merge(anno, withErrors)
Annotation.js:80Fold a sub validation's outcome into this one.
| anno | MMO.schemas.Annotation | |
| withErrors = true | boolean | false to keep only the "was evaluated" flag, which is what anyOf/oneOf need: a branch that failed still marks its properties as seen |
makeInvalid(schemaPath)
Annotation.js:90Make sub annotation invalid
| schemaPath = '' | string | [internal] |
| returns | none |
toJSON()
Annotation.js:104Serialise in the standard JSON-Schema "basic" output format.
| returns | valid: boolean, errors: Array= | } |