Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
6dbb8d6
fix: Update code
larshelge Jan 19, 2026
5e78bcf
merge: Merge from master branch
larshelge Jan 19, 2026
eef36e9
fix: Update code
larshelge Jan 21, 2026
2aeb160
fix: Update code
larshelge Jan 21, 2026
09e16f5
fix: Update code
larshelge Jan 22, 2026
22baaf0
fix: Update code
larshelge Jan 22, 2026
65e4c6a
fix: Update code
larshelge Jan 22, 2026
6733363
fix: Update code
larshelge Jan 22, 2026
f0670b2
merge: Merge from master branch
larshelge Jan 22, 2026
bcb9517
merge: Merge from master branch
larshelge Jan 22, 2026
524576b
fix: Update code
larshelge Jan 26, 2026
76803c8
fix: Update code
larshelge Jan 27, 2026
6a2afb8
fix: Update code
larshelge Jan 27, 2026
996e4ac
fix: Update code
larshelge Jan 27, 2026
e73e9cc
merge: Merge from master branch
larshelge Jan 27, 2026
adcd707
fix: Update code
larshelge Jan 27, 2026
b895778
merge: Merge from master branch
larshelge Jan 27, 2026
baed0e5
fix: Update code
larshelge Jan 27, 2026
efe180f
fix: Update code
larshelge Jan 27, 2026
733abac
fix: Update code
larshelge Jan 27, 2026
dbbc958
merge: Merge from master branch
larshelge Jan 27, 2026
947da72
fix: Update code
larshelge Jan 27, 2026
13005f5
fix: Update code
larshelge Feb 2, 2026
6adf1d1
fix: Update code
larshelge Feb 18, 2026
a2124a4
fix: Update code
larshelge Feb 18, 2026
3860d11
merge: Merge from master branch
larshelge Feb 18, 2026
1b3b4ff
fix: Update code
larshelge Feb 23, 2026
7e988a8
merge: Merge from master branch
larshelge Feb 23, 2026
72e2b9c
fix: Update code
larshelge Feb 25, 2026
b296677
fix: Update code
larshelge Feb 25, 2026
151ed4f
chore: Bump version
larshelge Feb 25, 2026
6208073
merge: Merge from master branch
larshelge Feb 25, 2026
24a18c3
merge: Merge from master branch
larshelge Feb 25, 2026
cc0ac36
fix: Add test
larshelge Feb 26, 2026
7f2016f
fix: Update code
larshelge Feb 26, 2026
7c02d20
fix: Update code
larshelge Feb 26, 2026
d8a8d5f
merge: Merge from master branch
larshelge Feb 26, 2026
a7568f5
fix: Update code
larshelge Mar 4, 2026
8b4b947
merge: Merge from master branch
larshelge Mar 4, 2026
9fc6e7a
fix: Update code
larshelge Mar 6, 2026
a537088
fix: Update code
larshelge Mar 6, 2026
f18110f
merge: Merge from master branch
larshelge Mar 6, 2026
0249573
merge: Merge from master branch
larshelge Mar 6, 2026
c3b96d4
fix: Update code
larshelge Mar 6, 2026
136d976
merge: Merge from master branch
larshelge Mar 6, 2026
ab9a0ae
fix: Update code
larshelge Mar 7, 2026
247b74b
merge: Merge from master branch
larshelge Mar 7, 2026
6c1d0c8
merge: Merge from master branch
larshelge Mar 7, 2026
437749e
fix: Update code
larshelge Mar 8, 2026
9bd01ae
fix: Update code
larshelge Mar 8, 2026
6cb5cc4
merge: Merge from master branch
larshelge Mar 8, 2026
4cfcbcf
fix: Add util method
larshelge Mar 9, 2026
717f095
merge: Merge from master branch
larshelge Mar 9, 2026
bc14846
fix: Update code
larshelge Mar 9, 2026
cef6eb5
merge: Merge from master branch
larshelge Mar 9, 2026
1880d03
fix: Update code
larshelge Mar 10, 2026
880061e
merge: Merge from master branch
larshelge Mar 10, 2026
485c297
fix: Update code
larshelge Mar 12, 2026
7f4556d
merge: Merge from master branch
larshelge Mar 12, 2026
542a7ec
fix: Update code
larshelge Mar 13, 2026
7cc77e8
fix: Update code
larshelge Mar 13, 2026
2bea5cb
fix: Update code
larshelge Mar 13, 2026
92744b9
merge: Merge from master branch
larshelge Mar 13, 2026
5a3edef
fix: Update code
larshelge Mar 13, 2026
5712164
merge: Merge from master branch
larshelge Mar 13, 2026
b78faf2
fix: Update code
larshelge Apr 6, 2026
53b2015
fix: Update code
larshelge Apr 6, 2026
d9b2f5f
fix: Update code
larshelge Apr 6, 2026
93a4cb5
merge: Merge from master branch
larshelge Apr 6, 2026
e0bff48
merge: Merge from master branch
larshelge Apr 6, 2026
91c67dc
Merge branch 'master' into lars-dev
larshelge Apr 6, 2026
3c5c983
merge: Merge from master branch
larshelge Apr 6, 2026
0cd5cb7
fix: Update code
larshelge Apr 6, 2026
e9510fd
fix: Update code
larshelge Apr 15, 2026
8733638
fix: Update code
larshelge Apr 15, 2026
e2cd534
fix: Update code
larshelge Apr 15, 2026
0e99617
fix: Update code
larshelge Apr 15, 2026
a0266f4
merge: Merge from master branch
larshelge Apr 15, 2026
60794f6
fix: Update code
larshelge Apr 15, 2026
a1f9e43
merge: Merge from master branch
larshelge Apr 15, 2026
979a79c
fix: Update code
larshelge Apr 15, 2026
c6be59f
merge: Merge from master branch
larshelge Apr 15, 2026
e6b1270
fix: Update code
larshelge Apr 24, 2026
93d7c14
fix: Update code
larshelge Apr 30, 2026
14e8cb7
fix: Update code
larshelge Apr 30, 2026
06ca21c
fix: Update code
larshelge May 4, 2026
992beb7
merge: Merge from master branch
larshelge May 4, 2026
c2656e0
merge: Merge from master branch
larshelge May 4, 2026
c9d6aef
fix: Update code
larshelge May 4, 2026
78f4c57
fix: Update code
larshelge May 4, 2026
d639e50
fix: Update code
larshelge May 4, 2026
40a9888
fix: Update code
larshelge May 4, 2026
e729fef
fix: Update code
larshelge May 4, 2026
5bce622
fix: Update code
larshelge May 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 6 additions & 17 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>org.hisp</groupId>
<artifactId>dhis2-java-client</artifactId>
<version>2.5.7</version>
<version>2.6.0</version>
<packaging>jar</packaging>

