Skip to content

Commit 0071624

Browse files
committed
Fixed ENUMs where empty string is returned
This was causing NPE due to missing enum . TaxType should not be an enum as this list varies from org to org when you create custom tax rates. Change type to String
1 parent e93d1c5 commit 0071624

5 files changed

Lines changed: 15 additions & 12 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ Add the dependency to your pom.xml. Gradle, sbt and other build tools can be fo
7474
<dependency>
7575
<groupId>com.github.xeroapi</groupId>
7676
<artifactId>xero-java</artifactId>
77-
<version>2.2.3</version>
77+
<version>2.2.4</version>
7878
</dependency>
7979

8080

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<groupId>com.github.xeroapi</groupId>
55
<artifactId>xero-java</artifactId>
66
<packaging>jar</packaging>
7-
<version>2.2.2</version>
7+
<version>2.2.4</version>
88
<name>Xero-Java SDK</name>
99
<description>This is the official Java SDK for Xero API</description>
1010
<url>https://github.com/XeroAPI/Xero-Java</url>

src/main/java/com/xero/api/JsonConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public String getAccessTokenUrl() {
132132

133133
@Override
134134
public String getUserAgent() {
135-
return USER_AGENT + " " + CONSUMER_KEY + " [Xero-Java-2.2.3]";
135+
return USER_AGENT + " " + CONSUMER_KEY + " [Xero-Java-2.2.4]";
136136
}
137137

138138
@Override

src/main/java/com/xero/models/accounting/Account.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,9 @@ public enum BankAccountTypeEnum {
180180

181181
CREDITCARD("CREDITCARD"),
182182

183-
PAYPAL("PAYPAL");
183+
PAYPAL("PAYPAL"),
184+
185+
EMPTY("");
184186

185187
private String value;
186188

@@ -302,7 +304,9 @@ public enum SystemAccountEnum {
302304

303305
UNREALISEDCURRENCYGAIN("UNREALISEDCURRENCYGAIN"),
304306

305-
WAGEPAYABLES("WAGEPAYABLES");
307+
WAGEPAYABLES("WAGEPAYABLES"),
308+
309+
EMPTY("");
306310

307311
private String value;
308312

src/main/java/com/xero/models/accounting/TaxRate.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import com.fasterxml.jackson.annotation.JsonCreator;
2020
import com.fasterxml.jackson.annotation.JsonValue;
2121
import com.xero.models.accounting.TaxComponent;
22-
import com.xero.models.accounting.TaxType;
2322
import io.swagger.annotations.ApiModel;
2423
import io.swagger.annotations.ApiModelProperty;
2524
import java.util.ArrayList;
@@ -38,7 +37,7 @@ public class TaxRate {
3837

3938

4039
@JsonProperty("TaxType")
41-
private TaxType taxType = null;
40+
private String taxType = null;
4241

4342

4443
@JsonProperty("TaxComponents")
@@ -198,21 +197,21 @@ public void setName(String name) {
198197
this.name = name;
199198
}
200199

201-
public TaxRate taxType(TaxType taxType) {
200+
public TaxRate taxType(String taxType) {
202201
this.taxType = taxType;
203202
return this;
204203
}
205204

206205
/**
207-
* Get taxType
206+
* The tax type
208207
* @return taxType
209208
**/
210-
@ApiModelProperty(value = "")
211-
public TaxType getTaxType() {
209+
@ApiModelProperty(value = "The tax type")
210+
public String getTaxType() {
212211
return taxType;
213212
}
214213

215-
public void setTaxType(TaxType taxType) {
214+
public void setTaxType(String taxType) {
216215
this.taxType = taxType;
217216
}
218217

0 commit comments

Comments
 (0)