Swiftpack.co - emckee4/ItunesSearchAPIClient as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by emckee4.
emckee4/ItunesSearchAPIClient 0.0.3
Swift client for Itunes Search API with a variety of result types.
⭐️ 0
🕓 3 years ago
iOS macOS watchOS tvOS
.package(url: "https://github.com/emckee4/ItunesSearchAPIClient.git", from: "0.0.3")

ItunesSearchClient

Provides a client for the iTunes search API. Supports Combine or closure based callbacks. Documentation available at https://affiliate.itunes.apple.com/resources/documentation/itunes-store-web-service-search-api/

Implementation details

The ItunesSearchResults struct acts as a container for concrete types of ResultItem. The basic untyped search decodes the wrapperType property and combines that with other metadata to determine the resulting output type. If you're seeing unsupportedType error, look in the decoder for ResultDecodingWrapper. The typed search requests will gracefully ignore any result types which do not correspond to the provided type.

Issues

  • Most result types are very conservative wrt optionality of parameters.
  • Some result types I'm not using may not be fully fleshed out.
  • Test coverage is quite limited. Unless/until mocking of api calls is added they probably won't be since the api is limited to 20 per minute for unregisted users.
  • Nearly all tests are built around Combine
  • The use of the nested enums for specifying media/entity/attribute combos needs to be refined slightly since there seem to still be a few legal combos that return nothing from the api.
  • The ResultDecodingWrapper for ItunesSearchResults may not handle all types yet.

API Issues:

  • music mix doesn't seem to work with attributes including mixTerm despite what the documentation suggests
  • There are some types hinted at in the docs that I haven't seen. These won't have ResultItems available

Test cases exist for some entity/attribute combos of:

[x] movie [x] music [x] podcast [x] TVShow [] musicVideo [] audiobook [] shortFilm [X] software [] ebook [] all

GitHub

link
Stars: 0
Last commit: 3 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics