Skip to content

Validate TextSearchRequest without query if type is set#566

Merged
domesticmouse merged 1 commit intogooglemaps:masterfrom
danoscarmike:master
May 2, 2019
Merged

Validate TextSearchRequest without query if type is set#566
domesticmouse merged 1 commit intogooglemaps:masterfrom
danoscarmike:master

Conversation

@danoscarmike
Copy link
Copy Markdown
Contributor

@danoscarmike danoscarmike commented May 1, 2019

Updated logic in validateRequest method of TextSearchRequest class

Fixes #564

Copy link
Copy Markdown
Contributor

@domesticmouse domesticmouse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a test 😉

@danoscarmike
Copy link
Copy Markdown
Contributor Author

I actually started to write one but then realized there is no obvious existing test class file in which to put it. Happy to create one but I'm wondering if instead we should overload the PlacesApi.textSearchQuery method with something like:

public static TextSearchRequest textSearchQuery(GeoApiContext context, PlaceType type) {
    TextSearchRequest request = new TextSearchRequest(context);
    request.type(type);
    return request;
}

Could easily extend existing tests then. WDYT?

@domesticmouse
Copy link
Copy Markdown
Contributor

I think I'll think about this after I/O =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TextSearchRequest requires query even when it contains type

2 participants