Open
Description
If I specify a URL in my yaml config, it seems useful to automatically infer the type to be System.Uri, but when saving the type, it doesn't seem useful to write out the properties of System.Uri, instead it should write out just the AbsoluteUri.
Reproduced with 2.0.0-alpha2 - the best workaround I've found is to add something to the sample to force the type to string.
Sample script:
#r "FSharp.Configuration.dll"
open FSharp.Configuration
type Config = YamlConfig<YamlText = "url: http://localhost">
let config = Config()
config.LoadText("url: http://localhost:9999")
config.Save("config.yml")And the resulting config.yml:
url:
AbsolutePath: /
AbsoluteUri: http://localhost:9999/
LocalPath: /
Authority: localhost:9999
HostNameType: Dns
IsLoopback: true
PathAndQuery: /
Segments:
- /
Host: localhost
Port: 9999
Query: ''
Fragment: ''
Scheme: http
OriginalString: http://localhost:9999
DnsSafeHost: localhost
IdnHost: localhost
IsAbsoluteUri: true
UserInfo: ''Reacted by moinessim
Metadata
Metadata
Assignees
Labels
No labels
Activity