Skip to content

Commit aa55b93

Browse files
PETOSS-345 - Fix incorrect documentation generated by OpenAPI
1 parent f9f1b39 commit aa55b93

File tree

4 files changed

+1521
-96
lines changed

4 files changed

+1521
-96
lines changed

Gemfile.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
xero-ruby (4.4.0)
4+
xero-ruby (5.0.0)
55
faraday (>= 2.0, < 3.0)
66
json (~> 2.1, >= 2.1.0)
77
json-jwt (~> 1.16, >= 1.16.3)

docs/files/index.html

+39-30
Original file line numberDiff line numberDiff line change
@@ -1015,6 +1015,28 @@
10151015
"type" : "string",
10161016
"description" : "The Object Type",
10171017
"enum" : [ "Unknown", "Accpay", "AccPayCredit", "AccPayPayment", "AccRec", "AccRecCredit", "AccRecPayment", "Adjustment", "ApCreditPayment", "ApOverPayment", "ApOverPaymentPayment", "ApOverPaymentSourcePayment", "ApPrepayment", "ApPrepaymentPayment", "ApPrepaymentSourcePayment", "ArCreditPayment", "ArOverPayment", "ArOverpaymentPayment", "ArOverpaymentSourcePayment", "ArPrepayment", "ArPrepaymentPayment", "ArPrepaymentSourcePayment", "CashPaid", "CashRec", "ExpPayment", "ManJournal", "PurchaseOrder", "Receipt", "Transfer", "Account", "Contact", "Business", "Employee", "Person", "User", "Org", "FixedAsset", "PayRun", "PriceListItem", "Bank", "Current", "Equity", "Expense", "Fixed", "Liability", "Prepayment", "Revenue", "Sales", "Overheads", "Depreciatn", "OtherIncome", "DirectCosts", "Currliab", "Termliab", "NonCurrent", "SalesQuote" ]
1018+
};
1019+
defs["UploadObject"] = {
1020+
"title" : "",
1021+
"required" : [ "body", "filename", "name" ],
1022+
"type" : "object",
1023+
"properties" : {
1024+
"body" : {
1025+
"type" : "string",
1026+
"format" : "byte"
1027+
},
1028+
"name" : {
1029+
"type" : "string",
1030+
"description" : "exact name of the file you are uploading"
1031+
},
1032+
"filename" : {
1033+
"type" : "string"
1034+
},
1035+
"mimeType" : {
1036+
"type" : "string"
1037+
}
1038+
},
1039+
"description" : ""
10181040
};
10191041
defs["User"] = {
10201042
"title" : "",
@@ -1234,11 +1256,10 @@ <h3>Usage and SDK Samples</h3>
12341256

12351257
xero_tenant_id = 'YOUR_XERO_TENANT_ID'
12361258
file_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
1237-
file_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
12381259
idempotency_key = 'KEY_VALUE'
12391260

12401261
begin
1241-
response = xero_client.accounting_api.create_file_association(xero_tenant_idfile_idassociation, idempotency_key)
1262+
response = xero_client.accounting_api.create_file_association(xero_tenant_id, file_id, association, idempotency_key)
12421263
return response
12431264
rescue XeroRuby::ApiError => e
12441265
puts "Exception when calling create_file_association: #{e}"
@@ -1407,7 +1428,7 @@ <h3>Usage and SDK Samples</h3>
14071428
idempotency_key = 'KEY_VALUE'
14081429

14091430
begin
1410-
response = xero_client.accounting_api.create_folder(xero_tenant_idfolder, idempotency_key)
1431+
response = xero_client.accounting_api.create_folder(xero_tenant_id, folder, idempotency_key)
14111432
return response
14121433
rescue XeroRuby::ApiError => e
14131434
puts "Exception when calling create_folder: #{e}"
@@ -1541,10 +1562,9 @@ <h3>Usage and SDK Samples</h3>
15411562

15421563
xero_tenant_id = 'YOUR_XERO_TENANT_ID'
15431564
file_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
1544-
file_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
15451565

15461566
begin
1547-
response = xero_client.accounting_api.delete_file(xero_tenant_idfile_id)
1567+
response = xero_client.accounting_api.delete_file(xero_tenant_id, file_id)
15481568
return response
15491569
rescue XeroRuby::ApiError => e
15501570
puts "Exception when calling delete_file: #{e}"
@@ -1655,12 +1675,10 @@ <h3>Usage and SDK Samples</h3>
16551675

16561676
xero_tenant_id = 'YOUR_XERO_TENANT_ID'
16571677
file_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
1658-
file_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
1659-
object_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
16601678
object_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
16611679

16621680
begin
1663-
response = xero_client.accounting_api.delete_file_association(xero_tenant_idfile_idobject_id)
1681+
response = xero_client.accounting_api.delete_file_association(xero_tenant_id, file_id, object_id)
16641682
return response
16651683
rescue XeroRuby::ApiError => e
16661684
puts "Exception when calling delete_file_association: #{e}"
@@ -1797,10 +1815,9 @@ <h3>Usage and SDK Samples</h3>
17971815

17981816
xero_tenant_id = 'YOUR_XERO_TENANT_ID'
17991817
folder_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
1800-
folder_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
18011818

18021819
begin
1803-
response = xero_client.accounting_api.delete_folder(xero_tenant_idfolder_id)
1820+
response = xero_client.accounting_api.delete_folder(xero_tenant_id, folder_id)
18041821
return response
18051822
rescue XeroRuby::ApiError => e
18061823
puts "Exception when calling delete_folder: #{e}"
@@ -1911,14 +1928,13 @@ <h3>Usage and SDK Samples</h3>
19111928

19121929
xero_tenant_id = 'YOUR_XERO_TENANT_ID'
19131930
object_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
1914-
object_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
19151931
pagesize = 50
19161932
page = 2
19171933
sort = 'Associations/{ObjectId}?sort=CreatedDateUtc'
19181934
direction = 'Associations/{ObjectId}?sort=CreatedDateUtc&direction=DESC'
19191935

19201936
begin
1921-
response = xero_client.accounting_api.get_associations_by_object(xero_tenant_idobject_id, pagesizepagesortdirection)
1937+
response = xero_client.accounting_api.get_associations_by_object(xero_tenant_id, object_id, pagesize, page, sort, direction)
19221938
return response
19231939
rescue XeroRuby::ApiError => e
19241940
puts "Exception when calling get_associations_by_object: #{e}"
@@ -2120,10 +2136,10 @@ <h3>Usage and SDK Samples</h3>
21202136
<pre class="prettyprint"><code class="language-ruby">xero_client.set_token_set(user.token_set)
21212137

21222138
xero_tenant_id = 'YOUR_XERO_TENANT_ID'
2123-
objectIds =
2139+
objectIds = []
21242140

21252141
begin
2126-
response = xero_client.accounting_api.get_associations_count(xero_tenant_idobjectIds)
2142+
response = xero_client.accounting_api.get_associations_count(xero_tenant_id, objectIds)
21272143
return response
21282144
rescue XeroRuby::ApiError => e
21292145
puts "Exception when calling get_associations_count: #{e}"
@@ -2239,10 +2255,9 @@ <h3>Usage and SDK Samples</h3>
22392255

22402256
xero_tenant_id = 'YOUR_XERO_TENANT_ID'
22412257
file_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
2242-
file_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
22432258

22442259
begin
2245-
response = xero_client.accounting_api.get_file(xero_tenant_idfile_id)
2260+
response = xero_client.accounting_api.get_file(xero_tenant_id, file_id)
22462261
return response
22472262
rescue XeroRuby::ApiError => e
22482263
puts "Exception when calling get_file: #{e}"
@@ -2358,10 +2373,9 @@ <h3>Usage and SDK Samples</h3>
23582373

23592374
xero_tenant_id = 'YOUR_XERO_TENANT_ID'
23602375
file_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
2361-
file_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
23622376

23632377
begin
2364-
response = xero_client.accounting_api.get_file_associations(xero_tenant_idfile_id)
2378+
response = xero_client.accounting_api.get_file_associations(xero_tenant_id, file_id)
23652379
return response
23662380
rescue XeroRuby::ApiError => e
23672381
puts "Exception when calling get_file_associations: #{e}"
@@ -2477,10 +2491,9 @@ <h3>Usage and SDK Samples</h3>
24772491

24782492
xero_tenant_id = 'YOUR_XERO_TENANT_ID'
24792493
file_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
2480-
file_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
24812494

24822495
begin
2483-
response = xero_client.accounting_api.get_file_content(xero_tenant_idfile_id)
2496+
response = xero_client.accounting_api.get_file_content(xero_tenant_id, file_id)
24842497
return response
24852498
rescue XeroRuby::ApiError => e
24862499
puts "Exception when calling get_file_content: #{e}"
@@ -2600,7 +2613,7 @@ <h3>Usage and SDK Samples</h3>
26002613
sort = 'CreatedDateUTC DESC'
26012614

26022615
begin
2603-
response = xero_client.accounting_api.get_files(xero_tenant_id, pagesizepagesort)
2616+
response = xero_client.accounting_api.get_files(xero_tenant_id, pagesize, page, sort)
26042617
return response
26052618
rescue XeroRuby::ApiError => e
26062619
puts "Exception when calling get_files: #{e}"
@@ -2750,10 +2763,9 @@ <h3>Usage and SDK Samples</h3>
27502763

27512764
xero_tenant_id = 'YOUR_XERO_TENANT_ID'
27522765
folder_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
2753-
folder_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
27542766

27552767
begin
2756-
response = xero_client.accounting_api.get_folder(xero_tenant_idfolder_id)
2768+
response = xero_client.accounting_api.get_folder(xero_tenant_id, folder_id)
27572769
return response
27582770
rescue XeroRuby::ApiError => e
27592771
puts "Exception when calling get_folder: #{e}"
@@ -3065,11 +3077,10 @@ <h3>Usage and SDK Samples</h3>
30653077

30663078
xero_tenant_id = 'YOUR_XERO_TENANT_ID'
30673079
file_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
3068-
file_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
30693080
idempotency_key = 'KEY_VALUE'
30703081

30713082
begin
3072-
response = xero_client.accounting_api.update_file(xero_tenant_idfile_idfileObject, idempotency_key)
3083+
response = xero_client.accounting_api.update_file(xero_tenant_id, file_id, fileObject, idempotency_key)
30733084
return response
30743085
rescue XeroRuby::ApiError => e
30753086
puts "Exception when calling update_file: #{e}"
@@ -3236,11 +3247,10 @@ <h3>Usage and SDK Samples</h3>
32363247

32373248
xero_tenant_id = 'YOUR_XERO_TENANT_ID'
32383249
folder_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
3239-
folder_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
32403250
idempotency_key = 'KEY_VALUE'
32413251

32423252
begin
3243-
response = xero_client.accounting_api.update_folder(xero_tenant_idfolder_idfolder, idempotency_key)
3253+
response = xero_client.accounting_api.update_folder(xero_tenant_id, folder_id, folder, idempotency_key)
32443254
return response
32453255
rescue XeroRuby::ApiError => e
32463256
puts "Exception when calling update_folder: #{e}"
@@ -3413,7 +3423,7 @@ <h3>Usage and SDK Samples</h3>
34133423
mimeType = 'mimeType_example'
34143424

34153425
begin
3416-
response = xero_client.accounting_api.upload_file(xero_tenant_idbodynamefilename, idempotency_keymimeType)
3426+
response = xero_client.accounting_api.upload_file(xero_tenant_id, body, name, filename, idempotency_key, mimeType)
34173427
return response
34183428
rescue XeroRuby::ApiError => e
34193429
puts "Exception when calling upload_file: #{e}"
@@ -3610,15 +3620,14 @@ <h3>Usage and SDK Samples</h3>
36103620

36113621
xero_tenant_id = 'YOUR_XERO_TENANT_ID'
36123622
folder_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
3613-
folder_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
36143623
body = BYTE_ARRAY_DATA_HERE
36153624
name = 'name_example'
36163625
filename = 'filename_example'
36173626
idempotency_key = 'KEY_VALUE'
36183627
mimeType = 'mimeType_example'
36193628

36203629
begin
3621-
response = xero_client.accounting_api.upload_file_to_folder(xero_tenant_idfolder_idbodynamefilename, idempotency_keymimeType)
3630+
response = xero_client.accounting_api.upload_file_to_folder(xero_tenant_id, folder_id, body, name, filename, idempotency_key, mimeType)
36223631
return response
36233632
rescue XeroRuby::ApiError => e
36243633
puts "Exception when calling upload_file_to_folder: #{e}"

docs/finance/index.html

+9-10
Original file line numberDiff line numberDiff line change
@@ -2820,7 +2820,7 @@ <h3>Usage and SDK Samples</h3>
28202820
end_month = '2021-09'
28212821

28222822
begin
2823-
response = xero_client.accounting_api.get_accounting_activity_account_usage(xero_tenant_id, start_monthend_month)
2823+
response = xero_client.accounting_api.get_accounting_activity_account_usage(xero_tenant_id, start_month, end_month)
28242824
return response
28252825
rescue XeroRuby::ApiError => e
28262826
puts "Exception when calling get_accounting_activity_account_usage: #{e}"
@@ -3285,13 +3285,12 @@ <h3>Usage and SDK Samples</h3>
32853285

32863286
xero_tenant_id = 'YOUR_XERO_TENANT_ID'
32873287
bank_account_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d'
3288-
bank_account_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d'
32893288
from_date = '2020-07-01'
32903289
to_date = '2021-06-30'
32913290
summary_only = true
32923291

32933292
begin
3294-
response = xero_client.accounting_api.get_bank_statement_accounting(xero_tenant_idbank_account_idfrom_dateto_date, summary_only)
3293+
response = xero_client.accounting_api.get_bank_statement_accounting(xero_tenant_id, bank_account_id, from_date, to_date, summary_only)
32953294
return response
32963295
rescue XeroRuby::ApiError => e
32973296
puts "Exception when calling get_bank_statement_accounting: #{e}"
@@ -3483,7 +3482,7 @@ <h3>Usage and SDK Samples</h3>
34833482
begin_date = '2021-09-15'
34843483

34853484
begin
3486-
response = xero_client.accounting_api.get_cash_validation(xero_tenant_id, balance_dateas_at_system_datebegin_date)
3485+
response = xero_client.accounting_api.get_cash_validation(xero_tenant_id, balance_date, as_at_system_date, begin_date)
34873486
return response
34883487
rescue XeroRuby::ApiError => e
34893488
puts "Exception when calling get_cash_validation: #{e}"
@@ -3755,7 +3754,7 @@ <h3>Usage and SDK Samples</h3>
37553754
end_date = '2021-09-15'
37563755

37573756
begin
3758-
response = xero_client.accounting_api.get_financial_statement_cashflow(xero_tenant_id, start_dateend_date)
3757+
response = xero_client.accounting_api.get_financial_statement_cashflow(xero_tenant_id, start_date, end_date)
37593758
return response
37603759
rescue XeroRuby::ApiError => e
37613760
puts "Exception when calling get_financial_statement_cashflow: #{e}"
@@ -3885,13 +3884,13 @@ <h3>Usage and SDK Samples</h3>
38853884
<pre class="prettyprint"><code class="language-ruby">xero_client.set_token_set(user.token_set)
38863885

38873886
xero_tenant_id = 'YOUR_XERO_TENANT_ID'
3888-
contact_ids = ["00000000-0000-0000-0000-000000000000","00000000-0000-0000-0000-000000000000"]
3887+
contact_ids = [["00000000-0000-0000-0000-000000000000","00000000-0000-0000-0000-000000000000"]]
38893888
include_manual_journals = true
38903889
start_date = '2020-09-15'
38913890
end_date = '2020-09-15'
38923891

38933892
begin
3894-
response = xero_client.accounting_api.get_financial_statement_contacts_expense(xero_tenant_id, contact_idsinclude_manual_journalsstart_dateend_date)
3893+
response = xero_client.accounting_api.get_financial_statement_contacts_expense(xero_tenant_id, contact_ids, include_manual_journals, start_date, end_date)
38953894
return response
38963895
rescue XeroRuby::ApiError => e
38973896
puts "Exception when calling get_financial_statement_contacts_expense: #{e}"
@@ -4070,13 +4069,13 @@ <h3>Usage and SDK Samples</h3>
40704069
<pre class="prettyprint"><code class="language-ruby">xero_client.set_token_set(user.token_set)
40714070

40724071
xero_tenant_id = 'YOUR_XERO_TENANT_ID'
4073-
contact_ids = ["00000000-0000-0000-0000-000000000000","00000000-0000-0000-0000-000000000000"]
4072+
contact_ids = [["00000000-0000-0000-0000-000000000000","00000000-0000-0000-0000-000000000000"]]
40744073
include_manual_journals = true
40754074
start_date = '2020-09-15'
40764075
end_date = '2020-09-15'
40774076

40784077
begin
4079-
response = xero_client.accounting_api.get_financial_statement_contacts_revenue(xero_tenant_id, contact_idsinclude_manual_journalsstart_dateend_date)
4078+
response = xero_client.accounting_api.get_financial_statement_contacts_revenue(xero_tenant_id, contact_ids, include_manual_journals, start_date, end_date)
40804079
return response
40814080
rescue XeroRuby::ApiError => e
40824081
puts "Exception when calling get_financial_statement_contacts_revenue: #{e}"
@@ -4259,7 +4258,7 @@ <h3>Usage and SDK Samples</h3>
42594258
end_date = '2021-09-15'
42604259

42614260
begin
4262-
response = xero_client.accounting_api.get_financial_statement_profit_and_loss(xero_tenant_id, start_dateend_date)
4261+
response = xero_client.accounting_api.get_financial_statement_profit_and_loss(xero_tenant_id, start_date, end_date)
42634262
return response
42644263
rescue XeroRuby::ApiError => e
42654264
puts "Exception when calling get_financial_statement_profit_and_loss: #{e}"

0 commit comments

Comments
 (0)