Project Configuration (cats.yml)
Starting with CATS 16.0.0, CATS uses a single, schema-validated YAML configuration file (cats.yml or cats.yaml) to configure your contract, server, default CLI options, headers, reference data, query/URL parameters, correlations, custom profiles, per-fuzzer overrides, error-leak keywords, path execution order, quality gates, and per-subcommand defaults.
.cats.properties removed in 16.0.0.cats.properties and --configFile <file>.properties are no longer supported in CATS 16.0.0. Auto-discovery ignores legacy .cats.properties with a warning, and passing a .properties file explicitly to --configFile exits with code 2. See the 16.0.0 migration guide.
Generating a starter cats.yml
Run cats init against your OpenAPI contract to scaffold a pre-populated cats.yml (with detected security headers and unresolved path parameters) alongside a starter functionalTests.yml:
cats init -c openapi.yml
Once cats.yml is in place, run CATS with zero flags:
cats
Auto-discovery and --configFile
Every CATS command (including lint, triage, compare, replay, smoke, run, random, template, analyze, list, explain, generate, stats, validate, info, and init) accepts --configFile <path>.
When --configFile is not supplied, CATS discovers cats.yml (or cats.yaml) automatically in this order:
- Contract directory — the directory containing the local file passed to
-c/--contract(skipped for remote URLs). - Working directory walking upward to
.git— searches the current working directory and parent directories up to the nearest.gitdirectory (inclusive). Outside a Git repository only the current working directory is searched, so an unrelatedcats.ymlin a parent or home directory is never picked up.
Config loading is bypassed for cats help, cats generate-completion, -h/--help, and -V/--version.
Precedence and subcommand isolation
- CLI flags always win over values in
cats.yml. - YAML CLI overlay files (
--headers,--refData,--queryParams,--correlations,--profileFile) merge with and override matching entries fromcats.yml. - Subcommand sections (
lint:,triage:,compare:,replay:,smoke:,run:,random:,template:) take precedence over rootoptions:defaults for that subcommand. - Root defaults are inherited by a subcommand only for options that take the same kind of value. A root list or value option is never applied to a same-named subcommand switch, so
options: fuzzers: [...],paths: [...], ormutators: ...do not affectcats list --fuzzers,cats list --paths, orcats list --mutators. cats initis isolated from root defaults so existing project settings do not interfere with scaffolding.cats replayignores rootoutputandserverdefaults unless explicitly set underreplay:or passed on the command line.
Auto-discovery security guard
When cats.yml is loaded via auto-discovery (for example when inspecting an untrusted repository), CATS ignores authRefreshScript (ars) and logs a warning so auto-discovered config files cannot execute arbitrary shell commands. Pass --configFile cats.yml explicitly to allow authRefreshScript from config.
Schema validation and IDE autocompletion
CATS validates cats.yml against its bundled Draft 2020-12 JSON Schema (cats-config.schema.json) and verifies every key under options: and subcommand sections against registered camelCase Picocli CLI options. Invalid YAML, unknown top-level keys, or unknown CLI options fail fast with exit code 2.
Include the YAML Language Server header at the top of cats.yml (added automatically by cats init) for live IDE autocompletion and validation:
# yaml-language-server: $schema=https://endava.github.io/cats/schemas/cats-config.schema.json
Relative path resolution
Relative file paths configured in cats.yml (such as contract, headers, refData, queryParams, correlations, wfcAuth, baseline, target, envFile, profileFile, functionalFlow, securityFlow, sslKeystore, mutators, operationPrefixMapFile, output, report, words, exportHar, exportFlow, exportRefData, exportCorrelations, exportContractPatch, exportReproducers, authRefreshScript paths containing / or \, and @file values for template.data) are resolved relative to the directory containing cats.yml—not the caller's current working directory.
Full cats.yml reference
# yaml-language-server: $schema=https://endava.github.io/cats/schemas/cats-config.schema.json
contract: "./openapi.yml"
server: "http://localhost:8080"
profile: ci
# Root CLI defaults (camelCase option names; run `cats --help` to list all options)
options:
stopAfterTimeInSec: 120
strictTypes: true
skipFuzzers:
- "DELETE /orders*=RemoveFields"
skipFields:
- "metadata.traceId"
mask:
- "X-Custom-Tenant"
- "credentials.clientSecret"
# Quality gate and baseline regression defaults
qualityGate:
failOn: "error"
qualityGate: "errors<1,warns<20"
baseline: "./baseline-report"
failOnNewWarnings: false
# Scoped HTTP headers (all, /path, /prefix*, "METHOD /path", "METHOD /prefix*")
headers:
all:
Authorization: "Bearer $$API_TOKEN"
"POST /orders":
X-Idempotency-Key: "#(uuid)"
# Scoped reference data (supports dot notation for nested fields)
refData:
all:
currency: "EUR"
"/orders/{orderId}":
orderId: "ord-123"
shippingAddress.country: "DE"
# Scoped query parameters
queryParams:
"/orders":
includeArchived: "false"
# Global URL path parameter substitutions
urlParams:
tenantId: "acme"
# Cross-field correlation rules
correlations:
- paths: ["/orders"]
when: "type == 'EXPRESS'"
then:
set:
priority: "HIGH"
# Custom fuzzer profiles (also shown in `cats list --profiles` and `cats explain --type profile <name>`)
profiles:
orders-smoke:
description: "Fast smoke checks for the Orders API"
fuzzers:
- HappyPath
- OnlyRequiredFields
- InvalidValuesInEnumsFields
# Per-fuzzer expected response codes and fuzzer-specific settings (replaces --fuzzersConfig)
fuzzersConfig:
DummyAcceptHeaders.expectedResponseCode: 403
MultipartOversizedFile.sizeBytes: 52428801
# Custom response keywords flagged as error leaks (replaces -K / --errorLeaksKeywords)
errorLeaksKeywords:
- "InternalDatabaseException"
- "ORA-00942"
# Explicit OpenAPI path execution order (replaces --pathsRunOrder)
pathsRunOrder:
- "/orders"
- "/orders/{orderId}"
- "/orders/{orderId}/items"
# Per-subcommand option defaults (camelCase option names)
lint:
pathNaming: "KEBAB"
strict: true
skipLinters:
- "Versions"
triage:
includeWarnings: true
compare:
failOnNewWarnings: true
replay:
stateful: true
smoke:
includeDelete: false
run:
stepTags:
- "smoke"
random:
stopAfterTimeInSec: 60
template:
httpMethod: "POST"
options:For repeatable map flags (header, refDataParam, queryParam, urlParam), use the dedicated top-level sections (headers:, refData:, queryParams:, urlParams:) in cats.yml rather than multi-entry YAML maps under options:. Only comma-splittable map options (oneOfSelection, anyOfSelection) accept multi-entry maps directly under options:.