Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions fern/products/api-def/asyncapi-pages/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,13 @@ fern/
└─ asyncapi.yml
```
</Step>
<Step title="Create a fern.config.json file">
<Step title="Create a `fern.config.json` file">
Add a `fern.config.json` file in your fern directory that lists your organization and the current version of the Fern CLI:

```json title="fern.config.json"
{
"organization": "your-organization",
"version": "0.77.2"
"version": "<Markdown src="/snippets/version-number-cli.mdx" />"
}
```

Expand All @@ -149,7 +149,7 @@ fern/
└─ asyncapi.yml
```
</Step>
<Step title="Create a generators.yml file">
<Step title="Create a `generators.yml` file">
Create a `generators.yml` file in your fern directory and add a reference to your AsyncAPI spec:

```yaml title="generators.yml"
Expand Down
64 changes: 55 additions & 9 deletions fern/products/api-def/grpc-pages/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -162,23 +162,69 @@ enum ChatMessageType {
<Info> Need help getting started with gRPC and Fern? Get live support [here](https://fern-community.slack.com/join/shared_invite/zt-2dpftfmif-MuAegl8AfP_PK8s2tx350Q%EF%BB%BF#/shared-invite/email) </Info>


Start by initializing your fern folder with a gRPC service

<CodeGroup>
```sh protobuf
fern init --proto ./path/to/service.proto
<Steps>
<Step title="Create your fern directory">
Create a `fern/` folder in your project root.

```
fern/
```
</Step>
<Step title="Add your gRPC service">
Add your gRPC files to the fern directory. You can place it in a subfolder called `proto` or directly in the fern directory.

```
fern/
└─ proto/
├─ user_service.proto
└─ common.proto
```
```sh directory
fern init --proto-directory ./path/to/proto/files
</Step>
<Step title="Create a `fern.config.json` file">
Add a `fern.config.json` file in your fern directory that lists your organization and the current version of the Fern CLI:

```json title="fern.config.json"
{
"organization": "your-organization",
"version": "<Markdown src="/snippets/version-number-cli.mdx" />"
}
```
</CodeGroup>

This will initialize a directory like the following
```
fern/
├─ fern.config.json
└─ proto/
├─ user_service.proto
└─ common.proto
```
</Step>
<Step title="Create a `generators.yml` file">
Create a `generators.yml` file in your fern directory and add a reference to your gRPC proto files:

```yaml title="generators.yml"
# Your API definition
api:
specs:
- proto:
root: ./proto
target: ./proto/user_service.proto

groups:
external:
generators:
# Your generator configurations here
```

Your final directory structure:

```
fern/
├─ fern.config.json
├─ generators.yml
└─ proto/
├─ user_service.proto
└─ common.proto
```
```
</Step>
</Steps>
61 changes: 51 additions & 10 deletions fern/products/api-def/openrpc-pages/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -146,22 +146,63 @@ components:

<Info> Considering options to generate an OpenRPC spec? Get live support [here](https://fern-community.slack.com/join/shared_invite/zt-2dpftfmif-MuAegl8AfP_PK8s2tx350Q%EF%BB%BF#/shared-invite/email) </Info>

Start by initializing your fern folder with an OpenRPC spec
<Steps>
<Step title="Create your fern directory">
Create a `fern/` folder in your project root.

<CodeGroup>
```sh file
fern init --openrpc ./path/to/openrpc
```
```sh url
fern init --openrpc https://host/path/to/openrpc
fern/
```
</Step>
<Step title="Add your OpenRPC specification">
Add your OpenRPC spec to the fern directory. You can place it in a subfolder called `openrpc` or directly in the fern directory.

```
fern/
└─ openrpc/
└─ openrpc.yml
```
</Step>
<Step title="Create a `fern.config.json` file">
Add a `fern.config.json` file in your fern directory that lists your organization and the current version of the Fern CLI:

```json title="fern.config.json"
{
"organization": "your-organization",
"version": "<Markdown src="/snippets/version-number-cli.mdx" />"
}
```
</CodeGroup>

This will initialize a directory like the following
```
fern/
├─ fern.config.json
└─ openrpc/
└─ openrpc.yml
```
</Step>
<Step title="Create a `generators.yml` file">
Create a `generators.yml` file in your fern directory and add a reference to your OpenRPC spec:

```yaml title="generators.yml"
# Your API definition
api:
specs:
- openrpc: ./openrpc/openrpc.yml

groups:
external:
generators:
# Your generator configurations here
```

Your final directory structure:

```
fern/
├─ fern.config.json
├─ generators.yml
└─ openrpc/
├─ openrpc.yml
```
└─ openrpc.yml
```
</Step>
</Steps>