Module: Fasti::Config::Schema

Defined in:
lib/fasti/config/schema.rb

Overview

Configuration schema definitions using dry-schema

Provides structured validation for configuration hashes.

Constant Summary collapse

StyleAttribute =

Style attribute schema Defines the structure for individual style attributes like true, foreground: :red

Dry::Schema.Params {
  config.validate_keys = true # Strict mode: reject unknown keys

  # Color attributes
  optional(:foreground).maybe(Types::Color)
  optional(:background).maybe(Types::Color)

  # Boolean styling attributes - allow string coercion for config files
  optional(:bold).maybe(Types::Params::Bool)
  optional(:italic).maybe(Types::Params::Bool)
  optional(:faint).maybe(Types::Params::Bool)
  optional(:inverse).maybe(Types::Params::Bool)
  optional(:blink).maybe(Types::Params::Bool)
  optional(:conceal).maybe(Types::Params::Bool)
  optional(:overline).maybe(Types::Params::Bool)

  # Special underline attribute
  optional(:underline).maybe(Types::UnderlineOption)
}