Error: System.Text.Json.JsonException: The JSON value could not be converted

Hi, I am using Radzen to create a dashboard. I am trying to connect to a REST API. I tried to follow the spotify example and implement is for my own schematic. But I get this error: Error: System.Text.Json.JsonException: The JSON value could not be converted to Test2.Models.Rdmapi.Registrations. Path: $ | LineNumber: 0 | BytePositionInLine: 1.

these are the schematics:

the JSON:

Can anyone help me create the schematic for my API

The posted JSON seems be missing the items property. This looks as a Registration rather than Registrations

The JSON i posted is just one record front the database, the API returns all the records from the database.

This is the JSON for 2 of the records:
image

Fixed it, removed the registrations schema and made the resource an array. Thanks for the help.

Hi @korchev , I followed the tutorial but I still get "The JSON value could not be converted to my model", My rest api works and provide data with Postman, here is example of my rest response

[
{
"id": 1,
"time": "2022-08-05T09:06:16",
"sensorId": 1,
"deviceId": 1,
"value": 0.55,
"sensorData": null,
"deviceData": null,
"valueJson": "{}"
},
{
"id": 2,
"time": "2022-08-19T13:28:22.705795",
"sensorId": 1,
"deviceId": 1,
"value": 0,
"sensorData": null,
"deviceData": null,
"valueJson": "{}"
},
.
.
.
{
"id": 9,
"time": "2022-08-19T13:28:25.705795",
"sensorId": 5,
"deviceId": 66,
"value": 6.363961,
"sensorData": null,
"deviceData": null,
"valueJson": "{}"
}
]


2

You haven't specified the Schema of the GetMeasurement operation. Pick one from the dropdown and check the Array checkbox since your API seems to return an array.

Also please do not post duplicate threads.

Thaks for your reply @korchev, I already tried to specify the schema but still not working, it is either showing this error, or not being able to auto generate Columns (or recognise Columns ), could you provide please the schema that you think it will make it work ?

I think you need to set the Schema of the operation to Measurement and check the array checkbox.

image

Shouldn´t measurments be an array?