mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-16 17:39:49 +00:00
AbstractHafasClientInterfaceProvider: Append '?' to constraint in jsonLocMatch().
This commit is contained in:
parent
d1f03705d0
commit
391ee47f3a
1 changed files with 3 additions and 3 deletions
|
@ -369,12 +369,12 @@ public abstract class AbstractHafasClientInterfaceProvider extends AbstractHafas
|
||||||
|
|
||||||
protected final SuggestLocationsResult jsonLocMatch(final CharSequence constraint, int maxLocations)
|
protected final SuggestLocationsResult jsonLocMatch(final CharSequence constraint, int maxLocations)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
|
checkNotNull(constraint);
|
||||||
if (maxLocations == 0)
|
if (maxLocations == 0)
|
||||||
maxLocations = DEFAULT_MAX_LOCATIONS;
|
maxLocations = DEFAULT_MAX_LOCATIONS;
|
||||||
|
final String loc = "{\"name\":" + JSONObject.quote(constraint + "?") + ",\"meta\":false}";
|
||||||
final String request = wrapJsonApiRequest("LocMatch",
|
final String request = wrapJsonApiRequest("LocMatch",
|
||||||
"{\"input\":{\"field\":\"S\",\"loc\":{\"name\":" + JSONObject.quote(checkNotNull(constraint).toString())
|
"{\"input\":{\"field\":\"S\",\"loc\":" + loc + ",\"maxLoc\":" + maxLocations + "}}", false);
|
||||||
+ ",\"meta\":false},\"maxLoc\":" + maxLocations + "}}",
|
|
||||||
false);
|
|
||||||
|
|
||||||
final HttpUrl url = requestUrl(request);
|
final HttpUrl url = requestUrl(request);
|
||||||
final CharSequence page = httpClient.get(url, request, "application/json");
|
final CharSequence page = httpClient.get(url, request, "application/json");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue