{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/harness/main/json-schema/harness-applications-application-sync-request-schema.json",
  "title": "ApplicationSyncRequest is a request to apply the config state to live state",
  "x-generated": "2026-10-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/harness-applications-api-openapi.yml#/components/schemas/applicationsApplicationSyncRequest",
  "type": "object",
  "properties": {
    "name": {
      "type": "string"
    },
    "revision": {
      "type": "string"
    },
    "dryRun": {
      "type": "boolean"
    },
    "prune": {
      "type": "boolean"
    },
    "strategy": {
      "$ref": "#/$defs/applicationsSyncStrategy"
    },
    "resources": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/applicationsSyncOperationResource"
      }
    },
    "manifests": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "infos": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/applicationsInfo"
      }
    },
    "retryStrategy": {
      "$ref": "#/$defs/applicationsRetryStrategy"
    },
    "syncOptions": {
      "$ref": "#/$defs/applicationsSyncOptions"
    },
    "appNamespace": {
      "type": "string"
    },
    "project": {
      "type": "string"
    },
    "sourcePositions": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "int64"
      }
    },
    "revisions": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "$defs": {
    "applicationsBackoff": {
      "type": "object",
      "properties": {
        "duration": {
          "type": "string",
          "title": "Duration is the amount to back off. Default unit is seconds, but could also be a duration (e.g. \"2m\", \"1h\")"
        },
        "factor": {
          "type": "string",
          "format": "int64",
          "title": "Factor is a factor to multiply the base duration after each failed retry"
        },
        "maxDuration": {
          "type": "string",
          "title": "MaxDuration is the maximum amount of time allowed for the backoff strategy"
        }
      },
      "title": "Backoff is the backoff strategy to use on subsequent retries for failing syncs"
    },
    "applicationsInfo": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "value": {
          "type": "string"
        }
      }
    },
    "applicationsRetryStrategy": {
      "type": "object",
      "properties": {
        "limit": {
          "type": "string",
          "format": "int64",
          "description": "Limit is the maximum number of attempts for retrying a failed sync. If set to 0, no retries will be performed."
        },
        "backoff": {
          "$ref": "#/$defs/applicationsBackoff"
        },
        "refresh": {
          "type": "boolean",
          "title": "Refresh indicates if the latest revision should be used on retry instead of the initial one (default: false)"
        }
      },
      "title": "RetryStrategy contains information about the strategy to apply when a sync failed"
    },
    "applicationsSyncOperationResource": {
      "type": "object",
      "properties": {
        "group": {
          "type": "string"
        },
        "kind": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "namespace": {
          "type": "string"
        }
      },
      "description": "SyncOperationResource contains resources to sync."
    },
    "applicationsSyncOptions": {
      "type": "object",
      "properties": {
        "items": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "applicationsSyncStrategy": {
      "type": "object",
      "properties": {
        "apply": {
          "$ref": "#/$defs/applicationsSyncStrategyApply"
        },
        "hook": {
          "$ref": "#/$defs/applicationsSyncStrategyHook"
        }
      },
      "title": "SyncStrategy controls the manner in which a sync is performed"
    },
    "applicationsSyncStrategyApply": {
      "type": "object",
      "properties": {
        "force": {
          "type": "boolean",
          "description": "Force indicates whether or not to supply the --force flag to `kubectl apply`.\nThe --force flag deletes and re-create the resource, when PATCH encounters conflict and has\nretried for 5 times."
        }
      },
      "title": "SyncStrategyApply uses `kubectl apply` to perform the apply"
    },
    "applicationsSyncStrategyHook": {
      "type": "object",
      "properties": {
        "force": {
          "type": "boolean",
          "title": "Embed SyncStrategyApply type to inherit any `apply` options\n+"
        }
      },
      "description": "SyncStrategyHook will perform a sync using hooks annotations.\nIf no hook annotation is specified falls back to `kubectl apply`."
    }
  }
}