<name>DHIS 2 API client for Java</name>
Expand Down Expand Up @@ -47,13 +47,12 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.release>17</maven.compiler.release>
<jackson.version>2.19.0</jackson.version>
<jackson.version>3.1.3</jackson.version>
<jts.version>1.20.0</jts.version>
<slf4j.version>2.0.17</slf4j.version>
<lombok.version>1.18.36</lombok.version>
<maven-artifact.version>3.9.9</maven-artifact.version>
<httpclient5.version>5.3.1</httpclient5.version>
<jackson-datatype-jts.version>2.14</jackson-datatype-jts.version>
<junit-jupiter.version>5.12.1</junit-jupiter.version>
<maven-artifact.version>3.9.4</maven-artifact.version>
<maven-surefire-plugin.version>3.5.2</maven-surefire-plugin.version>
Expand Down Expand Up @@ -89,35 +88,25 @@
</dependency>
<!-- Jackson -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<groupId>tools.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<groupId>tools.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<groupId>tools.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<groupId>tools.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-yaml</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.graphhopper.external</groupId>
<artifactId>jackson-datatype-jts</artifactId>
<version>${jackson-datatype-jts.version}</version>
</dependency>
<!-- SLF4J -->
<dependency>
<groupId>org.slf4j</groupId>
Expand Down
19 changes: 5 additions & 14 deletions src/main/java/org/hisp/dhis/BaseDhis2.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
import static org.hisp.dhis.util.CollectionUtils.toCommaSeparated;
import static org.hisp.dhis.util.HttpUtils.getUriAsString;

import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
Expand Down Expand Up @@ -118,6 +117,7 @@
import org.hisp.dhis.util.DateTimeUtils;
import org.hisp.dhis.util.HttpUtils;
import org.hisp.dhis.util.JacksonUtils;
import tools.jackson.databind.ObjectMapper;

/**
* @author Lars Helge Overland
Expand Down Expand Up @@ -1188,12 +1188,7 @@ private void handleErrorsForGet(ClassicHttpResponse response, String url)
* @throws IOException if reading failed.
*/
protected <T> T readValue(String content, Class<T> type) throws IOException {
try {
return objectMapper.readValue(content, type);
} catch (IOException ex) {
log.error("JSON deserialization error for content: {}", content);
throw ex;
}
return objectMapper.readValue(content, type);
}

