madskristensen / RestClientVS

Other
66 stars 14 forks source link

Top-level array results in JSON parsing error #25

Closed tommck closed 2 years ago

tommck commented 2 years ago

Describe the bug When the API returns an array as the top level (not an object), I get the following error:

Date: Tue, 26 Apr 2022 12:58:51 GMT
Server: Kestrel

** RestClientVS : Error parsing JSON ( Error reading JObject from JsonReader. Current JsonReader item is not an object: StartArray. Path '', line 1, position 1. ), raw content follows. **

[]

To Reproduce Steps to reproduce the behavior:

  1. Create an API method that returns an empty array
  2. Call it from an HTTP file
  3. See error

Expected behavior It should parse the array.

madskristensen commented 2 years ago

Fixed with associated PR #26