eclipse-ditto/ditto-clients

Things sorting with JS Client

thlandgraf opened this issue · 1 comments

Hi,
I use your Javascript binding (@eclipse-ditto/ditto-javascript-client-dom) for HTTP access to Ditto.

load5ThingsAsc() {
    var options = DefaultSearchOptions.getInstance().withLimit(0,5);
    options = options.withSort("+thingId");
    const p = this.searchHandle.search(options).then(result => console.log("returned",result.items))
  }

does fire a:

http://localhost:8080/api/2/search/things?option=limit(0%2C5)%2Csort(%252BthingId)

this results to a Error 400 with the message "Invalid input '%', expected Asc or Desc". A

...
options = options.withSort("-thingId");
...

works fine.

feels like a bug

Thomas

Hi @thlandgraf,

thank you very much for your bug report. This is actually caused by faulty encoding of the sort option, which I fixed in #160.

We're planning on including the fix into a release soon.