Skip to content

Commit 1f2bf70

Browse files
authored
(sdks, api definitions) Clarify API definition reference difference between OpenAPI and Fern Definition (#1152)
1 parent b41815b commit 1f2bf70

File tree

3 files changed

+53
-41
lines changed

3 files changed

+53
-41
lines changed

fern/products/api-def/pages/project-structure.mdx

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -43,23 +43,7 @@ determinism.
4343

4444
### `generators.yml`
4545

46-
The `generators.yml` file points to your API definition and [specifies which SDKs to generate](/sdks/overview/project-structure).
47-
48-
```yaml title="generators.yml"
49-
# Your API definition
50-
api:
51-
specs:
52-
- openapi: ./openapi-1.yml
53-
54-
# SDK generators
55-
groups:
56-
ts-sdk:
57-
generators:
58-
- name: fernapi/fern-typescript-sdk
59-
version: <Markdown src="/snippets/version-number-ts.mdx"/>
60-
github:
61-
repository: your-organization/typescript-sdk-repo # Location of TypeScript SDK
62-
```
46+
<Markdown src="/snippets/generators-yml-project-structure.mdx" />
6347

6448
### API definition file
6549

fern/products/sdks/project-structure.mdx

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -56,30 +56,7 @@ Every time you run a fern CLI command, the CLI downloads itself at the correct v
5656

5757
### `generators.yml`
5858

59-
The `generators.yml` file points to your API definition and specifies which SDKs to generate.
60-
61-
```yaml title="generators.yml"
62-
# Your API definition
63-
api:
64-
specs:
65-
- openapi: ./openapi-1.yml
66-
67-
# SDK generators
68-
groups:
69-
ts-sdk:
70-
generators:
71-
- name: fernapi/fern-typescript-sdk
72-
version: <Markdown src="/snippets/version-number-ts.mdx"/>
73-
github:
74-
repository: your-organization/typescript-sdk-repo # Location of TypeScript SDK
75-
76-
python-sdk:
77-
generators:
78-
- name: fernapi/fern-python-sdk
79-
version: <Markdown src="/snippets/version-number-python.mdx"/>
80-
github:
81-
repository: your-organization/python-sdk-repo # Location of Python SDK
82-
```
59+
<Markdown src="/snippets/generators-yml-project-structure.mdx" />
8360

8461
<Info title="Examples">
8562
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).
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
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`.
2+
3+
<Tabs>
4+
<Tab title="OpenAPI">
5+
6+
```yaml title="generators.yml"
7+
# Your API definition
8+
api:
9+
specs:
10+
- openapi: ./openapi-1.yml
11+
12+
# SDK generators
13+
groups:
14+
ts-sdk:
15+
generators:
16+
- name: fernapi/fern-typescript-sdk
17+
version: <Markdown src="/snippets/version-number-ts.mdx"/>
18+
github:
19+
repository: your-organization/typescript-sdk-repo # Location of TypeScript SDK
20+
21+
python-sdk:
22+
generators:
23+
- name: fernapi/fern-python-sdk
24+
version: <Markdown src="/snippets/version-number-python.mdx"/>
25+
github:
26+
repository: your-organization/python-sdk-repo # Location of Python SDK
27+
```
28+
</Tab>
29+
<Tab title="Fern Definition">
30+
31+
```yaml title="generators.yml"
32+
# No API reference needed – Fern auto-detects spec
33+
34+
# SDK generators
35+
groups:
36+
ts-sdk:
37+
generators:
38+
- name: fernapi/fern-typescript-sdk
39+
version: <Markdown src="/snippets/version-number-ts.mdx"/>
40+
github:
41+
repository: your-organization/typescript-sdk-repo # Location of TypeScript SDK
42+
43+
python-sdk:
44+
generators:
45+
- name: fernapi/fern-python-sdk
46+
version: <Markdown src="/snippets/version-number-python.mdx"/>
47+
github:
48+
repository: your-organization/python-sdk-repo # Location of Python SDK
49+
```
50+
</Tab>
51+
</Tabs>

0 commit comments

Comments
 (0)