Added PUT /account/{id}/fields
This commit is contained in:
@@ -119,7 +119,7 @@ var doc = `{
|
||||
},
|
||||
"/account/:id": {
|
||||
"delete": {
|
||||
"description": "Requires Authorization-header with role \"admin\".\nExample: Authorization: bearer xxx\nWhere \"xxx\" is a valid JWT token",
|
||||
"description": "Requires Authorization-header with role \"admin\" or a matching account id\nExample: Authorization: bearer xxx\nWhere \"xxx\" is a valid JWT token",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
@@ -171,6 +171,15 @@ var doc = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"404": {
|
||||
"description": "Not Found",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/handlers.ResJSONError"
|
||||
}
|
||||
}
|
||||
},
|
||||
"415": {
|
||||
"description": "Unsupported Media Type",
|
||||
"schema": {
|
||||
@@ -258,6 +267,86 @@ var doc = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/account/{id}/fields": {
|
||||
"put": {
|
||||
"description": "Requires Authorization-header with role \"admin\".\nExample: Authorization: bearer xxx\nWhere \"xxx\" is a valid JWT token",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"summary": "Update account fields",
|
||||
"operationId": "account-update-fields",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "Fields array with objects to be written to database",
|
||||
"name": "body",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/db.AccountCreateInputFields"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/db.Account"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/handlers.ResJSONError"
|
||||
}
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/handlers.ResJSONError"
|
||||
}
|
||||
}
|
||||
},
|
||||
"403": {
|
||||
"description": "Forbidden",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/handlers.ResJSONError"
|
||||
}
|
||||
}
|
||||
},
|
||||
"415": {
|
||||
"description": "Unsupported Media Type",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/handlers.ResJSONError"
|
||||
}
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/handlers.ResJSONError"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/auth/api-key": {
|
||||
"post": {
|
||||
"description": "Authenticate account by API Key",
|
||||
|
||||
@@ -103,7 +103,7 @@
|
||||
},
|
||||
"/account/:id": {
|
||||
"delete": {
|
||||
"description": "Requires Authorization-header with role \"admin\".\nExample: Authorization: bearer xxx\nWhere \"xxx\" is a valid JWT token",
|
||||
"description": "Requires Authorization-header with role \"admin\" or a matching account id\nExample: Authorization: bearer xxx\nWhere \"xxx\" is a valid JWT token",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
@@ -155,6 +155,15 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"404": {
|
||||
"description": "Not Found",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/handlers.ResJSONError"
|
||||
}
|
||||
}
|
||||
},
|
||||
"415": {
|
||||
"description": "Unsupported Media Type",
|
||||
"schema": {
|
||||
@@ -242,6 +251,86 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/account/{id}/fields": {
|
||||
"put": {
|
||||
"description": "Requires Authorization-header with role \"admin\".\nExample: Authorization: bearer xxx\nWhere \"xxx\" is a valid JWT token",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"summary": "Update account fields",
|
||||
"operationId": "account-update-fields",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "Fields array with objects to be written to database",
|
||||
"name": "body",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/db.AccountCreateInputFields"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/db.Account"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/handlers.ResJSONError"
|
||||
}
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/handlers.ResJSONError"
|
||||
}
|
||||
}
|
||||
},
|
||||
"403": {
|
||||
"description": "Forbidden",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/handlers.ResJSONError"
|
||||
}
|
||||
}
|
||||
},
|
||||
"415": {
|
||||
"description": "Unsupported Media Type",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/handlers.ResJSONError"
|
||||
}
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/handlers.ResJSONError"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/auth/api-key": {
|
||||
"post": {
|
||||
"description": "Authenticate account by API Key",
|
||||
|
||||
@@ -142,7 +142,7 @@ paths:
|
||||
consumes:
|
||||
- application/json
|
||||
description: |-
|
||||
Requires Authorization-header with role "admin".
|
||||
Requires Authorization-header with role "admin" or a matching account id
|
||||
Example: Authorization: bearer xxx
|
||||
Where "xxx" is a valid JWT token
|
||||
operationId: account-del
|
||||
@@ -177,6 +177,12 @@ paths:
|
||||
items:
|
||||
$ref: '#/definitions/handlers.ResJSONError'
|
||||
type: array
|
||||
"404":
|
||||
description: Not Found
|
||||
schema:
|
||||
items:
|
||||
$ref: '#/definitions/handlers.ResJSONError'
|
||||
type: array
|
||||
"415":
|
||||
description: Unsupported Media Type
|
||||
schema:
|
||||
@@ -237,6 +243,62 @@ paths:
|
||||
$ref: '#/definitions/handlers.ResJSONError'
|
||||
type: array
|
||||
summary: Get account by id
|
||||
/account/{id}/fields:
|
||||
put:
|
||||
consumes:
|
||||
- application/json
|
||||
description: |-
|
||||
Requires Authorization-header with role "admin".
|
||||
Example: Authorization: bearer xxx
|
||||
Where "xxx" is a valid JWT token
|
||||
operationId: account-update-fields
|
||||
parameters:
|
||||
- description: Fields array with objects to be written to database
|
||||
in: body
|
||||
name: body
|
||||
required: true
|
||||
schema:
|
||||
items:
|
||||
$ref: '#/definitions/db.AccountCreateInputFields'
|
||||
type: array
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/db.Account'
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
items:
|
||||
$ref: '#/definitions/handlers.ResJSONError'
|
||||
type: array
|
||||
"401":
|
||||
description: Unauthorized
|
||||
schema:
|
||||
items:
|
||||
$ref: '#/definitions/handlers.ResJSONError'
|
||||
type: array
|
||||
"403":
|
||||
description: Forbidden
|
||||
schema:
|
||||
items:
|
||||
$ref: '#/definitions/handlers.ResJSONError'
|
||||
type: array
|
||||
"415":
|
||||
description: Unsupported Media Type
|
||||
schema:
|
||||
items:
|
||||
$ref: '#/definitions/handlers.ResJSONError'
|
||||
type: array
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
items:
|
||||
$ref: '#/definitions/handlers.ResJSONError'
|
||||
type: array
|
||||
summary: Update account fields
|
||||
/auth/api-key:
|
||||
post:
|
||||
consumes:
|
||||
|
||||
Reference in New Issue
Block a user