Skip to content

Commit f4c773c

Browse files
docs: document OpenAPI spec auth-gating and path-based multi-API URLs (#6319)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Devin Logan <devinannlogan@gmail.com>
1 parent 62d540c commit f4c773c

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

fern/products/docs/pages/developer-tools/openapi-spec.mdx

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ Every Fern docs site exposes the OpenAPI specification at these paths:
1818
| `/openapi.yaml` | YAML | `application/x-yaml` |
1919
| `/openapi.yml` | YAML | `application/x-yaml` |
2020

21-
The spec includes all endpoints with request/response schemas, authentication schemes (Bearer, Basic, API Key, OAuth), webhooks, type definitions as component schemas, and server URLs from your environment configuration. The [`info.version`](/learn/api-definitions/openapi/extensions/api-version) field from your source spec is preserved as-is, including non-SemVer formats like CalVer. The spec is generated from the same API definition that powers your docs, so it's always up to date.
21+
The spec includes your endpoints with request/response schemas, authentication schemes (Bearer, Basic, API Key, OAuth), webhooks, type definitions as component schemas, and server URLs from your environment configuration. The [`info.version`](/learn/api-definitions/openapi/extensions/api-version) field from your source spec is preserved as-is, including non-SemVer formats like CalVer. The spec is generated from the same API definition that powers your docs, so it's always up to date.
22+
23+
<Info>
24+
Endpoints and API references marked `hidden: true` are excluded.
25+
</Info>
2226

2327
## Usage
2428

@@ -32,9 +36,14 @@ curl https://your-docs-site.com/openapi.json
3236
curl https://your-docs-site.com/openapi.yaml
3337
```
3438

35-
If your docs site includes multiple API definitions, the endpoint returns a listing of available APIs. Use the `api` query parameter to select a specific one:
39+
If your docs site includes multiple API definitions, the endpoint returns a listing of available APIs. To select a specific one, use the path-based form, which serves the spec directly and is CDN-friendly:
3640

3741
```bash
38-
# Get a specific API's spec
39-
curl https://your-docs-site.com/openapi.json?api=my-api-id
42+
curl https://your-docs-site.com/openapi/my-api-id.json
4043
```
44+
45+
The `my-api-id` segment resolves against an API's slug, title, or UUID.
46+
47+
<Note>
48+
If your docs site has password or SSO authentication configured, the spec endpoints inherit that authentication and return `401` to unauthenticated requests.
49+
</Note>

0 commit comments

Comments
 (0)