Skip to content

Conversation

@tstanmay13
Copy link
Contributor

Description

Refs: Slack thread from @tstanmay13

Fixes a bug where Java SDK dynamic snippets were referencing inline types from the wrong package location. When enable-inline-types is configured, types are generated as nested static classes within parent types (e.g., GetDiscriminatedUnionRequest.Bar), but the snippet generator was trying to import them from com.seed.object.types.* where they don't exist.

Link to Devin run: https://app.devin.ai/sessions/b8576a2505a54491902ab0e494874424
Requested by: [email protected] (@tstanmay13)

Changes Made

  • Added inline flag to the dynamic IR Declaration type to track whether a type should be generated as a nested class
  • Updated DynamicSnippetsConverter to populate the inline flag from the full IR
  • Implemented inline type mapping in DynamicSnippetsGeneratorContext that:
    • Traverses all types to find inline children and records their owner class + nested path
    • Handles name collisions by appending underscores (matching Java generator behavior)
    • Supports deeply nested inline types
  • Added getJavaClassReferenceForNamedType() method that returns nested class references for inline types
  • Updated DynamicTypeMapper and DynamicTypeLiteralMapper to use the new inline-aware method
  • Updated README.md generator (if applicable) - N/A

Testing

  • Seed tests pass for all 4 java-inline-types configurations:
    • java-inline-types:inline
    • java-inline-types:no-inline
    • java-inline-types:no-wrapped-aliases
    • java-inline-types:enable-forward-compatible-enums
  • Lint checks pass (pnpm run check)

Human Review Checklist

  • Verify the inline type naming logic in getUniqueNestedName() matches the Java generator's collision handling
  • Check that type assertions for inline property (lines 82-84, 320-322, 501) are safe workarounds until the SDK is published
  • Confirm traversal logic in traverseTypeForInlineChildren() handles all type structures correctly

@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

@tstanmay13
Copy link
Contributor Author

update the snapshots those are correct changes as we added a property

devin-ai-integration bot and others added 7 commits December 6, 2025 21:06
Now that inline types are correctly handled in dynamic snippets,
remove the following fixtures from allowedFailures:
- java-inline-types:inline
- java-inline-types:no-wrapped-aliases
- java-inline-types:enable-forward-compatible-enums

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
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.

3 participants