Open swombat opened 2 months ago
PETOSS-571
Thanks for raising an issue, a ticket has been created to track your request
Looking at accounting_api.rb
:
def get_accounts(xero_tenant_id, opts = {})
data, _status_code, _headers = get_accounts_with_http_info(xero_tenant_id, opts)
data
end
It appears the docs are wrong.
def get_accounts_with_http_info(xero_tenant_id, options = {})
opts = options.dup
(...)
opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?
# query parameters
query_params = opts[:query_params] || {}
query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil?
query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
# XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
header_params[:'xero-tenant-id'] = xero_tenant_id
header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil?
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:body]
# return_type
return_type = opts[:return_type] || 'Accounts'
# auth_names
auth_names = opts[:auth_names] || ['OAuth2']
Seems to me the docs should list the valid options as a hash with keys: :where
, :order
, :ids
, :contact_ids
, :header_params
, :if_modified_since
, :form_params
, :body
, :return_type
, :auth_names
.
API docs say:
But here is my code:
And the result:
So it seems the docs are incorrect at least here, probably in other places too. Do the docs need to be re-generated after an OpenAPI update?