Skip to main content

All Questions

Tagged with
-1 votes
1 answer
57 views

How to add objects to list without having array brackets

I have a for loop in which I add some attributes to the object and at the end I need to have a string (to pass it as a query parameter) I need {"items":[{"itemsCode":"item1&...
jacob1989's user avatar
0 votes
1 answer
45 views

find the JSONObject in JSONArray based on key-value of JSONObject

I have a JSONArray with JSONObjects , i want the find a JSONObject based on condition and update it . Consider my json as below ManagerArr = [ { name : "Ram", employees: ["Shyam&...
Sahithi Y's user avatar
  • 248
0 votes
0 answers
18 views

Converting Invalid Json to Valid Json in Java [duplicate]

I am getting the below records from a backend system and not sure how many such records I might be receiving. As you can see the data I receive is not in a valid json format. [489078:{cancelled:1, ...
Ruby's user avatar
  • 378
1 vote
1 answer
88 views

How to add an empty JSON Array to JSON Object in a specific order

I am trying to create this structure for a JSON - { "pricing": { "quantity": 4200, "minQuantity": 10, "pricePerUnit": { ...
matthewoak's user avatar
0 votes
0 answers
22 views

Getting value from an attribute from a class inside another class but I'm getting nullPointerException

I'm getting the values ​​from another repository fine but when I try to set the values I'm getting nullPointerException Here I got the object whit the class ResumenCreditosResponse final String ...
Ernesto Andres Cabello Venegas's user avatar
0 votes
1 answer
1k views

How to use PactDslJsonBody for an object within an object

Trying to implement Contract Testing using Pact. I'm starting off with Consumer side right now. It is event-driven messages so I am using MessagePactBuilder I will give an example of what I have and ...
ChrisH's user avatar
  • 29
-1 votes
1 answer
45 views

Null values being returned in json while using gson in java

I have the following Json file which I am trying to read: { "billingInformation": { "taxes": { "gst": 2.5, "hst": 7.8 }, "billTo&...
user avatar
-1 votes
1 answer
132 views

Given a json object want to filter out multiple specific fields

{ "hits":[ { date: "10142201" name: "jeremy" age:"19" identity:"A" }, { date:"10142202" ...
Ajm Kir's user avatar
  • 17
0 votes
2 answers
2k views

How to map a JSON response to java class object

I am using Java Spring Boot. What approach should I take to map my JSON response to my class? I'm looking to write a method that will go over the JSON and create ShareDataDaily objects from the ...
Tom's user avatar
  • 3
0 votes
2 answers
97 views

Need JOLT spec for array input JSON

I am working on transforming a complex json using JOLT. Input JSON: { "data": [ { "fieldname": "Name", "fieldvalue": [ "...
Dynamo_7587's user avatar
0 votes
0 answers
199 views

Can I dynamically create a Java class in the run time via JSON file?

For example, I have a JSON format like this: { "Invoice_iDoc": { "name": "Invoice", "methods": [ "customer", "project",...
Java Learner's user avatar
0 votes
1 answer
870 views

Spring boot. Map request to object if field isnt there

Suppose I make a get request to foo() with the JSON body: { „a“: „hallo“, „b“: „world“, „aa“: 10 } @PostMapping("/foo") public void foo(@RequestBody MyClass myClass) { ...
EraZer's user avatar
  • 75
-1 votes
1 answer
45 views

How to handle JsonObject to own Object

Now i take JsonObject from API like this: Its XML object converted to JsonObject. "Details": { "row": [ { ...
Nodirbek Sirojiddinov's user avatar
0 votes
2 answers
700 views

How to convert a java object into a Json

I have a code where I need to compare an email(string) coming from the frontend to the ones storaged in my ddbb. The thing is that the ones storaged are email objects with differents fields as ...
DiegoMG's user avatar
  • 451
0 votes
1 answer
1k views

update value by key of json array inside nested json java

I am able to update the value of jsonObject by using key name , here the method which I am using private static JSONObject setValue(JSONObject json, String key, String newValue) throws JSONException { ...
Cod's user avatar
  • 199

15 30 50 per page
1
2 3 4 5
15