-
Notifications
You must be signed in to change notification settings - Fork 47
✨ Add KeywordService for keyword details and movie discovery #252
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
Conversation
- Add Keyword model with id and name properties - Add KeywordService protocol with details and movies methods - Add TMDbKeywordService implementation - Add KeywordRequest and KeywordMoviesRequest classes - Expose keywords service via TMDbClient - Add comprehensive unit tests with JSON fixtures - Add integration tests against live TMDb API Co-Authored-By: Claude Opus 4.5 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds comprehensive support for TMDb's keyword endpoints by introducing a new KeywordService with methods to fetch keyword details and discover associated movies.
Changes:
- Introduced
Keywordmodel with id and name properties - Added
KeywordServiceprotocol andTMDbKeywordServiceimplementation for keyword operations - Created API request classes (
KeywordRequest,KeywordMoviesRequest) for keyword endpoints - Integrated keyword service into
TMDbClientas thekeywordsproperty
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| Sources/TMDb/Domain/Models/Keyword.swift | Defines the Keyword model with id and name properties |
| Sources/TMDb/Domain/Services/Keywords/KeywordService.swift | Protocol defining keyword service interface with details and movies methods |
| Sources/TMDb/Domain/Services/Keywords/TMDbKeywordService.swift | Implementation of KeywordService using APIClient |
| Sources/TMDb/Domain/Services/Keywords/Requests/KeywordRequest.swift | Request for fetching keyword details by id |
| Sources/TMDb/Domain/Services/Keywords/Requests/KeywordMoviesRequest.swift | Request for fetching movies associated with a keyword |
| Sources/TMDb/TMDBClient.swift | Adds keywords property exposing KeywordService |
| Tests/TMDbTests/Domain/Models/KeywordTests.swift | Unit tests for Keyword model JSON decoding |
| Tests/TMDbTests/Domain/Services/Keywords/TMDbKeywordServiceTests.swift | Unit tests for TMDbKeywordService methods |
| Tests/TMDbTests/Domain/Services/Keywords/Requests/KeywordRequestTests.swift | Unit tests for KeywordRequest properties |
| Tests/TMDbTests/Domain/Services/Keywords/Requests/KeywordMoviesRequestTests.swift | Unit tests for KeywordMoviesRequest with various parameter combinations |
| Tests/TMDbIntegrationTests/KeywordIntegrationTests.swift | Integration tests against live TMDb API |
| Tests/TMDbTests/Mocks/Models/Keyword+Mocks.swift | Mock factory methods for Keyword model |
| Tests/TMDbTests/Resources/json/keyword.json | JSON fixture for keyword details response |
| Tests/TMDbTests/Resources/json/keyword-movies.json | JSON fixture for keyword movies response |
| Tests/TMDbTests/TestUtils/Tags.swift | Adds keyword tag for test organization |
| Tests/TMDbIntegrationTests/TestUtils/Tags.swift | Adds keyword tag for integration test organization |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #252 +/- ##
==========================================
- Coverage 97.56% 97.53% -0.03%
==========================================
Files 249 254 +5
Lines 3936 3973 +37
==========================================
+ Hits 3840 3875 +35
- Misses 96 98 +2 ☔ View full report in Codecov by Sentry. |
Summary
Add a new
KeywordServiceto the TMDb Swift Package that provides access to TMDb's keyword endpoints. This enables users to fetch keyword details and discover movies associated with specific keywords.Changes
New Model:
Keyword- Simple model withidandnameproperties, conforming toCodable,Equatable,Hashable,Identifiable, andSendableNew Service:
KeywordServiceprotocol withdetails(forKeyword:)andmovies(forKeyword:page:language:)methodsTMDbKeywordServiceimplementationmovies(forKeyword:)without page/language parametersRequest Classes:
KeywordRequest- Fetches keyword details from/keyword/{id}KeywordMoviesRequest- Fetches movies for a keyword from/keyword/{id}/movieswith optional page and language parametersIntegration:
TMDbClientto exposekeywordsproperty for theKeywordServiceTests:
Keywordmodel JSON decodingTMDbKeywordServicewith mocked API clientKeywordRequestandKeywordMoviesRequestBenefits
Keywordmodel provides better IDE supportGenerated with Claude Code