/**
Expand Down Expand Up @@ -1289,15 +1284,11 @@ protected <T extends HttpUriRequestBase> T withAuth(T request) {
* @throws Dhis2ClientException if the serialization failed.
*/
protected String toJsonString(Object object) {
try {
String json = objectMapper.writeValueAsString(object);
String json = objectMapper.writeValueAsString(object);

log("Object JSON: '{}'", json);
log("Object JSON: '{}'", json);

return json;
} catch (IOException ex) {
throw new Dhis2ClientException("Failed to deserialize JSON", ex);
}
return json;
}

/**
Expand Down
21 changes: 6 additions & 15 deletions src/main/java/org/hisp/dhis/Dhis2AsyncRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
*/
package org.hisp.dhis;

import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.IOException;
import java.net.URI;
import java.util.ArrayList;
Expand All @@ -47,6 +46,7 @@
import org.hisp.dhis.response.job.JobInfoResponse;
import org.hisp.dhis.response.job.JobNotification;
import org.hisp.dhis.util.HttpUtils;
import tools.jackson.databind.ObjectMapper;

@Slf4j
public class Dhis2AsyncRequest {
Expand Down Expand Up @@ -223,11 +223,7 @@ private <T> T getSummary(JobInfo jobInfo, Class<T> klass) {

String summary = getForBody(summaryUrl);

try {
return objectMapper.readValue(summary, klass);
} catch (IOException ex) {
throw new Dhis2ClientException("Failed to parse task summaries", ex);
}
return objectMapper.readValue(summary, klass);
}

/**
Expand All @@ -237,18 +233,13 @@ private <T> T getSummary(JobInfo jobInfo, Class<T> klass) {
* @return a {@link JobNotification}.
*/
private JobNotification getLastNotification(URI url) {
try {
String response = getForBody(url);
String response = getForBody(url);

JobNotification[] notificationArray =
objectMapper.readValue(response, JobNotification[].class);
JobNotification[] notificationArray = objectMapper.readValue(response, JobNotification[].class);

List<JobNotification> notifications = new ArrayList<>(Arrays.asList(notificationArray));
List<JobNotification> notifications = new ArrayList<>(Arrays.asList(notificationArray));

return !notifications.isEmpty() ? notifications.get(0) : new JobNotification();
} catch (IOException ex) {
throw new Dhis2ClientException("Failed to parse job notifications", ex);
}
return !notifications.isEmpty() ? notifications.get(0) : new JobNotification();
}

/**
Expand Down
15 changes: 15 additions & 0 deletions src/main/java/org/hisp/dhis/model/IdentifiableObject.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
package org.hisp.dhis.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import java.io.Serializable;
import java.util.Date;
import java.util.HashSet;
Expand All @@ -46,6 +47,20 @@
@Setter
@ToString
@NoArgsConstructor
@JsonPropertyOrder(
value = {
"id",
"code",
"name",
"created",
"createdBy",
"lastUpdated",
"lastUpdatedBy",
"attributeValues",
"translations",
"sharing",
"access"
})
public class IdentifiableObject implements Serializable {
@JsonProperty protected String id;

Expand Down
18 changes: 18 additions & 0 deletions src/main/java/org/hisp/dhis/model/event/Event.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
Expand All @@ -47,6 +48,23 @@
@NoArgsConstructor
@EqualsAndHashCode(onlyExplicitlyIncluded = true)
@ToString(onlyExplicitlyIncluded = true)
@JsonPropertyOrder({
"event",
"program",
"trackedEntity",
"programStage",
"enrollment",
"orgUnit",
"attributeOptionCombo",
"status",
"createdAt",
"createdAtClient",
"updatedAt",
"updatedAtClient",
"scheduledAt",
"occurredAt",
"completedAt"
})
public class Event implements Serializable {
@EqualsAndHashCode.Include
@ToString.Include
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/org/hisp/dhis/model/trackedentity/TrackedEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
Expand All @@ -49,6 +50,15 @@
@Setter
@ToString
@NoArgsConstructor
@JsonPropertyOrder({
"trackedEntity",
"trackedEntityType",
"createdAt",
"createdAtClient",
"updatedAt",
"updatedAtClient",
"orgUnit"
})
public class TrackedEntity implements Serializable {
@JsonProperty private String trackedEntity;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.hisp.dhis.model.AggregationType;
import org.hisp.dhis.model.IdScheme;
Expand All @@ -53,6 +54,7 @@
@Getter
@Setter
@Accessors(chain = true)
@ToString
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class AnalyticsQuery {
private final List<QueryDimension> dimensions = new ArrayList<>();
Expand Down
Loading
Loading