title: How to deserialize dynamic Json objects?
body: <p>I am currently receiving the following JSON response from my api:</p>
  <pre><code>{&quot;Lastname&quot;:[&quot;ERRLASTNAMEEMPTY&quot;],&quot;Firstname&quot;:[&quot;ERRFIRSTNAMEEMPTY&quot;]}
  </code></pre>
  <p>Note that the above response is dynamic - i.e sometimes I can have FirstName, sometimes LastName, sometimes both. This response is based on the validation of data.</p>
  <p>My question is - is there a way to deserialize this response using JsonSerializer.DeSerialize?</p>
  <p>I have tried to use it like this but it does not work:</p>
  <pre><code>var errorBody = JsonSerializer.Deserialize&lt;dynamic&gt;(body, serializerOptions);
  </code></pre>