title: Override array settings in appsettings.json with those in appsettings.Production.json
body: <p>I'm using ASP.NET Core 2.1. I have settings in <a href="https://docs.microsoft.com/en-gb/aspnet/core/fundamentals/configuration/" rel="noreferrer"><code>appsettings.json</code></a> and I bind them to classes using the options pattern. I want to override some of them in <code>appsettings.Production.json</code>.</p>
  
  <p>Overriding is supported according to the docs, and works for me generally. 
  But it doesn't work for arrays.</p>
  
  <p><code>appsettings.json</code>:</p>
  
  <pre><code>"MySectionOuter": {
    "MySectionInner": [
      {
        "foo": "1",
        "bar": "2",
        "baz": "3"
      },
      {
        "foo": "a",
        "bar": "b",
        "baz": "c"
      }
    ]
  }
  </code></pre>
  
  <p>My overrides in <code>appsettings.Production.json</code></p>
  
  <pre><code>"MySectionOuter": {
    "MySectionInner": [
      {
        "bar": "4",
      },
      {
        "baz": "d"
      }
    ]
  }
  </code></pre>
  
  <p>However that doesn't work - it adds rather than replaces.</p>
  
  <p>I <a href="https://stackoverflow.com/a/37657321/9971404">read that</a> the array is syntactic sugar for a key-value store. So I also tried this:</p>
  
  <pre><code>"MySectionOuter": {
    "MySection:1": {
      "bar": "4",
    },
    "MySection:2": {
      "baz": "b",
    }
  }
  </code></pre>
  
  <p>But that also doesn't work.</p>
  
  <p>What is the correct syntax?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>The comments show I haven't explained properly. What I want is like this:</p>
  
  <p>During development:</p>
  
  <pre><code>element1: foo=1
  element1: bar=2
  element1: baz=3
  element2: foo=a
  element2: bar=b
  element2: baz=c
  </code></pre>
  
  <p>During production:</p>
  
  <pre><code>element1: foo=1
  element1: bar=2
  element1: baz=4  // this was changed
  element2: foo=a
  element2: bar=b
  element2: baz=d  // this was changed
  </code></pre>