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

fixed compiler & parser errors #32

Closed
wants to merge 3 commits into from

Conversation

mattes-bru
Copy link
Contributor

Hi @jagreenwood,

first let me thank you for providing this library.

I tried to use it and noticed some compiler errors on a swift 5.10 project. After the code compiled, there were some missing values which result in errors during the parsing the results from the WeatherKit service. I added the missing values as well.

You'll find the changes I made to get open-weather-kit running in this pull request.

@jagreenwood
Copy link
Owner

Hi @mattes-bru Thank you so much for raising this issue and contributing!

One of the goals of this project is to maintain as much of the native WeatherKit API as possible and the edits to WeatherQuery have moved away from this goal.
I think a change could be made to the internal parsing to resolve the issue.
This should also resolve the failing tests.

@jagreenwood
Copy link
Owner

I'm also seeing a reference to a submodule added in the diff. What is that for or was that an accident?

@mattes-bru
Copy link
Contributor Author

The submodule was clearly a mistake. I'll remove it.

The compiler error I tried to solve is:

WeatherQuery.swift:31:29 Cannot convert value of type 'KeyPath<WeatherProxy, Forecast?>' to expected argument type 'KeyPath<WeatherProxy, Forecast??>'

which happens when I try to compile the main branch.

@jagreenwood
Copy link
Owner

I refactored the way the payload is processed and resolved the compilation failure.
I'm still interested in merging your decoding fixes if you have time to edit this pr.

@mattes-bru
Copy link
Contributor Author

I'll open another pull request for that. I also made some changes in the language handling, which allows to make an request in another language than the default one.

@mattes-bru mattes-bru closed this Dec 4, 2024
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.

2 participants