489 Commits
Author SHA1 Message Date
Fuma Nama 4abdb050e4 refactor: use cnfast 2026-06-25 23:54:29 +08:00
Fuma Nama 0bc31df324 fix(openapi): improve Schema UI tag rendering 2026-06-24 22:17:12 +08:00
Fuma Nama 23c00f2211 fix(openapi): fix typescript definitions name 2026-06-20 20:42:14 +09:00
Fuma Nama 4fe2821cbb fix(openapi): fix usage tabs 2026-06-20 10:25:04 +09:00
Fuma Nama 2b7907710b fix(openapi): missing legacy export 2026-06-12 12:16:36 +08:00
Fuma Nama 5d981ab540 docs: migration guide for OpenAPI v11 2026-06-11 01:18:26 +08:00
Fuma Nama 0415b4ad6a breaking(openapi): drop other deprecated APIs 2026-06-11 01:18:26 +08:00
Fuma Nama 7285343f90 feat(openapi): keep more legacy options 2026-06-10 16:28:55 +08:00
Fuma Nama e8d6cc3048 feat(openapi): backward compat with <APIPage /> 2026-06-10 14:44:54 +08:00
Fuma Nama 3257e4a382 feat(asyncapi): show traits & bindings correctly 2026-06-09 19:50:48 +08:00
Fuma Nama 81a1f6473e feat(asyncapi): better UI 2026-06-09 00:37:08 +08:00
Fuma NamaandFuma Nama 7567916791 breaking(*): new translations system 2026-06-08 20:05:08 +08:00
Fuma NamaandFuma Nama 3e847746c7 docs: update docs for OpenAPI 2026-06-07 20:08:57 +08:00
Fuma NamaandFuma Nama 97c6309729 chore: clean deps 2026-06-07 20:08:57 +08:00
Fuma NamaandFuma Nama bb59540622 feat(openapi): support generate file API with non-RSC usage 2026-06-07 20:08:57 +08:00
Fuma NamaandFuma Nama 0ca9dbe1fe perf(openapi): only dereference at render 2026-06-07 20:08:57 +08:00
Fuma NamaandFuma Nama 820cef2b2f refactor(openapi): simplify client structure 2026-06-07 20:08:57 +08:00
Fuma NamaandFuma Nama 2d2c65de8f refactor: migrate old usage 2026-06-07 20:08:57 +08:00
Fuma NamaandFuma Nama ece63dc0b4 refactor(openapi): extract json-schema logics into uitls 2026-06-07 20:08:57 +08:00
Fuma NamaandFuma Nama f0277063d1 breaking(openapi): unify client API 2026-06-07 20:08:57 +08:00
Fuma NamaandFuma Nama 0b2650b403 refactor(openapi): add asyncapi types 2026-06-07 20:08:57 +08:00
Fuma Nama 0155ff608f fix lint 2026-06-04 22:06:44 +08:00
Fuma Nama 4f22826708 chore: Improve micro-interaction 2026-06-04 17:43:25 +08:00
Fuma Nama 2771e34d70 fix(openapi): reduce package size 2026-06-03 21:00:02 +08:00
Fuma Nama beb94bbf1d fix(openapi): improve performance 2026-06-03 19:25:20 +08:00
Fuma Nama 8eb7782915 feat(openapi): support components.Heading in client config 2026-06-03 19:12:35 +08:00
Fuma Nama c5d16192ab feat(openapi): better Webhook UI 2026-06-02 17:48:58 +08:00
23055816e6 feat(openapi): anchor links for request/response/parameter properties (#3327)
* feat(openapi): anchor links on schema properties

Each property rendered inline in a request body, response body, or parameter
now gets a stable id and a hover-revealed link icon, enabling deep links to
specific fields from guides. Ids follow:
  - body-<prop> for request bodies
  - response-<status>-<prop> for responses
  - parameters-<location>-<name> for parameters

A new idPrefix option on SchemaUI opts other Schema renderings into the same
behavior. See fuma-nama/fumadocs#3322.

* feat(openapi): deep-link nested schema properties

Extend the property anchor scheme to support hashes that point inside a
popover or below an array's "Show array" collapsible. Schema-internal
segments are joined with `.` so `#body.user.address.street` resolves
unambiguously regardless of dashes in property names.

On hash match, the inline anchor scrolls into view, the matching popover
auto-opens with its breadcrumb pre-navigated, the array collapsible
expands, and oneOf/anyOf tabs switch to the variant containing the
targeted field. The deep target is consumed after the first auto-open,
so subsequent user clicks on the same trigger get the base view; a
different deep hash re-arms it.

The hover anchor is now a copy-link button (matches fumadocs heading
anchors) that writes the full URL to the clipboard and updates the
address bar via history.replaceState (no hashchange, no popover reset).

* address PR review feedback

- Clarified the changeset: split anchor ID rules by context (request/response property paths vs flat parameter anchors) so dots aren't implied to apply to parameters.
- Namespaced anchors by media type when an operation has multiple request-body or response content types: prefix becomes `<media-slug>-body` / `response-<status>-<media-slug>`, and the content-type SelectTabs auto-switches to the targeted tab when a deep link arrives. Single-content-type operations keep the simple `body` / `response-<status>` form.
- Made findUnionPropMatch validate the *full* remaining path (via new pathResolves helper) so two variants that share the first prop name no longer race; the wrong tab can't be selected for a deep hash anymore.
- Reset SchemaUIPopover breadcrumb state when initialPath changes so a fresh deep hash takes effect on an already-open popover.
- Replaced the lossy slugifyPropertyName with encodeURIComponent (plus % encoding for `.`) so property anchors stay collision-safe across case-only differences, punctuation-only differences, and non-ASCII keys, while `.` remains exclusively a path separator.

* address PR review feedback

- Fix potential hydration mismatch in useTabValueFromHash by initializing state with the fallback value and resolving from the URL hash inside useEffect; the deep-linked tab now corrects after hydration on the client.

* fix(openapi): move useTabValueFromHash into a client component

The previous hydration-mismatch fix put `useEffect`/`useState` directly in
`operation/index.tsx`, which is a Server Component — Next refused to compile
because RSC modules can't import client-only React APIs. Extract the
hash-aware tab wrapper into `operation/hash-tabs.tsx` (with `"use client"`)
and switch both body and response sites to `HashAwareSelectTabs`. The parent
tree stays server-side; only the tab wrapper hydrates on the client.

* address PR review feedback

- Wrap decodeURIComponent in try/catch in both deep-link hash parsers so a malformed percent-encoded fragment (e.g. `#body%`) is treated as "no target" instead of throwing URIError and breaking tab / popover resolution.

* address PR review feedback

- Match the URL hash against DOM ids using the raw fragment first, with the fully-decoded form as a fallback, in both DeepLinkProvider and hash-tabs. Property anchors are generated via slugifyPropertyName (which percent-encodes reserved chars like `.`), so DOM ids contain the encoded form; decoding the hash before lookup caused links like `#body.foo%2Ebar` to miss the matching element.

* redesign

* fix types

---------

Co-authored-by: Fuma Nama <[email protected]>
2026-06-02 03:43:01 +08:00
Fuma Nama ee98724b9a fix(openapi): newer scalar client 2026-05-28 16:38:17 +08:00
Fuma Nama 5d579bdfac fix(openapi): improve loader API types 2026-05-27 19:27:48 +08:00
Fuma Nama 66679e2c28 fix(ui): strict types 2026-05-20 22:34:26 +08:00
Fuma Nama 313187420f feat(openapi): add missing labels 2026-05-20 20:46:37 +08:00
Fuma Nama a35da15f56 docs: use new i18n API 2026-05-20 20:22:12 +08:00
Fuma Nama 15a139a4cd OpenAPI: expose proxy types 2026-05-18 22:39:10 +08:00
Fuma Nama 4fa2013cde Chore: bump deps 2026-05-18 19:44:58 +08:00
Fuma Nama 975b530af3 OpenAPI: Add Source API methods & Dynamic Source support to server 2026-05-18 19:42:18 +08:00
d4c78e4aef OpenAPI: render deprecated badge for deprecated operations (#3281)
* OpenAPI: render deprecated badge for deprecated operations

Show a yellow "Deprecated" badge for any OpenAPI operation marked
`deprecated: true`. The badge appears in two places: inline with the
operation heading when `showTitle` is true, and as a standalone header
above the playground card when `showTitle` is false (which is the
default for individual operation pages generated by `openapiSource`).

This restores the behaviour originally added in #2417, which was lost
during the v9→v10 move of the operation renderer from
`packages/openapi/src/render/operation/index.tsx` to
`packages/openapi/src/ui/operation/index.tsx`. The parameter-level,
schema-property-level and auth-scheme-level deprecated badges all
survived the refactor; the operation-level one was silently dropped.

The example spec's `deletePlanet` operation already claimed in its
description to be deprecated but never set the flag (inherited from the
upstream Scalar Galaxy fixture). Setting it both fixes the
inconsistency and provides a visible demo for the new badge.

* OpenAPI: improve operation deprecation styles

---------

Co-authored-by: Fuma Nama <[email protected]>
2026-05-14 17:18:41 +08:00
Fuma Nama 0f08ca4a08 OpenAPI: clean code 2026-05-09 22:00:36 +08:00
Fuma Nama e89fd74ebc OpenAPI: fix hydration errors 2026-05-09 16:30:59 +08:00
Fuma Nama 970b1bffd0 OpenAPI: fix inconsistency in option names 2026-04-27 20:39:30 +08:00
Fuma Nama 6c772494fa Docs: introduce Local MD 2026-04-20 17:25:36 +08:00
Fuma Nama d10688d4fc Chore: keep legacy types for backward compat 2026-04-20 15:13:17 +08:00
Fuma Nama c0f4d1a207 Bump deps 2026-04-19 22:23:53 +08:00
Fuma Nama 1ecb7ae448 OpenAPI: expose more types 2026-04-16 17:39:38 +08:00
Fuma Nama ccad791959 Chore: reduce more deps 2026-04-13 21:56:28 +08:00
Fuma Nama 9518cc8b40 OpenAPI: remove openapi-sampler dep 2026-04-12 14:47:29 +08:00
Fuma Nama 335b9c1076 Chore: bundle more deps 2026-04-12 14:34:44 +08:00
Fuma Nama 8462aa6245 OpenAPI: Support displaying response results of different mime types 2026-04-07 15:56:03 +08:00
Fuma Nama f15e322867 OpenAPI: improve Auth UI 2026-04-04 22:42:40 +08:00
Fuma Nama 94a45da98a OpenAPI: workaround ajv limitations 2026-04-03 18:39:00 +08:00