Model Format Changelog
Every change to the format of the class files, per format version. Files in an older format keep loading: the platform converts them on load, and the upgrade download rewrites them for you.
Version 1
The first versioned format. It makes the vocabulary consistent: a definition is a class, a typed
property of a class is a field, and type is only used to tell which kind of script or layout item
an object is. Files without a version are format 0.
JSON Schema: https://api.mosterd.com/schema/definition-v1.schema.json
Renamed properties
| Format 0 | Format 1 |
|---|---|
| — | "version": 1 at the top of the file |
type (of the class: BASIC, ABSTRACT, NONE, EXTENSION) | kind (BASIC, ABSTRACT, CONFIG, EXTENSION) |
"type": "NONE" | "kind": "CONFIG" |
valueTypes | fields |
nameValueType | nameField |
customKeyName | customKeyField |
relations[].type | relations[].class |
formulas[].valueType | formulas[].field |
translations[].valueTypeLabels | translations[].fieldLabels |
layouts[].type | layouts[].kind |
layouts[].labelKey | layouts[].label |
assets[].type | assets[].kind |
generalSearchType | generalSearchClasses |
navigationType (NAVIGATE layout items) | navigationKind |
Changed values
| What | Format 0 | Format 1 |
|---|---|---|
Script type | javascript, functionGateway, consumerGateway, producerGateway | JAVASCRIPT, FUNCTION_GATEWAY, CONSUMER_GATEWAY, PRODUCER_GATEWAY |
| JavaScript producer | "type": "javascript" with "producer": true | "type": "JAVASCRIPT_PRODUCER" |
Column aggregate | sum, avg, count | SUM, AVG, COUNT |
| Label prefixes | DATA_CLASS_SINGULAR:, DATA_CLASS_PLURAL:, VALUE_TYPE_LABEL: | CLASS_SINGULAR:, CLASS_PLURAL:, FIELD_LABEL: |
scripts[].trigger, generalSearchClasses | A single value or an array | Always an array |
File references (javascriptFile, utilitiesFiles, templateFile, promptFile, schemaFile) | Extension optional (scripts/logNoteChange) | Always with extension (scripts/logNoteChange.js) |
Platform properties as a column or filter name | type, creationDate, modificationDate | _class, _creationDate, _modificationDate |
| Gateway target that changes the object's class | "name": "_type" | "name": "_class" |
| Class filter in a formula's relation bracket | contents[type=task] | contents[class=task] |
In format 0, type, creationDate and modificationDate as a column or view-filter name meant the
platform property unless the class had a field of that name. In format 1 they are ordinary field names;
the platform properties start with _.
References by class name
A related class is always named by its qualified name (commons.dossier), never by the relation's REST
name (dossier, invoiceLines):
| Where | Format 0 | Format 1 |
|---|---|---|
Archetype relation slots in archetypes[].slots | "container": "dossier" | "container": "commons.dossier" |
Report context[].relation | "relation": "invoiceLines" | "relation": "commons.invoiceLine" |
In a format 1 file, a REST name in these places is an error that suggests the class name.
New
apiVersionon scripts. The version of the script API a JavaScript script was written for, or the contract version of a gateway. Scripts from a format 0 file getapiVersion: 0on conversion; a script without it uses version 1.$schema. An optional editor hint; see Editor support.
Stricter checks
These apply to every file, whatever its format:
- An unknown property refuses the model instead of being ignored.
- Field, script and file references are checked when the model loads instead of when they are used.
- Field names are lowerCamelCase and never contain
_. - A refused model does not replace the active one. See Loading a model.
Deprecated
Nothing.