Skip to content

manifest.json

manifest.json holds what other parties rely on: the types of arguments, results, catalog rows and events, the catalogs, the required modules and the pages in the Dashboard. The Go types are generated from it; never write a contract type by hand.

{
"module": "battlepass",
"version": "0.2.0",
"title": "Battle pass",
"description": "Seasons of tiers players climb with experience.",
"icon": "award",
"requires": {"stores": "^1.0"},
"types": {
"Season": {
"type": "object",
"required": ["key", "window"],
"properties": {
"key": {"type": "string"},
"window": {"$ref": "rudder:window"}
}
},
"Tier": {
"type": "object",
"required": ["season", "level", "xp", "reward"],
"properties": {
"season": {"type": "string"},
"level": {"type": "integer"},
"xp": {"type": "integer"},
"reward": {"$ref": "rudder:amount"},
"premiumReward": {"$ref": "rudder:amount", "nullable": true}
}
},
"Reached": {
"type": "object",
"required": ["season", "level"],
"properties": {
"season": {"type": "string"},
"level": {"type": "integer"}
}
}
},
"content": {
"seasons": {"row": "Season", "key": "key", "window": "window", "exclusive": true},
"tiers": {"row": "Tier", "indexes": ["season"]}
},
"events": {"reached": "Reached"}
}
FieldMeaning
moduleThe name of the module, lowercase letters and digits starting with a letter, such as battlepass. The client calls it by this name. admin, ledger, rudder and session are taken.
versionA semantic version, such as 0.2.0. A published version never changes.
title, description, iconThe card of the module in the Dashboard. icon is one of the page icons.
requiresThe modules this one calls or listens to, each with a caret range (see Calls and events).
typesThe named types of the contract.
contentThe catalogs (see Catalogs).
eventsThe events the module emits, each naming an object type of types.
adminThe pages of the module in the Dashboard (see Dashboard pages).

An entry of types is a JSON Schema of a small subset: an object, an enum of strings ({"type": "string", "enum": ["day", "week"]}) or any other value schema. Its name is an exported Go identifier.

  • A property is a scalar, an array, a map (additionalProperties) or a $ref. An object or an enum used as a property is always a named entry of types.
  • $ref is #/types/<name> or one of the built-in types below.
  • allOf with one $ref to an object type embeds it, and adds the properties of its own.
  • The keywords are type, properties, required, items, additionalProperties, enum, format: date-time, $ref, allOf, nullable, title and description. Any other keyword fails generation. Value constraints such as minimum or pattern are not supported yet: check values in code.
  • Types are not recursive.
Built-in typeJSONGo
rudder:amount{"asset": "gems", "amount": 10}rudder.Amount
rudder:window{"start": "...", "end": "..."}, either bound optionalrudder.Window
rudder:regen{"every": 300, "max": 5}rudder.RegenRule
rudder:regen-state{"value", "max", "every", "nextAt", "fullAt", "at"}rudder.RegenState
SchemaGo
integerint64
numberfloat64
boolean, stringbool, string
string with format: date-timetime.Time
arraya slice
object with additionalPropertiesmap[string]T
$ref: #/types/<name>the generated type
an objecta struct, fields sorted by name
a property not in requireda field that is omitted when zero
nullable: truea pointer
an enum of stringsa named string type with constants <Type><Value> (PeriodDay)

A field is named after its property with the first letter in upper case and a trailing Id or Url in capitals: id is ID, premiumPrice is PremiumPrice, imageUrl is ImageURL. Zero and absent are told apart only with nullable.

title and description label the fields of a form in the Dashboard.

FileWhat it isCommit it
rudder_gen.goThe types, the catalogs, the wiring of the fields and functions.yes
rudder_gen_test.goThe test client (NewGame).yes
rudder.lock.jsonThe fields, functions, events and timers of the module as published, for the compatibility check.yes
requires/<module>.json and requires/<module>/The contract of a required module and its generated package.yes
<module>.wasm, <module>.manifest.jsonThe build and the built manifest.no

The built manifest is the source manifest plus what comes from the code: the functions with their kinds, the fields, the timers and the errors. Rudder reads only the built manifest.