Skip to content

Commit 0198cdc

Browse files
committed
fill out python qs, make some changes to snippets
1 parent d53dc52 commit 0198cdc

File tree

5 files changed

+57
-46
lines changed

5 files changed

+57
-46
lines changed

fern/products/sdks/overview/python/quickstart.mdx

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,37 +12,16 @@ Generate a Python SDK by following the instructions on this page.
1212

1313
### Initialize the Fern Folder
1414

15-
You can use either the OpenAPI definition, AsyncAPI definition, or Fern Definition to generate your SDK.
15+
You can use either the OpenAPI definition, AsyncAPI definition, or Fern
16+
Definition to generate your SDK.
1617

1718
<AccordionGroup>
18-
<Accordion title="Option 1: OpenAPI">
1919
<Markdown src="/products/sdks/snippets/option-1-openapi.mdx"/>
20-
</Accordion>
2120

22-
<Accordion title="Option 2: AsyncAPI">
2321
<Markdown src="/products/sdks/snippets/option-2-asyncapi.mdx"/>
24-
</Accordion>
2522

26-
<Accordion title="Option 3: Fern Definition">
2723
<Markdown src="/products/sdks/snippets/option-3-fern-def.mdx"/>
2824

29-
1. Add the config option `outputSourceFiles: true` to `generators.yml`. This ensures your SDK contains `.py` files instead of compiled output.
30-
31-
```yaml {11-12}
32-
# yaml-language-server: $schema=https://schema.buildwithfern.dev/generators-yml.json
33-
default-group: local
34-
groups:
35-
local:
36-
generators:
37-
- name: fernapi/fern-typescript-node-sdk
38-
output:
39-
location: local-file-system
40-
path: ../sdks/typescript
41-
version: <Markdown src="/snippets/version-number.mdx"/>
42-
config:
43-
outputSourceFiles: true
44-
```
45-
</Accordion>
4625
</AccordionGroup>
4726

4827
<Markdown src="/products/sdks/snippets/pass-fern-check.mdx"/>

fern/products/sdks/snippets/generate-sdk.mdx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@
33
Generate the SDK:
44

55
```bash
6-
fern generate --group sdk
7-
```
6+
fern generate --group sdk```
87
This creates a `sdks` folder in your current directory. The resulting folder structure looks like this:

fern/products/sdks/snippets/option-1-openapi.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<Accordion title="Option 1: OpenAPI">
12
Initialize the Fern folder using your OpenAPI Specification. Run one of the following commands based on your spec's location.
23

34
<Tip>
@@ -33,4 +34,5 @@
3334
├─ generators.yml # generators you're using
3435
└─ openapi/
3536
├─ openapi.yml # API-level configuration
36-
```
37+
```
38+
</Accordion>

fern/products/sdks/snippets/option-2-asyncapi.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<Accordion title="Option 2: AsyncAPI">
12
Initialize the Fern folder using your AsyncAPI Specification. Run one of the following commands based on your spec's location.
23

34
<Tip>
@@ -33,4 +34,5 @@
3334
├─ generators.yml # generators you're using
3435
└─ openapi/
3536
├─ openapi.yml # API-level configuration
36-
```
37+
```
38+
</Accordion>
Lines changed: 48 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,55 @@
1+
<Accordion title="Option 3: Fern Definition">
12
1. Initialize the Fern folder using the Fern Definition by running the following command:
23

3-
```bash
4-
fern init --organization <YourOrganization>
5-
```
4+
```bash
5+
fern init --organization <YourOrganization>
6+
```
67

7-
<Info>
8-
`--organization <YourOrganization>` configures your organization name in `fern.config.json`. This is required in order to successfully generate your SDK.
9-
</Info>
8+
<Info> `--organization <YourOrganization>` configures your organization
9+
name in `fern.config.json`. This is required in order to successfully
10+
generate your SDK. </Info>
1011

11-
This creates a `fern` folder in your current directory with the Fern Definition.
12+
This creates a `fern` folder in your current directory with the Fern Definition.
1213

13-
```bash
14-
fern/
15-
├─ fern.config.json # root-level configuration
16-
├─ generators.yml # generators you're using
17-
└─ definition/
18-
├─ api.yml # API-level configuration
19-
└─ imdb.yml # endpoints, types, and errors
20-
```
14+
```bash
15+
fern/
16+
├─ fern.config.json # root-level configuration
17+
├─ generators.yml # generators you're using
18+
└─ definition/
19+
├─ api.yml # API-level configuration
20+
└─ imdb.yml # endpoints, types, and errors
21+
```
2122

22-
<Note>
23-
`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.
24-
</Note>
23+
<Note> `imdb.yml` contains an example movies API. If you’re just
24+
generating an SDK for test purposes, you can leave this file as it is. To
25+
generate an SDK for your own API instead of the example movies API,
26+
replace `imdb.yml` with your own endpoints, types, and errors before
27+
proceeding with the rest of this page. </Note>
2528

26-
{/* TODO: show want generators.yml looks like, link out to configuration.md */}
29+
{/* TODO: show what generators.yml looks like, link out to configuration.md */}
30+
31+
1. Add the config option `outputSourceFiles: true` to
32+
`generators.yml`. This ensures your SDK contains source files in
33+
your designated language instead of compiled output.
34+
35+
```yaml {11-12}
36+
# yaml-language-server: $schema=https://schema.buildwithfern.dev/generators-yml.json
37+
default-group: local
38+
groups:
39+
local:
40+
generators:
41+
- name: fernapi/fern-typescript-node-sdk
42+
output:
43+
location: local-file-system
44+
path: ../sdks/typescript
45+
version: <Markdown src="/snippets/version-number.mdx"/>
46+
config:
47+
outputSourceFiles: true
48+
```
49+
50+
<Note>`fern init` creates a default configuration that includes the
51+
TypeScript Node SDK generator. The `local` group containing this
52+
generator only generates if you run fern generate without specifying a
53+
group, or if you explicitly target it with `fern generate --group
54+
local`. In subsequent steps, you'll add an additional generator for your
55+
preferred SDK language.</Note>

0 commit comments

Comments
 (0)