FSharp.Configuration icon indicating copy to clipboard operation
FSharp.Configuration copied to clipboard

Yaml merge syntax

Open legomind opened this issue 10 years ago • 0 comments

Given the following YAML:

Default: &Default
  Db:
    ConnectionString: Data Source=localhost;Initial Catalog=;Integrated Security=True;Application Name=


Test: &Test
  Environment: Test
  <<: *Default


ActiveConfig:
  <<: *Test

I would think that I should access the desired key like this:

open FSharp.Configuration

type Config = YamlConfig<"Config.yaml">

let config = Config ()

let value = config.ActiveConfig.Environment

But, as it turns out, the resulting type is structured like this:

let value = config.ActiveConfig.``<<``.Environment

Am I missing something? Obviously using the << property is not logical or convenient.

legomind avatar Sep 06 '15 01:09 legomind