diff --git a/fern/products/sdks/introduction.mdx b/fern/products/sdks/introduction.mdx index 32f00bf4b..d77e3980d 100644 --- a/fern/products/sdks/introduction.mdx +++ b/fern/products/sdks/introduction.mdx @@ -228,16 +228,28 @@ description: Generate idiomatic SDKs in multiple programming languages - +
- Request Rust - -
+ Rust + +
diff --git a/fern/products/sdks/overview/rust/configuration.mdx b/fern/products/sdks/overview/rust/configuration.mdx new file mode 100644 index 000000000..d18033234 --- /dev/null +++ b/fern/products/sdks/overview/rust/configuration.mdx @@ -0,0 +1,25 @@ +--- +title: Rust configuration +description: Configuration options for the Fern Rust SDK. +--- + +You can customize the behavior of the Rust SDK generator in `generators.yml`: + +```yaml {6-8} title="generators.yml" +groups: + rust-sdk: + generators: + - name: fernapi/fern-rust-sdk + version: + config: + clientName: PlantStoreClient + enableWireTests: true +``` + + +The name of the generated client struct. This determines the primary client type name that users will interact with in the generated Rust SDK. + + + +Generates [mock server (wire) tests](/sdks/deep-dives/testing#mock-server-tests) to verify that the SDK sends the correct HTTP requests and correctly handles responses per the API spec. When enabled, the generated tests use WireMock for HTTP mocking. + diff --git a/fern/products/sdks/overview/rust/quickstart.mdx b/fern/products/sdks/overview/rust/quickstart.mdx new file mode 100644 index 000000000..735c099ac --- /dev/null +++ b/fern/products/sdks/overview/rust/quickstart.mdx @@ -0,0 +1,71 @@ +--- +title: Rust quickstart +description: Get started with the Fern Rust SDK. +--- + +Generate a Rust SDK by following the instructions on this page. + + + + + + + +### Add the SDK generator + +Run the following command to add the Rust SDK generator to `generators.yml`: + +```bash +fern add fern-rust-sdk --group rust-sdk +``` + + `rust-sdk` is the name of the `generators.yml` group that configures your Rust + SDK's output location and other metadata. You can customize this group name to + differentiate between multiple SDKs across different languages (e.g., + `ruby-sdk`, etc) in your organization. + + +This command adds the following `group` to `generators.yml`: + +```yaml title="generators.yml" + rust-sdk: # group name + generators: + - name: fernapi/fern-rust-sdk + version: + output: + location: local-file-system + path: ../sdks/rust +``` + +### Generate the SDK + +Run the following command to generate your SDK: + +```bash +fern generate --group rust-sdk +``` + + + If you have multiple APIs, use the [`--api` flag](/cli-api-reference/cli-reference/commands#api) to specify the API you want to generate: + + ```bash + fern generate --group rust-sdk --api your-api-name + ``` + + + + + + + + + + + + + + + + + + diff --git a/fern/products/sdks/reference/generators-yml-reference.mdx b/fern/products/sdks/reference/generators-yml-reference.mdx index bb99db052..5f76d96c0 100644 --- a/fern/products/sdks/reference/generators-yml-reference.mdx +++ b/fern/products/sdks/reference/generators-yml-reference.mdx @@ -445,6 +445,8 @@ groups: + + diff --git a/fern/products/sdks/sdks.yml b/fern/products/sdks/sdks.yml index fea04a3b9..019a635d3 100644 --- a/fern/products/sdks/sdks.yml +++ b/fern/products/sdks/sdks.yml @@ -205,6 +205,16 @@ navigation: slug: publishing - changelog: ./overview/swift/changelog slug: changelog + - section: Rust + contents: + - page: Quickstart + path: ./overview/rust/quickstart.mdx + slug: quickstart + - page: Configuration + path: ./overview/rust/configuration.mdx + slug: configuration + - changelog: ./overview/rust/changelog + slug: changelog - section: Postman contents: - page: Quickstart diff --git a/fern/snippets/version-number-rust.mdx b/fern/snippets/version-number-rust.mdx new file mode 100644 index 000000000..dffa40ec3 --- /dev/null +++ b/fern/snippets/version-number-rust.mdx @@ -0,0 +1 @@ +0.13.4