SpoonX / aurelia-api

A simple convenience wrapper around aurelia-fetch-client
http://aurelia-api.spoonx.org
MIT License
72 stars 21 forks source link

FEAT: support of traditional URI request templates (RFC6570) when building query strings #174

Closed pfurini closed 7 years ago

pfurini commented 8 years ago

Reason: Some endpoints require the old syntax for passing array-like query parameters, like the following ?sort=name&sort=surname (one popular example is Spring Data REST).

Now the Rest object lacks the ability to enable this flag, but the underlying aurelia-path lib that it uses to build query strings supports a traditional flag to enable RFC6570.

I propose a PR that adds a useTraditionalUriTemplates property to the Rest class, that's disabled by default. One can simply set this to true to enable the behavior for the whole instance. I prefered not to alter all the method signatures, and by the way is more common to have the RFC6570 syntax enabled for the entire API surface and not for some methods only..