Questions tagged [jsonconvert]

This tag can be used when you want to convert any text, objects or other formats into a JSON object,or if you want to transform a JSON object into something else.

207 questions
0
votes
1 answer

Converting from base64string to json wuth jsoncons

I have base64 string eyJod2liOmZhbHNlfV19 I use jsoncons lib. I want decode this string to json oblect. How can I do this?
Orest
  • 43
  • 1
  • 7
0
votes
3 answers

Deserialize the Json property(Nested Json) as string in C#

I need requirement that the deserialize the json as string which is available inside another Json. I have the Json string as like below, string testJson = "{ "AssemblyName":"AssemplyName", "ClassName":"AssemplyName.ClassName", …
0
votes
1 answer

How to convert json to csv with single header and multiple values?

I have input data = [ { "details": [ { "health": "Good", "id": "1", "timestamp": 1579155574 }, { "health": "Bad", "id": "1", "timestamp": 1579155575 } ] }, { …
ABCD
  • 730
  • 1
  • 13
  • 31
0
votes
1 answer

remove null array field from dataframe while converting it to JSON

Is there any method where i can create a json from a spark dataframe by not using those fields which are null: Lets suppose i have a data frame: +-------+----------------+ | name| hit_songs| +-------+----------------+ |beatles|[help, hey…
0
votes
2 answers

newtonsoft. json serializeObject string contains fraction value doesn't seem to escape properly

Having an issue where my object is being serialized using Newton where one of the properties is a string that contains values that are fractions such as 1/2", 1/4", etc... After serializing I'm passing the variable to a SQL Server Stored Procedure…
SKing605
  • 1
  • 1
0
votes
1 answer

JsonConvert Deserialization - How to get the value of some parts of json as string instead of deserializing

I am receiving a json as follows: { "soce":{ "message":{"details":"No Details available now.","code":"123"}, "number":"500" } } I am using Newtonsoft JsonConvert. I do not want to serialize the value in message as json but as a string. I…
user2347528
  • 580
  • 1
  • 8
  • 22
0
votes
1 answer
0
votes
2 answers

Dotnet 3.0.103 - JsonConvert.DeserializeObject expects well escaped string as opposed to a plain Json

I am on Dotnet 3.0.103. I have exposed a webapi, that has a code defined like this, [HttpPost] public string Post([FromBody] string data) { try { EmployeeRequest request =…
Arun A Nayagam
  • 195
  • 2
  • 9
0
votes
3 answers

Extension method for JSONConvert.Deserilize on collection of JSON object values

I have a situation where I have Json Values as List of string. List values = new List() { "{\"Id\":\"SC\",\"Value\":8563}", "{\"Id\":\"SC\",\"Value\":8563}", "{\"Id\":\"SC\",\"Value\":8563}" }; How to I de-serialize into…
VR1256
  • 1,266
  • 4
  • 28
  • 56
0
votes
1 answer

How can I check my json string for 502 errors

I have an API call that returns a query string in json format. Occasionally I get the following response "\r\n502 Bad Gateway\r\n\r\n

502 Bad…

Brian K
  • 11
  • 4
0
votes
0 answers

Convert string with German culture format to double using JsonConvert

I need to convert German format currency in a JSON (value may be negative or positive) to Double, I am able to do it using double.parse and specifying NumberStyle, something like below CultureInfo culture =…
0
votes
1 answer

C# Object to Json to Xml, how to generate xml element for array items

I'm converting an Object to json first, and then convert the json to xml. I need to do this to generate some of the properties as xml attribute instead of elements. Everything works as expected except I couldn't get it to generate seperate xml…
coder
  • 4,121
  • 14
  • 53
  • 88
0
votes
1 answer

How to serialize Dictionary with JsonConvert+attribute in order to hide a dictionary name?

I am trying to serialize this model public class Rootobject { public Los los { get; set; } public int Id { get; set; } } public class Los { [JsonConverter(typeof(DictionaryToJsonObjectConverter))] public…
mko
  • 6,638
  • 12
  • 67
  • 118
0
votes
3 answers

Deserializing JSON string to a non-predefined object in C#

I have a JSON response from an API with a number of data. What I actually need is just a few of the items in the result. Is there a way I can deserialize it to a C# object without having to define a class with members to correspond with all the…
Josh
  • 1,660
  • 5
  • 33
  • 55
0
votes
2 answers

Deserialize an array within an array in JSON

I have the following JSON file that I want to deserialize into an object { "InputFileFolder": "D:\\MontlyTransactions\\", "TransactionGroups": [ { "Name": "Income", "FilterString": "Type=@0 and Amount>@1 and…
MikeM
  • 3
  • 1