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

Update Card+ImageUris.swift #22

Merged
merged 1 commit into from
May 14, 2024
Merged

Update Card+ImageUris.swift #22

merged 1 commit into from
May 14, 2024

Conversation

Bonney
Copy link
Contributor

@Bonney Bonney commented May 14, 2024

closes #21

Fixed artCrop and borderCrop not decoding properly by removing custom CodingKeys. The JSON decoder used in the networking client already converts from snakeCase when decoding the API response; these coding keys were inadvertently causing a coding key mis-match.

JSON decoder as set up in NetworkService.swift, lines 75 & 76:

let decoder = JSONDecoder()
decoder.keyDecodingStrategy = .convertFromSnakeCase

A quick test with the local changes (removing the custom coding keys) has solved the issue in my test app.

Fixed artCrop and borderCrop not decoding properly by removing custom CodingKeys. The JSON decoder used in the networking client already converts from snakeCase when decoding the API response; these coding keys were inadvertently causing a coding key mis-match.

JSON decoder as set up in `NetworkService.swift`, lines 75 & 76:

```swift
let decoder = JSONDecoder()
decoder.keyDecodingStrategy = .convertFromSnakeCase
```
@JacobHearst JacobHearst merged commit ff695ad into JacobHearst:main May 14, 2024
2 checks passed
@JacobHearst
Copy link
Owner

Thanks for the contribution!

@Bonney
Copy link
Contributor Author

Bonney commented May 14, 2024

My pleasure! Thank you for all your hard work on this project!

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.

art_crop and border_crop URIs Missing from Cards
2 participants