Skip to content

Commit

Permalink
Make file_format and locale_id required params
Browse files Browse the repository at this point in the history
  • Loading branch information
theSoenke committed Apr 19, 2024
1 parent 4878562 commit 1ee4b80
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
8 changes: 4 additions & 4 deletions clients/go/test/api_uploads_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
2 changes: 1 addition & 1 deletion clients/php/test/Api/UploadsApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
3 changes: 2 additions & 1 deletion clients/python/test/test_uploads_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
2 changes: 2 additions & 0 deletions paths/uploads/create.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ requestBody:
title: upload/create/parameters
required:
- file
- file_format
- locale_id
properties:
file:
description: File to be imported
Expand Down

0 comments on commit 1ee4b80

Please sign in to comment.