Skip to content
This repository was archived by the owner on Dec 18, 2018. It is now read-only.
This repository was archived by the owner on Dec 18, 2018. It is now read-only.

ConfigurationBinder binds empty array as null #788

@andrewslavin

Description

@andrewslavin

Example:

  1. I have a class AppSettings with property public string[] SomeValues { get; set; }.
  2. My appsettings.json is {"SomeValues": []}.

When I bind an instance of AppSettings to the configuration like this: configurationBuilder.AddJsonFile("appsettings.json").Build().Bind(appSettings), property SomeValues is null. I expect empty array.

Note that if I change appsettings.json to {"SomeValues": ["val1", "val2"]}, SomeValues does get set to the expected string array. So generally binding is working.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions