XeroAPI / xero-ruby

Xero Ruby SDK for OAuth 2.0 generated from XeroAPI/Xero-OpenAPI
http://developer.xero.com/
MIT License
58 stars 91 forks source link

Tax rate creation not working as advertised? #200

Closed JSFernandes closed 1 year ago

JSFernandes commented 3 years ago

Heya 👋

I work in a project which recently migrated to XeroRuby. Today we came across a bug where tax rates were not being created correctly when passing a collection of XeroRuby::Accounting::TaxRates to XeroRuby::AccountingApi#create_tax_rates. Only one of the tax rates was being created, rather than the entire collection.

After looking at the Xero API documentation, it seems this is intended behaviour: https://developer.xero.com/documentation/api/accounting/taxrates/#post-taxrates

Use this method to create or update a tax rate. Only one tax rate can be created or updated per request.

I think that XeroRuby should drop create_tax_rates in favour of a single create_tax_rate. Would this be acceptable? Let me know if so, and I'll prepare a PR.

rjaus commented 3 years ago

Thanks for reporting @JSFernandes.

Agree with your thoughts here. We'll handle this internally, as it's a minor change & will be required upstream in the SDK generators or OpenAPI Spec (OAS).

RettBehrens commented 3 years ago

@JSFernandes fyi on the latest for this https://github.com/OAI/OpenAPI-Specification/discussions/2770