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

Mismatch in url from application.properties and WeatherClient #15

Closed
micskeiz opened this issue Oct 12, 2020 · 1 comment
Closed

Mismatch in url from application.properties and WeatherClient #15

micskeiz opened this issue Oct 12, 2020 · 1 comment

Comments

@micskeiz
Copy link

After the update the to openweathermap API, the /weather endpoint is not working. I think the reason is due to weather url.

In application.properties it is defined as:

weather.url = https://api.openweathermap.org/data/2.5/weather

And it is called in WeatherClient.java as:

var url = String.format("%s/data/2.5/weather?q=%s&appid=%s", weatherServiceUrl, CITY, weatherServiceApiKey);

The part /data/2.5/weather will be duplicated. A simple fix is to define it in application.properties as:

weather.url = https://api.openweathermap.org

After fixing it, the existing tests and the /weather endpoint were working for me.

By the way, is /src/main/resources/application-int.properties still used? It still contains a reference to the darksky API.

@hamvocke
Copy link
Owner

Thanks for spotting! These are indeed two distinct issues and I just fixed both of them:

  1. I removed application-int.properties. This was a remnant of an earlier iteration that was no longer referenced in the Readme
  2. I fixed the weather.url property in application.properties to not include the URL path

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