Skip to content

Commit 000263b

Browse files
authored
Merge pull request #85 from rryam/docs-idmissing
Document idMissing validation
2 parents 0102c5e + f6b0a57 commit 000263b

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,10 @@ This method performs a GET request to Apple's test endpoint and validates:
207207
- Network connectivity to Apple Music API
208208
- Basic API communication works
209209

210+
### Input validation
211+
212+
Requests that require identifiers validate empty inputs and throw `MusadoraKitError.idMissing` when arrays are empty. This applies to favorites, ratings, add-resources, and batch resource requests (catalog and library).
213+
210214
## Catalog
211215

212216
To easily access the Apple Music Catalog, you can use pre-defined methods from MusadoraKit. The methods are similar across the music items.
@@ -629,6 +633,8 @@ print(response.songs)
629633
print(response.albums)
630634
```
631635

636+
> **Note:** Empty identifier collections throw `MusadoraKitError.idMissing`.
637+
632638
## MusicLibraryResourcesRequest:
633639

634640
To fetch multiple library music items by their identifiers in the same request. For example:
@@ -641,6 +647,8 @@ print(response.songs)
641647
print(response.playlists)
642648
```
643649

650+
> **Note:** Empty identifier collections throw `MusadoraKitError.idMissing`.
651+
644652
## Animated Artwork View
645653

646654
Create stunning animated backgrounds from music artwork with dynamic mesh gradients. Available on iOS 18, macOS 15, watchOS 11, tvOS 18, and visionOS 2 or later.

Sources/MusadoraKit/Documentation.docc/MusadoraKit.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ let recommendations = try await MRecommendation.default()
4242
let summary = try await MSummary.latest()
4343
```
4444

45+
## Input validation
46+
47+
Request builders that require identifiers validate empty inputs and throw `MusadoraKitError.idMissing` when arrays are empty. This includes favorites, ratings, add-resources, and batch resource requests for catalog and library items.
48+
4549
## API Overview
4650

4751
### Core APIs

0 commit comments

Comments
 (0)