Skip to content

fix(java): Enable forward-compatible enums; stop extra props#13524

Merged
fern-support merged 3 commits intomainfrom
sdk-config
Mar 13, 2026
Merged

fix(java): Enable forward-compatible enums; stop extra props#13524
fern-support merged 3 commits intomainfrom
sdk-config

Conversation

@iamnamananand996
Copy link
Contributor

Description

Refs SDK config changes for Java generator.

Enables forward-compatible enums by default in the Java SDK generator (download-files mode) and disables deserialization of additional properties in the client generator context.

Link to Devin Session: https://app.devin.ai/sessions/43fc16994a2a40c8acf6863c33228fb6
Requested by: @iamnamananand996

Changes Made

  • Forward-compatible enum constructor made PUBLIC (ForwardCompatibleEnumGenerator.java): The constructor was previously package-private; it is now public so enums can be constructed from outside the package.
  • New config option enable-forward-compatible-enums (JavaSdkDownloadFilesCustomConfig.java): Added to the download-files custom config, defaults to true.
  • Wired config into Cli (Cli.java): Passes the new enableForwardCompatibleEnums config value into the generator context builder.
  • Disabled deserializeWithAdditionalProperties (ClientGeneratorContext.java): Changed from truefalse, meaning unknown/extra JSON properties will no longer be captured during deserialization.
  • Updated README.md generator (if applicable)

Testing

  • Unit tests added/updated
  • Manual testing completed
  • Seed fixtures updated to reflect new defaults

⚠️ Human Review Checklist

  • deserializeWithAdditionalPropertiesfalse: This is a behavioral change. Confirm downstream Java SDKs do not rely on additional properties being deserialized. This could be breaking for consumers.
  • enableForwardCompatibleEnums defaults to true: All Java SDKs in download-files mode will now generate forward-compatible enums by default. Verify this is the intended default (vs. opt-in with false).
  • Public constructor on forward-compatible enums: Changing visibility from package-private to public expands the API surface of generated enums. Confirm this is required.
  • No seed fixture updates: Generated output will change for Java SDK fixtures — snapshot diffs should be verified.

Add support for forward-compatible enums and disable deserialization of additional properties. A new config flag enable-forward-compatible-enums (default true) was added to JavaSdkDownloadFilesCustomConfig and passed through the CLI to enable the feature. ForwardCompatibleEnumGenerator's constructor was made public. ClientGeneratorContext.deserializeWithAdditionalProperties() was changed to return false to prevent automatic acceptance of unknown properties during deserialization.
@devin-ai-integration
Copy link
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@claude
Copy link

claude bot commented Mar 13, 2026

⚠️ Code review skipped — your organization's overage spend limit has been reached.

Code review is billed via overage credits. To resume reviews, an organization admin can raise the monthly limit in Settings → Usage.

Once credits are available, reopen this pull request to trigger a review.

Remove the public modifier from the forward-compatible enum constructor to make it package-private and limit external instantiation. Also change ClientGeneratorContext.deserializeWithAdditionalProperties() to return true so generated clients will deserialize additional/unknown properties.
Add a 3.44.1 entry documenting a fix: the enable-forward-compatible-enums config flag was ignored in download files mode because it was missing from JavaSdkDownloadFilesCustomConfig, so setting enable-forward-compatible-enums: false in generators.yml had no effect when using --local generation. Also records createdAt (2026-03-14) and irVersion (65).
@iamnamananand996 iamnamananand996 changed the title feat(java): Enable forward-compatible enums; stop extra props fix(java): Enable forward-compatible enums; stop extra props Mar 13, 2026
@fern-support fern-support merged commit 9d05fa6 into main Mar 13, 2026
128 checks passed
@fern-support fern-support deleted the sdk-config branch March 13, 2026 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants