{
  "type": "object",
  "properties": {
    "action": {
      "type": "string",
      "enum": [
        "publish",
        "review"
      ],
      "description": "Recommend publish only if the draft is ready, state.document.approved is true, and state.oauth.scopes contains documents:publish. Otherwise select review."
    },
    "reason": {
      "type": "string",
      "enum": [
        "ready",
        "needs_review"
      ],
      "description": "Use ready for a publication recommendation; otherwise needs_review."
    }
  },
  "required": [
    "action",
    "reason"
  ],
  "additionalProperties": false,
  "if": {
    "properties": {
      "action": {
        "const": "publish"
      }
    },
    "required": [
      "action"
    ]
  },
  "then": {
    "properties": {
      "reason": {
        "const": "ready"
      }
    }
  },
  "else": {
    "properties": {
      "reason": {
        "const": "needs_review"
      }
    }
  }
}
