Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
69 changes: 26 additions & 43 deletions fern/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ai-search:
location:
- docs

title: Plant Store
title: Fern Docs Starter

layout:
searchbar-placement: header
Expand All @@ -19,69 +19,52 @@ tabs:
home:
display-name: Docs
icon: home
guides:
display-name: Guides
icon: book
API Reference:
display-name: API Reference
icon: puzzle

navigation:
- tab: home
layout:
- section: Get Started
- section: Get started
contents:
- page: Welcome
path: docs/pages/welcome.mdx
- tab: guides
layout:
- section: Get started
contents:
- page: Overview
path: docs/pages/get-started/overview.mdx
icon: fa-duotone fa-book-open
- page: Quickstart
path: docs/pages/get-started/quickstart.mdx
icon: fa-duotone fa-rocket
- section: Capabilities
contents:
- page: Plant management
path: docs/pages/capabilities/plant-management.mdx
icon: fa-duotone fa-seedling
- page: Order processing
path: docs/pages/capabilities/order-processing.mdx
icon: fa-duotone fa-cart-shopping
- page: Customer management
path: docs/pages/capabilities/customer-management.mdx
icon: fa-duotone fa-users
- page: Inventory tracking
path: docs/pages/capabilities/inventory-tracking.mdx
icon: fa-duotone fa-boxes-stacked
- section: Tutorials
contents:
- page: Searching for plants
path: docs/pages/tutorials/searching-plants.mdx
icon: fa-duotone fa-magnifying-glass
- page: Creating your first order
path: docs/pages/tutorials/first-order-tutorial.mdx
icon: fa-duotone fa-bag-shopping
- page: Managing plant inventory
path: docs/pages/tutorials/inventory-tutorial.mdx
icon: fa-duotone fa-clipboard-list
icon: fa-duotone fa-house
- page: Edit your docs
path: docs/pages/editing-your-docs.mdx
icon: fa-duotone fa-pen-to-square
- page: Write content
path: docs/pages/writing-content.mdx
icon: fa-duotone fa-file-lines
- page: Set up navigation
path: docs/pages/navigation.mdx
icon: fa-duotone fa-sitemap
- page: Customize your docs
path: docs/pages/customization.mdx
icon: fa-duotone fa-palette
- page: Support
path: docs/pages/support.mdx
icon: fa-duotone fa-headset
- section: Changelog
contents:
- changelog: docs/changelog
- tab: API Reference

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sbawabe want to add:

  • OpenAPI overrides (estimate of 30% of users use it)
  • an AsyncAPI spec (estimate of 10% of users use it)

layout:
- api: API Reference
- section: Overview
contents:
- page: API reference
path: docs/pages/api-reference-overview.mdx
icon: fa-duotone fa-book
- api: Plant Store API

navbar-links:
- type: minimal
text: Fork this repo
Comment thread
sbawabe marked this conversation as resolved.
url: https://github.com/fern-api/docs-starter
- type: filled
text: Get a demo
url: https://buildwithfern.com/contact?utm_campaign=demo&utm_medium=plantstore&utm_source=navbar
text: Dashboard
url: https://dashboard.buildwithfern.com
- type: github
value: https://github.com/fern-api/fern

Expand Down
114 changes: 114 additions & 0 deletions fern/docs/pages/api-reference-overview.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
---
title: API reference
subtitle: Interactive documentation generated from your API specification
slug: api-reference
---

Fern automatically generates interactive API reference documentation from your API specification. This starter template includes a sample Plant Store API to demonstrate the feature.

## Supported specifications

Fern supports multiple API specification formats:

| Format | Description |
|--------|-------------|
| **OpenAPI** | The most widely used REST API specification format (versions 3.0 and 3.1) |
| **AsyncAPI** | For event-driven and message-based APIs |
| **gRPC** | Protocol buffer definitions for gRPC services |
| **Fern Definition** | Fern's native YAML-based API definition format |
Comment thread
sbawabe marked this conversation as resolved.
Outdated

<Note>
This starter template uses an OpenAPI specification. For documentation on other formats, see the [API definitions documentation](https://buildwithfern.com/learn/api-definitions/openapi/overview).
</Note>

## How it works

Place your API specification file in the `fern/` directory and reference it in your `docs.yml` navigation:

```yaml title="docs.yml"
navigation:
- section: Documentation
contents:
- page: Overview
path: docs/pages/overview.mdx
- api: API Reference
```

Fern parses your specification and generates:

- Endpoint documentation with request/response schemas
- Interactive API Explorer for testing endpoints
- Code snippets in multiple languages
- Type definitions and examples

## API Explorer

The API Explorer lets users test API endpoints directly in the documentation. Users can fill in parameters, send requests, and see responses without leaving the page.

<Note>
For advanced API Explorer features like auto-populating API keys, see the [API Explorer documentation](https://buildwithfern.com/learn/docs/api-references/api-explorer/overview).
</Note>

## Customizing the API reference

Control how your API reference appears using the `api` configuration in `docs.yml`:

```yaml title="docs.yml"
navigation:
- api: API Reference
api-name: plantstore
paginated: true
```

You can also add custom content to API reference pages, organize endpoints into groups, and control which endpoints are visible.

<Note>
For detailed customization options, see the [API reference documentation](https://buildwithfern.com/learn/docs/api-references/generate-api-ref).
</Note>

## SDK code snippets

If you generate SDKs with Fern, code snippets automatically appear in your API reference showing how to call each endpoint using your SDK:

```yaml title="generators.yml"
groups:
python-sdk:
generators:
- name: fernapi/fern-python-sdk
version: 4.3.1
output:
location: pypi
package-name: plantstore
```

<Note>
For more information on SDK generation, see the [SDK documentation](https://buildwithfern.com/learn/sdks/overview/introduction).
</Note>

## Explore the Plant Store API

This starter template includes a sample Plant Store API with endpoints for managing plants, orders, and users. Browse the API reference below to see how Fern generates documentation from an OpenAPI specification.

<CardGroup cols={3}>
<Card
title="Plant endpoints"
icon="duotone seedling"
href="/api-reference/plant/addPlant"
>
Add, update, and search plants
</Card>
<Card
title="Store endpoints"
icon="duotone store"
href="/api-reference/store/getInventory"
>
Manage inventory and orders
</Card>
<Card
title="User endpoints"
icon="duotone user"
href="/api-reference/user/loginUser"
>
Authentication and user management
</Card>
</CardGroup>
Comment thread
sbawabe marked this conversation as resolved.
Outdated
77 changes: 0 additions & 77 deletions fern/docs/pages/capabilities/customer-management.mdx

This file was deleted.

93 changes: 0 additions & 93 deletions fern/docs/pages/capabilities/inventory-tracking.mdx

This file was deleted.

Loading