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
2 answers

How to deseralize json object in linq query?

I am fetching json data from txt file in linq and performing some actions on that to making the process fast. but when I am trying to call that query then it's showing me an error for deserialization of json object. So how to deserialize it? I am…
Hardik Dhankecha
  • 148
  • 1
  • 11
0
votes
1 answer

@RequestBody is not working in Spring Boot

hi I am new to Spring boot, have problem in Post request I am getting following error 2019-01-31 10:41:56.011 WARN 9532 --- [nio-8090-exec-1] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved…
Shantaram Tupe
  • 1,646
  • 3
  • 16
  • 42
0
votes
1 answer

How to add keys to values and convert to json in PowerShell?

I have a string like this: $string = "PackageName1,1,C:\Path PackageName2,12,C:\Path2 PackageName3,3,C:\Path3" (is a file with multilines, when I get the content I have the string above) I want to convert this string to Json: [ { Pacakge:…
Shayki Abramczyk
  • 36,824
  • 16
  • 89
  • 114
0
votes
2 answers

Call JsonConvert.DeserializeObject when you dont know the data type?

I have a 3rdParty program that I receive JOSN data from. The Json can come in two ways and I have created two classes to represent the two JSON messages using http://json2csharp.com/ public class Data1 { public Content1 content { get; set; } …
Harry Boy
  • 4,159
  • 17
  • 71
  • 122
0
votes
1 answer

JsonConvert.SerializeObject add backslashes to quotes

I am sending a message from my C# Windows Service to Amazon Web Services SNS so that it can be received from an iOS application. PublishRequest pubRequest = new PublishRequest(); pubRequest.TargetArn = arn; pubRequest.Message =…
Harry Boy
  • 4,159
  • 17
  • 71
  • 122
0
votes
1 answer

Issue In JSON Result when using JsonConvert.SerializeObject C#

I am getting bellow result when serializing the C# Model into JSON object. This is my model. public class ResultSet { public int RowsInserted { get; set; } public string RequestStatus { get; set; } } In my controller, I am creating an object to…
ksrider 148
  • 55
  • 1
  • 11
0
votes
0 answers

Custom JSONConvert serializing

I'm trying to perform some JSONConvert serializing, and I've ran into a brick wall. All my relevant objects are subclasses from a certain class, say class Super. A subclass of Super can have other Super-inherited members in the class, i.e. public…
0
votes
1 answer

what kind of error str brings in when it can't deal with conversion?

I am writing a kind of 'universal' json decoder that would convert everything it can using a default json encoder plus sets, and everything else it will convert using str() - which is a bit stupid, but it will allow to just work silently and let…
Philipp Chapkovski
  • 1,949
  • 3
  • 22
  • 43
0
votes
0 answers

How to map flat JSON to nested object using custom JsonConverter?

I need to map flat JSON to nested object, where flattened properties are marked with Flat attribute. E.g. mapping { "x": 1, "y": 2, "z": 3 } to the following model public class Foo { public int X { get; set; } public int Y {…
KolesnichenkoDS
  • 530
  • 1
  • 6
  • 20
0
votes
2 answers

Read from unknown json structure - beginner

I have a JSON string, and I need to extract values from it- for example I need to get the value for ID and Name. string someJson = @"[ {'ID': '12'} , { 'Name' : 'JAMES'} ]"; Note: I don't have a model created for this JSON. My code: string…
Illep
  • 16,375
  • 46
  • 171
  • 302
0
votes
0 answers

Timeout error on serializing HttpActionExecutedContext object

I am writing one Exception test filter in my project where I want to log the Request and Response object. Here is my code: public override void OnException(HttpActionExecutedContext actionExecutedContext) { //Add custom log LogEventInfo…
Amrendra
  • 511
  • 8
  • 18
0
votes
1 answer

Standard REST Api convention while updating child resource

I have a situation : Category - Master data with different types. Order - Has a reference to Category. It is a one-to-one mapping from Order to Category. Order table has a foreign key column to Category. Now api to get Orders /users/orders Will…
Santosh
  • 1,849
  • 4
  • 19
  • 31
-1
votes
1 answer

Having a date with a day number > 12 gives a Newtonsoft.Json.JsonReaderException

I have this class which deserializes the json of the object I receive so I can then put it into a class: public CourseOverview CreateCourseOverview(object obj) { var instance =…
CRS01
  • 37
  • 6
-1
votes
1 answer

C# Converting mixed data type in nested JSON into an object

I have a problem while developing a project, and I really need your helps ! I got a POST response using var resp = webClient.UploadString(url, header). The result looks like { "dataList": [{ "status":1, "dataOptions": {"partitions":…
Boonrak K.
  • 11
  • 1
  • 2
-1
votes
1 answer

Parse (Deserialize) JSON with dynamic keys (C#)

I want to parse the JSON on the bottom. Till now I always have the static key for the variables, but in this example, the keys are always changing. Here the "58e7a898dae4c" and "591ab00722c9f" could have any value and change constantly. How can I…
A9191
  • 23
  • 5