Skip to content

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

@vlad-pisanov

Description

@vlad-pisanov

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions