Skip to content

Commit 7e34c67

Browse files
committed
fix: Fix document upload API path
1 parent 1b338d3 commit 7e34c67

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77

8+
## Unreleased
9+
### Fixed
10+
* Change document upload to use the path `/v2/document` instead of `/v2/document/` (no trailing `/`).
11+
Both paths will continue to work in the v2 version of the API, but `/v2/document` is the intended one.
12+
13+
814
## [1.4.0] - 2023-11-03
915
### Added
1016
* Add optional `context` parameter for text translation, that specifies
@@ -93,6 +99,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9399
Initial version.
94100

95101

102+
[Unreleased]: https://github.com/DeepLcom/deepl-java/compare/v1.4.0...HEAD
96103
[1.4.0]: https://github.com/DeepLcom/deepl-java/compare/v1.3.0...v1.4.0
97104
[1.3.0]: https://github.com/DeepLcom/deepl-java/compare/v1.2.0...v1.3.0
98105
[1.2.0]: https://github.com/DeepLcom/deepl-java/compare/v1.1.0...v1.2.0

deepl-java/src/main/java/com/deepl/api/Translator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ public DocumentHandle translateDocumentUpload(
447447
try (FileInputStream inputStream = new FileInputStream(inputFile)) {
448448
HttpResponse response =
449449
httpClientWrapper.uploadWithBackoff(
450-
"/v2/document/", params, inputFile.getName(), inputStream);
450+
"/v2/document", params, inputFile.getName(), inputStream);
451451
checkResponse(response, false, false);
452452
return jsonParser.parseDocumentHandle(response.getBody());
453453
}

0 commit comments

Comments
 (0)