Filter generated Jellyfin API operations

This commit is contained in:
Brendan Szymanski 2026-08-08 15:21:08 -04:00
parent 0addde59d3
commit f74cb400f5
2 changed files with 45 additions and 4 deletions

View file

@ -3,3 +3,42 @@ generate:
- client - client
accessModifier: public accessModifier: public
namingStrategy: idiomatic namingStrategy: idiomatic
# Only the operations Luminate calls are generated. The Jellyfin specification defines 388
# operations and 357 schemas; generating all of them produced roughly 258,000 lines of Swift and
# dominated build time. The generator additionally includes the transitive closure of every
# component the listed operations reference, so no `schemas:` additions are needed.
#
# Keep this list in sync with the `JellyfinAPI` protocol in
# Sources/LuminateServices/Session/JellyfinAPI.swift. An operation that is not listed here is not
# generated, and a call to it fails to compile with "value of type 'Client' has no member".
filter:
operations:
# Discovery and system
- GetPublicSystemInfo
- GetSystemInfo
# Auth
- GetPublicUsers
- AuthenticateUserByName
- UpdateUserPassword
- GetQuickConnectEnabled
- InitiateQuickConnect
- GetQuickConnectState
- AuthenticateWithQuickConnect
# Home and browse
- GetUserViews
- GetItems
- GetItem
- GetResumeItems
- GetNextUp
- GetLatestMedia
- GetSeasons
- GetEpisodes
- GetSearchHints
# Images
- GetItemImage
- GetItemImageByIndex
# User state
- MarkPlayedItem
- MarkUnplayedItem
- MarkFavoriteItem
- UnmarkFavoriteItem

View file

@ -23,10 +23,12 @@ import LuminateAPI
/// The slice of the generated Jellyfin API that ``JellyfinClient`` actually calls. /// The slice of the generated Jellyfin API that ``JellyfinClient`` actually calls.
/// ///
/// The generated `APIProtocol` declares all 388 operations in the Jellyfin specification, which /// The seam exists so a test double conforms to a protocol this module owns rather than to the
/// makes it impossible to conform a test double to. This protocol names only the operations /// generated `APIProtocol`, whose shape is decided by
/// Luminate uses, so a test can implement a handful of methods instead of hundreds. The generated /// `Sources/LuminateAPI/openapi-generator-config.yaml`. Adding an operation here also requires
/// `Client` already has matching signatures, so it conforms with an empty extension. /// adding its `operationId` to that file's `filter.operations` list, or the generated `Client`
/// will not have the method. The generated `Client` already has matching signatures, so it
/// conforms with an empty extension.
/// ///
/// This is a service-layer seam and nothing more: it deals in generated `Operations.*` types, which /// This is a service-layer seam and nothing more: it deals in generated `Operations.*` types, which
/// never travel above ``JellyfinClient``. /// never travel above ``JellyfinClient``.