Skip to content

Commit 31e92e3

Browse files
Merge pull request #175 from onfido/release-upgrade
Refresh onfido-java after onfido-openapi-spec update (4204f00)
2 parents 8f89bbd + 52c6b95 commit 31e92e3

14 files changed

Lines changed: 324 additions & 535 deletions

.github/workflows/maven.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ jobs:
4747
run: mvn -B package --file pom.xml -Dmaven.test.skip
4848
- name: Run integration tests with Maven
4949
if: ${{ github.repository_owner == 'onfido' &&
50-
(github.event_name == 'pull_request' || github.event_name == 'release') }}
50+
(github.event_name == 'pull_request' ||
51+
github.event_name == 'release' ||
52+
github.event_name == 'workflow_dispatch') }}
5153
run: mvn test
5254
env:
5355
ONFIDO_API_TOKEN: ${{ secrets.ONFIDO_API_TOKEN }}

.release.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"source": {
33
"repo_url": "https://github.com/onfido/onfido-openapi-spec",
4-
"short_sha": "d66dc55",
5-
"long_sha": "d66dc55aa73210fc789fcb93a3cba9d1d1f89a8a",
6-
"version": "v6.0.0"
4+
"short_sha": "4204f00",
5+
"long_sha": "4204f00a2c7f0f5bd61da3b5442d8eb613418e9e",
6+
"version": ""
77
},
88
"release": "v7.0.0"
99
}

MIGRATION.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,53 @@ major versions of the client library.
66
It covers changes in core resources, other endpoints, and the OpenAPI generator,
77
ensuring a smooth transition between versions.
88

9+
## Upgrading from 6.x to 7.x
10+
11+
### Core Resources
12+
13+
- **All API methods**: All API method calls now use request builder pattern with `.execute()`
14+
- This change enables backward compatibility when new optional parameters are added
15+
- Example migration:
16+
```java
17+
// Before (v6.x)
18+
List<WorkflowRun> runs = api.listWorkflowRuns(applicantId, status, page, perPage);
19+
20+
// After (v7.x)
21+
List<WorkflowRun> runs = api.listWorkflowRuns()
22+
.applicantId(applicantId)
23+
.status(status)
24+
.page(page)
25+
.perPage(perPage)
26+
.execute();
27+
```
28+
- Documents
29+
- Driving licence information properties removed from general `DocumentProperties`
30+
and moved to new `DocumentPropertiesWithDrivingLicenceInformation` class
31+
- Workflow Runs
32+
- `createdAtGt` and `createdAtLt` parameters in `listWorkflowRuns` changed from
33+
date-time format to date format (YYYY-MM-DD)
34+
35+
### Other Endpoints
36+
37+
- Reports
38+
- Device Intelligence: Removed deprecated `breakdown` property and related
39+
breakdown classes:
40+
- `DeviceIntelligenceBreakdownProperties` removed
41+
- `DeviceIntelligenceBreakdownPropertiesDevice` → `DeviceIntelligencePropertiesDevice`
42+
- `DeviceIntelligenceBreakdownPropertiesGeolocation` → `DeviceIntelligencePropertiesGeolocation`
43+
- `DeviceIntelligenceBreakdownPropertiesIp` → `DeviceIntelligencePropertiesIp`
44+
- Identity Enhanced: Changed `totalNumberOfSources` and `numberOfMatches` from
45+
number to string type
46+
47+
### Security
48+
49+
- SSL certificate validation: Removed support for self-signed certificates unless
50+
explicitly configured via `setSslCaCert()`
51+
52+
### OpenAPI generator
53+
54+
- Version upgraded from `7.11.0` to `7.16.0`
55+
956
## Upgrading from 5.x to 6.x
1057

1158
### Core Resources

src/main/java/com/onfido/JSON.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,10 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri
152152
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.DeviceIntelligenceBreakdown.CustomTypeAdapterFactory());
153153
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.DeviceIntelligenceBreakdownDevice.CustomTypeAdapterFactory());
154154
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.DeviceIntelligenceBreakdownDeviceBreakdown.CustomTypeAdapterFactory());
155-
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.DeviceIntelligenceBreakdownProperties.CustomTypeAdapterFactory());
156-
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.DeviceIntelligenceBreakdownPropertiesDevice.CustomTypeAdapterFactory());
157-
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.DeviceIntelligenceBreakdownPropertiesGeolocation.CustomTypeAdapterFactory());
158-
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.DeviceIntelligenceBreakdownPropertiesIp.CustomTypeAdapterFactory());
159155
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.DeviceIntelligenceProperties.CustomTypeAdapterFactory());
156+
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.DeviceIntelligencePropertiesDevice.CustomTypeAdapterFactory());
157+
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.DeviceIntelligencePropertiesGeolocation.CustomTypeAdapterFactory());
158+
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.DeviceIntelligencePropertiesIp.CustomTypeAdapterFactory());
160159
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.DeviceIntelligenceReport.CustomTypeAdapterFactory());
161160
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.Document.CustomTypeAdapterFactory());
162161
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.DocumentBreakdown.CustomTypeAdapterFactory());

