Bugfix for support attachment base64 and custom filename.

Introduce tests for attachment data parsing. Use tests at build stage.
This commit is contained in:
zeetabit
2022-07-31 13:45:29 +02:00
parent c52fa0e53c
commit 270278ca30
8 changed files with 169 additions and 43 deletions

View File

@@ -241,7 +241,9 @@ var doc = `{
}
],
"responses": {
"200": {},
"200": {
"description": ""
},
"400": {
"description": "Bad Request",
"schema": {
@@ -281,7 +283,9 @@ var doc = `{
}
],
"responses": {
"204": {},
"204": {
"description": ""
},
"400": {
"description": "Bad Request",
"schema": {
@@ -323,7 +327,9 @@ var doc = `{
}
],
"responses": {
"204": {},
"204": {
"description": ""
},
"400": {
"description": "Bad Request",
"schema": {
@@ -365,7 +371,9 @@ var doc = `{
}
],
"responses": {
"204": {},
"204": {
"description": ""
},
"400": {
"description": "Bad Request",
"schema": {
@@ -1200,7 +1208,9 @@ var doc = `{
}
],
"responses": {
"201": {},
"201": {
"description": ""
},
"400": {
"description": "Bad Request",
"schema": {
@@ -1472,7 +1482,9 @@ var doc = `{
}
],
"responses": {
"204": {},
"204": {
"description": ""
},
"400": {
"description": "Bad Request",
"schema": {
@@ -1687,7 +1699,7 @@ var doc = `{
"properties": {
"base64_attachment": {
"type": "string",
"example": "<BASE64 ENCODED DATA> or 'data:<MIME-TYPE>;base64,<BASE64 ENCODED DATA>' or 'data:<MIME-TYPE>;filename=<FILENAME>;base64,<BASE64 ENCODED DATA>'"
"example": "'\u003cBASE64 ENCODED DATA\u003e' OR 'data:\u003cMIME-TYPE\u003e;base64,\u003cBASE64 ENCODED DATA\u003e' OR 'data:\u003cMIME-TYPE\u003e;filename=\u003cFILENAME\u003e;base64,\u003cBASE64 ENCODED DATA\u003e'"
},
"is_group": {
"type": "boolean"
@@ -1712,9 +1724,13 @@ var doc = `{
"base64_attachments": {
"type": "array",
"items": {
"type": "string",
"example": "<BASE64 ENCODED DATA> or 'data:<MIME-TYPE>;base64,<BASE64 ENCODED DATA>' or 'data:<MIME-TYPE>;filename=<FILENAME>;base64,<BASE64 ENCODED DATA>'"
}
"type": "string"
},
"example": [
"\u003cBASE64 ENCODED DATA\u003e",
"data:\u003cMIME-TYPE\u003e;base64\u003ccomma\u003e\u003cBASE64 ENCODED DATA\u003e",
"data:\u003cMIME-TYPE\u003e;filename=\u003cFILENAME\u003e;base64\u003ccomma\u003e\u003cBASE64 ENCODED DATA\u003e"
]
},
"message": {
"type": "string"