From 1ee4b8032b960d937dd438f848cd0b8e9446bb1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Behrendt?= Date: Thu, 18 Apr 2024 16:41:33 +0200 Subject: [PATCH] Make file_format and locale_id required params --- clients/go/test/api_uploads_test.go | 8 ++++---- .../test/java/com/phrase/client/api/UploadsApiTest.java | 2 +- clients/php/test/Api/UploadsApiTest.php | 2 +- clients/python/test/test_uploads_api.py | 3 ++- paths/uploads/create.yaml | 2 ++ 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/clients/go/test/api_uploads_test.go b/clients/go/test/api_uploads_test.go index ae1f1f328..8b59bf60f 100644 --- a/clients/go/test/api_uploads_test.go +++ b/clients/go/test/api_uploads_test.go @@ -46,8 +46,8 @@ func Test_phrase_UploadsApiService(t *testing.T) { apiClient := phrase.NewAPIClient(configuration) file, _ := os.Create("testfile.json") - fileFormat := optional.NewString("json") - localeId := optional.NewString("99") + fileFormat := "json" + localeId := "99" // setting format_options formatOptions := make(map[string]interface{}) @@ -61,8 +61,8 @@ func Test_phrase_UploadsApiService(t *testing.T) { formatOptionsMap := optional.NewInterface(formatOptions) - localVarOptionals := phrase.UploadCreateOpts{FileFormat: fileFormat, LocaleId: localeId, FormatOptions: formatOptionsMap} - resp, httpRes, err := apiClient.UploadsApi.UploadCreate(context.Background(), "project_id", file, &localVarOptionals) + localVarOptionals := phrase.UploadCreateOpts{FormatOptions: formatOptionsMap} + resp, httpRes, err := apiClient.UploadsApi.UploadCreate(context.Background(), "project_id", file, fileFormat, localeId, &localVarOptionals) requestUrl := httpRes.Request.URL require.Nil(t, err) diff --git a/clients/java/src/test/java/com/phrase/client/api/UploadsApiTest.java b/clients/java/src/test/java/com/phrase/client/api/UploadsApiTest.java index 91c4ba579..c96c0231f 100644 --- a/clients/java/src/test/java/com/phrase/client/api/UploadsApiTest.java +++ b/clients/java/src/test/java/com/phrase/client/api/UploadsApiTest.java @@ -106,7 +106,7 @@ public void uploadCreateTest() throws ApiException, IOException, InterruptedExce Boolean autotranslate = null; Boolean markReviewed = null; Boolean tagOnlyAffectedKeys = null; - Upload response = api.uploadCreate(projectId, file, xPhraseAppOTP, branch, fileFormat, localeId, tags, updateTranslations, updateDescriptions, convertEmoji, skipUploadTags, skipUnverification, fileEncoding, localeMapping, formatOptions, autotranslate, markReviewed, tagOnlyAffectedKeys); + Upload response = api.uploadCreate(projectId, file, fileFormat, localeId, xPhraseAppOTP, branch, tags, updateTranslations, updateDescriptions, convertEmoji, skipUploadTags, skipUnverification, fileEncoding, localeMapping, formatOptions, autotranslate, markReviewed, tagOnlyAffectedKeys); Assert.assertEquals("valid id returned", "id_example", response.getId()); Assert.assertEquals("valid creation date returned", OffsetDateTime.parse("2015-01-28T09:52:53Z"), response.getCreatedAt()); diff --git a/clients/php/test/Api/UploadsApiTest.php b/clients/php/test/Api/UploadsApiTest.php index 779eb02d2..4b6259d3a 100644 --- a/clients/php/test/Api/UploadsApiTest.php +++ b/clients/php/test/Api/UploadsApiTest.php @@ -107,7 +107,7 @@ public function testUploadCreate() $file = new \SplFileObject($fileName, 'w+'); $file->fwrite('test'); - $result = $this->apiInstance->uploadCreate($projectId, $file, null, null); + $result = $this->apiInstance->uploadCreate($projectId, $file, "yml", "en", null, null); $file = null; unlink($fileName); diff --git a/clients/python/test/test_uploads_api.py b/clients/python/test/test_uploads_api.py index d00816810..912895444 100644 --- a/clients/python/test/test_uploads_api.py +++ b/clients/python/test/test_uploads_api.py @@ -48,7 +48,8 @@ def test_upload_create(self, mock_post): api_response = api_instance.upload_create( project_id, file="./test/fixtures/en.json", - file_format="simple_json" + file_format="simple_json", + locale_id="en" ) self.assertEqual("https://api.phrase.com/v2/projects/project_id_example/uploads", mock_post.call_args_list[0].args[1]) diff --git a/paths/uploads/create.yaml b/paths/uploads/create.yaml index 15464dd93..9dc47ddd8 100644 --- a/paths/uploads/create.yaml +++ b/paths/uploads/create.yaml @@ -61,6 +61,8 @@ requestBody: title: upload/create/parameters required: - file + - file_format + - locale_id properties: file: description: File to be imported