src/main/java/com/onfido/model/DeviceIntelligenceBreakdown.java

Lines changed: 3 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import com.google.gson.stream.JsonReader;
2222
import com.google.gson.stream.JsonWriter;
2323
import com.onfido.model.DeviceIntelligenceBreakdownDevice;
24-
import com.onfido.model.DeviceIntelligenceBreakdownProperties;
2524
import java.io.IOException;
2625
import java.util.Arrays;
2726

@@ -59,12 +58,6 @@ public class DeviceIntelligenceBreakdown {
5958
@javax.annotation.Nullable
6059
private DeviceIntelligenceBreakdownDevice device;
6160

62-
public static final String SERIALIZED_NAME_PROPERTIES = "properties";
63-
@Deprecated
64-
@SerializedName(SERIALIZED_NAME_PROPERTIES)
65-
@javax.annotation.Nullable
66-
private DeviceIntelligenceBreakdownProperties properties;
67-
6861
public DeviceIntelligenceBreakdown() {
6962
}
7063

@@ -86,29 +79,6 @@ public void setDevice(@javax.annotation.Nullable DeviceIntelligenceBreakdownDevi
8679
this.device = device;
8780
}
8881

89-
90-
@Deprecated
91-
public DeviceIntelligenceBreakdown properties(@javax.annotation.Nullable DeviceIntelligenceBreakdownProperties properties) {
92-
this.properties = properties;
93-
return this;
94-
}
95-
96-
/**
97-
* Get properties
98-
* @return properties
99-
* @deprecated
100-
*/
101-
@Deprecated
102-
@javax.annotation.Nullable
103-
public DeviceIntelligenceBreakdownProperties getProperties() {
104-
return properties;
105-
}
106-
107-
@Deprecated
108-
public void setProperties(@javax.annotation.Nullable DeviceIntelligenceBreakdownProperties properties) {
109-
this.properties = properties;
110-
}
111-
11282
/**
11383
* A container for additional, undeclared properties.
11484
* This is a holder for any undeclared properties as specified with
@@ -164,22 +134,20 @@ public boolean equals(Object o) {
164134
return false;
165135
}
166136
DeviceIntelligenceBreakdown deviceIntelligenceBreakdown = (DeviceIntelligenceBreakdown) o;
167-
return Objects.equals(this.device, deviceIntelligenceBreakdown.device) &&
168-
Objects.equals(this.properties, deviceIntelligenceBreakdown.properties)&&
137+
return Objects.equals(this.device, deviceIntelligenceBreakdown.device)&&
169138
Objects.equals(this.additionalProperties, deviceIntelligenceBreakdown.additionalProperties);
170139
}
171140

172141
@Override
173142
public int hashCode() {
174-
return Objects.hash(device, properties, additionalProperties);
143+
return Objects.hash(device, additionalProperties);
175144
}
176145

177146
@Override
178147
public String toString() {
179148
StringBuilder sb = new StringBuilder();
180149
sb.append("class DeviceIntelligenceBreakdown {\n");
181150
sb.append(" device: ").append(toIndentedString(device)).append("\n");
182-
sb.append(" properties: ").append(toIndentedString(properties)).append("\n");
183151
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
184152
sb.append("}");
185153
return sb.toString();
@@ -202,7 +170,7 @@ private String toIndentedString(Object o) {
202170

203171
static {
204172
// a set of all properties/fields (JSON key names)
205-
openapiFields = new HashSet<String>(Arrays.asList("device", "properties"));
173+
openapiFields = new HashSet<String>(Arrays.asList("device"));
206174

207175
// a set of required properties/fields (JSON key names)
208176
openapiRequiredFields = new HashSet<String>(0);
@@ -225,10 +193,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
225193
if (jsonObj.get("device") != null && !jsonObj.get("device").isJsonNull()) {
226194
DeviceIntelligenceBreakdownDevice.validateJsonElement(jsonObj.get("device"));
227195
}
228-
// validate the optional field `properties`
229-
if (jsonObj.get("properties") != null && !jsonObj.get("properties").isJsonNull()) {
230-
DeviceIntelligenceBreakdownProperties.validateJsonElement(jsonObj.get("properties"));
231-
}
232196
}
233197

234198
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {

0 commit comments

Comments
 (0)