Issue for empty string deserialization

I have an issue in my Spring projet when I call a web-service that return an object with a attribute that is an empty string. In my projet I have Spring boot 1.5.2, Spring 4.3.7 and Jackson 2.8.7. I use a RestTemplate to call web-services. Respons...
more »

2017-06-16 11:06 (2) Answers

json_encode in particular way

so this my php <?php include 'connect.php'; $sql = "SELECT name from startup_schema"; $result = mysqli_query($mysqli, $sql) or die("Error in Selecting " . mysqli_error($mysqli)); $emparray = array(); while ($row = my...
more »

2017-06-15 12:06 (3) Answers

jQuery Unexpected token in JSON for valid input

I am getting the below error. I am not sure where I get the ' symbol in the JSON. I have double checked and sure that the json_encode function of PHP does not add the ' symbol in the first position. I have seen other question and solutions in StackO...
more »

2017-06-15 11:06 (1) Answers

how to use jq to filter select items not in list?

In jq, I can select an item in a list fairly easily: $ echo '["a","b","c","d","e"]' | jq '.[] | select(. == ("a","c"))' Or if you prefer to get it as an array: $ echo '["a","b","c","d","e"]' | jq 'map(select(. == ("a","c")))' But how do I selec...
more »

2017-06-15 10:06 (2) Answers

Angular 4 - create json based on model

I need to call [POST] a REST service from Angular 4 app. The rest service expects a JSON in the body of the request. The JSON which I am constructing in Angular, based on some user inputs looks something like { "val-type": "prop", ...
more »

2017-06-15 05:06 (1) Answers

Polymorphic Deserialization Issue with Jackson

I have the following classes that I want to deserialize a JSON string to using Jackson. PushNotificationMessage.java public class PushNotificationMessage { @JsonProperty("device_info") private DeviceInfo deviceInfo; private String conte...
more »

2017-06-14 18:06 (1) Answers

JSON parsing gives me NULL data

I am using Jackson library to try and parse my JSON file. My JSON is actually an ARRAY of JSON Objects: JSON ARRAY: [ { "Id" : "0", "name" : "John" }, { "Id" : "1", "name" : "Doe" } ] POJO CLASS: @JsonIgnoreProperties(ignoreUnknown =...
more »

2017-06-14 13:06 (2) Answers

Arrays merging and Json encoding

I generate an unknown number of arrays like this: for ($t=0;$t<2;$t++) { for ($xx=0;$xx<$totf[$t];$xx++) { $otdata[$t][$xx] = array("".$otname[$t][$xx]."" => ['games'=> $otg[$t][$xx], 'mint'=> $otqmint[$t][$xx],...
more »

2017-06-14 11:06 (1) Answers

Need to change JSON property using a variable

c.key = "test"; a = {}; a.body = {}; a.body.interval={}; a.body.interval = c.key; b = {}; b.body = {}; b.body.interval={}; b.body.interval = c.key; c["key"]="sample"; return JSON.stringify(a); I want to change all the values which are referr...
more »

2017-06-14 02:06 (1) Answers

Trouble with AJAX and data format

I have some code that uses jQuery's $.ajax(). I found that I had to pass my data through JSON.stringify(). $.ajax({ url: '/Resource/ReportError', type: 'POST', data: JSON.stringify({ ResourceId: popup.data('id'), Reason:...
more »

2017-06-14 01:06 (2) Answers