diff --git a/docs/api/purchase.md b/docs/api/purchase.md index c63ba52..25ef625 100644 --- a/docs/api/purchase.md +++ b/docs/api/purchase.md @@ -15,6 +15,8 @@ Use this before a purchase to check if a purchase is possible. see [this JSON schema](../schema/candopurchaserequest.md) +Note that ``type`` is not used at all. + ### response On a invalid request body: HTTP status code 400 Bad request diff --git a/docs/schema/CanDoPurchaseRequest.schema.json b/docs/schema/CanDoPurchaseRequest.schema.json index 62246f4..333c1ea 100644 --- a/docs/schema/CanDoPurchaseRequest.schema.json +++ b/docs/schema/CanDoPurchaseRequest.schema.json @@ -14,8 +14,7 @@ }, "additionalProperties": false, "required": [ - "deviceAuthToken", - "type" + "deviceAuthToken" ], "definitions": {}, "$schema": "http://json-schema.org/draft-07/schema#", diff --git a/docs/schema/candopurchaserequest.md b/docs/schema/candopurchaserequest.md index 4cb3652..d2d8cc9 100644 --- a/docs/schema/candopurchaserequest.md +++ b/docs/schema/candopurchaserequest.md @@ -18,7 +18,7 @@ https://timelimit.io/CanDoPurchaseRequest | Property | Type | Required | Nullable | Defined by | | :---------------------------------- | :------- | :------- | :------------- | :------------------------------------------------------------------------------------------------------------------------------------------------- | -| [type](#type) | `string` | Required | cannot be null | [CanDoPurchaseRequest](candopurchaserequest-properties-type.md "https://timelimit.io/CanDoPurchaseRequest#/properties/type") | +| [type](#type) | `string` | Optional | cannot be null | [CanDoPurchaseRequest](candopurchaserequest-properties-type.md "https://timelimit.io/CanDoPurchaseRequest#/properties/type") | | [deviceAuthToken](#deviceauthtoken) | `string` | Required | cannot be null | [CanDoPurchaseRequest](candopurchaserequest-properties-deviceauthtoken.md "https://timelimit.io/CanDoPurchaseRequest#/properties/deviceAuthToken") | ## type @@ -27,7 +27,7 @@ https://timelimit.io/CanDoPurchaseRequest `type` -* is required +* is optional * Type: `string` diff --git a/src/api/schema.ts b/src/api/schema.ts index afaa5f1..4a72696 100644 --- a/src/api/schema.ts +++ b/src/api/schema.ts @@ -113,7 +113,7 @@ export interface CreateRegisterDeviceTokenRequest { } export interface CanDoPurchaseRequest { - type: 'googleplay' | 'any' + type?: 'googleplay' | 'any' deviceAuthToken: string } diff --git a/src/api/validator.ts b/src/api/validator.ts index db26000..9d0d7bd 100644 --- a/src/api/validator.ts +++ b/src/api/validator.ts @@ -3353,8 +3353,7 @@ export const isCanDoPurchaseRequest: (value: unknown) => value is CanDoPurchaseR }, "additionalProperties": false, "required": [ - "deviceAuthToken", - "type" + "deviceAuthToken" ], "definitions": definitions, "$schema": "http://json-schema.org/draft-07/schema#"