Aggregate query on a Postgres jsonb array based on a condition

I have a postgres table (documents) which has a jsonb column called details which holds a jsonb that looks like this: { “identifier”: “lead_id”, “callback_url”: “http://localhost:3000/supply/internal/api/v3/attempts/9a967788-ad44-499e-93e8-3ce6544f3786”, “document_ids”: [ “0246ef40-db40-4c07-898c-7c09ad50d3ff”, null, “c155d537-2faf-4397-90ba-741651fdee9d”, “f926ffc5-6184-44ad-ac16-3da7c0bc3186”, “68f91648-9297-4f34-b320-d00cec04f52c”, “2159baf8-55a9-40f9-a998-3b237f370b3a” ], “identifier_value”: “9a967788-ad44-499e-93e8-3ce6544f3786” } document_ids is a jsonb array which holds a list of document ids some of which may be…

Custom Mapping from JSON to Java/POJO in Spring RestTemplate response

I have a Spring boot application where I am using RestTemplate to call a Rest API and I receive following JSON formatted response: { “data”: [ { “id”: “1”, “type”: “type1”, “config”: { “property1” : “value1”, “property2” : “value2” } }, { “id”: “2”, “type”: “type2”, “config”: { “property3” : “value3”, “property4” : “value4”, “propArray”:…