-
Notifications
You must be signed in to change notification settings - Fork 303
feat(java-sdk): remove omitted basic auth fields from generated SDK API #14408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Swimburger
wants to merge
41
commits into
main
Choose a base branch
from
devin/1774997719-basic-auth-optional-java-sdk
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
90e5382
feat(java-sdk): support optional username/password in basic auth when…
Swimburger 71f8797
fix(java-sdk): use per-field omit checks instead of coarse eitherOmit…
Swimburger 892774a
fix(java-sdk): update AbstractRootClientGenerator.visitBasic() with p…
Swimburger c7e3900
fix(java-sdk): fix spotless formatting for addStatement calls
Swimburger 631e5c4
fix(java-sdk): update seed output for basic-auth-optional to reflect …
Swimburger 65f4da3
Merge remote-tracking branch 'origin/main' into devin/1774997719-basi…
Swimburger ee43296
fix(java-sdk): remove omitted fields entirely from builder/constructo…
Swimburger e45749d
fix(java-sdk): regenerate seed output with complete field removal for…
Swimburger d478ef3
fix(java-sdk): handle omitted fields in ENDPOINT_SECURITY routing aut…
Swimburger ebee291
fix(java-sdk): fix BasicAuthProvider constructor arg mismatch in ENDP…
Swimburger 8f8edec
fix(java-sdk): apply spotless formatting
Swimburger d7f8488
fix(java-sdk): make auth error message conditional on which fields ar…
Swimburger fe3f255
ci: retrigger CI for flaky java-sdk seed-test-results cancellation
Swimburger 1d059f3
ci: retrigger CI for flaky java-sdk seed-test-results cancellation (a…
Swimburger 5e6e9e7
fix(java-sdk): skip auth header when both fields omitted and auth is …
Swimburger 6678bdb
merge: resolve versions.yml conflict with main (bump to 4.1.1)
Swimburger 31f9d42
fix(java-sdk): use 'omit' instead of 'optional' in versions.yml chang…
Swimburger 9bf8f71
fix(java-sdk): correct changelog - both omitted skips auth, not Runti…
Swimburger 7ffe2fd
refactor: rename basic-auth-optional fixture to basic-auth-pw-omitted
Swimburger 0204105
merge: resolve versions.yml conflict with main (bump to 4.1.2)
Swimburger 0279ac7
fix(java-sdk): bump version to 4.2.0 (feat requires minor bump)
Swimburger b4dc575
Merge remote-tracking branch 'origin/main' into devin/1774997719-basi…
Swimburger a70da13
fix(java-sdk): handle usernameOmit/passwordOmit in dynamic snippets g…
Swimburger f625a07
refactor(java-sdk): simplify omit checks from === true to !!
Swimburger 7aeb101
fix: pass usernameOmit/passwordOmit through DynamicSnippetsConverter …
Swimburger 68d38a3
ci: retrigger CI (flaky go-sdk job cancellation)
Swimburger 558f069
ci: retrigger CI (flaky python-sdk seed-test-results failure)
Swimburger c91374e
ci: retrigger CI (2nd attempt - flaky test-ete timeout)
Swimburger a13c6cf
merge: resolve versions.yml conflict with main (4.1.2 from main)
Swimburger 132be8e
fix: update createdAt date to 2026-04-08 for version 4.2.0
Swimburger dbb260e
merge: resolve versions.yml conflict with main (4.1.3 from main)
Swimburger 548dda0
merge: resolve versions.yml conflict with main (4.2.0-rc.0 from main)
Swimburger 605de9b
fix: update irVersion to 66 for 4.2.0 to match seed.yml after IR v66 …
Swimburger 68be15f
merge: resolve versions.yml conflict with main (4.1.4 from main)
Swimburger 6fc61f7
Merge remote-tracking branch 'origin/main' into devin/1774997719-basi…
Swimburger 073f537
merge: resolve conflict with main (4.2.0-rc.1, NameUtils.toName wrapper)
Swimburger 23ee5e5
merge: resolve versions.yml conflict with main (4.2.0 from main)
Swimburger 98e6f6b
fix: correct createdAt date for 4.2.1 to match chronological order
Swimburger 40340df
merge: resolve versions.yml conflict with main (bumped to 4.2.2 above…
Swimburger 4718d36
merge: resolve versions.yml conflict with main (bump to 4.2.3)
Swimburger 9115e2c
Merge remote-tracking branch 'origin/main' into devin/1774997719-basi…
Swimburger File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
257 changes: 181 additions & 76 deletions
257
...s/java/sdk/src/main/java/com/fern/java/client/generators/AbstractRootClientGenerator.java
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔴 Forbidden
as unknown as Xtype assertion bypasses type system instead of updating dynamic IR typeThe code uses
auth as unknown as Record<string, unknown>to accessusernameOmit/passwordOmitfields that don't exist onFernIr.dynamic.BasicAuth. This violates CLAUDE.md's explicit rule: "Never useas anyoras unknown as X. These are escape hatches that bypass the type system entirely. If the types don't line up, fix the types."The dynamic IR's
BasicAuthtype atpackages/ir-sdk/fern/apis/ir-types-latest/definition/dynamic/auth.yml:22-25only declaresusernameandpassword. Whilepackages/cli/generation/ir-generator/src/dynamic-snippets/DynamicSnippetsConverter.ts:736-748does attach these fields at runtime using an intersection type, the proper fix is to addusernameOmit: optional<boolean>andpasswordOmit: optional<boolean>to the dynamic IR'sBasicAuthdefinition, then regenerate the SDK types so the field access is type-safe.Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Acknowledged — the
as unknown as Record<string, unknown>cast is a known limitation. The proper fix requires addingusernameOmit/passwordOmitto the dynamic IR'sBasicAuthtype definition and regenerating SDK types. This is deferred to a follow-up (IR schema changes are out of scope for this PR per reviewer instruction).