# Conditional Nickel schema demonstrating optional fields with dependencies
# Shows how ContractAnalyzer automatically generates 'when' expressions

{
  # Feature toggles with optional dependent fields

  # TLS Configuration
  tls_enabled | doc "Enable TLS for secure connections" : Bool = false,

  tls_cert_path | optional
    | doc "Path to TLS certificate file"
    : String,

  tls_key_path | optional
    | doc "Path to TLS private key file"
    : String,

  # Database Configuration
  database_enabled | doc "Enable database" : Bool = true,

  database_url | optional
    | doc "Database connection URL"
    : String,

  database_pool_size | optional
    | doc "Database connection pool size"
    : Number = 10,

  # Authentication Configuration
  auth_enabled | doc "Enable authentication" : Bool = false,

  auth_provider | optional
    | doc "Authentication provider (oauth, jwt, basic)"
    : String,

  auth_secret | optional
    | doc "Authentication secret key"
    : String,

  # Logging Configuration
  logging_enabled | doc "Enable application logging" : Bool = true,

  logging_level | optional
    | doc "Logging level (debug, info, warn, error)"
    : String = "info",

  logging_file | optional
    | doc "Log file path (leave empty for stdout)"
    : String,
}
