---
url: /zh/reference/manifest.md
description: 服务的 Manifest 写成的 JSON：每个对象及其键。
---

# Manifest 格式

服务的 Manifest 是一份 JSON 文档（`format` 1）：它的限界上下文、上下文中的聚合及其命令与事件、订阅、框架的错误码，以及 `$defs` 之下每个载荷的 JSON Schema 2020-12。模块的片段（`META-INF/wow/manifest/<module>.json`）形状相同，只是没有 `service`。下面每个对象及其键的提纲，由写出它的代码 [`ManifestTree`](https://github.com/Ahoo-Wang/Wow/blob/main/api/manifest/src/main/kotlin/me/ahoo/wow/manifest/ManifestTree.kt) 生成；说明取自源码，为英文。

写出时省略的内容：

Absent optional values (a null description, unknown `produces`, `derives`, `schedules` or `transformsTo`, a fragment's service, a subscription's `retry` or `job`) are left out, not written as null, and so are a subscription source's `nullableState` and a command's `mounted` when false, an aggregate's `ownership` when it is `OWNER`, the default, and its `retired` events when it has none.

## `Manifest`

* `format`
* `service`: 对象; 缺省或取默认值时省略
  * `name`
  * `version`
* `contexts`: 数组，元素为 [`Context`](#context)
* `errors`: 数组，元素为 [`Error`](#error)
* `$defs`

## `Context`

* `name`
* `description`
* `aggregates`: 数组，元素为 [`Aggregate`](#aggregate)
* `subscriptions`: 数组，元素为 [`Subscription`](#subscription)
* `published`: 对象数组
  * `aggregate`
  * `topic`
  * `includeState`
* `errors`: 数组，元素为 [`Error`](#error)

## `Error`

* `code`
* `status`
* `description`

## `Aggregate`

* `name`
* `description`
* `state`: 对象
  * `schema`
  * `fingerprint`
* `snapshot`: 对象
  * `enabled`
  * `stateRevision`: 缺省或取默认值时省略
* `commands`: 对象数组
  * `name`
  * `aliases`
  * `schema`
  * `creation`
  * `produces`
  * `routes`: 数组，元素为 [`Route`](#route)
  * `mounted`: 缺省或取默认值时省略
  * `transformsTo`
  * `description`
* `events`: 对象数组
  * `name`
  * `aliases`
  * `revision`
  * `schema`
  * `description`
* `lifecycle`
* `queries`: 对象数组
  * `model`
  * `routes`: 数组，元素为 [`Route`](#route)
* `schedules`
* `ownership`: 缺省或取默认值时省略
* `retired`: 缺省或取默认值时省略

## `Route`

* `method`
* `path`

## `Subscription`

* `name`
* `kind`
* `source`: 对象
  * `context`
  * `aggregates`
  * `events`
  * `nullableState`: 缺省或取默认值时省略
* `function`: 对象
  * `kind`
  * `context`
  * `processor`
  * `name`
* `derives`
* `rejected`
* `committed`
* `calls`
* `start`: 缺省或取默认值时省略
* `schedules`
* `retry`: 对象; 缺省或取默认值时省略
  * `maxAttempts`
  * `initialBackoff`
  * `maxBackoff`
  * `timeout`
  * `recoverable`
  * `unrecoverable`
* `job`: 对象; 缺省或取默认值时省略
  * `name`
  * `cron`
  * `zone`
  * `scope`
  * `sharded`
  * `misfire`
