open-api icon indicating copy to clipboard operation
open-api copied to clipboard

[ENDPOINT]: Consistently use type or listing_type, but not both

Open foxfriends opened this issue 3 years ago • 2 comments

Is there an existing issue for this?

  • [X] I have searched the existing tickets

Current Endpoint Design

When I get a listing, it comes with a field listing_type.

When I need to update a listing, it requires the field type.

Seems like I have to rename that field to upload my product, which is kind of a pain.

In general, it would be nice if the API supported either

  1. PATCH requests to update only certain fields; or
  2. the same format for the PUT request as returned in the GET responses. There are a number of changes required when updating a listing (see also #397) or updating its inventory (as documented, but that is still a weird thing) that are just asking for trouble.

Proposed Endpoint Design Change

Use listing_type in both situations.

Why are you proposing this change?

This is causing confusion and unnecessary bug-proneness to the API.

foxfriends avatar Mar 09 '22 23:03 foxfriends

@foxfriends We have this on our list of issues to address in the future.

etsyachristensen avatar Mar 17 '22 23:03 etsyachristensen

@foxfriends I just re-read your post and wanted to address one thing. You requested "PATCH requests to update only certain fields". The updateListing endpoint already accepts partial data updates. While they aren't set as PATCH but POST you only need to include the fields you want to update, with few exceptions such as who_made, when_made and is_supply all have to be provided together but only if you are updating one or more of those fields.

etsyachristensen avatar Apr 12 '22 14:04 etsyachristensen