Archived 2022.11.20. Content moved to error scenarios and responses.
Question
If the Accredited Data Recipient (ADR) puts an additional forward slash '/', for example, Get/banking/accounts// instead of Get/banking/accounts/{accountId}, then what should be the Data Holder (DH) response?
Should the DH treat it as a bulk retrieval request or should an error be returned as 'urn:au-cds:error:cds-all: Field/Missing'?
Requests:
Get/banking/accounts/{accountId}
Get/banking/accounts/{accountId}/transactions/{transactionId}
Get/banking/payees/{payeeId}
Get/banking/products/{productId}
Answer
The response to requests with trailing slashes depends on the type of implementation the DH has in place, as it may vary depending on the API gateways, code libraries and specific code implementation for each API. For example, if the DH saw two trailing slashes and their implementation parsed this as a null resource identifier then it would be reasonable to return an error. Other implementations may see the two trailing slashes and ignore them and return the parent resource.
Specifically,
- If the DH truncates trailing slashes then they would treat the call as a bulk call
- If the DH treats it as a missing parameter then an error is appropriate
Both behaviours mentioned above are valid as the CDS do not specify these. However, the ADRs should always ensure that their API requests are well-formed in accordance with the CDS.
Comments
0 comments
Please sign in to leave a comment.