Implemented the GET /marketplace/listings/{listing_id} endpoint for the Open API specification document in the library target.

This commit is contained in:
2025-10-20 16:44:14 +02:00
parent 9a9f0eb7d7
commit 9bf497676c
+206 -13
View File
@@ -1872,6 +1872,35 @@ paths:
$ref: '#/components/responses/Unprocessable'
'500':
$ref: '#/components/responses/InternalError'
/marketplace/listings/{listing_id}:
get:
tags:
- Marketplace
summary: Get information about a listing in the marketplace.
description: |
Views the data associated with a listing in the marketplace.
In case of authenticated as an inventory owner, items that not only have the `For Sale` state will be shown as well as other extra fields in those items such as `weight`, `format_quality`, `external_id`, `location`, and `quantity_keys`. Note that the `quantity` field is read-only for *NearMint* users, who will see *1* for all quantity values, regardless of their actual count.
In case the user is authorized, the listing will contain a `in_cart` boolean field indicating whether or not this listing is in their cart.
operationId: getListing
parameters:
- $ref: '#/components/parameters/ListingId'
- $ref: '#/components/parameters/Currency'
responses:
'200':
description: Successfully retrieved a listing in a marketplace.
headers:
X-Discogs-RateLimit:
$ref: '#/components/headers/RateLimit'
X-Discogs-RateLimit-Used:
$ref: '#/components/headers/RateLimitUsed'
X-Discogs-RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
content:
application/json:
schema:
$ref: '#/components/schemas/Listing'
'404':
$ref: '#/components/responses/NotFound'
'422':
@@ -2062,6 +2091,15 @@ components:
type: integer
minimum: 0
example: 123
ListingId:
description: An identifier of a listing.
name: listing_id
in: path
required: true
schema:
type: integer
minimum: 0
example: 172723812
Location:
description: A geographical location of a user.
name: location
@@ -2470,9 +2508,6 @@ components:
status:
description: An explanation for the stat status of a community.
type: string
required:
- have
- want
ConditionMedia:
description: A type that represents a media condition.
type: string
@@ -2503,6 +2538,8 @@ components:
Currency:
description: A list of currency codes defined in the marketplace.
type: string
minLength: 3
maxLength: 3
enum:
- USD
- GBP
@@ -2933,9 +2970,21 @@ components:
price:
description: A price assigned to a listing.
$ref: '#/components/schemas/Price'
original_price:
description: An original price assigned to a listing.
$ref: '#/components/schemas/PriceFormatted'
shipping_price:
description: A shipping price assigned to a listing.
$ref: '#/components/schemas/Price'
original_shipping_price:
description: An original shipping price assigned to a listing.
$ref: '#/components/schemas/PriceFormatted'
allow_offers:
description: A flag that indicates whether a listing allow to receive offers or not.
type: boolean
offer_submitted:
description: A flag that indicates whether a user submitted an offer for a listing.
type: boolean
condition:
description: A media condition of a listing.
$ref: '#/components/schemas/ConditionMedia'
@@ -2954,7 +3003,7 @@ components:
type: string
seller:
description: A seller of a listing.
$ref: '#/components/schemas/UserId'
$ref: '#/components/schemas/Seller'
release:
description: A release of a listing.
$ref: '#/components/schemas/ReleaseInListing'
@@ -2976,7 +3025,7 @@ components:
type: integer
minimum: 0
in_cart:
description: A flag that indicates whether a listing is in the shopping cart of a user.
description: A flag that indicates whether a listing is in the shopping cart of a user, if any.
type: boolean
required:
- allow_offers
@@ -2984,11 +3033,15 @@ components:
- comments
- condition
- id
- offer_submitted
- original_price
- original_shipping_price
- posted
- price
- release
- resource_url
- seller
- shipping_price
- ships_from
- sleeve_condition
- status
@@ -3078,6 +3131,31 @@ components:
required:
- currency
- value
PriceFormatted:
description: A type that represents a formatted price.
type: object
properties:
curr_abbr:
description: An abbreviation of a currency in a marketplace.
$ref: '#/components/schemas/Currency'
curr_id:
description: An identifier of a currency in a marketplace.
type: integer
minimum: 0
readOnly: true
formatted:
description: A price in formatted form.
type: string
value:
description: A decimal number of a price.
type: number
format: float
minimum: 0
required:
- curr_abbr
- curr_id
- formatted
- value
Rating:
description: A type that represents a community rating of a release.
type: object
@@ -3159,6 +3237,12 @@ components:
format_quantity:
description: A total number of formats of a release.
type: integer
blocked_from_sale:
description: A flag that indicates whether the a released is blocked for sale in a marketplace.
type: boolean
is_offensive:
description: A flag that indicates whether a release have explicit language/content or not.
type: boolean
master_id:
description: An identifier of a master associated with a release, if any.
type: integer
@@ -3200,17 +3284,22 @@ components:
description: Some community information of a release.
$ref: '#/components/schemas/Community'
companies:
description: A list of companies related to a release.
description: A list of companies related to a release, if any.
type: array
items:
$ref: '#/components/schemas/LabelId'
tracklist:
description: A list of tracks of a release.
description: A list of tracks of a release, if any.
type: array
items:
$ref: '#/components/schemas/Track'
images:
description: A list of images of a release, if any.
type: array
items:
$ref: '#/components/schemas/Image'
videos:
description: A list of videos associated with a release.
description: A list of videos associated with a release, if any.
type: array
items:
$ref: '#/components/schemas/Video'
@@ -3309,21 +3398,61 @@ components:
catalog_number:
description: A catalog number of a release.
type: string
title:
description: A title of a release.
type: string
artist:
description: An artist of a release.
type: string
label:
description: A label of a release.
type: string
description:
description: A descriptive explanation of a release.
type: string
thumbnail:
description: A thumbnail image of a release.
type: string
format: uri
year:
description: A number of year of a release.
type: integer
minimum: 1800
thumbnail:
description: A thumbnail image of a release.
type: string
format: uri
images:
description: A list of images associated with a release.
type: array
items:
$ref: '#/components/schemas/Image'
stats:
description: A type that represents statistical information about a release.
type: object
properties:
community:
description: A type that represents statistical information about a release provided by a community.
type: object
properties:
in_collection:
description: A total number of users in a community that have a release in their collection.
type: integer
minimum: 0
in_wantlist:
description: A total number of users in a community that have a release in their wantlist.
type: integer
minimum: 0
required:
- in_collection
- in_wantlist
required:
- community
required:
- artist
- catalog_number
- description
- images
- label
- thumbnail
- stats
- title
- year
ReleaseInstance:
description: A type that represents an instace of a release.
@@ -3575,6 +3704,70 @@ components:
- type
- uri
- year
Seller:
description: A type that represents a user that sells inventory in a marketplace.
allOf:
- $ref: '#/components/schemas/UserId'
- type: object
properties:
uid:
description: An identifier of a user associated with a seller.
type: integer
minimum: 0
readOnly: true
url:
description: A URI related to a user.
type: string
format: uri
avatar_url:
description: An avatar URL of a user.
type: string
format: uri
html_url:
description: A URL to the website of a seller.
type: string
format: uri
min_order_total:
description: A number of
type: integer
minimum: 0
payment:
description: A payment type preferred by a seller.
type: string
shipping:
description: An explanation of the shipping conditions of a seller.
type: string
stats:
description: A type that represents the statistics associated with a seller.
type: object
properties:
rating:
description: A total percentage number of the ratings given to a seller.
type: string
maxLength: 5
pattern: '^\d{1,3}\.\d{1}$'
stars:
description: An average number of stars given to a seller.
type: number
format: float
minimum: 0
maximum: 5
total:
description: A total number of rating reviews given to a seller.
type: integer
minimum: 0
required:
- rating
- stars
- total
required:
- avatar_url
- html_url
- min_order_total
- payment
- shipping
- uid
- url
Service:
description: A type that encapsulates any available information about the service.
type: object
@@ -3646,7 +3839,7 @@ components:
type: object
properties:
id:
description: An identifier of a user.
description: An identifier of a user, if any.
type: integer
username:
description: A username of a user.