{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-bicep/json-schema/microsoft-bicep-what-if-operation-result-schema.json",
  "title": "WhatIfOperationResult",
  "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/WhatIfOperationResult",
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "Status of the what-if operation"
    },
    "properties": {
      "type": "object",
      "properties": {
        "changes": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/WhatIfChange"
          },
          "description": "List of resource changes predicted by the what-if operation"
        }
      }
    },
    "error": {
      "$ref": "#/$defs/ErrorResponse"
    }
  },
  "$defs": {
    "ErrorResponse": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "description": "The error code"
        },
        "message": {
          "type": "string",
          "description": "The error message"
        },
        "target": {
          "type": "string",
          "description": "The error target"
        },
        "details": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ErrorResponse"
          },
          "description": "The error details"
        },
        "additionalInfo": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "description": "The additional info type"
              },
              "info": {
                "type": "object",
                "description": "The additional info"
              }
            }
          },
          "description": "The error additional info"
        }
      }
    },
    "WhatIfChange": {
      "type": "object",
      "properties": {
        "resourceId": {
          "type": "string",
          "description": "Resource ID"
        },
        "changeType": {
          "type": "string",
          "enum": [
            "Create",
            "Delete",
            "Ignore",
            "Deploy",
            "NoChange",
            "Modify",
            "Unsupported"
          ],
          "description": "Type of change to the resource"
        },
        "before": {
          "type": "object",
          "description": "Resource snapshot before the deployment"
        },
        "after": {
          "type": "object",
          "description": "Resource snapshot after the deployment"
        },
        "delta": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "path": {
                "type": "string",
                "description": "The path of the property change"
              },
              "propertyChangeType": {
                "type": "string",
                "enum": [
                  "Create",
                  "Delete",
                  "Modify",
                  "Array",
                  "NoEffect"
                ],
                "description": "The type of property change"
              },
              "before": {
                "description": "The value of the property before the deployment"
              },
              "after": {
                "description": "The value of the property after the deployment"
              }
            }
          },
          "description": "The predicted changes to resource properties"
        }
      }
    }
  }
}