Category "json"

How to check JSON and add/remove key

I have a JSON file as an export of a nosql database, the sample below is 2 of 1xxx records. { "task": { "id1": { "completed": true,

Set default values according to JSON schema automatically

I am using the jsonschema package in python to validate my JSONs. I can set default in jsonschema. Let us assume the following schema: from jsonschema import va

ASP.NET Core 5 returning JSON adding $id and $values properties

I'm using ASP.NET Core 5. As below, I'm using System.Text.Json: public IActionResult Index() { var result = GetAllMenuItems(); return Ok(result); } The

Unexpected character encountered while parsing value

Currently, I have some issues. I'm using C# with Json.NET. The issue is that I always get: {"Unexpected character encountered while parsing value: e. Path '',

Unmarshalling json to structure using json.RawMessage

I need to unmarshal json object which may have the following formats: Format1: { "contactType": 2, "value": "0123456789" } Format2: { "contactType"

How to compress web service response json in ajax call

I am using asmx web service and calling it through ajax as $.ajax({ url: 'xxxxxxx.asmx/Getxxxxxxxx', method: 'post', contentT

How to display data to table in React Js?

I'm trying to display some data received through API to table in React Js, data is received as object so I can't map trough it. What would be the best practice

How to parse json and read in vb.net

I have this code in my project: Dim request As HttpWebRequest Dim response As HttpWebResponse = Nothing Dim reader As StreamReader request = DirectCast(WebRe

Passing UTC DateTime to Web API HttpGet Method results in local time

I'm trying to pass a UTC date as a query string parameter to a Web API method. The URL looks like /api/order?endDate=2014-04-01T00:00:00Z&zoneId=4 The s

Uncaught SyntaxError: Unexpected token & in JSON at position 1 at JSON.parse (<anonymous>)

I am trying to parse JSON but it keeps returning Uncaught SyntaxError: Unexpected token & in JSON at position 1 at JSON.parse (<anonymous>) The c

How to Pass JSON in the body of GET Request in Rest Assured?

Trying to pass this JSON in the body of a get request in rest assured. Is creating a JSON object a way to go ? { "pharmacyListId": null, "pharmacyListNa

If statement in Postman tests

I work in Postman and I want to build the test construction like that: var login_status = pm.environment.get("LOGIN_STATUS"); var jsonData = pm.response.json();

Javascript control data flow by JSON

I have a web application makes in JQuery + KnockOut that reads all data in a JSon format from a web service. The data are reloaded and reparse every seconds wit

How can I make Laravel return a custom error for a JSON REST API

I'm developing some kind of RESTful API. When some error occurs, I throw an App::abort($code, $message) error. The problem is: I want him to throw a json form

Using jq to stream, filter large json file and save output as csv

I have a very large json file I would like to stream (using --stream) and filter with jq, then save it as a csv. This is the sample data with two objects: [{"_i

Replace null values to empty values in a JSON OBJECT

Hi I've got a JSON object provided by an ajax request. Some of the values inside the json appears as null, but I want an empty String instead My sample of cod

How to turn off or handle camelCasing in JSON response ASP.NET Core?

I'm running through a WintellectNOW course on ASP.NET Core/Web API/Angular 2. I have the API portion implemented, but for whatever reason, the JSON that is bein

Post JSON Object RestSharp v107

I have to post this json data: JSON.stringify(dataRest) is: {"Ds_MerchantParameters":"eyJEU19NRVJDSEFOVF9BTU9VTlQiOiI3Myw4NCIsIkRTX01FUkNIQU5UX0NVUlJFTkNZIjoiOT

JSON reader was expecting a name but found ':'. in Mongodb Java

I am storing my data from external file to mongodb in localhost. it's quite huge dataset of volume 1.70GB with ~10 million tweets. While importing from file to

How to flatten multilevel/nested JSON?

I am trying to convert JSON to CSV file, that I can use for further analysis. Issue with my structure is that I have quite some nested dict/lists when I convert