Skip to content

Commit a71eaa3

Browse files
docs: change to openapi-focused readme (#22)
1 parent 12ba0cc commit a71eaa3

File tree

2 files changed

+31
-18
lines changed

2 files changed

+31
-18
lines changed

README.md

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<br/>
22
<div align="center">
3-
<a href="https://www.buildwithfern.com/?utm_source=github&utm_medium=readme&utm_campaign=docs-starter&utm_content=logo">
3+
<a href="https://www.buildwithfern.com/?utm_source=github&utm_medium=readme&utm_campaign=docs-starter-openapi&utm_content=logo">
44
<img src="/fern/docs/assets/logo_light_mode.png" height="50" align="center" alt="header" />
55
</a>
66

77
<br/>
88

99
# Docs Starter
1010

11-
Create beautiful documentation in under 5 minutes. Here's [an example!](https://petstore-openapi.docs.buildwithfern.com)
11+
Create beautiful documentation in under 5 minutes using an OpenAPI/Swagger specification. Here's [an example!](https://petstore-openapi.docs.buildwithfern.com)
1212

1313
[![Discord](https://img.shields.io/badge/Join%20Our%20Community-black?logo=discord)](https://discord.com/invite/JkkXumPzcG)
1414

@@ -28,6 +28,8 @@ Your docs can look this good:
2828

2929
## Let's get started
3030

31+
The OpenAPI specification is a language for defining a REST API. OpenAPI (3.x) was previously known as Swagger (2.x) and is a widely used standard for defining RESTful APIs. Fern supports both OpenAPI 3.x and Swagger 2.x.
32+
3133
### Step 1: Use this template
3234

3335
1. Click on the "Use this template" button. You must be logged into GitHub.
@@ -57,39 +59,53 @@ instances:
5759
- url: petstore-openapi.docs.buildwithfern.com
5860
```
5961
60-
6162
### Step 4: Install the Fern CLI
6263
6364
Install the Fern CLI globally by running:
6465
6566
```bash
6667
npm install -g fern-api
6768
```
69+
6870
As this is a global command, you can run it from any location. The CLI commands in the following steps must be run from within your repository.
6971

70-
### Step 5 (Optional): Use an OpenAPI Specification
72+
### Step 5: (Optional) Use your OpenAPI/Swagger specification
7173

72-
If you will be using [Fern Definitions](https://docs.buildwithfern.com/api-definition/fern-definition/overview) to describe your API, skip to [Step 6](#step-6-generate-your-documentation).
74+
If you'd like to use the an example OpenAPI specificaton file, run:
7375

74-
If you will be using the [OpenAPI Specification](https://chat.openai.com/share/47bcc007-17d8-483a-ab5a-91c10c4a73e1) (OAS), follow these steps:
75-
1. Delete the `definition` folder.
76-
2. Run:
76+
```bash
77+
fern init --openapi https://petstore3.swagger.io/api/v3/openapi.json
78+
```
79+
80+
If you'd like to use your own OpenAPI specification file, run:
7781

7882
```bash
7983
fern init --openapi URL_OR_PATH_TO_YOUR_OPENAPI_SPEC
8084
```
8185

86+
You can use a URL to an OAS file online, or you can use a local path. The file must be formatted as JSON or YAML.
87+
8288
Examples:
8389

8490
```fern init --openapi https://petstore3.swagger.io/api/v3/openapi.json```
8591

8692
```fern init --openapi ../apis/openapi.yml```
8793

88-
You can use a URL to an OAS file online, or you can use a local path. The file must be formatted as JSON or YAML.
89-
9094
Confirm that you see a new folder named `openapi` and that it contains the OAS file you specified, in YAML format.
9195

92-
### Step 6: Generate your documentation
96+
*Note: Don't have an OpenAPI spec? Use Fern's simpler format to define your API.* [*Learn more*](https://github.com/fern-api/docs-starter-fern-definition)
97+
98+
### Step 6: Check that your OpenAPI specification is valid
99+
100+
Run the following command to check that your OpenAPI/Swagger specification is valid:
101+
102+
```bash
103+
fern check
104+
```
105+
106+
If you see errors, resolve them in your OpenAPI/Swagger specification file. If you need help, reach out in [Discord](https://discord.com/invite/JkkXumPzcG) or [via email](mailto:support@buildwithfern.com). We're here to help!
107+
108+
### Step 7: Generate your documentation
93109

94110
Generate and publish your documentation with the following command:
95111

@@ -106,11 +122,8 @@ Once the documentation is generated, you will receive a URL where your documenta
106122
│ ✓ petstore-openapi.docs.buildwithfern.com
107123
└─
108124
```
109-
### Step 7: Customize your documentation
110125

111-
To update your API definitions:
112-
- For [Fern Definitions](https://docs.buildwithfern.com/api-definition/fern-definition/overview), update the files in the `definition` folder.
113-
- For OpenAPI Specification, update the file in the `openapi` folder. YAML and JSON file formats are supported.
126+
### Step 8: Customize your documentation
114127

115128
Next, modify the markdown pages located in the `docs/pages` folder, such as the Welcome page.
116129

@@ -122,7 +135,7 @@ To preview updates to your documentation before publishing changes, run `fern ge
122135

123136
Fern has a built-in component library for you to use. [Explore the components.](https://docs.buildwithfern.com/generate-docs/component-library/)
124137

125-
### Step 8: Set up a custom domain
138+
### Step 9: Set up a custom domain
126139

127140
If you wish to use a custom subdomain like `https://docs.YOUR_ORGANIZATION.com` or a subpath like `https://YOUR_ORGANIZATION.com/docs`, you can subscribe to the [Starter plan](https://buildwithfern.com/pricing). Once subscribed, update `docs.yml` with the custom domain configuration:
128141

@@ -131,7 +144,7 @@ If you wish to use a custom subdomain like `https://docs.YOUR_ORGANIZATION.com`
131144
custom-domain: docs.petstore-openapi.com
132145
```
133146
134-
### Step 9: Explore advanced features
147+
### Step 10: Explore advanced features
135148
136149
For advanced documentation features and options, view the full [configuration docs](https://docs.buildwithfern.com/generate-docs/overview/configuration).
137150

fern/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<div align="center">
2-
<a href="https://www.buildwithfern.com/?utm_source=github&utm_medium=readme&utm_campaign=docs-starter&utm_content=logo">
2+
<a href="https://www.buildwithfern.com/?utm_source=github&utm_medium=readme&utm_campaign=docs-starter-openapi&utm_content=favicon">
33
<img src="../favicon.ico" height="50" align="center" alt="header" />
44
</a>

0 commit comments

Comments
 (0)