Omertron / api-omdb

API for the Open Movie Database
GNU General Public License v3.0
27 stars 20 forks source link

OmdbApi : getInfo() and search() method should be updated to update APIKey only if parameters don't contain it already #13

Closed vinodss33 closed 6 years ago

vinodss33 commented 6 years ago

OmdbApi.txt Hi Team,

OmdbApi class needs to be updated for method getInfo() and search(). The following code needs to be added : if (!parameters.has(Param.APIKEY)) { parameters.add(Param.APIKEY, this.apiKey); }
Current Design: As soon as request comes to API , it adds APIKey, which is fine if the client has used parameterised constructor to create Object. But problem comes when client has used default constructor to create object and passing APIKey in OMDBParameter list. But since we are adding searchParams.add(Param.APIKEY, this.apiKey); , the value of APIKey ggets overridden in Omdbparameters with default null value.

Issue: User is forced to use OmdbApi object in application with APIKey, which might not be suitable for different user for different needs. File with suggested code is attached

trickert76 commented 5 years ago

In which release will this be available?