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] getFeedConnections returns a 200, not a 201

judgej opened this issue · comments

The OpenAPI description lists the response to the /FeedConnections endpoint being a 201 with pager metadata. I am receiving a 200 rather than a 201, resulting in my client throwing an exception with the unexpected status code. The body payload is correct, so I have a workaround extracting that from the response outside of the client.

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

The human-readable documentation lists 200 as the response, so it seems the OpenAPI description is the odd one out.

https://developer.xero.com/documentation/bank-feeds-api/feed-connections#Get%20Feed%20Connections

Expected Behavior

Current Behavior

Get a 200 with a correct payload {"pagination":{"page":1,"pageCount":0,"pageSize":20,"itemCount":0},"items":[]}

The 200 may only be related to an empty set of items; I have not tried it with a non-empty set yet.

Possible Solution

Fix the response code in the OpenAPI description. I have not put a PR together for this yet, as I have not tested other cases, so am not certain that both 200 and 201 are valid responses, which would require a different fix to the OpenAPI description.

Steps to Reproduce (for bugs)

  1. Call /FeedConnections with a bankfeeds scope.
  2. Get paged payload with a 201 response (according to OpenAPI description).
  3. Get a 200 instead (consistent with other documentation).

Context

I'm using my own generated client (with camelCase objects rather than snakeCase).

Your Environment

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