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
|
- User Identity
|
||||||
summary: Get information about a user.
|
summary: Get information about a user.
|
||||||
description: |
|
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.
|
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
|
operationId: getUserProfile
|
||||||
parameters:
|
parameters:
|
||||||
- $ref: '#/components/parameters/Username'
|
- $ref: '#/components/parameters/Username'
|
||||||
security:
|
|
||||||
- UserToken: []
|
|
||||||
- ConsumerKeySecret: []
|
|
||||||
- OAuth: []
|
|
||||||
responses:
|
responses:
|
||||||
'200':
|
'200':
|
||||||
description: Successfully retrieved profile user information by a given username.
|
description: Successfully retrieved profile user information by a given username.
|
||||||
@@ -932,6 +928,46 @@ paths:
|
|||||||
$ref: '#/components/responses/NotFound'
|
$ref: '#/components/responses/NotFound'
|
||||||
'500':
|
'500':
|
||||||
$ref: '#/components/responses/InternalError'
|
$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:
|
components:
|
||||||
headers:
|
headers:
|
||||||
Link:
|
Link:
|
||||||
@@ -1038,6 +1074,14 @@ components:
|
|||||||
in: query
|
in: query
|
||||||
schema:
|
schema:
|
||||||
type: string
|
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:
|
Label:
|
||||||
description: A filter by label.
|
description: A filter by label.
|
||||||
name: label
|
name: label
|
||||||
@@ -1052,6 +1096,13 @@ components:
|
|||||||
schema:
|
schema:
|
||||||
type: integer
|
type: integer
|
||||||
example: 1
|
example: 1
|
||||||
|
Location:
|
||||||
|
description: A geographical location of a user.
|
||||||
|
name: location
|
||||||
|
in: query
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
example: Planet Earth
|
||||||
MasterId:
|
MasterId:
|
||||||
description: An identifier of a master.
|
description: An identifier of a master.
|
||||||
name: master_id
|
name: master_id
|
||||||
@@ -1073,6 +1124,13 @@ components:
|
|||||||
- label
|
- label
|
||||||
- catno
|
- catno
|
||||||
- country
|
- country
|
||||||
|
Name:
|
||||||
|
description: A real name of a user.
|
||||||
|
name: name
|
||||||
|
in: query
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
example: Some real name
|
||||||
Page:
|
Page:
|
||||||
description: A number of page of results to return.
|
description: A number of page of results to return.
|
||||||
name: page
|
name: page
|
||||||
@@ -1090,6 +1148,13 @@ components:
|
|||||||
type: integer
|
type: integer
|
||||||
minimum: 1
|
minimum: 1
|
||||||
maximum: 100
|
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:
|
Rating:
|
||||||
description: A number (between 1 and 5) for a rating of a release.
|
description: A number (between 1 and 5) for a rating of a release.
|
||||||
name: rating
|
name: rating
|
||||||
@@ -1152,6 +1217,14 @@ components:
|
|||||||
Malformed:
|
Malformed:
|
||||||
value:
|
value:
|
||||||
message: An internal server error occurred. (Malformed query?)
|
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:
|
NotFound:
|
||||||
description: A requested resource cannot be found.
|
description: A requested resource cannot be found.
|
||||||
content:
|
content:
|
||||||
@@ -1161,7 +1234,7 @@ components:
|
|||||||
example:
|
example:
|
||||||
message: Resource not found.
|
message: Resource not found.
|
||||||
Unauthorized:
|
Unauthorized:
|
||||||
description: A requested resource cannot be accessed.
|
description: A requested resource cannot be accessed due to a lack of authentication.
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
@@ -2128,24 +2201,24 @@ components:
|
|||||||
- type: object
|
- type: object
|
||||||
properties:
|
properties:
|
||||||
name:
|
name:
|
||||||
description: A name of a user.
|
description: A real name of a user.
|
||||||
type: string
|
type: string
|
||||||
email:
|
email:
|
||||||
description: An e-mail address of a user, if any.
|
description: An e-mail address of a user, if any.
|
||||||
type: string
|
type: string
|
||||||
format: email
|
format: email
|
||||||
profile:
|
profile:
|
||||||
description: A profile explanation of a user.
|
description: A biographical information of a user.
|
||||||
type: string
|
type: string
|
||||||
location:
|
location:
|
||||||
description: A physical location of a user.
|
description: A geographical location of a user.
|
||||||
type: string
|
type: string
|
||||||
uri:
|
uri:
|
||||||
description: A URL to the resource of a user.
|
description: A URL to the resource of a user.
|
||||||
type: string
|
type: string
|
||||||
format: uri
|
format: uri
|
||||||
home_page:
|
home_page:
|
||||||
description: A URI to the home page of a user.
|
description: A URI to a website of a user.
|
||||||
type: string
|
type: string
|
||||||
format: uri
|
format: uri
|
||||||
registered:
|
registered:
|
||||||
|
|||||||
Reference in New Issue
Block a user