Skip to content

Commit 6f3a76d

Browse files
authored
(api definitions) Add manual setup instructions for AsyncAPI (#808)
1 parent 70bc0c2 commit 6f3a76d

File tree

1 file changed

+54
-11
lines changed

1 file changed

+54
-11
lines changed

fern/products/api-def/asyncapi-pages/overview.mdx

Lines changed: 54 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -111,24 +111,67 @@ components:
111111
112112
## Set up your fern folder
113113
114-
<Info> Considering options to generate an AsyncAPI spec? Get live support [here](https://fern-community.slack.com/join/shared_invite/zt-2dpftfmif-MuAegl8AfP_PK8s2tx350Q%EF%BB%BF#/shared-invite/email) </Info>
114+
<Info>
115+
Considering options to generate an AsyncAPI spec? Get live support [here](https://fern-community.slack.com/join/shared_invite/zt-2dpftfmif-MuAegl8AfP_PK8s2tx350Q%EF%BB%BF#/shared-invite/email)
116+
</Info>
115117
116-
Start by initializing your fern folder with an AsyncAPI spec
118+
<Steps>
119+
<Step title="Create your fern directory">
120+
Create a `fern/` folder in your project root.
117121

118-
<CodeGroup>
119-
```sh file
120-
fern init --asyncapi ./path/to/asyncapi
121122
```
122-
```sh url
123-
fern init --asyncapi https://host/path/to/asyncapi
123+
fern/
124+
```
125+
</Step>
126+
<Step title="Add your AsyncAPI specification">
127+
Add your AsyncAPI spec to the fern directory. You can place it in a subfolder called `asyncapi` or directly in the fern directory.
128+
129+
```
130+
fern/
131+
└─ asyncapi/
132+
└─ asyncapi.yml
133+
```
134+
</Step>
135+
<Step title="Create a fern.config.json file">
136+
Add a `fern.config.json` file in your fern directory that lists your organization and the current version of the Fern CLI:
137+
138+
```json title="fern.config.json"
139+
{
140+
"organization": "your-organization",
141+
"version": "0.77.2"
142+
}
124143
```
125-
</CodeGroup>
126144

127-
This will initialize a directory like the following
145+
```
146+
fern/
147+
├─ fern.config.json
148+
└─ asyncapi/
149+
└─ asyncapi.yml
150+
```
151+
</Step>
152+
<Step title="Create a generators.yml file">
153+
Create a `generators.yml` file in your fern directory and add a reference to your AsyncAPI spec:
154+
155+
```yaml title="generators.yml"
156+
# Your API definition
157+
api:
158+
specs:
159+
- asyncapi: ./asyncapi/asyncapi.yml
160+
161+
groups:
162+
external:
163+
generators:
164+
# Your generator configurations here
165+
```
166+
167+
Your final directory structure:
168+
128169
```
129170
fern/
130171
├─ fern.config.json
131172
├─ generators.yml
132173
└─ asyncapi/
133-
├─ asyncapi.yml
134-
```
174+
└─ asyncapi.yml
175+
```
176+
</Step>
177+
</Steps>

0 commit comments

Comments
 (0)