tagged [json]

How to get string objects instead of Unicode from JSON

How to get string objects instead of Unicode from JSON I'm using to parse JSON from text files. When loading these files with either [json](https://docs.python.org/2/library/json.html) or [simplejson]...

Serialize enum values as camel cased strings using StringEnumConverter

Serialize enum values as camel cased strings using StringEnumConverter I'm trying to serialize a list of objects to JSON using Newtonsoft's JsonConvert. My Marker class includes an enum, and I'm tryin...

14 Sep at 09:53

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,...

How to handle both a single item and an array for the same property using JSON.net

How to handle both a single item and an array for the same property using JSON.net I'm trying to fix my SendGridPlus library to deal with SendGrid events, but I'm having some trouble with the inconsis...

31 Aug at 22:6

json add new object to existing json file C#

json add new object to existing json file C# I'm trying to automate the addition of new objects to an existing JSON file. I looked all around the web but only found adding data and stuff but not a who...

30 Aug at 08:14

Which JSON content type do I use?

Which JSON content type do I use? There are many "standards" for the [JSON](http://en.wikipedia.org/wiki/JSON) content type: Which one do I use, and where? I assume security and browser support issues...

29 Aug at 10:22

DataTable to JSON

DataTable to JSON I recently needed to serialize a datatable to JSON. Where I'm at we're still on .Net 2.0, so I can't use the JSON serializer in .Net 3.5. I figured this must have been done before, s...

24 Aug at 20:17

How to output Django queryset as JSON?

How to output Django queryset as JSON? I want to serialize my queryset, and I want it in a format as this view outputs: I simply d

19 Aug at 21:43

Fetch: POST JSON data

Fetch: POST JSON data I'm trying to POST a JSON object using [fetch](https://developer.mozilla.org/en-US/docs/Web/API/GlobalFetch/fetch). From what I can understand, I need to attach a stringified obj...

18 Aug at 07:9

JavaScript find json value

JavaScript find json value I need to search inside a json list of countries. The json is like: I get from database only the code and would output the entire name. So if I get "AL" I would like to retr...

17 Aug at 14:44

ServiceStack Deserialize Json with Required Attribute

ServiceStack Deserialize Json with Required Attribute I'm trying to get the deserialization to throw an exception if a certain JSON attribute is missing. ex. This should deserialize fine (and it does)...

System.Text.Json.JsonElement ToObject workaround

System.Text.Json.JsonElement ToObject workaround I want to know the equivalent of the `ToObject()` method in [Json.NET](https://www.newtonsoft.com/json/help/html/Introduction.htm) for . Using Json.NET...

10 Aug at 14:32

Error "Uncaught SyntaxError: Unexpected token with JSON.parse"

Error "Uncaught SyntaxError: Unexpected token with JSON.parse" What causes this error on the third line? ``` var products = [{ "name": "Pizza", "price": "10", "quantity": "7" }, { "name": "Cerveja...

8 Aug at 18:20

How to map JSON to C# Objects

How to map JSON to C# Objects I am having issues with understanding how to make this happen. Basically we have an API, the user sends a JSON of the format: I have a class ca

29 Jul at 08:55

Retuning JObject\dynamic with ServiceStack seems to return

Retuning JObject\dynamic with ServiceStack seems to return I'm trying to take a JSON string from SQL (works fine with SQL json queries, it's stuctured fine in there) and return it through ServiceStack...

5 Jul at 13:59

Can comments be used in JSON?

Can comments be used in JSON? Can I use comments inside a [JSON](https://en.wikipedia.org/wiki/JSON) file? If so, how?

5 Jul at 00:35

Why can't Python parse this JSON data?

Why can't Python parse this JSON data? I have this JSON in a file: I wrote this s

1 Jul at 21:31

ServiceStack: How do I Serialize a nested object of Dictionary<string, object>?

ServiceStack: How do I Serialize a nested object of Dictionary? ``` //Structure public List> EventData { get; set; } = new List

30 Jun at 18:22

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...

Use of PUT vs PATCH methods in REST API real life scenarios

Use of PUT vs PATCH methods in REST API real life scenarios First of all, some definitions: PUT is defined in [Section 9.6 RFC 2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.6): > Th...

20 Jun at 09:30

ServiceStack: REST API call not interpreted correctly (and OpenAPI / Swagger output is strange)

ServiceStack: REST API call not interpreted correctly (and OpenAPI / Swagger output is strange) The APIs I define in ServiceStack are not generating a correct OpenAPI spec, or at least, ServiceStack d...

17 Jun at 01:33

Add JObject to JObject

Add JObject to JObject I have a json structure like this: I would like to add a new empty Object like "report":{} to the json My C# code is like

16 Jun at 09:1

How can I deserialize JSON with C#?

How can I deserialize JSON with C#? I have the following code: The input in `responsecontent` is JSON, but it is not properly deserialized into an object. How should I properly deserialize it?

How to generate JSON data with PHP?

How to generate JSON data with PHP? I have to genera

8 Jun at 16:23

Each parameter in the deserialization constructor on type must bind to an object property or field on deserialization

Each parameter in the deserialization constructor on type must bind to an object property or field on deserialization I have the following simple classes : ``` public abstract class GitObject { publ...

5 Jun at 19:24