Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation leak #14

Open
trickert76 opened this issue Dec 27, 2018 · 1 comment
Open

Documentation leak #14

trickert76 opened this issue Dec 27, 2018 · 1 comment
Assignees

Comments

@trickert76
Copy link

Hi,

your API has a little documentation leak. I need several times to understand, when I make a OmdbAPI.search request with a OmbdBuilder.setTitle() parameter, the api-omdb-search doesn't return any results, because it makes a call to omdbapi.com/?t=... instead of omdbapi.com/?s=...

The reason is - the search() method wants to create a List of OmdbVideoBasic objects inside a SearchResult, but the builder produces a query with "t" Title - and then OmdbApi.com only returns one entry. And then the JSON Mapper doesn't match (matching an SearchResult entry to SearchResult) and the result is ok, but empty (List==null).
I found a lot of AbstractJsonMapper trace log messages, that the JSON data couldnt be mapped...

So - either add an example to the documentation so that the search should only be used with OmdbBuilder.setSearchTerm() and never use OmdbBuilder.setTitle() in a search or make the builder/parser more robust against this issue.

@trickert76
Copy link
Author

Example:

This will never work, but makes no error nor message about wrong usage.

OmdbBuilder builder = getOmdbBuilder();
builder = builder.setTitle(mytitle);
SearchResults r = omdb.search(builder.build());

This works.
OmdbBuilder builder = getOmdbBuilder();
builder = builder.setSearchTerm(mytitle);
SearchResults r = omdb.search(builder.build());

@Omertron Omertron self-assigned this Dec 31, 2018
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

No branches or pull requests

2 participants