WojciechZankowski / iextrading4j

IEX Cloud open source API wrapper

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UsageRequestBuilder requires usage type

droidkfx opened this issue · comments

Describe the bug
The UsageRequestBuilder requires a usage type in order to work correctly. The build method throws a null pointer exception if a type was not specified. The API does not require this type. The functionality when not provided is to return all types.

To Reproduce
Steps to reproduce the behavior:

  1. execute :
    iexTradingClient.executeRequest(new UsageRequestBuilder().build());
    with a configured client
  2. See null pointer error:
Caused by: java.lang.NullPointerException: null
	at pl.zankowski.iextrading4j.client.rest.request.account.UsageRequestBuilder.build(UsageRequestBuilder.java:25) ~[iextrading4j-client-3.0.0.jar:na]

Expected behavior
The request builder should allow for the parameter to be omitted.
Screenshots
N/A

Additional context
N/A

Hey,

Thanks for reporting your problem. I had to do couple more changes to support this use case because response is different for the call without usage type. Check this class for more details: https://github.com/WojciechZankowski/iextrading4j/blob/ba6d7f14c7b556661c75a20863675a09d56498f2/iextrading4j-client/src/main/java/pl/zankowski/iextrading4j/client/rest/request/account/UsageRequestBuilder.java

Issue is solved, will be merged with this pull request: #47

Fix released:

<dependency>
	<groupId>pl.zankowski</groupId>
	<artifactId>iextrading4j-all</artifactId>
	<version>3.0.1</version>
</dependency>