Implemented the GET /users/{username}/collection/fields endpoint for the Open API specification document in the library target.

This commit is contained in:
2025-10-16 15:19:44 +02:00
parent 5b91d0383f
commit 12fe3865e5
+84
View File
@@ -1453,6 +1453,51 @@ paths:
$ref: '#/components/responses/NotFound'
'500':
$ref: '#/components/responses/InternalError'
/users/{username}/collection/fields:
get:
tags:
- User Collection
summary: Get a list of custom fields defined by a user.
description: |
Retrieves a list of collection notes fields defined by a user.
These fields are available on every release in a collection. In case a collection has been made private by its owner, then the endpoints requires authentication as the collection owner. Otherwise only public custom fields will be visible.
operationId: getCustomFields
parameters:
- $ref: '#/components/parameters/Username'
security:
- ConsumerKeySecret: []
- UserToken: []
- OAuth: []
responses:
'200':
description: Successfully retrieved a list of custom fields defined by a user.
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:
description: A type that contains a list of retrieved custom fields of a user.
type: object
properties:
fields:
description: A list of custom fields.
type: array
items:
$ref: '#/components/schemas/CustomField'
required:
- fields
'403':
$ref: '#/components/responses/NotAccessable'
'404':
$ref: '#/components/responses/NotFound'
'500':
$ref: '#/components/responses/InternalError'
components:
headers:
Link:
@@ -1978,6 +2023,45 @@ components:
- NZD
- SEK
- ZAR
CustomField:
description: A type that represents a custom field.
type: object
properties:
id:
description: An identifier of a custom field.
type: integer
readOnly: true
name:
description: A name of a custom field.
type: string
position:
description: A position of a custom field.
type: integer
minimum: 1
public:
description: A flag that indicates whether a custom field is public or not.
type: boolean
type:
description: A type of a custom field.
type: string
enum:
- dropdown
- textarea
lines:
description: A number of lines of content to allow for a custom field of a textarea type.
type: integer
minimum: 1
options:
description: A list of options to display, in case the field is of dropdown type.
type: array
items:
type: string
required:
- id
- name
- position
- public
- type
Folder:
description: A type that represents a collection folder of a user.
type: object