tagged [json]
JSON.NET how to remove nodes
JSON.NET how to remove nodes I have a json like the following: I just want to trans
JSON.Net get native type of value
JSON.Net get native type of value Using JSON.Net, how do I get the native type of a value in a JSON file? Namely, I'm after simply if it's a string (value enclosed in quotations) or not.
Tell Json.Net to write a single-quote rather than a double quote when serializing objects
Tell Json.Net to write a single-quote rather than a double quote when serializing objects When calling `Newtonsoft.Json.JsonConvert.SerializeObject(myObject)` I'm getting keys and values enclosed in d...
- Modified
- 10 Dec at 17:36
System.Text.Json.JsonException: The input does not contain any JSON tokens
System.Text.Json.JsonException: The input does not contain any JSON tokens I'm just trying to use a Http POST method in a Blazor app through _http and myObject have been defined elsewhere, but I'm get...
- Modified
- 23 Jun at 15:11
Find and return JSON differences using newtonsoft in C#?
Find and return JSON differences using newtonsoft in C#? I'd like to get a list of the JSON parts that don't match when doing a comparison using Newtonsoft. I have this code that compares: But can't f...
how to return json error msg in asp.net web api?
how to return json error msg in asp.net web api? I would like to return a json errormessage but at the moment in fiddler I cannot see this in the json panel: ``` string error = "An error just happened...
- Modified
- 24 Mar at 10:41
How to Deserialize JSON data?
How to Deserialize JSON data? I am new to working with JSON data. I am reading data from a web service. The query data sent back is the following: ``` [["B02001_001E","NAME","state"], ["4712651","Alab...
- Modified
- 14 Aug at 21:30
Servicestack json allow unquoted properties
Servicestack json allow unquoted properties Is it possible to tell servicestack to allow unquoted properties in JSON? I have a lot of JSON that I need to send to a service which doesn't have quoted pr...
- Modified
- 30 Aug at 15:57
How do I deserialize an array of JSON objects to a C# anonymous type?
How do I deserialize an array of JSON objects to a C# anonymous type? I have no problem deserializing a single json object to a C# anonymous type: But when I have an array: ``` string jsonArray = @"[{...
Json.Net And ActionResult
Json.Net And ActionResult Im building a JObject myself and want to return it as ActionResult. I dont want to create and then serialize a data object For example ``` public ActionResult Test(string id)...
- Modified
- 6 Mar at 11:43
JSON_Spirit: mapping value.type() back to the type?
JSON_Spirit: mapping value.type() back to the type? You can display a Value's type like this: ``` cout
- Modified
- 22 Apr at 00:54
How can I tell Json.NET to ignore properties in a 3rd-party object?
How can I tell Json.NET to ignore properties in a 3rd-party object? The Json.NET documentation says you use `JsonIgnore` to not serialize certain properties in your classes: How can I make Json.NET ig...
Add Multiple Contract Resolver in Newtonsoft.Json
Add Multiple Contract Resolver in Newtonsoft.Json Blueprint for data structure: Using Newtonsoft.Json, I have the following configuration for Json serialization. Clearly that, this will print out:
Json.net serialize/deserialize derived types?
Json.net serialize/deserialize derived types? json.net (newtonsoft) I am looking through the documentation but I can't find anything on this or the best way to do it. Now I have Derived objects in the...
- Modified
- 20 Mar at 08:21
JObject nested property
JObject nested property I am trying to make a json object like this with JObject: I can add properties like: But any time I try to nest an object inside another object so I can have the parent "input"...
Newtonsoft.Json SerializeObject without escape backslashes
Newtonsoft.Json SerializeObject without escape backslashes Given the code: The output is below: When debugging a large json document it is hard to read - using the built in features of Newtonsoft.Json...
Deserialize anonymous type with System.Text.Json
Deserialize anonymous type with System.Text.Json I am updating some apps for .NET Core 3.x, and as part of that I'm trying to move from `Json.NET` to the new `System.Text.Json` classes. With Json.NET,...
- Modified
- 12 Dec at 22:2
Getting the name / key of a JToken with JSON.net
Getting the name / key of a JToken with JSON.net I have some JSON that looks like this I parse this as a JArray: Then, I lo
Deserialize JSON as object or array with JSON.Net
Deserialize JSON as object or array with JSON.Net I want to know if it is possible to deserialize a JSON object that could either be an object or an array. Similar to this question: [Jackson deseriali...
How to write a JSON file in C#?
How to write a JSON file in C#? I need to write the following data into a text file using JSON format in C#. The brackets are important for it to be valid JSON format. Here is my model class: ``` publ...
- Modified
- 28 Nov at 19:23
Additional text encountered after finished reading JSON content:
Additional text encountered after finished reading JSON content: I am having some problems with create with JSON.Net. When I try to parse it, it gives me following error: > Additional text encountered...
Explanation of JSONB introduced by PostgreSQL
Explanation of JSONB introduced by PostgreSQL PostgreSQL just introduced [JSONB](http://www.depesz.com/2014/03/25/waiting-for-9-4-introduce-jsonb-a-structured-format-for-storing-json/) in version 9.4,...
- Modified
- 5 Sep at 07:19
Extract Values from JObject
Extract Values from JObject I'm trying to extract some values from a Json but I have problems with the data between [ ] for the first values I'm using: but when I'm