[#1] Use body to provide object attribute

Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
Denis Kirillov 2022-04-20 17:52:41 +03:00 committed by Alex Vanin
parent 3727f5561d
commit 06060348ae
8 changed files with 285 additions and 164 deletions

View file

@ -340,27 +340,7 @@ func init() {
"in": "body",
"required": true,
"schema": {
"type": "object",
"required": [
"containerId",
"fileName"
],
"properties": {
"containerId": {
"type": "string"
},
"fileName": {
"type": "string"
},
"payload": {
"type": "string"
}
},
"example": {
"containerId": "5HZTn5qkRnmgSz9gSrw22CEdPPk6nQhkwf2Mgzyvkikv",
"fileName": "myFile.txt",
"payload": "Y29udGVudCBvZiBmaWxl"
}
"$ref": "#/definitions/ObjectUpload"
}
}
],
@ -817,6 +797,41 @@ func init() {
}
}
},
"ObjectUpload": {
"type": "object",
"required": [
"containerId",
"fileName"
],
"properties": {
"attributes": {
"type": "array",
"items": {
"$ref": "#/definitions/Attribute"
}
},
"containerId": {
"type": "string"
},
"fileName": {
"type": "string"
},
"payload": {
"type": "string"
}
},
"example": {
"attributes": [
{
"key": "User-Attribute",
"value": "some-value"
}
],
"containerId": "5HZTn5qkRnmgSz9gSrw22CEdPPk6nQhkwf2Mgzyvkikv",
"fileName": "myFile.txt",
"payload": "Y29udGVudCBvZiBmaWxl"
}
},
"Operation": {
"type": "string",
"enum": [
@ -1424,27 +1439,7 @@ func init() {
"in": "body",
"required": true,
"schema": {
"type": "object",
"required": [
"containerId",
"fileName"
],
"properties": {
"containerId": {
"type": "string"
},
"fileName": {
"type": "string"
},
"payload": {
"type": "string"
}
},
"example": {
"containerId": "5HZTn5qkRnmgSz9gSrw22CEdPPk6nQhkwf2Mgzyvkikv",
"fileName": "myFile.txt",
"payload": "Y29udGVudCBvZiBmaWxl"
}
"$ref": "#/definitions/ObjectUpload"
}
}
],
@ -1952,6 +1947,41 @@ func init() {
}
}
},
"ObjectUpload": {
"type": "object",
"required": [
"containerId",
"fileName"
],
"properties": {
"attributes": {
"type": "array",
"items": {
"$ref": "#/definitions/Attribute"
}
},
"containerId": {
"type": "string"
},
"fileName": {
"type": "string"
},
"payload": {
"type": "string"
}
},
"example": {
"attributes": [
{
"key": "User-Attribute",
"value": "some-value"
}
],
"containerId": "5HZTn5qkRnmgSz9gSrw22CEdPPk6nQhkwf2Mgzyvkikv",
"fileName": "myFile.txt",
"payload": "Y29udGVudCBvZiBmaWxl"
}
},
"Operation": {
"type": "string",
"enum": [