Skip to content

Commit 77ee67e

Browse files
committed
Add 422 response and error types
Added 3 more error type enums
1 parent 6ac9986 commit 77ee67e

File tree

3 files changed

+40
-2
lines changed

3 files changed

+40
-2
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ This repository holds the official Xero [OpenAPI](https://www.openapis.org/) des
77
OpenAPI spec 3.0
88
* [Accounting API - yaml](https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/oas3/spec/v3/Xero_accounting_2.0.0_swagger.yaml)
99
* [Accounting API - json](https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/oas3/spec/v3/Xero_accounting_2.0.0_swagger.json)
10+
* [Bank Feeds API - yaml](https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/oas3/spec/v3/Xero_bankfeeds_1.0.0_swagger.yaml)
11+
* [Bank Feeds API - json](https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/oas3/spec/v3/Xero_bankfeeds_1.0.0_swagger.json)
1012
* [Fixed Assets API - yaml](https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/oas3/spec/v3/Xero_assets_1.0.0_swagger.yaml)
1113
* [Fixed Assets API - json](https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/oas3/spec/v3/Xero_assets_1.0.0_swagger.json)
1214

spec/v3/Xero_bankfeeds_1.0.0_swagger.json

+17-1
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,22 @@
445445
}
446446
}
447447
},
448+
"422" : {
449+
"description" : "Unprocessable Entity",
450+
"content" : {
451+
"application/problem+json" : {
452+
"schema" : {
453+
"$ref" : "#/components/schemas/Statements"
454+
},
455+
"example" : {
456+
"type" : "invalid-end-balance",
457+
"title" : "Invalid End Balance",
458+
"status" : 422,
459+
"detail" : "End balance does not match start balance +/- statement line amounts."
460+
}
461+
}
462+
}
463+
},
448464
"500" : {
449465
"description" : "Intermittent Xero Error",
450466
"content" : {
@@ -814,7 +830,7 @@
814830
},
815831
"type" : {
816832
"type" : "string",
817-
"enum" : [ "invalid-request", "invalid-application", "invalid-feed-connection", "duplicate-statement", "internal-error" ],
833+
"enum" : [ "invalid-request", "invalid-application", "invalid-feed-connection", "duplicate-statement", "invalid-end-balance", "invalid-start-and-end-date", "invalid-start-date", "internal-error" ],
818834
"example" : "invalid-application"
819835
}
820836
}

spec/v3/Xero_bankfeeds_1.0.0_swagger.yaml

+21-1
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,18 @@ paths:
386386
"status": 413,
387387
"detail": "Request size of 3500000 bytes exceeds the limit of 3000000 bytes."
388388
}
389+
'422':
390+
description: Unprocessable Entity
391+
content:
392+
application/problem+json:
393+
schema:
394+
$ref: '#/components/schemas/Statements'
395+
example: {
396+
"type": "invalid-end-balance",
397+
"title": "Invalid End Balance",
398+
"status": 422,
399+
"detail": "End balance does not match start balance +/- statement line amounts."
400+
}
389401
'500':
390402
description: Intermittent Xero Error
391403
content:
@@ -681,7 +693,15 @@ components:
681693
example: "The application has not been configured to use these API endpoints."
682694
type:
683695
type: string
684-
enum: ["invalid-request","invalid-application","invalid-feed-connection","duplicate-statement","internal-error"]
696+
enum:
697+
- "invalid-request"
698+
- "invalid-application"
699+
- "invalid-feed-connection"
700+
- "duplicate-statement"
701+
- "invalid-end-balance"
702+
- "invalid-start-and-end-date"
703+
- "invalid-start-date"
704+
- "internal-error"
685705
example: "invalid-application"
686706
CreditDebitIndicator:
687707
type: string

0 commit comments

Comments
 (0)