-
Notifications
You must be signed in to change notification settings - Fork 4
Add Swift quickstart and publishing guide (SDKs) #579
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| @@ -0,0 +1,64 @@ | |||
| --- | |||
| title: Publishing as a Swift package | |||
| description: How to publish the Fern Go SDK to the Go module proxy. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorrect description referencing "Go"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed!
| --- | ||
| 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: <Markdown src="/snippets/version-number-swift.mdx"/> | ||
| ``` | ||
|
|
||
| ## SDK Configuration Options No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm I'm not seeing this page in the preview URL. Is that expected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We implemented 2 generator config options in this PR (merged today): clientClassName and environmentEnumName. We can probably mention them here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I originally hid it from the left nav because there weren't any config options listed. I just added info on the clientClassName and environmentEnumName, and the page should appear in the preview link now!
| ``` | ||
|
|
||
| <Tip> | ||
| Unlike centralized registries, there's no separate "publishing" step required. Your package becomes available immediately once pushed to Git with proper tags. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd change "once pushed to Git" to "Once pushed to GitHub" or "Once pushed to a Git repo"
Git is the version control system. We currently support GitHub publishing only. There are other hosting providers like Gitlab and Bitbucket
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
e.g. can say something like "Unlike other languages that rely on centralized registries, Swift packages are available as soon as they’re tagged and pushed to a Git repository"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, thanks!
| ├─ swift | ||
| ├─ Package.swift | ||
| └─ Sources | ||
| ├─ ApiClient.swift |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to confirm: ApiClient.swift here isn’t fixed. For example, in the Chrt SDK, it’ll be ChrtClient.swift, since that’s set via generator config options (WIP). For others, it might be PetstoreClient.swift, etc.
When naming the root client class, we first check the generator config options. If no value is provided there, we fall back to the API name from the IR (inferred from the definition). ApiClient.swift only appears when the inferred name is Api.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed this to YourClient.swift
No description provided.