-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In the JSON dump docker app, explicitly load the received data before sending again. This prevents the data from being interpreted as a string instead of a JSON object.
- Loading branch information
1 parent
5369dc0
commit 387df52
Showing
8 changed files
with
391 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
...s/vcr_cassettes/JSONDumpBackendTests/JSONDumpBackendTests.test_multiple_file_uploads.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
interactions: | ||
- request: | ||
body: '"{\"values\": {\"file\": [{\"file_name\": \"file1.txt\", \"content\": \"VGhpcyBpcyBleGFtcGxlIGNvbnRlbnQu\"}, | ||
{\"file_name\": \"file2.txt\", \"content\": \"Q29udGVudCBleGFtcGxlIGlzIHRoaXMu\"}]}, | ||
\"schema\": {\"$schema\": \"https://json-schema.org/draft/2020-12/schema\", | ||
\"type\": \"object\", \"properties\": {\"static_var_1\": {\"type\": \"string\", | ||
\"pattern\": \"^cool_pattern$\"}, \"form_var_1\": {\"type\": \"string\"}, \"form_var_2\": | ||
{\"type\": \"string\"}, \"attachment\": {\"type\": \"string\", \"contentEncoding\": | ||
\"base64\"}}, \"required\": [\"static_var_1\", \"form_var_1\", \"form_var_2\"], | ||
\"additionalProperties\": false}}"' | ||
headers: | ||
Accept: | ||
- '*/*' | ||
Accept-Encoding: | ||
- gzip, deflate, br | ||
Authorization: | ||
- Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiIiLCJpYXQiOjE3Mzc0Njk5MDAsImNsaWVudF9pZCI6IiIsInVzZXJfaWQiOiIiLCJ1c2VyX3JlcHJlc2VudGF0aW9uIjoiIn0.VaaQtoX7c3ac2_Zf8GPvB8fAMYfmJft53c7qXNBY_lk | ||
Connection: | ||
- keep-alive | ||
Content-Length: | ||
- '638' | ||
Content-Type: | ||
- application/json | ||
User-Agent: | ||
- python-requests/2.32.2 | ||
method: POST | ||
uri: http://localhost/json_plugin | ||
response: | ||
body: | ||
string: "{\n \"data\": {\n \"schema\": {\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n | ||
\ \"additionalProperties\": false,\n \"properties\": {\n \"attachment\": | ||
{\n \"contentEncoding\": \"base64\",\n \"type\": \"string\"\n | ||
\ },\n \"form_var_1\": {\n \"type\": \"string\"\n },\n | ||
\ \"form_var_2\": {\n \"type\": \"string\"\n },\n \"static_var_1\": | ||
{\n \"pattern\": \"^cool_pattern$\",\n \"type\": \"string\"\n | ||
\ }\n },\n \"required\": [\n \"static_var_1\",\n \"form_var_1\",\n | ||
\ \"form_var_2\"\n ],\n \"type\": \"object\"\n },\n \"values\": | ||
{\n \"file\": [\n {\n \"content\": \"VGhpcyBpcyBleGFtcGxlIGNvbnRlbnQu\",\n | ||
\ \"file_name\": \"file1.txt\"\n },\n {\n \"content\": | ||
\"Q29udGVudCBleGFtcGxlIGlzIHRoaXMu\",\n \"file_name\": \"file2.txt\"\n | ||
\ }\n ]\n }\n },\n \"message\": \"Data received\"\n}\n" | ||
headers: | ||
Connection: | ||
- close | ||
Content-Length: | ||
- '923' | ||
Content-Type: | ||
- application/json | ||
Date: | ||
- Tue, 21 Jan 2025 14:31:40 GMT | ||
Server: | ||
- Werkzeug/3.1.3 Python/3.12.8 | ||
status: | ||
code: 201 | ||
message: CREATED | ||
version: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
...NDumpBackendTests/JSONDumpBackendTests.test_no_file_upload_for_single_file_component.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
interactions: | ||
- request: | ||
body: '"{\"values\": {\"file\": null}, \"schema\": {\"$schema\": \"https://json-schema.org/draft/2020-12/schema\", | ||
\"type\": \"object\", \"properties\": {\"static_var_1\": {\"type\": \"string\", | ||
\"pattern\": \"^cool_pattern$\"}, \"form_var_1\": {\"type\": \"string\"}, \"form_var_2\": | ||
{\"type\": \"string\"}, \"attachment\": {\"type\": \"string\", \"contentEncoding\": | ||
\"base64\"}}, \"required\": [\"static_var_1\", \"form_var_1\", \"form_var_2\"], | ||
\"additionalProperties\": false}}"' | ||
headers: | ||
Accept: | ||
- '*/*' | ||
Accept-Encoding: | ||
- gzip, deflate, br | ||
Authorization: | ||
- Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiIiLCJpYXQiOjE3Mzc0Njk5MDAsImNsaWVudF9pZCI6IiIsInVzZXJfaWQiOiIiLCJ1c2VyX3JlcHJlc2VudGF0aW9uIjoiIn0.VaaQtoX7c3ac2_Zf8GPvB8fAMYfmJft53c7qXNBY_lk | ||
Connection: | ||
- keep-alive | ||
Content-Length: | ||
- '476' | ||
Content-Type: | ||
- application/json | ||
User-Agent: | ||
- python-requests/2.32.2 | ||
method: POST | ||
uri: http://localhost/json_plugin | ||
response: | ||
body: | ||
string: "{\n \"data\": {\n \"schema\": {\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n | ||
\ \"additionalProperties\": false,\n \"properties\": {\n \"attachment\": | ||
{\n \"contentEncoding\": \"base64\",\n \"type\": \"string\"\n | ||
\ },\n \"form_var_1\": {\n \"type\": \"string\"\n },\n | ||
\ \"form_var_2\": {\n \"type\": \"string\"\n },\n \"static_var_1\": | ||
{\n \"pattern\": \"^cool_pattern$\",\n \"type\": \"string\"\n | ||
\ }\n },\n \"required\": [\n \"static_var_1\",\n \"form_var_1\",\n | ||
\ \"form_var_2\"\n ],\n \"type\": \"object\"\n },\n \"values\": | ||
{\n \"file\": null\n }\n },\n \"message\": \"Data received\"\n}\n" | ||
headers: | ||
Connection: | ||
- close | ||
Content-Length: | ||
- '693' | ||
Content-Type: | ||
- application/json | ||
Date: | ||
- Tue, 21 Jan 2025 14:31:40 GMT | ||
Server: | ||
- Werkzeug/3.1.3 Python/3.12.8 | ||
status: | ||
code: 201 | ||
message: CREATED | ||
version: 1 |
54 changes: 54 additions & 0 deletions
54
...pBackendTests/JSONDumpBackendTests.test_one_file_upload_for_multiple_files_component.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
interactions: | ||
- request: | ||
body: '"{\"values\": {\"file\": [{\"file_name\": \"file1.txt\", \"content\": \"VGhpcyBpcyBleGFtcGxlIGNvbnRlbnQu\"}]}, | ||
\"schema\": {\"$schema\": \"https://json-schema.org/draft/2020-12/schema\", | ||
\"type\": \"object\", \"properties\": {\"static_var_1\": {\"type\": \"string\", | ||
\"pattern\": \"^cool_pattern$\"}, \"form_var_1\": {\"type\": \"string\"}, \"form_var_2\": | ||
{\"type\": \"string\"}, \"attachment\": {\"type\": \"string\", \"contentEncoding\": | ||
\"base64\"}}, \"required\": [\"static_var_1\", \"form_var_1\", \"form_var_2\"], | ||
\"additionalProperties\": false}}"' | ||
headers: | ||
Accept: | ||
- '*/*' | ||
Accept-Encoding: | ||
- gzip, deflate, br | ||
Authorization: | ||
- Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiIiLCJpYXQiOjE3Mzc0Njk5MDAsImNsaWVudF9pZCI6IiIsInVzZXJfaWQiOiIiLCJ1c2VyX3JlcHJlc2VudGF0aW9uIjoiIn0.VaaQtoX7c3ac2_Zf8GPvB8fAMYfmJft53c7qXNBY_lk | ||
Connection: | ||
- keep-alive | ||
Content-Length: | ||
- '555' | ||
Content-Type: | ||
- application/json | ||
User-Agent: | ||
- python-requests/2.32.2 | ||
method: POST | ||
uri: http://localhost/json_plugin | ||
response: | ||
body: | ||
string: "{\n \"data\": {\n \"schema\": {\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n | ||
\ \"additionalProperties\": false,\n \"properties\": {\n \"attachment\": | ||
{\n \"contentEncoding\": \"base64\",\n \"type\": \"string\"\n | ||
\ },\n \"form_var_1\": {\n \"type\": \"string\"\n },\n | ||
\ \"form_var_2\": {\n \"type\": \"string\"\n },\n \"static_var_1\": | ||
{\n \"pattern\": \"^cool_pattern$\",\n \"type\": \"string\"\n | ||
\ }\n },\n \"required\": [\n \"static_var_1\",\n \"form_var_1\",\n | ||
\ \"form_var_2\"\n ],\n \"type\": \"object\"\n },\n \"values\": | ||
{\n \"file\": [\n {\n \"content\": \"VGhpcyBpcyBleGFtcGxlIGNvbnRlbnQu\",\n | ||
\ \"file_name\": \"file1.txt\"\n }\n ]\n }\n },\n | ||
\ \"message\": \"Data received\"\n}\n" | ||
headers: | ||
Connection: | ||
- close | ||
Content-Length: | ||
- '810' | ||
Content-Type: | ||
- application/json | ||
Date: | ||
- Tue, 21 Jan 2025 14:31:40 GMT | ||
Server: | ||
- Werkzeug/3.1.3 Python/3.12.8 | ||
status: | ||
code: 201 | ||
message: CREATED | ||
version: 1 |
56 changes: 56 additions & 0 deletions
56
...s/vcr_cassettes/JSONDumpBackendTests/JSONDumpBackendTests.test_submission_happy_flow.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
interactions: | ||
- request: | ||
body: '"{\"values\": {\"auth_bsn\": \"123456789\", \"firstName\": \"We Are\", | ||
\"file\": {\"file_name\": \"test_file.txt\", \"content\": \"VGhpcyBpcyBleGFtcGxlIGNvbnRlbnQu\"}}, | ||
\"schema\": {\"$schema\": \"https://json-schema.org/draft/2020-12/schema\", | ||
\"type\": \"object\", \"properties\": {\"static_var_1\": {\"type\": \"string\", | ||
\"pattern\": \"^cool_pattern$\"}, \"form_var_1\": {\"type\": \"string\"}, \"form_var_2\": | ||
{\"type\": \"string\"}, \"attachment\": {\"type\": \"string\", \"contentEncoding\": | ||
\"base64\"}}, \"required\": [\"static_var_1\", \"form_var_1\", \"form_var_2\"], | ||
\"additionalProperties\": false}}"' | ||
headers: | ||
Accept: | ||
- '*/*' | ||
Accept-Encoding: | ||
- gzip, deflate, br | ||
Authorization: | ||
- Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiIiLCJpYXQiOjE3Mzc0Njk5MDAsImNsaWVudF9pZCI6IiIsInVzZXJfaWQiOiIiLCJ1c2VyX3JlcHJlc2VudGF0aW9uIjoiIn0.VaaQtoX7c3ac2_Zf8GPvB8fAMYfmJft53c7qXNBY_lk | ||
Connection: | ||
- keep-alive | ||
Content-Length: | ||
- '613' | ||
Content-Type: | ||
- application/json | ||
User-Agent: | ||
- python-requests/2.32.2 | ||
method: POST | ||
uri: http://localhost/json_plugin | ||
response: | ||
body: | ||
string: "{\n \"data\": {\n \"schema\": {\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n | ||
\ \"additionalProperties\": false,\n \"properties\": {\n \"attachment\": | ||
{\n \"contentEncoding\": \"base64\",\n \"type\": \"string\"\n | ||
\ },\n \"form_var_1\": {\n \"type\": \"string\"\n },\n | ||
\ \"form_var_2\": {\n \"type\": \"string\"\n },\n \"static_var_1\": | ||
{\n \"pattern\": \"^cool_pattern$\",\n \"type\": \"string\"\n | ||
\ }\n },\n \"required\": [\n \"static_var_1\",\n \"form_var_1\",\n | ||
\ \"form_var_2\"\n ],\n \"type\": \"object\"\n },\n \"values\": | ||
{\n \"auth_bsn\": \"123456789\",\n \"file\": {\n \"content\": | ||
\"VGhpcyBpcyBleGFtcGxlIGNvbnRlbnQu\",\n \"file_name\": \"test_file.txt\"\n | ||
\ },\n \"firstName\": \"We Are\"\n }\n },\n \"message\": \"Data | ||
received\"\n}\n" | ||
headers: | ||
Connection: | ||
- close | ||
Content-Length: | ||
- '850' | ||
Content-Type: | ||
- application/json | ||
Date: | ||
- Tue, 21 Jan 2025 14:31:40 GMT | ||
Server: | ||
- Werkzeug/3.1.3 Python/3.12.8 | ||
status: | ||
code: 201 | ||
message: CREATED | ||
version: 1 |
Oops, something went wrong.