{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-bicep/json-schema/microsoft-bicep-deployment-what-if-schema.json",
  "title": "DeploymentWhatIf",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/microsoft-bicep-deployments-api-openapi.yml#/components/schemas/DeploymentWhatIf",
  "type": "object",
  "required": [
    "properties"
  ],
  "properties": {
    "properties": {
      "allOf": [
        {
          "$ref": "#/$defs/DeploymentProperties"
        },
        {
          "type": "object",
          "properties": {
            "whatIfSettings": {
              "type": "object",
              "properties": {
                "resultFormat": {
                  "type": "string",
                  "enum": [
                    "ResourceIdOnly",
                    "FullResourcePayloads"
                  ],
                  "description": "The format of the what-if results"
                }
              }
            }
          }
        }
      ]
    },
    "location": {
      "type": "string",
      "description": "The location to store the deployment data"
    }
  },
  "$defs": {
    "DeploymentParameter": {
      "type": "object",
      "properties": {
        "value": {
          "description": "Input value to the parameter"
        },
        "reference": {
          "type": "object",
          "properties": {
            "keyVault": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Azure Key Vault resource ID"
                }
              }
            },
            "secretName": {
              "type": "string",
              "description": "Azure Key Vault secret name"
            },
            "secretVersion": {
              "type": "string",
              "description": "Azure Key Vault secret version"
            }
          },
          "description": "Azure Key Vault parameter reference"
        },
        "expression": {
          "type": "string",
          "description": "Input expression to the parameter"
        }
      }
    },
    "DeploymentProperties": {
      "type": "object",
      "required": [
        "mode"
      ],
      "properties": {
        "template": {
          "type": "object",
          "description": "The template content. Use this when passing the compiled Bicep template directly in the request."
        },
        "templateLink": {
          "$ref": "#/$defs/TemplateLink"
        },
        "parameters": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/DeploymentParameter"
          },
          "description": "Name and value pairs that define the deployment parameters for the template."
        },
        "parametersLink": {
          "$ref": "#/$defs/ParametersLink"
        },
        "mode": {
          "type": "string",
          "enum": [
            "Incremental",
            "Complete"
          ],
          "description": "The deployment mode. Incremental adds resources without deleting existing ones. Complete deletes resources not in the template."
        },
        "debugSetting": {
          "type": "object",
          "properties": {
            "detailLevel": {
              "type": "string",
              "description": "Specifies the type of information to log for debugging. Permitted values are none, requestContent, responseContent, or both separated by a comma."
            }
          }
        },
        "onErrorDeployment": {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "LastSuccessful",
                "SpecificDeployment"
              ],
              "description": "The deployment on error behavior type"
            },
            "deploymentName": {
              "type": "string",
              "description": "The deployment name to use on error"
            }
          }
        },
        "expressionEvaluationOptions": {
          "type": "object",
          "properties": {
            "scope": {
              "type": "string",
              "enum": [
                "Outer",
                "Inner",
                "NotSpecified"
              ],
              "description": "Specifies whether template expressions are evaluated within the scope of the parent template or nested template."
            }
          }
        },
        "validationLevel": {
          "type": "string",
          "enum": [
            "Template",
            "Provider",
            "ProviderNoRbac"
          ],
          "description": "The level of validation performed on the deployment"
        }
      }
    },
    "ParametersLink": {
      "type": "object",
      "required": [
        "uri"
      ],
      "properties": {
        "uri": {
          "type": "string",
          "format": "uri",
          "description": "The URI of the parameters file"
        },
        "contentVersion": {
          "type": "string",
          "description": "If included, must match the ContentVersion in the template."
        }
      }
    },
    "TemplateLink": {
      "type": "object",
      "properties": {
        "uri": {
          "type": "string",
          "format": "uri",
          "description": "The URI of the template to deploy"
        },
        "id": {
          "type": "string",
          "description": "The resource ID of a Template Spec. Use either the id or uri property, but not both."
        },
        "contentVersion": {
          "type": "string",
          "description": "If included, must match the ContentVersion in the template."
        },
        "queryString": {
          "type": "string",
          "description": "The query string (for example, a SAS token) to be used with the templateLink URI."
        },
        "relativePath": {
          "type": "string",
          "description": "The relativePath property can be used to deploy a linked template at a location relative to the parent."
        }
      }
    }
  }
}