MoviebaseApp / tmdb-kotlin

🎬 Modern powerful TMDB API to fetch movies and TV shows for Kotlin Multiplatform.
https://www.moviebase.app
Apache License 2.0
205 stars 20 forks source link

Fix TmdbSeasonDetail images parsing #117

Closed DrewCarlson closed 10 months ago

DrewCarlson commented 10 months ago

Right now, response parsing can fail for tv season details with images as it expects the images to be within a nested result list but the API provides a top level block roughly matching the TmdbImages class. Added a test to validate the failure and fix.

HttpClient: RESPONSE https://api.themoviedb.org/3/tv/63333/season/1?append_to_response=release_dates%2Cimages%2Ccredits%2Ctv_credits%2Cexternal_ids&include_image_language=
failed with exception: io.ktor.serialization.JsonConvertException: Field 'results' is required for type with serial name 'app.moviebase.tmdb.model.TmdbResult', but it was missing at path: $.images
ChrisKruegerDev commented 10 months ago

Nice, thanks! Interesting to you that it's different from the other append to response objects now.