Questions tagged [jsonserializer]

The JsonSerializer enables to control how objects are encoded into JSON. JSONSerializer will also pay attention to any method or field annotated by JSON.

JSONSerializer is the main class for performing serialization of Java objects to JSON. JSONSerializer by default performs a shallow serialization. While this might seem strange there is a method to this madness. Shallow serialization allows the developer to control what is serialized out of the object graph. This helps with performance, but more importantly makes good OO possible, fixes the circular reference problem, and doesn't require boiler plate translation code.

A simple example:

JSONSerializer serializer = new JSONSerializer();
return serializer.serialize( person );

Source:

Related tags:

512 questions
-1
votes
1 answer

Convert string JSON property to Object on Web API Call

I have the following class that represents a table in an MSSQL database: public string firstname { get; set; } public string lastname { get; set; } public string events { get; set; } The 'events' property is actually an array of JSON objects…
Nick Reeve
  • 1,658
  • 2
  • 22
  • 32
-1
votes
1 answer

Serialize object using specific type

I am using Jsonserializer.SerializeObject trying to convert a byte[] into a specific object. The class structure of message is following: public class ProjectMessageQueueMessage { public ProjectMessageQueueMessage(); public byte[]…
andrewb
  • 2,995
  • 7
  • 54
  • 95
-1
votes
1 answer

Issue with Json Response in C# when RESPONSE write two fields in foreign language

i make web service in c# which write with HTTP RESPONE.WRITE json answer but the problem is when i return the json with some field which included the hebrew langauge , after that the json response is not full the end bracket miss.. i put the code in…
Igor Kurylo
  • 45
  • 2
  • 9
-1
votes
2 answers

Get NSCFDictionary sub key values

I am parsing JSON data and I get a JSON tree like 2015-10-13 15:29:10.563 JsonProject[29154:1434114] requestReply: ( { DNumb = 512421421; DTempData = ""; DUUID = 12; Id = 1; }, { …
Mr. Joe
  • 17
  • 1
-1
votes
1 answer

Json array deserialize

How to deserialize below json array. unable to fetch the field_options values and array of field_options. i am using DataContractJsonSerializer to deserialize. I need to fetch the field_options like size then if field_type is dropdown i will…
-1
votes
1 answer

Unable to de-serialize nullable int 32 type

i am making a web api to create a drive . the html code with scripts is as below:

All Drives

smriti
  • 115
  • 3
  • 14
-1
votes
1 answer

Use Json.Net as default formatter in MVC, Not API

I just solved a recent problem where Json.Net allows me to include the 'type' of an object when it serializes it going to the Client. The reason for this is that the class that I'm sending back and forth has a property that is typed as a BaseClass…
Matt S.
  • 141
  • 1
  • 10
-2
votes
1 answer

The JSON value could not be converted to System.Collections.Generic.Dictionary`2[System.String,System.String]

Before serialize - "welcomePageConfig": { "welcomeTitleText": { "style": { "color": "#FFFFFF" }, "content": { "sv": "Välkommen", "en": "Welcome" …
-2
votes
2 answers

JsonSerializer.DeserializeAsync no error, no exception, no result

In my NET MAUI application I am de-serializing a http response: private async Task SerializeResponse(HttpContent content) { var options = new JsonSerializerOptions { PropertyNameCaseInsensitive = true }; using var…
-2
votes
1 answer

how to deserialize the property which has xml value but rest are json values

I have an azure function and which receives the request as below . One of the property has xml value . But when I desearialize it to json ,i'm getting the error. { "policyVersionedApiName": "petstoreoperationpolicyapi", "operationPolicies":…
-2
votes
1 answer

C# JsonSerializer.Serialize add key value in the generated json

I need to group the data in my table by 2 fields to categorize the visualization for the end user, I tried to do it this way, only that the generated json does not contain the key that would be the category name. My table: var niveis =…
MariINova
  • 323
  • 4
  • 15
-2
votes
4 answers

Create a json request object in c#

[{ "channel_id":299, "requests":[{ "order_id":3975, "action":"REQUEST_LABELS" }] }] How to create the above request in c# the requests can be multiple. I am new to c# i tried the below: Dictionary>…
vini
  • 4,657
  • 24
  • 82
  • 170
-3
votes
1 answer

Converting JSON to C# class deserializer errors on List

I have this JSON object - in view mode [{ "Urltitle": "", "location": "", "Url": "" }, { "Urltitle": "", "location": "", "Url": "" }, { "Urltitle": "", "location": "", "Url": "" }] Class: namespace Models { …
enavuio
  • 1,428
  • 2
  • 19
  • 31
-3
votes
1 answer

JSON decoder issue. How I can parse these data?

everyone. I am making an app for iOS. I use an API that allows to fetch city's sights as JSON. Here is an example of the data: { "type":"FeatureCollection", "features":[ { "type":"Feature", "id":"7281004", …
Artemast
  • 7
  • 3
-3
votes
1 answer

Send Json Data to server with Windows phone

I want to send data Json in a web request to the web service in json format and get the result from the server. a lot of methods .. :p Please help me to find a solution.
Adnane
  • 21
  • 6
1 2 3
34
35