Skip to content

Commit

Permalink
Merge branch 'master' into fix_openapi_upload
Browse files Browse the repository at this point in the history
  • Loading branch information
jablan committed Oct 30, 2023
2 parents 37a3c87 + 7634985 commit e72ad07
Show file tree
Hide file tree
Showing 112 changed files with 1,171 additions and 453 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/test-go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Run Go Tests
on: [push]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '1.19.6'
- name: Run Tests
run: |
npm install
npm run generate.go
cd ./clients/go/test
go test
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ docs: lint bundle
ruby:
openapi-generator-cli generate -i tmp/compiled.yaml -g ruby -o clients/ruby -c ./openapi-generator/ruby_lang.yaml
go:
openapi-generator-cli generate -i tmp/compiled.yaml -g go -o clients/go -c ./openapi-generator/go_lang.yaml
openapi-generator-cli generate -i tmp/compiled.yaml -g go -o clients/go -c ./openapi-generator/go_lang.yaml --global-property apiTests=false,modelTests=false
go install golang.org/x/tools/cmd/goimports@latest
goimports -w clients/go
cd clients/go && go mod tidy
Expand Down
7 changes: 7 additions & 0 deletions clients/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [2.14.0](https://github.com/phrase/openapi/compare/cli-v2.13.0...cli-v2.14.0) (2023-10-23)


### Features

* **API:** Add order param to comment list endpoints ([#441](https://github.com/phrase/openapi/issues/441)) ([441c9c4](https://github.com/phrase/openapi/commit/441c9c46169f8c5ac4e71ade09a95dab136314ef))

## [2.13.0](https://github.com/phrase/openapi/compare/cli-v2.12.0...cli-v2.13.0) (2023-10-13)


Expand Down
2 changes: 1 addition & 1 deletion clients/cli/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/daviddengcn/go-colortext v1.0.0
github.com/jpillora/backoff v1.0.0
github.com/mitchellh/mapstructure v1.4.0
github.com/phrase/phrase-go/v2 v2.15.0 // x-release-please-version
github.com/phrase/phrase-go/v2 v2.17.0 // x-release-please-version
github.com/spf13/cobra v1.0.0
github.com/spf13/viper v1.7.1
gopkg.in/yaml.v2 v2.4.0
Expand Down
14 changes: 14 additions & 0 deletions clients/go/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## [2.17.0](https://github.com/phrase/openapi/compare/go-v2.16.0...go-v2.17.0) (2023-10-30)


### Features

* Update openapi-generator to v7 ([#418](https://github.com/phrase/openapi/issues/418)) ([524626f](https://github.com/phrase/openapi/commit/524626f5e914bfef6025d0e1c2cbc7a728d08f56))

## [2.16.0](https://github.com/phrase/openapi/compare/go-v2.15.0...go-v2.16.0) (2023-10-23)


### Features

* **API:** Add order param to comment list endpoints ([#441](https://github.com/phrase/openapi/issues/441)) ([441c9c4](https://github.com/phrase/openapi/commit/441c9c46169f8c5ac4e71ade09a95dab136314ef))

## [2.15.0](https://github.com/phrase/openapi/compare/go-v2.14.0...go-v2.15.0) (2023-10-13)


Expand Down
124 changes: 124 additions & 0 deletions clients/go/test/api_locales_test.go

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

79 changes: 79 additions & 0 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.

14 changes: 14 additions & 0 deletions clients/java/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## [1.16.0](https://github.com/phrase/openapi/compare/java-v1.15.0...java-v1.16.0) (2023-10-30)


### Features

* Update openapi-generator to v7 ([#418](https://github.com/phrase/openapi/issues/418)) ([524626f](https://github.com/phrase/openapi/commit/524626f5e914bfef6025d0e1c2cbc7a728d08f56))

## [1.15.0](https://github.com/phrase/openapi/compare/java-v1.14.0...java-v1.15.0) (2023-10-23)


### Features

* **API:** Add order param to comment list endpoints ([#441](https://github.com/phrase/openapi/issues/441)) ([441c9c4](https://github.com/phrase/openapi/commit/441c9c46169f8c5ac4e71ade09a95dab136314ef))

## [1.14.0](https://github.com/phrase/openapi/compare/java-v1.13.0...java-v1.14.0) (2023-10-13)


Expand Down
14 changes: 14 additions & 0 deletions clients/php/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## [1.16.0](https://github.com/phrase/openapi/compare/php-v1.15.0...php-v1.16.0) (2023-10-30)


### Features

* Update openapi-generator to v7 ([#418](https://github.com/phrase/openapi/issues/418)) ([524626f](https://github.com/phrase/openapi/commit/524626f5e914bfef6025d0e1c2cbc7a728d08f56))

## [1.15.0](https://github.com/phrase/openapi/compare/php-v1.14.0...php-v1.15.0) (2023-10-23)


### Features

* **API:** Add order param to comment list endpoints ([#441](https://github.com/phrase/openapi/issues/441)) ([441c9c4](https://github.com/phrase/openapi/commit/441c9c46169f8c5ac4e71ade09a95dab136314ef))

## [1.14.0](https://github.com/phrase/openapi/compare/php-v1.13.0...php-v1.14.0) (2023-10-13)


Expand Down
21 changes: 21 additions & 0 deletions clients/python/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# Changelog

## [1.16.0](https://github.com/phrase/openapi/compare/python-v1.15.0...python-v1.16.0) (2023-10-30)


### Features

* Update openapi-generator to v7 ([#418](https://github.com/phrase/openapi/issues/418)) ([524626f](https://github.com/phrase/openapi/commit/524626f5e914bfef6025d0e1c2cbc7a728d08f56))

## [1.15.0](https://github.com/phrase/openapi/compare/python-v1.14.1...python-v1.15.0) (2023-10-23)


### Features

* **API:** Add order param to comment list endpoints ([#441](https://github.com/phrase/openapi/issues/441)) ([441c9c4](https://github.com/phrase/openapi/commit/441c9c46169f8c5ac4e71ade09a95dab136314ef))

## [1.14.1](https://github.com/phrase/openapi/compare/python-v1.14.0...python-v1.14.1) (2023-10-23)


### Bug Fixes

* **python:** pass format_options correctly ([#436](https://github.com/phrase/openapi/issues/436)) ([3621400](https://github.com/phrase/openapi/commit/362140060ab90463185b3b1f729b79c08226bf55))

## [1.14.0](https://github.com/phrase/openapi/compare/python-v1.13.0...python-v1.14.0) (2023-10-13)


Expand Down
12 changes: 7 additions & 5 deletions clients/python/test/test_uploads_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,26 +30,28 @@ def setUp(self):
def tearDown(self):
pass

@patch('phrase_api.ApiClient.request')
@patch('urllib3.PoolManager.urlopen')
def test_upload_create(self, mock_post):
"""Test case for upload_create
Upload a new file # noqa: E501
"""
mock_post.return_value = Mock(ok=True)
mock_post.return_value.data = '{"id": "upload_id", "format": "simple_json"}'
mock_post.return_value.data = '{"id": "upload_id", "format": "simple_json"}'.encode()
mock_post.return_value.getencoding.return_value = 'utf-8'
mock_post.return_value.status = 201
mock_post.return_value.getheader.side_effect = { 'Content-Type': "application/json" }.get

project_id = "project_id_example"
with phrase_api.ApiClient(self.configuration) as api_client:
api_instance = phrase_api.UploadsApi(api_client)
api_response = api_instance.upload_create(
project_id,
file="./test/fixtures/en.json",
file_format="simple_json",
format_options={"enable_pluralization": True}
file_format="simple_json"
)

mock_post.assert_called_with("POST", "https://api.phrase.com/v2/projects/project_id_example/uploads", query_params=[], headers={'Accept': 'application/json', 'Content-Type': 'multipart/form-data', 'User-Agent': 'OpenAPI-Generator/1.14.0/python', 'Authorization': 'token YOUR_API_KEY'}, post_params=[('file_format', 'simple_json'), ('format_options', {'enable_pluralization': True}), ('file', ('en.json', b'{\n "key": "value"\n}\n', 'application/json'))], body=None, _preload_content=True, _request_timeout=None)
self.assertEqual("https://api.phrase.com/v2/projects/project_id_example/uploads", mock_post.call_args_list[0].args[1])

self.assertIsNotNone(api_response)
self.assertIsInstance(api_response, phrase_api.models.upload.Upload)
Expand Down
14 changes: 14 additions & 0 deletions clients/ruby/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## [2.19.0](https://github.com/phrase/openapi/compare/ruby-v2.18.0...ruby-v2.19.0) (2023-10-30)


### Features

* Update openapi-generator to v7 ([#418](https://github.com/phrase/openapi/issues/418)) ([524626f](https://github.com/phrase/openapi/commit/524626f5e914bfef6025d0e1c2cbc7a728d08f56))

## [2.18.0](https://github.com/phrase/openapi/compare/ruby-v2.17.0...ruby-v2.18.0) (2023-10-23)


### Features

* **API:** Add order param to comment list endpoints ([#441](https://github.com/phrase/openapi/issues/441)) ([441c9c4](https://github.com/phrase/openapi/commit/441c9c46169f8c5ac4e71ade09a95dab136314ef))

## [2.17.0](https://github.com/phrase/openapi/compare/ruby-v2.16.0...ruby-v2.17.0) (2023-10-13)


Expand Down
Loading

0 comments on commit e72ad07

Please sign in to comment.