nbarbettini/FlexibleConfiguration

AddJsonFile adds YamlProvider

Closed this issue · 1 comments

The problem is here
https://github.com/nbarbettini/FlexibleConfiguration/blob/master/src/FlexibleConfiguration/ConfigurationBuilderProviderExtensions.cs#L50

        public static IConfigurationBuilder AddJson(
            this IConfigurationBuilder builder,
            string json,
            string root = null,
            ILogger logger = null)
        {
            var provider = new YamlProvider(json, root, logger);
            return builder.Add(provider);
        }

Looks like YamlProvider can parse json files. The problem that made me think this is the bug described here
When json file contains comment with colon :, the YamlProvider fails to parse this json.