As of 0.8.4, bundle authors may define an optional schema for the Replicants in their bundle. If present, NodeCG will validate every change made to the Replicant against this schema. If any change fails validation, either on the server or on the client, an error will be synchronously thrown.
All schemas are in the JSON Schema format. To add a schema to a Replicant,
.json file with the same name as your Replicant in your bundle's
schemas folder. For example,
my-bundle has a Replicant called
foo, the schema would be located at
NodeCG will automatically see and load this schema on startup. Changes to the schema require restarting NodeCG.
If a Replicant's schema has defaults defined, NodeCG will use those defaults to automatically build a
for the Replicant. This auto-generated
defaultValue is overridden by any
defaultValue that is provided during Replicant
If for any reason a Replicant's persisted value becomes invalid, NodeCG will discard this value on startup.