diff --git a/Sources/AmiiboService/Public/Clients/AmiiboLiveClient.swift b/Sources/AmiiboService/Public/Clients/AmiiboLiveClient.swift index 004ccd0..d8c5d6e 100644 --- a/Sources/AmiiboService/Public/Clients/AmiiboLiveClient.swift +++ b/Sources/AmiiboService/Public/Clients/AmiiboLiveClient.swift @@ -157,6 +157,7 @@ private extension AmiiboLiveClient { .map { Amiibo($0) } .sorted { $0.identifier < $1.identifier } case .none: + // The service returns `"amiibo": null` when an `id` filter matches nothing. return [] } } diff --git a/Sources/AmiiboService/openapi.yaml b/Sources/AmiiboService/openapi.yaml index c50b1b3..1992b91 100644 --- a/Sources/AmiiboService/openapi.yaml +++ b/Sources/AmiiboService/openapi.yaml @@ -564,7 +564,10 @@ components: $ref: '#/components/schemas/GameSeries' # Wrapper Entities AmiiboWrapper: - description: A response wrapper that contains zero, one, or more amiibos. + description: | + A response wrapper that contains zero, one, or more amiibos. + + Note: Unlike the other response wrappers, the `amiibo` property is deliberately not required: the service returns `"amiibo": null` when an `id` filter matches nothing, and an empty list when other filters match nothing. The property must therefore remain optional for decoding to succeed in both cases. type: object properties: amiibo: