Skip to content

maui-iap: one unknown platform empties the whole KitApi response #329

Description

@hyochan

KitSubscription.Platform (IapPlatform) and KitProduct.Platform
(KitProductPlatform) are the only wire fields on the KitApi records typed as
enums; everything else IAPKit could extend — State, Type, BillingPeriod,
Kind, Format — is already string.

Both converters throw on an unrecognised value:
IapPlatformJsonConverter.Read at libraries/maui-iap/src/OpenIap.Maui/Types.cs
ends in throw new JsonException(...) with no Unknown member to land on, and
KitProductPlatform uses the stock JsonStringEnumConverter. Because the body
is decoded in one parsed.Deserialize<T>() in KitApi.cs, a single unknown
platform empties the entire entitlements or products response rather than
dropping one row.

IAPKit deploys from main and already carries horizon and amazon on the
verify surface, so widening platform is plausible.

Blocked on a decision: the clean fix changes a public property type
(IapPlatform -> string, matching State on the same record) in a released
package. A non-breaking alternative is a KitApi-local tolerant converter plus
per-element decoding of the subscriptions, products and offers arrays.
Types.cs is generated and must not be hand-edited.

Context: #321, and /docs/kit-compatibility for the policy.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions