skip to Main Content

Getting error: Newtonsoft.Json.JsonSerializationException: 'Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'myclass'

I am trying to deserialize a javascript kind of JSON "{n "resultSet1": [n {n "AgentID": 13173,n "FirstName": "Drilon",n "SG_ID": 14336,n "LoginName": "UI813926",n "SG_Description": "LKC Bauhotline",n "SG_Name": "Y_BAU__FO",n "EnterpriseName": "LKC_Abdullahu_Drilon",n "LastName": "Abdullahu"n },n {n "AgentID": 14432,n "FirstName": "Pinar",n "SG_ID": 14336,n "LoginName":…

VIEW QUESTION

Php – Unserialize string incoming string

I have serialized array. It is serialized into string looking like: *field1_name*|*field1_value*;*field2_name*|*field2_value*;*field3_name*|*field3_value* etc. I need to get value of field 3. At this moment i get it by: explode("*|*", explode("*;*", serialized_array)[3])[1] but i'm almost sure that there is better way…

VIEW QUESTION

Deserializing JSON (without dynamic) where array has multiple possible depths based on value of another property?

I am trying to deserialize the following JSON without using dynamic as it is not supported by my system: https://raw.githubusercontent.com/vansha/Two10.CountryLookup/master/Two10.CountryLookup/region-list.json Each line presents a region for geolocating with. Using the JSON Converter here: https://json2csharp.com/ I get the suggestion for data…

VIEW QUESTION

Symfony 6 Deserializing JSON array

I receive a JSON string containing an array of objects similar to this: {"expert": "foo", "username": "bar", "activity": [{"action": "RFDF", "count": 172}","{"action": "RETA", "count": 10},{"action": "AS", "count": 3}]} I want to decode it into a model like this (I read…

VIEW QUESTION
Back To Top
Search