Skip to content

feat: update bundles, webhooks, fields, string comments and other APIs to the latest docs - #422

Merged
andrii-bodnar merged 2 commits into
masterfrom
feature/small-apis-update
Oct 27, 2026
Merged

andrii-bodnar merged 2 commits into
masterfrom
feature/small-apis-update

Conversation

@katerina20

@katerina20 katerina20 commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Part of updating the SDK to the current Crowdin API docs. This PR covers the smaller APIs: Bundles, Webhooks (project and organization), Fields, String Comments, Style Guides, Languages, Issues, Clients, Vendors, Machine Translation Engines, Notifications, String Corrections and Security Logs. Distributions, Dictionaries and Storage were checked and already match the docs.

Fixes

  • OrganizationWebhooksApi.listWebhooks / addWebhook: they called a relative "/webhooks" URL without the base URL, so they failed at runtime. The tests registered their mocks under the same relative URL, which hid the bug; they now use the full URL.
  • webhooks.model.Event: added file.qa.finished, project.qa.finished, project.built, preTranslation.completed and task.updated. Before, listing or getting a webhook subscribed to any of these failed.
  • Webhook headers: the response schema types it as an array, and an empty [] used to fail parsing. It now reads as null, the same as a missing value. This is documented on Webhook.headers and OrganizationWebhook.headers.
    • Known limitation: the field uses the existing shared EmptyArrayToNullDeserializer, which turns any array into null, not only an empty one. If the API ever returned a non-empty array of strings (the documented response type), those values would be dropped silently. The create forms and the docs example both use an object ({"Authorization": "…"}), so this is very unlikely, and the previous release failed on any array anyway. The shared deserializer was deliberately left unchanged.
  • fields.model.enums.EntityType: added TERM and CONCEPT.
  • FieldsApi.getField: it returns a ResponseList, but GET /fields/{fieldId} returns a single field. Added getFieldById(Long) returning ResponseObject<Field>, and deprecated getField.

New fields and parameters

  • Bundles: sourceLanguageExportPattern, labelMatchRule, excludeLabelMatchRule and languageIds on Bundle and AddBundleRequest. listBundleBranches now has Javadoc links.
  • String comments:
    • StringComment: projectId, resolverId, resolver, resolvedAt, fileId, file, isShared, senderOrganization, resolverOrganization.
    • AddStringCommentRequest: fileId, isShared.
    • New fileId query parameter for listStringComments.
  • Issues: user and string on Issue.
  • Other models:
    • Language.bcp47Code.
    • webUrl on Client and Vendor.
    • groupId on StyleGuide/AddStyleGuideRequest (Enterprise).
    • CustomMtTranslateCredentials for custom_mt engines.
  • Fields Config: minValue/maxValue (Double), because the API types min/max as numbers.
  • Query parameters: denormalizePlaceholders for getCorrection; createdAfter/createdBefore for listUserSecurityLogs.
  • Javadoc: fixed the operation links for notifications and string corrections.

Deprecated (still working)

  • BundleExport.eta: the API deprecates it.
  • AddStringCommentRequest.issueStatus: not part of the API's add-comment request.
  • Config.min / Config.max: use minValue / maxValue.
  • FieldsApi.getField: use getFieldById.

Backward compatibility

No public method, field or class was removed, renamed or retyped. Existing overloads delegate to the new ones and send the same requests.

  • Field Config (behaviour correction):
    • The deprecated setMin(Integer)/setMax(Integer) fill the new fields, so the value is sent as a decimal (10.0).
    • The deprecated getMin()/getMax() truncate a fractional value inside the Integer range towards zero (1.5 → 1, -1.5 → -1), the same as the previous release.
    • For a value outside the Integer range (or NaN) they return null instead of a clamped value. The previous release failed the whole response for such values.
    • Use getMinValue()/getMaxValue() for the exact number.
  • New enum constants: Event and EntityType gain constants, so exhaustive switch statements over them will see new values.
  • ListStyleGuidesParams: now has @EqualsAndHashCode(callSuper = true), so its equals includes the pagination fields.
  • equals/hashCode/toString include the new fields.

Testing

  • ./gradlew build: 651 tests, 0 failures, on both JDK 17 and JDK 8.
  • ./gradlew javadoc on JDK 8: no errors.
  • New and updated mock tests and fixtures cover:
    • organization webhooks list/add with the full URL;
    • round trips for all new Event values, and empty headers;
    • the new comment, issue, bundle, language, client, vendor and style guide fields;
    • getFieldById, number field Config (request JSON from the deprecated setters), and fields filtered by type;
    • ConfigTest: the deprecated getters with fractional values, Integer boundary values, and out-of-range, infinite and NaN values;
    • custom MT credentials, and the new query parameters.

🤖 Generated with Claude Code

…s to the latest docs

Fixes:
- OrganizationWebhooksApi.listWebhooks/addWebhook used a relative
  "/webhooks" URL without the base URL and failed at runtime
- webhooks.Event: add file.qa.finished, project.qa.finished,
  project.built, preTranslation.completed and task.updated
- webhook `headers` returned as [] is read as null instead of failing
- fields.EntityType: add TERM and CONCEPT
- FieldsApi: add getFieldById returning a single field; deprecate
  getField, whose list return type doesn't match the API

New fields and params:
- Bundle/AddBundleRequest: sourceLanguageExportPattern, labelMatchRule,
  excludeLabelMatchRule, languageIds
- Language.bcp47Code; Client.webUrl; Vendor.webUrl;
  StyleGuide/AddStyleGuideRequest.groupId
- StringComment: projectId, resolverId, resolver, resolvedAt, fileId,
  file, isShared, senderOrganization, resolverOrganization;
  AddStringCommentRequest: fileId, isShared
- Issue: user, string
- fields Config: minValue/maxValue as numbers (min/max deprecated)
- custom_mt credentials for machine translation engines
- query params: fileId for listStringComments, denormalizePlaceholders
  for getCorrection, createdAfter/createdBefore for listUserSecurityLogs

Deprecations: BundleExport.eta, AddStringCommentRequest.issueStatus.
Javadoc: fixed the notifications and string corrections operation links.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…-of-range values

The deprecated integer getters clamped numbers outside the Integer range
to Integer.MAX_VALUE/MIN_VALUE. They now return null for such values
(and NaN), while fractional values within the range keep being
truncated towards zero as before. Javadoc recommends getMinValue() /
getMaxValue() for the exact value.

Document that an empty `headers` array returned by the API is
represented as null in Webhook and OrganizationWebhook.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@andrii-bodnar
andrii-bodnar merged commit 8cbdbfc into master Oct 27, 2026
3 checks passed
@andrii-bodnar
andrii-bodnar deleted the feature/small-apis-update branch October 27, 2026 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants