Skip to content

Conversation

iamnamananand996
Copy link
Contributor

Description

closes: #9338

This PR adds dynamic snippet generation support for the Rust SDK generator. The implementation enables automatic generation of code snippets that demonstrate API usage patterns, improving developer experience and documentation.

Changes Made

  • Added DynamicTypeInstantiationMapper to handle type conversion for dynamic snippets
  • Implemented EndpointSnippetGenerator for generating endpoint usage examples
  • Integrated dynamic snippet generation into the main SdkGeneratorCli

Testing

  • Manual testing completed
  • Generated snippets for all seed projects (exhaustive, imdb, pagination, etc.)

@iamnamananand996 iamnamananand996 marked this pull request as ready for review September 12, 2025 10:51
@iamnamananand996
Copy link
Contributor Author

cc - @musicpulpite,

before reviewing this, we need to merge the #9315 to have rustfmt support in dynamic-snippet

@iamnamananand996
Copy link
Contributor Author

For this PR, I will take the changes from the merged PR and verify therustfmt again for dynamic-snippets and let you know about the merge.

cc - @musicpulpite

@musicpulpite
Copy link
Collaborator

Hey @iamnamananand996 please fix the single biome error here and then I will admin merge for you. As we saw, the generate-docs-test-windows and live-test-dev are failing due to permission issues for you pulling organization secrets... but it also looks like that is the reason why the seed tests will not run for you either since they need to pull a github token. I will discuss with the team further on this to come up with a better long-term solution!

@iamnamananand996
Copy link
Contributor Author

Hi @musicpulpite, now generate-docs-test-windows and live-test-dev are skipped, and the update seed is failing because of a similar kind of issue, i.e not having access to token: ${{ secrets.FERN_GITHUB_PAT }}.

Looks like we are good for now.

@musicpulpite musicpulpite merged commit e752b13 into fern-api:main Sep 17, 2025
62 of 64 checks passed
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.

Rust SDK: Add dynamic snippet generation support
2 participants