avadev/AvaTax-REST-V2-JS-SDK

Why is `model` now optional in all the API functions?

BioSurienDG opened this issue · 1 comments

I noticed that in the different methods you mark model as optional but does it really make sense for model to be optional in the various methods especially this one (see example below) if we pass in undefined for the model what customers are being created? I know in the API docs body is optional for most/all of the methods but that seems like an error to me?
Ex.

     /*
       * @param {number} companyId The unique ID number of the company that recorded this customer
       * @param {Models.CustomerModel[]} model The list of customer objects to be created
     * @return {Models.CustomerModel[]}
     */
    createCustomers({ companyId, model }: {
        companyId: number;
        model?: Models.CustomerModel[];
    }): Promise<Array<Models.CustomerModel>

That is the way they are defined in the Avatax Swagger File for some reason that I am not aware of and asking around I think it has been like that forever. I know it's a big misleading, but unfortunately the SDK is generated based on the attributes in the swagger file so there is not much we can do about it right now. Raising it to the platform team's attention but honestly, I doubt this will be changed. I will follow up with them and reopen this ticket if they are planning to make some updates.