Skip to content

Conversation

@iamnamananand996
Copy link
Contributor

Description

Linear ticket: Closes FER-7724

Fixes seed failures caused by illegal circular type references in Rust SDK generation. Adds cycle detection to catch invalid recursive types early and enhances recursive type utilities to properly handle unions and undiscriminated unions.

Changes Made

  • Created RustCycleDetector to detect illegal recursive cycles that cannot be represented in Rust
  • Integrated cycle detection into AbstractRustGeneratorContext initialisation (fails fast on invalid schemas)
  • Added visited set tracking in irUsesType() to prevent infinite recursion on circular types
  • Enhanced recursiveTypeUtils.ts to handle all type shapes:
    • Discriminated unions (check all variants and base properties)
    • Undiscriminated unions (check all members)
    • Alias types (check aliased type)
  • Updated seed fixtures with circular references to use Box<T> wrapping
  • Updated allowedFailures in rust-model seed.yml

Testing

  • Unit tests added/updated
  • Manual testing completed

@github-actions
Copy link
Contributor

github-actions bot commented Nov 21, 2025

🌱 Seed Test Selector

Select languages to run seed tests for:

  • Python
  • TypeScript
  • Java
  • Go
  • Ruby
  • C#
  • PHP
  • Swift
  • Rust
  • OpenAPI
  • Postman

How to use: Click the ⋯ menu above → "Edit" → check the boxes you want → click "Update comment". Tests will run automatically and snapshots will be committed to this PR.

@iamnamananand996 iamnamananand996 force-pushed the namananand/fer-7724-rust-sdk-circular-reference-seed-failure branch from 3cd5be2 to 2870482 Compare November 25, 2025 16:44
@iamnamananand996 iamnamananand996 merged commit 62a49b7 into main Nov 25, 2025
100 checks passed
@iamnamananand996 iamnamananand996 deleted the namananand/fer-7724-rust-sdk-circular-reference-seed-failure branch November 25, 2025 17:16
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