plaid / plaid-openapi

API version 2020-09-14
https://plaid.com/docs
91 stars 39 forks source link

Should the members of `RemovedTransaction` be required? #163

Closed richardasymmetric closed 6 months ago

richardasymmetric commented 6 months ago

Hi, I'm not sure if this is a question, or a bug report, but I'm implementing the transaction sync process (in node/ts) and was wondering if the fields in RemovedTransaction should be marked as required. Current definition:

export interface RemovedTransaction {
    /**
     * The ID of the removed transaction.
     * @type {string}
     * @memberof RemovedTransaction
     */
    transaction_id?: string;
    /**
     * The ID of the account of the removed transaction.
     * @type {string}
     * @memberof RemovedTransaction
     */
    account_id?: string;
}

As it stands, the types given by the typescript definition would allow an empty object to be returned, or an object with just an account id.

Currently valid:


removed: RemovedTransaction = {}; // valid
removed: RemovedTransaction = { account_id: "id" }; // valid
removed: RemovedTransaction = { transaction_id: "id" }; //valid

In the 3 above situations, I'm not sure how I would interpret what Plaid is trying to tell me.

phoenixy1 commented 6 months ago

Thanks for reporting! This is a duplicate of / the same issue as

https://github.com/plaid/plaid-node/issues/620

And the answer is that yes, these fields should be required. This has been fixed upstream but the fix hasn't been published yet, it will go out in the next library release.