From 9c8533131c33828e39a0ce86623b7bbf7adb83f8 Mon Sep 17 00:00:00 2001 From: Devin Logan Date: Thu, 21 Aug 2025 16:10:48 -0400 Subject: [PATCH 1/4] add publishing and quickstart pages for swift --- .../sdks/overview/swift/configuration.mdx | 17 +++++ .../publishing-to-swift-package-manager.mdx | 64 +++++++++++++++++++ .../sdks/overview/swift/quickstart.mdx | 61 ++++++++++++++++++ fern/products/sdks/sdks.yml | 14 ++++ 4 files changed, 156 insertions(+) create mode 100644 fern/products/sdks/overview/swift/configuration.mdx create mode 100644 fern/products/sdks/overview/swift/publishing-to-swift-package-manager.mdx create mode 100644 fern/products/sdks/overview/swift/quickstart.mdx diff --git a/fern/products/sdks/overview/swift/configuration.mdx b/fern/products/sdks/overview/swift/configuration.mdx new file mode 100644 index 000000000..e7d010869 --- /dev/null +++ b/fern/products/sdks/overview/swift/configuration.mdx @@ -0,0 +1,17 @@ +--- +title: Swift configuration +description: Configuration options for the Fern Swift SDK. +--- + +You can customize the behavior of the Swift SDK generator in `generators.yml`: + +```yaml {7-8} title="generators.yml" +default-group: local +groups: + local: + generators: + - name: fernapi/fern-swift-sdk + version: +``` + +## SDK Configuration Options \ No newline at end of file diff --git a/fern/products/sdks/overview/swift/publishing-to-swift-package-manager.mdx b/fern/products/sdks/overview/swift/publishing-to-swift-package-manager.mdx new file mode 100644 index 000000000..aa8e80901 --- /dev/null +++ b/fern/products/sdks/overview/swift/publishing-to-swift-package-manager.mdx @@ -0,0 +1,64 @@ +--- +title: Publishing as a Swift package +description: How to publish the Fern Go SDK to the Go module proxy. +--- + +Publish your public-facing Fern Swift SDK as a Swift package distributed via Git. After following the steps on this page, you'll have a versioned package that developers can install using Swift Package Manager. + + + +## Configure `generators.yml` + + + + Swift packages are distributed via Git repositories, so remove the auto-generated `output` and `config` properties. Instead, add the path to your GitHub repository: + + ```yaml {6-7} title="generators.yml" + groups: + swift-sdk: + generators: + - name: fernapi/fern-swift-sdk + version: 1.0.0 + github: + repository: your-org/company-swift + ``` + + + +## Publish as a Swift package + +At this point, you're ready to generate a release for your SDK. + + + + Regenerate your SDK and publish it to your repository: + + ```bash + fern generate --group swift-sdk --version + ``` + + Local machine output will verify that the release is pushed to your repository and tagged with the version you specified. + + + + Your Swift package is now available! Developers can add it to their projects by: + + - **In Xcode**: File → Add Package Dependencies → Enter your repository URL + - **In Package.swift**: Add to dependencies array: + + ```swift + dependencies: [ + .package(url: "https://github.com//", from: "") + ] + ``` + + + Unlike centralized registries, there's no separate "publishing" step required. Your package becomes available immediately once pushed to Git with proper tags. + + You can optionally submit your package to the community-maintained [Swift Package Index](https://swiftpackageindex.com/) for better discoverability. + + + + + + diff --git a/fern/products/sdks/overview/swift/quickstart.mdx b/fern/products/sdks/overview/swift/quickstart.mdx new file mode 100644 index 000000000..b43c51a81 --- /dev/null +++ b/fern/products/sdks/overview/swift/quickstart.mdx @@ -0,0 +1,61 @@ +--- +title: Swift quickstart +description: Get started quickly with the Fern Swift SDK. +--- + +Generate a Swift SDK by following the instructions on this page. + + + + + + +### Add the SDK generator + +Run the following command to add the Swift SDK generator to `generators.yml`: + +```bash +fern add fern-swift-sdk --group swift-sdk +``` + + + `swift-sdk` is the name of the `generators.yml` group that configures your Swift + 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" + swift-sdk: # group name + generators: + - name: fernapi/fern-swift-sdk + version: + output: + location: local-file-system + path: ../sdks/swift +``` + +### Generate the SDK + + Run the following command to generate your SDK: + + ```bash + fern generate --group swift-sdk + ``` + + + +```bash +fern/ # created by fern init +sdks/ # created by fern generate --group swift-sdk +├─ swift + ├─ Package.swift + └─ Sources + ├─ ApiClient.swift + ├─ Schemas/ + ├─ Public/ + ├─ Core/ + └─ Resources/ +``` diff --git a/fern/products/sdks/sdks.yml b/fern/products/sdks/sdks.yml index b3842290d..f3d5bddb0 100644 --- a/fern/products/sdks/sdks.yml +++ b/fern/products/sdks/sdks.yml @@ -179,6 +179,20 @@ navigation: slug: changelog - link: Customer showcase href: https://buildwithfern.com/showcase#sdk-customers.ruby + - section: Swift + contents: + - page: Quickstart + path: ./overview/swift/quickstart.mdx + slug: quickstart + - page: Configuration + hidden: true + path: ./overview/swift/configuration.mdx + slug: configuration + - page: Publishing as a Swift package + path: ./overview/swift/publishing-to-swift-package-manager.mdx + slug: publishing + - changelog: ./overview/swift/changelog + slug: changelog - page: MCP Server path: ./overview/mcp-server/introduction.mdx slug: mcp-server From d50c0547adc1139bab429821abf5e76f4c8aef2c Mon Sep 17 00:00:00 2001 From: Devin Logan Date: Mon, 25 Aug 2025 09:28:23 -0400 Subject: [PATCH 2/4] fix syntax error --- fern/products/sdks/overview/swift/quickstart.mdx | 1 + 1 file changed, 1 insertion(+) diff --git a/fern/products/sdks/overview/swift/quickstart.mdx b/fern/products/sdks/overview/swift/quickstart.mdx index b43c51a81..5a31053e3 100644 --- a/fern/products/sdks/overview/swift/quickstart.mdx +++ b/fern/products/sdks/overview/swift/quickstart.mdx @@ -59,3 +59,4 @@ sdks/ # created by fern generate --group swift-sdk ├─ Core/ └─ Resources/ ``` + From 3bc0546b868b7ce78480fccef1534b007f295583 Mon Sep 17 00:00:00 2001 From: Devin Logan Date: Mon, 25 Aug 2025 14:45:13 -0400 Subject: [PATCH 3/4] address comments, add config options --- .../default-components/tooltips.mdx | 4 ++++ fern/products/sdks/overview/swift/configuration.mdx | 12 +++++++++++- .../swift/publishing-to-swift-package-manager.mdx | 4 ++-- fern/products/sdks/sdks.yml | 1 - 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/fern/products/docs/pages/component-library/default-components/tooltips.mdx b/fern/products/docs/pages/component-library/default-components/tooltips.mdx index 50f55e20c..0829c8a47 100644 --- a/fern/products/docs/pages/component-library/default-components/tooltips.mdx +++ b/fern/products/docs/pages/component-library/default-components/tooltips.mdx @@ -5,6 +5,8 @@ description: 'Add interactive tooltips to your documentation.' The Tooltips component provides a way to display additional information when users hover over an element. This is particularly useful for providing context or explanations without cluttering the interface. +## Tooltips in CodeBlocks + ## Properties @@ -135,3 +137,5 @@ const api = axios.create({ ````` + +## Tooltips for Text diff --git a/fern/products/sdks/overview/swift/configuration.mdx b/fern/products/sdks/overview/swift/configuration.mdx index e7d010869..9b14f4e45 100644 --- a/fern/products/sdks/overview/swift/configuration.mdx +++ b/fern/products/sdks/overview/swift/configuration.mdx @@ -12,6 +12,16 @@ groups: generators: - name: fernapi/fern-swift-sdk version: + clientClassName: YourClientName + environmentEnumName: YourCustomEnvironment ``` -## SDK Configuration Options \ No newline at end of file +## SDK Configuration Options + + +The name of the generated client class. This allows you to customize the class name that users will instantiate when using your SDK. + + + +The name of the generated environment enum. This allows you to customize the enum name that defines your API environments (such as production, staging, development) and ensures consistent naming across SDK generations. + \ No newline at end of file diff --git a/fern/products/sdks/overview/swift/publishing-to-swift-package-manager.mdx b/fern/products/sdks/overview/swift/publishing-to-swift-package-manager.mdx index aa8e80901..62d15bb93 100644 --- a/fern/products/sdks/overview/swift/publishing-to-swift-package-manager.mdx +++ b/fern/products/sdks/overview/swift/publishing-to-swift-package-manager.mdx @@ -1,6 +1,6 @@ --- title: Publishing as a Swift package -description: How to publish the Fern Go SDK to the Go module proxy. +description: How to publish the Fern Swift SDK as a Swift package --- Publish your public-facing Fern Swift SDK as a Swift package distributed via Git. After following the steps on this page, you'll have a versioned package that developers can install using Swift Package Manager. @@ -53,7 +53,7 @@ At this point, you're ready to generate a release for your SDK. ``` - Unlike centralized registries, there's no separate "publishing" step required. Your package becomes available immediately once pushed to Git with proper tags. + Unlike other languages that rely on centralized registries, Swift packages are available as soon as they’re tagged and pushed to a Git repository. You can optionally submit your package to the community-maintained [Swift Package Index](https://swiftpackageindex.com/) for better discoverability. diff --git a/fern/products/sdks/sdks.yml b/fern/products/sdks/sdks.yml index 4469d0288..b4cf4638a 100644 --- a/fern/products/sdks/sdks.yml +++ b/fern/products/sdks/sdks.yml @@ -185,7 +185,6 @@ navigation: path: ./overview/swift/quickstart.mdx slug: quickstart - page: Configuration - hidden: true path: ./overview/swift/configuration.mdx slug: configuration - page: Publishing as a Swift package From 72bdf9b9f78b3a3aae0ddf0fc0a7feeea5cde8a7 Mon Sep 17 00:00:00 2001 From: Devin Logan Date: Mon, 25 Aug 2025 14:48:07 -0400 Subject: [PATCH 4/4] modify quickstart example --- fern/products/sdks/overview/swift/quickstart.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fern/products/sdks/overview/swift/quickstart.mdx b/fern/products/sdks/overview/swift/quickstart.mdx index 5a31053e3..dbc17d573 100644 --- a/fern/products/sdks/overview/swift/quickstart.mdx +++ b/fern/products/sdks/overview/swift/quickstart.mdx @@ -53,7 +53,7 @@ sdks/ # created by fern generate --group swift-sdk ├─ swift ├─ Package.swift └─ Sources - ├─ ApiClient.swift + ├─ YourClient.swift ├─ Schemas/ ├─ Public/ ├─ Core/