You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
├─ fern.config.json # Root-level config for entire Fern project
16
16
├─ generators.yml # Defines SDKs and docs to generate
17
17
└─ spec-folder/ # definition, openapi, asyncapi, etc.
18
-
└─ spec-file.yml # API specification file
18
+
└─ spec-file.yml # API definition file
19
19
```
20
20
21
-
<Info>
22
-
For Fern Definition, your API configuration is split across two files: `api.yml` for API-wide configuration and separate `.yml` files for your actual endpoint and type definitions. See [What is a Fern Definition?](/api-definitions/ferndef/overview) for more information.
23
-
24
-
For the other specification formats ([OpenAPI](/api-definitions/openapi/overview), [AsyncAPI](/api-definitions/asyncapi/overview), [OpenRPC](/api-definitions/openrpc/overview), and [gRPC](/api-definitions/grpc/overview)), you'll have a single self-contained specification file.
25
-
</Info>
26
-
27
-
<AccordionGroup>
28
-
<Accordiontitle="What is the fern.config.json file?">
21
+
### `fern.config.json file`
29
22
30
23
Every fern folder has a single `fern.config.json` file. This file stores the organization and
31
24
the version of the Fern CLI that you are using.
32
25
33
-
```json
26
+
```json title="fern.config.json"
34
27
{
35
28
"organization": "your-organization",
36
29
"version": "0.31.2"
@@ -39,35 +32,22 @@ the version of the Fern CLI that you are using.
39
32
40
33
Every time you run a fern CLI command, the CLI downloads itself at the correct version to ensure
41
34
determinism.
42
-
</Accordion>
43
-
<Accordiontitle="What is the generators.yml file?">
44
35
45
-
The `generators.yml` file includes information about where your API definition file is located. It also configures the SDKs you're generating for your API.
36
+
### `generators.yml`
37
+
38
+
The `generators.yml` file includes information about where your API definition file is located. It also [configures the SDKs](/sdks/overview/github) you're generating for your API.
46
39
47
-
```yaml
40
+
```yaml title="generators.yml"
48
41
api:
49
42
path: ./path/to/openapi.yml
50
43
```
51
-
</Accordion>
52
-
</AccordionGroup>
53
44
54
-
## Multiple APIs
45
+
### API definition file
55
46
56
-
The fern folder can house multiple API definitions. When you have multiple APIs, nest your definition files within an `apis` folder.
47
+
For Fern Definition, your API configuration is split across two files: `api.yml` for API-wide configuration and separate `.yml` files for your actual endpoint and type definitions. See [What is a Fern Definition?](/api-definitions/ferndef/overview) for more information.
57
48
58
-
Each API must also have a separate `generators.yml` file that specifies the location of the API definition and configures SDK generation.
49
+
For the other specification formats ([OpenAPI](/api-definitions/openapi/overview), [AsyncAPI](/api-definitions/asyncapi/overview), [OpenRPC](/api-definitions/openrpc/overview), and [gRPC](/api-definitions/grpc/overview)), you'll have a single self-contained specification file.
59
50
60
-
```bash
61
-
fern/
62
-
├─ fern.config.json
63
-
├─ generators.yml # Optional: top-level configuration for all APIs
This separation allows you to manage API definitions centrally while keeping each SDK in its own repository for independent versioning and distribution.
28
28
29
-
<Info>
30
-
For an example of this structure, see Cohere's [fern folder](https://github.com/cohere-ai/cohere-developer-experience/tree/23d6c541a01eb6b54dd9bb3588c805bb0e307713/fern) and [TypeScript](https://github.com/cohere-ai/cohere-typescript) and [Python](https://github.com/cohere-ai/cohere-python) child repositories.
29
+
<Infotitle="Examples">
30
+
See Cohere's [fern folder](https://github.com/cohere-ai/cohere-developer-experience/tree/23d6c541a01eb6b54dd9bb3588c805bb0e307713/fern) and [TypeScript](https://github.com/cohere-ai/cohere-typescript) and [Python](https://github.com/cohere-ai/cohere-python) child repositories.
31
31
</Info>
32
32
33
33
## Core configuration files
34
34
35
-
[Initializing your `fern` folder](/sdks/overview/quickstart) creates two key configuration files:
35
+
The parent repository contains a `fern/` folder that is initialized with your API definitions and a top-level `generators.yml` file.
36
36
37
37
### `fern.config.json`
38
38
39
-
This file stores your organization name and Fern CLI version:
39
+
Every fern folder has a single `fern.config.json` file. This file stores the organization name and the version of the Fern CLI that you are using:
40
40
41
41
```json
42
42
{
@@ -45,40 +45,13 @@ This file stores your organization name and Fern CLI version:
45
45
}
46
46
```
47
47
48
-
### `generators.yml`
49
-
50
-
The `generators.yml` file specifies which SDKs to generate and where to publish them. It acts as the bridge between your API definitions and your SDK repositories.
Your`generators.yml` file contains a group for each SDK and points to the corresponding child repository:
52
+
The`generators.yml` file specifies which SDKs to generate and where to publish them. It acts as the bridge between your API definitions and your SDK repositories. For SDK generation, it contains a group for each SDK and points to the corresponding child repository:
80
53
81
-
```yaml title="generators.yml"
54
+
```yaml
82
55
groups:
83
56
ts-sdk:
84
57
generators:
@@ -95,11 +68,20 @@ groups:
95
68
repository: your-organization/python-sdk-repo
96
69
```
97
70
71
+
<Info title="Examples">
72
+
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).
73
+
</Info>
74
+
75
+
See the [`generators.yml` reference page](/sdks/reference/generators-yml) for complete configuration options.
76
+
77
+
### API definition file
78
+
79
+
For information on how to structure your API definition files, see [Project structure (API Definitions)](/api-definitions/overview/project-structure).
80
+
98
81
## Child repository structure
99
82
100
83
Each SDK has its own repository with the following structure:
0 commit comments