XeroAPI / Xero-OpenAPI

An OpenAPI description of the Xero API

Home Page:https://developer.xero.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bank Feeds] createFeedConnections returns 202 (201 in OpenAPI desc)

judgej opened this issue · comments

Creating a single bank feed connection returns the pending result as status code 202 Accepted not the 201 Created as defined in the OpenAPI description.

https://github.com/XeroAPI/Xero-OpenAPI/blob/master/xero_bankfeeds.yaml#L113

I ave not tried this creating multiple bank feed connections in one request, so there may be other response status codes at play which I am not seeing in other situations, so I can't say a 201 is never returned. Issue #378 hints that it may be a 200 with mixed results, but I can only guess.

Expected Behavior

The pending bank feed connection response should be delivered as a HTTP 201 according to the OpenAPI description, indicating it has been accepted but not yet processed. This is what the generated code expects. If the request contains a number of requests, then the response could contain a number of different resues - pending, created and errors - and I have no idea what the HTTP status code would be in that case.

Current Behavior

The correct PENDING response is returned, with the arguably correct 202 Accepted response.

Possible Solution

  • The OpenAPI description is fixed to show the payload for a 202 response.
  • Maybe remove the 201 response from the OpenAPI description if it is never returned.
  • I have a hunch there are other response status codes in play for responses containing a mix of results. I could discover them by experiment, but that doesn't tell me what the responses were planned to be.

Steps to Reproduce (for bugs)

  1. Make POST request to createFeedConnections operation for a single bank feed connection, for a connection that should be valid.
  2. Observe the result: 202 with the FeedConnections schema payload, but without the pagination property.

Context

Your Environment

  • Version used:
  • Browser Name and version:
  • Operating System and version (desktop or mobile):
  • Link to your project: