Skip to content

setResultLimit with limit 1 throws an Exception in Gson parser #23

@auvn

Description

@auvn

Way to reproduce:
ApiClient client = new RestApiClient().withLoggingEnabled().withCredentials( "userid", "apikey" );
Account.Service service = Account.service( client );
service.setResultLimit( new ResultLimit( 1,1 ) );
service.getHardware();

In result the JavaClient makes the following request:

https://api.softlayer.com/rest/v3.1/SoftLayer_Account/Hardware.json?resultLimit=1,1

And SL API returns a single Json object instead of array of Json objects, but Gson is expecting list of Json objects and we are facing with the following exception:

Exception in thread "main" com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $

I think you need a fix on SL Rest API side :)

Thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions