title: System.Text.Json.JsonException: The JSON value could not be converted to System.String in asp.net core
body: <p>I am working a asp.net core project with Postgresql.</p>
  <p>I wrote a query to get a list <code>ArrivalGuide</code> .</p>
  <pre><code>// this is working fine
  var x = await _catalogDbContext.Destinations.ToListAsync();  
  
  // But I got error for this query
  var y = await _catalogDbContext.ArrivalGuide.ToListAsync();  
  </code></pre>
  <p>I got this error:</p>
  <blockquote>
  <p>fail: Microsoft.EntityFrameworkCore.Query[10100]</p>
  <p>An exception occurred while iterating over the results of a query for context type 'Techne.TravelHub.Data.CatalogDbContext'.</p>
  <p>System.Text.Json.JsonException: The JSON value could not be converted to System.String. Path: $[9].PointsOfInterests[3].Meta[9].Content | LineNumber: 0 | BytePositionInLine: 103060.</p>
  <p>System.InvalidOperationException: Cannot get the value of a token type 'StartObject' as a string.</p>
  <p>at System.Text.Json.Utf8JsonReader.GetString()<br />
  at System.Text.Json.JsonPropertyInfoNotNullable`4.OnRead(ReadStack&amp; state, Utf8JsonReader&amp; reader)<br />
  at System.Text.Json.JsonSerializer.ReadCore(JsonSerializerOptions options, Utf8JsonReader&amp; reader, ReadStack&amp; readStack)<br />
  --- End of inner exception stack trace ---<br />
  at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack&amp; readStack, Utf8JsonReader&amp; reader, Exception ex)<br />
  at System.Text.Json.JsonSerializer.ReadCore(JsonSerializerOptions options, Utf8JsonReader&amp; reader, ReadStack&amp; readStack)<br />
  at System.Text.Json.JsonSerializer.ReadCore(Type returnType, JsonSerializerOptions options, Utf8JsonReader&amp; reader)<br />
  at System.Text.Json.JsonSerializer.Deserialize(String json, Type returnType, JsonSerializerOptions options)<br />
  at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, JsonSerializerOptions options)<br />
  at Npgsql.TypeHandlers.JsonHandler.Read[T](NpgsqlReadBuffer buf, Int32 byteLen, Boolean async, FieldDescription fieldDescription)</p>
  </blockquote>
  <p>Entity classes:</p>
  <pre><code>public class ArrivalGuide
  {
       public List&lt;DestinationSection&gt; Sections { get; set; }
       // removed rest
  }
  
  public class DestinationSection
  {
      public List&lt;PointsOfInterest&gt; PointsOfInterests { get; set; }
      // removed rest
  }
  
  public class PointsOfInterest
  {
      public List&lt;PointOfInterestMeta&gt; Meta { get; set; }
  }
  
  public class PointOfInterestMeta
  {
      public string Type { get; set; }
      public string Content { get; set; }
  }
  </code></pre>
  <p>Configuration:</p>
  <pre><code>builder.Property(i =&gt; i.Sections)
              .HasColumnType(&quot;jsonb&quot;);
      
  builder.Ignore(i =&gt; i.Video);
  </code></pre>
  <p>Why does this error occur?</p>
  <p><strong>Edit:</strong> sections - jsonb</p>
  <pre><code>[
    {
      &quot;Iso&quot;: &quot;eating&quot;,
      &quot;PointsOfInterests&quot;: [
        {
          &quot;Meta&quot;: [
            {
              &quot;Type&quot;: &quot;address&quot;,
              &quot;Content&quot;: &quot;1A Bailuzhou Dong Lu, Siming District, Xiamen&quot;
            },
            {
              &quot;Type&quot;: &quot;phone&quot;,
              &quot;Content&quot;: &quot;+86 592 5330 888&quot;
            },
            {
              &quot;Type&quot;: &quot;www&quot;,
              &quot;Content&quot;: null
            },
            {
              &quot;Type&quot;: &quot;openinghours&quot;,
              &quot;Content&quot;: &quot;11h - 14h30, 17h - 22h30&quot;
            }
          ],
          &quot;Description&quot;: &quot;S&quot;,
          &quot;IsAdvertisement&quot;: false
        },
        {
          &quot;Meta&quot;: [
            {
              &quot;Type&quot;: &quot;address&quot;,
              &quot;Content&quot;: &quot;515 Siming Nan Lu, Siming District, Xiamen&quot;
            },
            {
              &quot;Type&quot;: &quot;phone&quot;,
              &quot;Content&quot;: &quot;+86 592 2085 908&quot;
            },
            {
              &quot;Type&quot;: &quot;www&quot;,
              &quot;Content&quot;: null
            }
          ]
        }
      ]
    }
  ]
  </code></pre>
  <p><strong>BUT I really don't want to select sections. I need only Iso, Image, Description, video</strong></p>
  <p><code> var arrivalGuideList = await _techneDbContext.ArrivalGuide .Select(x =&gt; new { x.Iso, x.Image, x.Description, x.Video }).ToListAsync();</code></p>
  <p>But I got same error. Why I got the above mentioned error fro this query too. I did not select <code>sections</code>.
  Then why this error occurs?</p>
  <p><code> System.Text.Json.JsonException: The JSON value could not be converted to System.String. Path: $[9].PointsOfInterests[3].Meta[9].Content | LineNumber: 0 | BytePositionInLine: 103060.</code></p>