fsprojects / FSharp.Configuration

The FSharp.Configuration project contains type providers for the configuration of .NET projects.
http://fsprojects.github.io/FSharp.Configuration/
Other
114 stars 63 forks source link

Yaml merge syntax #67

Open legomind opened 9 years ago

legomind commented 9 years ago

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.