Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 1 addition & 17 deletions fern/products/api-def/pages/project-structure.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -43,23 +43,7 @@ determinism.

### `generators.yml`

The `generators.yml` file points to your API definition and [specifies which SDKs to generate](/sdks/overview/project-structure).

```yaml title="generators.yml"
# Your API definition
api:
specs:
- openapi: ./openapi-1.yml

# SDK generators
groups:
ts-sdk:
generators:
- name: fernapi/fern-typescript-sdk
version: <Markdown src="/snippets/version-number-ts.mdx"/>
github:
repository: your-organization/typescript-sdk-repo # Location of TypeScript SDK
```
<Markdown src="/snippets/generators-yml-project-structure.mdx" />

### API definition file

Expand Down
25 changes: 1 addition & 24 deletions fern/products/sdks/project-structure.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -56,30 +56,7 @@ Every time you run a fern CLI command, the CLI downloads itself at the correct v

### `generators.yml`

The `generators.yml` file points to your API definition and specifies which SDKs to generate.

```yaml title="generators.yml"
# Your API definition
api:
specs:
- openapi: ./openapi-1.yml

# SDK generators
groups:
ts-sdk:
generators:
- name: fernapi/fern-typescript-sdk
version: <Markdown src="/snippets/version-number-ts.mdx"/>
github:
repository: your-organization/typescript-sdk-repo # Location of TypeScript SDK

python-sdk:
generators:
- name: fernapi/fern-python-sdk
version: <Markdown src="/snippets/version-number-python.mdx"/>
github:
repository: your-organization/python-sdk-repo # Location of Python SDK
```
<Markdown src="/snippets/generators-yml-project-structure.mdx" />

<Info title="Examples">
See Cohere's [`generators.yml` file](https://github.com/cohere-ai/cohere-developer-experience/blob/23d6c541a01eb6b54dd9bb3588c805bb0e307713/fern/apis/sdks/generators.yml) and Vapi's [`generators.yml` file](https://github.com/VapiAI/docs/blob/9c674c2b16ba03e864e26673c5290c88048c9a7a/fern/apis/api/generators.yml).
Expand Down
51 changes: 51 additions & 0 deletions fern/snippets/generators-yml-project-structure.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
The `generators.yml` file specifies which SDKs to generate. **For OpenAPI**, it also points to the location of your spec. **For Fern Definition**, Fern automatically detects your spec when your `definition/` folder is at the same level as `generators.yml`.

<Tabs>
<Tab title="OpenAPI">

```yaml title="generators.yml"
# Your API definition
api:
specs:
- openapi: ./openapi-1.yml

# SDK generators
groups:
ts-sdk:
generators:
- name: fernapi/fern-typescript-sdk
version: <Markdown src="/snippets/version-number-ts.mdx"/>
github:
repository: your-organization/typescript-sdk-repo # Location of TypeScript SDK

python-sdk:
generators:
- name: fernapi/fern-python-sdk
version: <Markdown src="/snippets/version-number-python.mdx"/>
github:
repository: your-organization/python-sdk-repo # Location of Python SDK
```
</Tab>
<Tab title="Fern Definition">

```yaml title="generators.yml"
# No API reference needed – Fern auto-detects spec

# SDK generators
groups:
ts-sdk:
generators:
- name: fernapi/fern-typescript-sdk
version: <Markdown src="/snippets/version-number-ts.mdx"/>
github:
repository: your-organization/typescript-sdk-repo # Location of TypeScript SDK

python-sdk:
generators:
- name: fernapi/fern-python-sdk
version: <Markdown src="/snippets/version-number-python.mdx"/>
github:
repository: your-organization/python-sdk-repo # Location of Python SDK
```
</Tab>
</Tabs>