Defined the POST /users/{username} endpoints for the Open API specification document in the library target.
This commit is contained in:
@@ -902,7 +902,7 @@ paths:
|
||||
- User Identity
|
||||
summary: Get information about a user.
|
||||
description: |
|
||||
Retrieves a user by username.
|
||||
Retrieves a user profile by username.
|
||||
|
||||
In case of being authenticated as the requested user, the `email` property will be visible, and the `num_list` count will also include a user's private lists.
|
||||
|
||||
@@ -910,10 +910,6 @@ paths:
|
||||
operationId: getUserProfile
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/Username'
|
||||
security:
|
||||
- UserToken: []
|
||||
- ConsumerKeySecret: []
|
||||
- OAuth: []
|
||||
responses:
|
||||
'200':
|
||||
description: Successfully retrieved profile user information by a given username.
|
||||
@@ -932,6 +928,46 @@ paths:
|
||||
$ref: '#/components/responses/NotFound'
|
||||
'500':
|
||||
$ref: '#/components/responses/InternalError'
|
||||
post:
|
||||
tags:
|
||||
- User Identity
|
||||
summary: Update information about a user.
|
||||
description: |
|
||||
Edits some user profile information by username.
|
||||
|
||||
This endpoint requires authentication.
|
||||
operationId: postUserProfile
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/Username'
|
||||
- $ref: '#/components/parameters/Name'
|
||||
- $ref: '#/components/parameters/HomePage'
|
||||
- $ref: '#/components/parameters/Location'
|
||||
- $ref: '#/components/parameters/Profile'
|
||||
- $ref: '#/components/parameters/Currency'
|
||||
security:
|
||||
- UserToken: []
|
||||
- ConsumerKeySecret: []
|
||||
- OAuth: []
|
||||
responses:
|
||||
'200':
|
||||
description: Successfully retrieved an updated profile user information by a given username.
|
||||
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/UserProfile'
|
||||
'403':
|
||||
$ref: '#/components/responses/NotAccessable'
|
||||
'404':
|
||||
$ref: '#/components/responses/NotFound'
|
||||
'500':
|
||||
$ref: '#/components/responses/InternalError'
|
||||
components:
|
||||
headers:
|
||||
Link:
|
||||
@@ -1038,6 +1074,14 @@ components:
|
||||
in: query
|
||||
schema:
|
||||
type: string
|
||||
HomePage:
|
||||
description: A URI to a website of a user.
|
||||
name: home_page
|
||||
in: query
|
||||
schema:
|
||||
type: string
|
||||
format: uri
|
||||
example: https://www.some-home.page
|
||||
Label:
|
||||
description: A filter by label.
|
||||
name: label
|
||||
@@ -1052,6 +1096,13 @@ components:
|
||||
schema:
|
||||
type: integer
|
||||
example: 1
|
||||
Location:
|
||||
description: A geographical location of a user.
|
||||
name: location
|
||||
in: query
|
||||
schema:
|
||||
type: string
|
||||
example: Planet Earth
|
||||
MasterId:
|
||||
description: An identifier of a master.
|
||||
name: master_id
|
||||
@@ -1073,6 +1124,13 @@ components:
|
||||
- label
|
||||
- catno
|
||||
- country
|
||||
Name:
|
||||
description: A real name of a user.
|
||||
name: name
|
||||
in: query
|
||||
schema:
|
||||
type: string
|
||||
example: Some real name
|
||||
Page:
|
||||
description: A number of page of results to return.
|
||||
name: page
|
||||
@@ -1090,6 +1148,13 @@ components:
|
||||
type: integer
|
||||
minimum: 1
|
||||
maximum: 100
|
||||
Profile:
|
||||
description: A biographical information about a user.
|
||||
name: profile
|
||||
in: query
|
||||
schema:
|
||||
type: string
|
||||
example: Some biographical information about a user goes here...
|
||||
Rating:
|
||||
description: A number (between 1 and 5) for a rating of a release.
|
||||
name: rating
|
||||
@@ -1152,6 +1217,14 @@ components:
|
||||
Malformed:
|
||||
value:
|
||||
message: An internal server error occurred. (Malformed query?)
|
||||
NotAccessable:
|
||||
description: A requested resource cannot be accessed due to a lack of permission.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ServiceError'
|
||||
example:
|
||||
message: You must have permission to access this resource.
|
||||
NotFound:
|
||||
description: A requested resource cannot be found.
|
||||
content:
|
||||
@@ -1161,7 +1234,7 @@ components:
|
||||
example:
|
||||
message: Resource not found.
|
||||
Unauthorized:
|
||||
description: A requested resource cannot be accessed.
|
||||
description: A requested resource cannot be accessed due to a lack of authentication.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
@@ -2128,24 +2201,24 @@ components:
|
||||
- type: object
|
||||
properties:
|
||||
name:
|
||||
description: A name of a user.
|
||||
description: A real name of a user.
|
||||
type: string
|
||||
email:
|
||||
description: An e-mail address of a user, if any.
|
||||
type: string
|
||||
format: email
|
||||
profile:
|
||||
description: A profile explanation of a user.
|
||||
description: A biographical information of a user.
|
||||
type: string
|
||||
location:
|
||||
description: A physical location of a user.
|
||||
description: A geographical location of a user.
|
||||
type: string
|
||||
uri:
|
||||
description: A URL to the resource of a user.
|
||||
type: string
|
||||
format: uri
|
||||
home_page:
|
||||
description: A URI to the home page of a user.
|
||||
description: A URI to a website of a user.
|
||||
type: string
|
||||
format: uri
|
||||
registered:
|
||||
|
||||
Reference in New Issue
Block a user