Skip to content

SchemaValidationOperationSetting

Source: src/Cloudflare/SchemaValidation/OperationSetting.ts

A per-operation schema validation override (/zones/{zone_id}/schema_validation/settings/operations/{operation_id}) — pins a mitigation action for a single API Shield operation, superseding the zone-level default just for that operation.

The override is keyed by the operation’s UUID; deleting the resource clears the override so the operation falls back to the zone default. Deleting the underlying API Shield operation cascades the override away.

Block non-conforming requests on one operation

const op = yield* Cloudflare.ApiShieldOperation("GetUser", {
zoneId: zone.zoneId,
method: "GET",
host: "api.example.com",
endpoint: "/users/{id}",
});
yield* Cloudflare.SchemaValidationOperationSetting("BlockGetUser", {
zoneId: zone.zoneId,
operationId: op.operationId,
mitigationAction: "block",
});

Exempt an operation from validation

yield* Cloudflare.SchemaValidationOperationSetting("SkipWebhook", {
zoneId: zone.zoneId,
operationId: webhookOp.operationId,
mitigationAction: "none",
});