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

Bug: multiple APIs cannot be used in the same expression #284

Open vlad-pisanov opened 4 months ago

vlad-pisanov commented 4 months ago

This works: ✔️

tenant_id = client.connections.first['tenantId']
client.accounting_api.get_organisations(tenant_id)
#<XeroRuby::Accounting::Organisations:0x00007fc485ca4530
# @organisations= ...

But once rewritten as a single expression, it does not: ❌

client.accounting_api.get_organisations(client.connections.first['tenantId'])
# Error message: the server returns an error (XeroRuby::ApiError)
# HTTP status code: 404

This is because client.connections overwrites the @base_url of the client used in client.accounting_api, so the account api ends up making requests to https://api.xero.com instead of https://api.xero.com/api.xro/2.0.

Combining any two or more APIs in the same expression leads to this bug.

github-actions[bot] commented 4 months ago

PETOSS-461

github-actions[bot] commented 4 months ago

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