fix(java): Enable forward-compatible enums; stop extra props#13524
Merged
fern-support merged 3 commits intomainfrom Mar 13, 2026
Merged
fix(java): Enable forward-compatible enums; stop extra props#13524fern-support merged 3 commits intomainfrom
fern-support merged 3 commits intomainfrom
Conversation
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.
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
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).
fern-support
approved these changes
Mar 13, 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.
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
PUBLIC(ForwardCompatibleEnumGenerator.java): The constructor was previously package-private; it is now public so enums can be constructed from outside the package.enable-forward-compatible-enums(JavaSdkDownloadFilesCustomConfig.java): Added to the download-files custom config, defaults totrue.Cli.java): Passes the newenableForwardCompatibleEnumsconfig value into the generator context builder.deserializeWithAdditionalProperties(ClientGeneratorContext.java): Changed fromtrue→false, meaning unknown/extra JSON properties will no longer be captured during deserialization.Testing
deserializeWithAdditionalProperties→false: This is a behavioral change. Confirm downstream Java SDKs do not rely on additional properties being deserialized. This could be breaking for consumers.enableForwardCompatibleEnumsdefaults totrue: All Java SDKs in download-files mode will now generate forward-compatible enums by default. Verify this is the intended default (vs. opt-in withfalse).