Repository navigation
fix(reports): support arbitrary matchType ranges and drop unreleased deprecated fields - #425
Merged
Merged
Conversation
The API documents `matchType` in netRateSchemes as a free string (`perfect`, `100` or any percentage range such as `100-82`), but Match only had the closed MatchType enum, so ranges without a constant were read as null and could not be sent. Match now stores the raw value in `matchTypeValue` (JSON key `matchType`). The existing getMatchType()/setMatchType(MatchType) keep their signatures and work on top of it; getMatchType() returns null only for values without a predefined constant, while the original value stays available. No overload was added to setMatchType, so existing calls stay unambiguous. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Remove fields that were introduced only in #423 and are marked deprecated in the official API: - postEditingCategories from GroupPreTranslateAccuracySchema and GroupTranslatorAccuracySchema (use matchScoreCategories) - excludeApprovalsForEditedTranslations and preTranslatedStringsCategorizationAdjustment from GroupTranslationCostsPostEditingByTaskSchema and ReportSettingsTemplate.Config They were never part of a release. Pre-existing deprecated fields stay in place with @deprecated. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
andrii-bodnar
approved these changes
Oct 28, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #423. It resolves the two review questions left open there, checked against the official Crowdin OpenAPI specs.
1.
matchTypeaccepts any documented valueIn every
netRateSchemesschema (translation-costs-pe,costs-estimation-pe,group-translation-costs-pe, and the settings template plus its form), the API typesmatchTypeas a freestring:perfect,100, or any percentage range such as100-82or100-74.Matchonly had the closedMatchTypeenum. As a result:null, so the value was silently lost;Changes in
Match:String matchTypeValue(getMatchTypeValue()/setMatchTypeValue(String)) holds the raw value under the JSON keymatchType.getMatchType()andsetMatchType(MatchType)keep their exact signatures and work on top of the new field.getMatchType()returns the constant for known values, andnullonly for ranges without a constant. The original value is always inmatchTypeValue.setMatchType(null)clears the value.setMatchType(String), so existing calls such assetMatchType(null)stay unambiguous.Matchis shared by everynetRateSchemes, so the fix covers report generation requests and settings templates (requests and responses).2. Deprecated fields introduced in #423
Compared with the pre-#423
master(8cbdbfc7), #423 added these fields, all marked deprecated in the official OpenAPI. They are removed here:GenerateGroupReportRequest.GroupPreTranslateAccuracySchemapostEditingCategoriesmatchScoreCategoriesGenerateGroupReportRequest.GroupTranslatorAccuracySchemapostEditingCategoriesmatchScoreCategoriesGenerateGroupReportRequest.GroupTranslationCostsPostEditingByTaskSchemaexcludeApprovalsForEditedTranslations,preTranslatedStringsCategorizationAdjustmentReportSettingsTemplate.ConfigexcludeApprovalsForEditedTranslations,preTranslatedStringsCategorizationAdjustment@Deprecated.postEditingCategoriesinPreTranslateAccuracyGenerateReportRequestandTranslateAccuracyGenerateReportRequest.TranslationCostsPostEndingGenerateReportRequestandGenerateGroupReportRequest.GroupTranslationCostsPostEditingSchema.matchScoreCategoriesand the other non-deprecated replacements stay.Backward compatibility
master: no public signature was removed or changed.Matchkeeps its constructor and every original accessor, and gainsgetMatchTypeValue()/setMatchTypeValue(String).master: the only removed members are the getters/setters of the 7 fields above. They were added by feat(reports): update reports API to the latest docs #423, which is not part of any release yet (latest tag: 1.36.0).Matchequals/hashCode: these now compare the rawmatchTypestring. The result is the same for every predefined value.Match,matchTypeis now written afterprice. Key order has no meaning in JSON.Remaining risks
MatchTypedoesn't list every possible range, sogetMatchType()keeps returningnullfor values without a constant. Callers who need those values must usegetMatchTypeValue(). This is documented in the Javadoc.Testing
MatchTest(5 tests, using the realJacksonJsonTransformer): round trips for everyMatchTypeconstant through the enum accessors, known values parsed into the enum, custom ranges sent and parsed without loss, and enum setter/nullbehaviour.addPostEditingReportSettingsTemplateWithCustomMatchTypeRangesTest: a settings template withperfect,100-82,100-74and99-60throughReportsApi, checking the request JSON and the response values.setMatchType(MatchType…)and their fixtures pass unchanged../gradlew build): 717 tests, 0 failures, on both JDK 17 and JDK 8.matchTypeistype: stringwith no enum in every context, and no non-deprecated field is missing.🤖 Generated with Claude Code