When configuration has conditional dependencies, make the system fail fast only for cases that break invariants (correctness/safety), but allow secure graceful degradation for “optional feature” toggles when prerequisites may be missing.
Apply this rule: 1) Enforce bidirectional relationships in schema
auth_type), use JSON Schema conditionals so invalid combinations are rejected rather than silently ignored.allOf with focused if/then blocks to avoid partial validation gaps.Example (JSON Schema conditional enforcement):
{
"allOf": [
{
"if": {"properties": {"auth_type": {"const": "per_user_headers"}}, "required": ["auth_type"]},
"then": {"required": ["per_user_header_keys"]}
}
]
}
2) Don’t turn “safe no-ops” into hard failures
Decision heuristic:
Enter the URL of a public GitHub repository