[ENDPOINT]: Consistently use type or listing_type, but not both
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
PATCHrequests to update only certain fields; or- the same format for the
PUTrequest as returned in theGETresponses. 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 We have this on our list of issues to address in the future.
@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.