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
You can use either the OpenAPI definition, AsyncAPI definition, or Fern Definition to generate your SDK.
26
16
27
17
<AccordionGroup>
28
-
<Accordiontitle="Option 1: OpenAPI">
29
-
Initialize the Fern folder using your OpenAPI Specification. Run one of the following commands based on your spec's location.
30
-
31
-
<Tip>
32
-
Fern can handle both JSON and YML formats for OpenAPI specifications, and the --openapi flag accepts either format, so you can use whichever format your API spec is available in.
33
-
</Tip>
34
-
35
-
<Info>
36
-
`--organization <YourOrganization>` configures your organization name in `fern.config.json`. This is required in order to successfully generate your SDK.
This creates a `fern` folder in your current directory with the OpenAPI Specification. The exact folder structure might look different depending on your initial input files.
56
-
57
-
```bash
58
-
fern/
59
-
├─ fern.config.json # root-level configuration
60
-
└─ api/ # your API
61
-
├─ generators.yml # generators you're using
62
-
└─ openapi/
63
-
├─ openapi.yml # API-level configuration
64
-
```
65
-
</Accordion>
66
-
<Accordiontitle="Option 2: AsyncAPI">
67
-
Initialize the Fern folder using your AsyncAPI Specification. Run one of the following commands based on your spec's location.
68
-
69
-
<Tip>
70
-
Fern can handle both JSON and YML formats for AsyncAPI specifications, and the --openapi flag accepts either format, so you can use whichever format your API spec is available in.
71
-
</Tip>
72
-
73
-
<Info>
74
-
`--organization <YourOrganization>` configures your organization name in `fern.config.json`. This is required in order to successfully generate your SDK.
This creates a `fern` folder in your current directory with the AsyncAPI Specification. The exact folder structure might look different depending on your initial input files.
94
-
95
-
```bash
96
-
fern/
97
-
├─ fern.config.json # root-level configuration
98
-
└─ api/ # your API
99
-
├─ generators.yml # generators you're using
100
-
└─ openapi/
101
-
├─ openapi.yml # API-level configuration
102
-
```
103
-
</Accordion>
104
-
<Accordiontitle="Option 3: Fern Definition">
105
-
106
-
1. Initialize the Fern folder using the Fern Definition by running the following command:
107
-
108
-
```bash
109
-
fern init --organization <YourOrganization>
110
-
```
111
-
112
-
<Info>
113
-
`--organization <YourOrganization>` configures your organization name in `fern.config.json`. This is required in order to successfully generate your SDK.
114
-
</Info>
115
-
116
-
This creates a `fern` folder in your current directory with the Fern Definition.
117
-
118
-
```bash
119
-
fern/
120
-
├─ fern.config.json # root-level configuration
121
-
├─ generators.yml # generators you're using
122
-
└─ definition/
123
-
├─ api.yml # API-level configuration
124
-
└─ imdb.yml # endpoints, types, and errors
125
-
```
126
-
127
-
<Note>
128
-
`imdb.yml` contains an example movies API. If you’re just generating an SDK for test purposes, you can leave this file as it is. To generate an SDK for your own API instead of the example movies API, replace `imdb.yml` with your own endpoints, types, and errors before proceeding with the rest of this page.
129
-
</Note>
130
-
131
-
{/* TODO: show want generators.yml looks like, link out to configuration.md */}
132
-
133
-
1. Add the config option `outputSourceFiles: true` to `generators.yml`. This ensures your SDK contains `.ts` files instead of compiled output.
Initialize the Fern folder using your OpenAPI Specification. Run one of the following commands based on your spec's location.
3
+
4
+
<Tip>
5
+
Fern can handle both JSON and YML formats for OpenAPI specifications, and the --openapi flag accepts either format, so you can use whichever format your API spec is available in.
6
+
</Tip>
7
+
8
+
<Info>
9
+
`--organization <YourOrganization>` configures your organization name in `fern.config.json`. This is required in order to successfully generate your SDK.
This creates a `fern` folder in your current directory with the OpenAPI Specification. The exact folder structure might look different depending on your initial input files.
0 commit comments