Implemented the GET /marketplace/orders/{order_id}/messages endpoint for the Open API specification document in the library target.

This commit is contained in:
2025-11-09 23:46:55 +01:00
parent 45ee53e145
commit 93094d1d2b
+170 -13
View File
@@ -1940,6 +1940,8 @@ paths:
$ref: '#/components/responses/Unauthorized' $ref: '#/components/responses/Unauthorized'
'403': '403':
$ref: '#/components/responses/NotAccessable' $ref: '#/components/responses/NotAccessable'
'404':
$ref: '#/components/responses/NotFound'
'422': '422':
$ref: '#/components/responses/Unprocessable' $ref: '#/components/responses/Unprocessable'
'500': '500':
@@ -2062,6 +2064,10 @@ paths:
required: required:
- listings - listings
- pagination - pagination
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/NotAccessable'
'500': '500':
$ref: '#/components/responses/InternalError' $ref: '#/components/responses/InternalError'
/marketplace/orders/{order_id}: /marketplace/orders/{order_id}:
@@ -2098,6 +2104,62 @@ paths:
$ref: '#/components/responses/Unauthorized' $ref: '#/components/responses/Unauthorized'
'403': '403':
$ref: '#/components/responses/NotAccessable' $ref: '#/components/responses/NotAccessable'
'404':
$ref: '#/components/responses/NotFound'
'500':
$ref: '#/components/responses/InternalError'
/marketplace/orders/{order_id}/messages:
get:
tags:
- Marketplace
summary: Get a list of messages related to an order.
description: |
Returns a list orders for a seller in a marketplace.
This endpoints accepts pagination and authentication as a seller.
operationId: getOrderMessages
parameters:
- $ref: '#/components/parameters/OrderId'
security:
- ConsumerKeySecret: []
- UserToken: []
- OAuth: []
responses:
'200':
description: Successfully retrieved a list of messages related to an order.
headers:
Link:
$ref: '#/components/headers/Link'
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:
description: A type that contains a list of messages for a related order in a marketplace.
type: object
properties:
pagination:
$ref: '#/components/schemas/Pagination'
messages:
description: A list of messages for an order in a marketplace.
type: array
items:
$ref: '#/components/schemas/OrderMessage'
required:
- messages
- pagination
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/NotAccessable'
'404':
$ref: '#/components/responses/NotFound'
'422':
$ref: '#/components/responses/Unprocessable'
'500': '500':
$ref: '#/components/responses/InternalError' $ref: '#/components/responses/InternalError'
components: components:
@@ -3407,17 +3469,10 @@ components:
type: integer type: integer
Order: Order:
description: A type that represents an order. description: A type that represents an order.
type: object allOf:
- $ref: '#/components/schemas/OrderId'
- type: object
properties: properties:
id:
description: An identifier of an order.
type: string
readOnly: true
resource_url:
description: A URI resource of an order.
type: string
format: uri
readOnly: true
messages_url: messages_url:
description: A URI resource for the messages of an order. description: A URI resource for the messages of an order.
type: string type: string
@@ -3479,18 +3534,32 @@ components:
- buyer - buyer
- created - created
- fee - fee
- id
- items - items
- last_activity - last_activity
- messages_url - messages_url
- next_status - next_status
- resource_url
- seller - seller
- shipping - shipping
- shipping_address - shipping_address
- status - status
- total - total
- uri - uri
OrderId:
description: A type that references an order.
type: object
properties:
id:
description: An identifier of an order.
type: string
readOnly: true
resource_url:
description: A URI resource of an order.
type: string
format: uri
readOnly: true
required:
- id
- resource_url
OrderItem: OrderItem:
description: A type that represents an item of an order. description: A type that represents an item of an order.
type: object type: object
@@ -3510,6 +3579,94 @@ components:
- id - id
- price - price
- release - release
OrderMessage:
description: A type that represents a message of an order.
type: object
properties:
timestamp:
description: A timestamp of a message for an order.
type: string
format: date-time
type:
description: A type of message for an order.
type: string
enum:
- message
- refund_received
- refund_sent
- shipping
- status
subject:
description: A subject of a message for an order.
type: string
message:
description: A body of a message for an order.
type: string
order:
description: A reference to an order.
$ref: '#/components/schemas/OrderId'
status_id:
description: An identifier for a status of an order, if any.
type: integer
minimum: 0
original:
description: TDB, if any.
type: integer
minimum: 0
new:
description: TDB, if any.
type: integer
minimum: 0
actor:
description: An actor that sent a message for an order, if any.
$ref: '#/components/schemas/OrderMessageSender'
from:
description: A user that a message for an order, if any.
$ref: '#/components/schemas/OrderMessageSender'
refund:
description: A requested refund for an order, if any.
type: object
properties:
amount:
description: An amount for a requested refund of an order.
type: integer
minimum: 0
order:
description: A reference to an order for which a refund has been requested.
$ref: '#/components/schemas/OrderId'
required:
- amount
- order
required:
- message
- order
- subject
- timestamp
- type
OrderMessageSender:
description: A type that represents a message sender for an order.
type: object
properties:
id:
description: An identifier of a message sender for an order, if any.
type: integer
minimum: 0
readOnly: true
resource_url:
description: A URI resource of a message sender for an order.
type: string
format: uri
readOnly: true
username:
description: A username of a message sender for an order.
type: string
avatar_url:
description: A URI avatar of a message sender for an order, if any.
type: string
format: uri
required:
- resource_url
- username
OrderStatus: OrderStatus:
description: A type that represents a status of an order. description: A type that represents a status of an order.
type: string type: string
@@ -3521,7 +3678,7 @@ components:
- Payment Pending - Payment Pending
- Payment Received - Payment Received
- In Progress - In Progress
- Shippied - Shipped
- Merged - Merged
- Order Changed - Order Changed
- Refund Sent - Refund Sent