Category "json"

Replace tags in text file using key-value pairs from JSON file

I am trying to write a shell script that can read a json string, decode it to an array and foreach through the array and use the key/value for replacing strings

How to build VS Code TreeView with custom JSON?

I'd like to build a TreeView based on a JSON file / REST Call and have an icon for each type of my objects. I have only three types of objects: Server, Host and

Encoding 4 byte UTF-8 character to JSON from Rails produce invalid character

I have a web service in rails (3.2.19) that encode a JSON to be read by some iOS or Android apps. The json might contain any characters, but it seems to fail ev

Create a class from a nested JSON

I am struggling with this problem, I have to make a class out of a json-rpc client I get responses like this {"jsonrpc":"2.0","id":1,"result":{"os":"linux","pla

How can I use SwaggerValidator(com.atlassian.oai.validator) to validate a simple JSON without request or response?

I have the following need: Input is a JSON object got from a messaging (or Kafka) queue. My need to is to validate the above JSON message against a Swagger spec

How to send an image and additional data body using fetch

I'm trying to upload an image to a serverless function on firebase. I'm sending the request like this: const updateProfileImage = (image) => { fetch(

AvroTypeException: Expected start-union. Got VALUE_NUMBER_INT

[PS : I have gone through all the possible issues under same error and tried to fix my Json Schema] I have the following Avro Schema (Converted to JSON using ht

How to validate Envato Purchase Code in PHP

I'm working on Envato API to verify Purchase Code I used plugin sample code from GitHub https://github.com/codehaiku/Envato-Purchase-Code-Verifier here I added

Circe list deserialization with best-attempt and error reporting

I'm using Circe to deserialize json containing a list. Sometimes a few items in the json list are corrupted, and that causes the entire deserialization to fail.

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