Repository navigation
feat: tolerate unknown enum values, update source files and branches API - #419
Merged
Merged
Conversation
Enum values the SDK does not know yet (for example ones added to the API after a release) used to make the whole response fail with an IllegalArgumentException. They are now deserialized as null so the rest of the response is still usable. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…t docs Source files: - add missing import options fields (Docx, Spreadsheet, Xml, Html, HtmlWithFrontMatter) and new import options classes for WebXml, Vsdx, Idml, Md, MdxV2, StringCatalog, Adoc and Vdf files - add export options classes for Md, MdxV1, MdxV2 and Docx files - add Enterprise custom `fields` to AddFileRequest and FileInfo/File - resolve import/export options by the file type, so Html, Md, Mdx and other richer options are returned instead of the generic classes; new classes extend OtherFileImportOptions/GeneralFileExportOptions so existing casts keep working - deprecate FileRevision.info, which is no longer part of the API Branches: - add isProtected to Branch, AddBranchRequest, CloneBranchRequest and ClonedBranch (string-based projects) - add dryRun to BranchMergeStatus attributes and acceptSourceChanges to BranchMergeSummary - fix the checkMergeBranchStatus Javadoc link and add Enterprise links Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
andrii-bodnar
approved these changes
Oct 19, 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.
First part of updating the SDK to the current Crowdin API docs. It covers core enum handling, source files and branches.
Changes
fix(core): unknown enum values becomenullBefore, an enum value the SDK didn't know (for example one added to the API after a release) made the whole response fail with an
IllegalArgumentException.EnumDeserializernow returnsnullfor it, and the rest of the response is still usable.feat(source-files): source files and branchestype; distinctive keys are the fallback when there is no type.OtherFileImportOptions/GeneralFileExportOptions.fieldstoAddFileRequestandFileInfo/File.isProtected(string-based projects) toBranch,AddBranchRequest,CloneBranchRequestandClonedBranch.dryRuntoBranchMergeStatusattributes andacceptSourceChangestoBranchMergeSummary.FileRevision.infoand its classes, which are no longer in the API.checkMergeBranchStatusnow linksapi.projects.branches.merges.getinstead ofclones.get, and the clone and merge methods now have Enterprise links.Backward compatibility
HtmlFileImportOptions,HtmlWithFrontMatterFileImportOptionsandMdxV1FileImportOptionsnow extendOtherFileImportOptions. TheircontentSegmentation/srxStorageIdaccessors are inherited with identical signatures, so this stays binary compatible.nullinstead of throwing. Aswitchon such a value would throw aNullPointerException.instanceof OtherFileImportOptions/GeneralFileExportOptionsstill holds, but code comparinggetClass()exactly will see a different class.equals/hashCode/toStringinclude the new fields.Testing
./gradlew build: 617 tests, 0 failures, on both JDK 17 and JDK 8../gradlew javadocon JDK 8, as the docs workflow runs it: no errors.FileOptionsDeserializationTestround-trips every options class and covers the fallback without a type.EnumSerializationTestcovers unknown enum values.🤖 Generated with Claude Code