11---
2- title : Overview of the Fern Folder
2+ title : Set up the Fern Folder
33description : Describes the Fern folder structure
44---
55
@@ -9,47 +9,39 @@ your API definitions, generators, and your CLI version.
99After you configure your ` fern ` folder, you'll be ready to start generating SDKs
1010in different languages.
1111
12- ## Directory structure
12+ ## Set up the fern folder
1313
14- You can initialize your Fern folder with either a Fern Definition or OpenAPI specification.
14+ < Steps >
1515
16- <Info >
17- You can always convert a Fern Definition to OpenAPI or OpenAPI to a Fern Definition later on.
18- </Info >
16+ <Markdown src = " /products/sdks/snippets/install-cli.mdx" />
17+
18+ ### Initialize the Fern Folder
19+
20+ <Markdown src = " /products/sdks/snippets/initialize-fern-folder-intro.mdx" />
21+
22+ <AccordionGroup >
23+ <Markdown src = " /products/sdks/snippets/option-1-openapi.mdx" />
1924
20- The ` fern ` directory is initialized with:
25+ <Accordion title = " Option 2: Fern Definition" >
26+
27+ <Markdown src = " /products/sdks/snippets/option-2-fern-def.mdx" />
28+ </Accordion >
29+
30+ { /* <Markdown src="/products/sdks/snippets/option-3-asyncapi.mdx"/> */ }
31+
32+ </AccordionGroup >
33+ </Steps >
34+
35+ ## Learn more about the initialized files
36+
37+ Every initialized ` fern ` directory has:
2138* A ` fern.config.json ` file
2239* A ` generators.yml ` file
23- * Either a ` definition/ ` (for a Fern Definition spec) or ` openapi/ ` (for an OpenAPI spec) directory that contains your API specification files.
24-
25- <AccordionGroup >
26- <Accordion title = " Initializing with the Fern Definition" >
27- When you run ` fern init ` , your Fern folder will be initialized with the following files:
28- ``` bash
29- fern/
30- ├─ fern.config.json
31- ├─ generators.yml
32- └─ definition/
33- ├─ api.yml
34- └─ imdb.yml
35- ```
36- </Accordion >
37- <Accordion title = " Initializing with OpenAPI" >
38- If you want to initialize Fern with an OpenAPI Specification, run ` fern init --openapi path/to/openapi ` instead.
39- ``` yaml
40- fern/
41- ├─ fern.config.json
42- ├─ generators.yml # required on Fern version 0.41.0 and above
43- └─ openapi/
44- ├─ openapi.yml
45- ```
46- </Accordion >
47- </AccordionGroup >
4840
4941### ` fern.config.json `
5042
51- Every fern folder has a single ` fern.config.json ` file. This file stores the organization and
52- the version of the Fern CLI that you are using.
43+ This file stores the organization and the version of the Fern CLI that you are
44+ using.
5345
5446``` json
5547{
@@ -70,9 +62,13 @@ API specification. For each generator, it specifies where the package is
7062published and configures customizations like package metadata, output locations,
7163and generation settings.
7264
73- ## Configuring Multiple APIs
65+ <Info >
66+ See the [ ` generators.yml ` reference page] ( /learn/sdks/reference/generators-yml-reference ) for more information.
67+ </Info >
68+
69+ ## Configure Multiple APIs
7470
75- The Fern folder can house multiple API definitions. Instead of placing your API
71+ The fern folder can house multiple API definitions. Instead of placing your API
7672definitions at the top level, you can nest them within an ` apis ` folder. Be sure
7773to include a ` generators.yml ` file within each API folder that specifies the
7874location of the API definition.
0 commit comments