Skip to content

Commit ba3a86f

Browse files
committed
docs: add info to changelog
1 parent 24d447b commit ba3a86f

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
## Next Release
44

55
- Adds `WebhookCustomHeader` model, allowing `custom_headers` to be passed when creating/updating a webhook
6+
- Fixes error parsing
7+
- Allows for alternative format of `errors` field (previously we deserialized the `errors` field into a list of `Error` objects; however, sometimes the errors are simply a list of strings. This change make the `errors` field a list of `Object` allowing for either the new `FieldError` object or a list of strings. Users will need to check for the type of error returned and handle appropriately)
8+
- Removed the unused `Error` model
9+
- Added an explicit `AddressVerificationFieldError` model
10+
- The `BetaPaymentRefund` now uses a list of `FieldError` instead of `Error` for the `errors` field
611
- Corrects payload wrapping for updating a webhook
712
- Bumps dependencies
813

src/main/java/com/easypost/model/AddressVerificationFieldError.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,20 @@
55

66
@Getter
77
public final class AddressVerificationFieldError {
8+
private String message;
89
private String code;
910
private String field;
10-
private String message;
1111
private String suggestion;
1212

13+
/**
14+
* Set the message of this error object.
15+
*
16+
* @param message The error message.
17+
*/
18+
void setMessage(final String message) {
19+
this.message = message;
20+
}
21+
1322
/**
1423
* Set the code of this error object.
1524
*
@@ -28,15 +37,6 @@ void setField(final String field) {
2837
this.field = field;
2938
}
3039

31-
/**
32-
* Set the message of this error object.
33-
*
34-
* @param message The error message.
35-
*/
36-
void setMessage(final String message) {
37-
this.message = message;
38-
}
39-
4040
/**
4141
* Set the suggestion of this error object.
4242
*

src/test/java/com/easypost/AddressTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ public void testCreateVerify() throws EasyPostException {
9090
address = vcr.client.address.create(addressData);
9191

9292
assertInstanceOf(Address.class, address);
93+
9394
assertEquals(false, address.getVerifications().getDelivery().getSuccess());
9495
assertInstanceOf(AddressDetail.class, address.getVerifications().getDelivery().getDetails());
9596
AddressVerificationFieldError addressVerificationFieldErrorGetDelivery = address.getVerifications().getDelivery().getErrors().get(0);

0 commit comments

Comments
 (0)