Questions tagged [json-deserialization]

JSON deserialization is the process of converting a JSON string into an instance of an object, often a class.

JSON (Object Notation) is an efficient data encoding format that enables fast exchanges of small amounts of data between client browsers and -enabled Web services.

JSON deserialization is the process of converting a JSON string into an instance of an object, often a class. JSON encoded strings carry both structural and data information, so the instance of the object resulting from deserialization is a well-defined, data-filled object.

For example the following string:

string json_encoded_string = @"{""name"" : ""John"", ""surname"" : ""Doe"", ""age"" : 38}";

can be deserialized into an instance of the following class:

class Person
{
    public string name { get; set; }
    public string surname { get; set; }
    public int age { get; set; }
}
2322 questions
0
votes
0 answers

Jackson - Custom Deserializer for nested map value

I have a map like so: @JsonSerialize(contentUsing = MyClassCustomJacksonSerializer.class) @JsonDeserialize(contentUsing = MyClassCustomJacksonDeserializer.class) Map> mapA; I get this exception: java.util.HashMap…
griffinjm
  • 493
  • 2
  • 10
0
votes
0 answers

How to convert to concrete types residing in external assembly

I have one assembly of POCO classes which I used as deserialization type for json text. Now I need to split the types across assemblies. I can directly add the reference but adding new assemblies would force me to recompile everytime, Is it possible…
Kryptonian
  • 860
  • 3
  • 10
  • 26
0
votes
2 answers

Problem trying to deserialize a json with a model

I am trying to deserialize a json (using Newtonsoft.Json), i created the classes, but in json code there is a variable that i don't know if it is corrected or i don't know how to deserialize. I am getting a null exception on line :…
0
votes
1 answer

Json Deserialize for hetero-type json Java

Apologies in advance, I'm a little new to JSON parsing and I m facing a problem in parsing JSON in Object in java. { result: { "City": { "Delhi": { "A-Hospital": { "pincode": 400001 }, …
0
votes
2 answers

JSON TO C# Deserializing

Can someone help me deserialize JSON from this api https://www.freeforexapi.com/api/live?pairs=EURUSD,GBPUSD to a C# Object? I have tried many ways and examples I found online, non seems to be working
Ithra
  • 45
  • 6
0
votes
1 answer

How to Deserialize a JSON and serialize a specific String value pair as different JSON?

The Json body I want to deserialize is something like below { "status": "OK", "place_id": "07e0a63d862b2982e4c4b7e655f148d2", "scope": "APP" } Below is the Json body I want to build from above Json after deserializing it { "place_id":…
0
votes
1 answer

JAX-RS JSON Binding deserialization error when using multiple parameter in POST

I'm trying to develop a Jax-RS POST resource, reported here below: @Path("testJson") @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public Response testJson(Float firstValue, Float secondValue, String thirdValue)…
PyroSandro
  • 35
  • 7
0
votes
0 answers

Not JSON or YMAL. Which data format is this?

need help to understand following format, Which data notation format is this? any clue, data format sample, SCHEMA user="AAA" time=1235789008 /* "23-Jun-2018 02:09:14" */ { /* comment - data*/ VERSION=4 TITLE=Test }
0cool
  • 683
  • 2
  • 10
  • 27
0
votes
1 answer

XMLGregorianCalendar is changing the format while using GSON

My pojo class having some field whose datatype is XMLGregorianCalendar. protected XMLGregorianCalendar driverBirthDate; //the value is -"1967-08-13-05:45" While I am converting the object to json string using GSON the output is generating…
0
votes
1 answer

Convert byte array from PLC to JSON or Java Object

Is there a way to get a json or Java object out of an byte stream? If the structure in the plc looks like that Data - id int - pos array[0..3] of int - time dint id=5 pos[0]=1 pos[1]=2 pos[2]=3 pos[3]=4 time = 5 I would get a…
user2071938
  • 2,055
  • 6
  • 28
  • 60
0
votes
1 answer

DataContractSerializer returns null for all the variables when I try to deserialize

I have a problem where DataContractSerializer returns null for all my variable. It's like it doesn't see them or something. I'm using it to deserialize a json file into an object. I had it working for another json file that was using another class…
0
votes
1 answer

Concat names of nested values of a json file in c# ex: ` "obj_nested1_nested2" : "text"

I'm looking for a way to transform this c# object: class BaseClass { public string Value1 {get; set;} public NestedObject nestedObject {get;set;} } class NestedObject { public string NestedValue1 {get; set;} } Into this json: { …
0
votes
0 answers

Ignore additional properties while deserializing request content

We are consuming requests from upstream systems. Some time, we receive request payload with additional properties which are not defined in our entity. httpcontent.ReadAsJsonAsync fails to deserialize since property is not found in our entity. We…
user145610
  • 2,949
  • 4
  • 43
  • 75
0
votes
1 answer

Deserialize json array of array to List of string in C#

I want to know how can I convert(Deserialize) a json array of json array to a list of string. which means that inner array should be converted into string the json is : [ [ "a", "b", "c", null, 1 …
Parsa
  • 7,995
  • 2
  • 27
  • 37
0
votes
2 answers

how to get json from passed string via command line c#

I'm doing that for a reason. This is what i need for the next step of my application. I'm creating Visual Studio Extension and i need that for communication between plugin and proj. I pass json string as argument of command line in visual…
user12465572
1 2 3
99
100