XeroAPI / xero-php-oauth2

Xero PHP SDK for oAuth 2 generated from Xero API OpenAPI Spec 3.0
MIT License
92 stars 66 forks source link

Documentation does not list how to use BankAccount AccountID or multiple filters #260

Closed zoe-edwards closed 2 years ago

zoe-edwards commented 2 years ago

SDK you're using:

Describe the bug The documentation simply say “use filters” and gives an example of using a Status filter. It does not say how to use multiple filters or how to use nested filters.

To Reproduce

  1. Go to https://xeroapi.github.io/xero-php-oauth2/docs/v2/accounting/index.html#api-Accounting-getBankTransactions
  2. View this code:
$where = "Status=="' . XeroAPI\XeroPHP\Models\Accounting\BankTransaction::STATUS_AUTHORISED . '"";

Note that this is not actually valid PHP code.

Expected behavior The documenation to display accurate PHP code, that says how to use filters.

zoe-edwards commented 2 years ago

Got half-way, this is how you do nested filters:

BankAccount.AccountID==GUID("A728B055-XXX-XXX-XXXX-BF03A161DBD7")
RettBehrens commented 2 years ago

@zoe-edwards you are correct re: nested filter as above.

It also looks like the quotes got switched around in the generated docs example.

Below is code from the sample app demonstrating how to use multiple filters using the AND filter operator and PHP string concatenation.

$where = 'Status=="' . \XeroAPI\XeroPHP\Models\Accounting\Account::STATUS_ACTIVE .'" AND Type=="' . \XeroAPI\XeroPHP\Models\Accounting\AccountType::FIXED . '"';

I'm working on an update to the generated language docs and will include correcting the example on the next build

zoe-edwards commented 2 years ago

Thank you!