Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PETOSS-345 - Fix the Idempotency key order in method definitions #581

Merged
merged 2 commits into from
Feb 1, 2024

Conversation

Raghunath-S-S-J
Copy link
Contributor

@Raghunath-S-S-J Raghunath-S-S-J commented Jan 31, 2024

Recently introduced idempotencyKey for POST, PUT and PATCH requests broke existing invocations, as this optional parameter is added in between of the method definition instead of the end.

Example using node SDK:

Previous:

updateOrCreateInvoices (xeroTenantId: string, invoices: Invoices, idempotencyKey?: string, summarizeErrors?: boolean, unitdp?: number, options: {headers: {[name: string]: string}} = {headers: {}})

Now:

updateOrCreateInvoices (xeroTenantId: string, invoices: Invoices, summarizeErrors?: boolean, unitdp?: number, idempotencyKey?: string, options: {headers: {[name: string]: string}} = {headers: {}})

Description

  • Update method definitions to position idempotencyKey as last optional parameter.
  • Fix method definitions where required request-body parameters are declared as optional.
    • Below are the methods changed due to request-body
    • Payroll-AU
      • updateEmployee
      • updatePayRun
      • updatePayslip
      • updateSuperfund
      • updateTimesheet
    • Files
      • uploadFile
      • updateFile
      • uploadFileToFolder
      • createFileAssociation
      • createFolder
    • Bankfeeds
      • createStatements
    • Assets
      • createAssetType

Release Notes

This change is required for app partners/SDK users to move to latest versions of SDKs without requiring to change method invocations.
Fixes #649 and #337

Screenshots (if appropriate):

Types of Changes

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Copy link

PETOSS-388

Copy link

Thanks for raising an issue, a ticket has been created to track your request

@jameshulse
Copy link

I'm a little concerned that the "Breaking change" checkbox isn't checked. It was a breaking change when it went in, and it is surely a breaking change when it gets updated?

@Raghunath-S-S-J
Copy link
Contributor Author

I'm a little concerned that the "Breaking change" checkbox isn't checked. It was a breaking change when it went in, and it is surely a breaking change when it gets updated?

Hi @jameshulse
Apologies for the inconvenience. Yes, it was a breaking change when it was released and we see people have refrained from using the troubling version. We are discussing internally whether to release this fix as a Patch update or as a Major update.

@Raghunath-S-S-J Raghunath-S-S-J force-pushed the PETOSS-345-Xero-OpenAPI branch from 45c8b85 to 9e0748c Compare February 1, 2024 08:49
@manishT72 manishT72 merged commit 004fb15 into master Feb 1, 2024
@Raghunath-S-S-J Raghunath-S-S-J deleted the PETOSS-345-Xero-OpenAPI branch February 1, 2024 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

idempotencyKey parameter introduced in 4.36.0 breaks existing calls to accounting api
4 participants