Files
2026-07-07 17:53:33 +08:00

68 KiB

[email protected]

Add Rust codegen for OpenAPI examples

Default to Base UI

Internal packages & templates now use Base UI rather than Radix UI.

[email protected]

Migrate to cnfast

Drop tailwind-merge.

[email protected]

Improve Schema UI tag rendering

Change behaviour for multi-line value in schema tags.

[email protected]

Fix style warning in usage tabs

Fix TypeScript definitions name

The type name now reflect on the actual meaning.

@fuma-docs/openapi

11.0.2

Patch Changes

  • 2b79077: fix missing legacy export

11.0.1

Patch Changes

11.0.0

Major Changes

  • f027706: Unify RSC & client APIs

    • createAPIPage() & createClientAPIPage() unify into createOpenAPIPage():
      • no longer accepts an OpenAPIServer & client option.
      • requires api-page.tsx to be a client component.
      • server should pass page props using page.data.getOpenAPIPageProps() (virtual files) or openapi.preloadOpenAPIPage() (pre-generated files).
    • Remove subpath exports: ui/client.

    Server & loader

    • getSchema() no longer includes the dereferenced document.
    • input: drop the whole-map factory () => SchemaMap. Use a record instead: [k: string]: string | Document | (() => Awaitable<string | Document>).

    Customization callbacks

    More context will be available to callbacks:

    • generateCodeSamples: (method: MethodInformation) → ({ operation, method, pathItem }).
    • renderOperationLayout: (slots, ctx, method) → (slots, { operation, method, pathItem, ctx }).
    • playground.render: method: MethodInformation → ({ operation, method, pathItem }).

    Drop deprecated APIs

    • transformerOpenAPI(): use openapiPlugin() instead.
    • createCodeSample(): use CodeUsageGenerator API instead.
    • generateTypeScriptSchema(): use generateTypeScriptDefinitions() instead.
    • playground.requestTimeout option: use fetchOptions.requestTimeout instead.
    • allowedUrls option: use allowedOrigins or filterRequest instead.
    • groupStyle option: use folderStyle instead.

    Other

    • generateFiles & beforeWrite context: remove documents field, access from the OpenAPI server instead.

Minor Changes

  • 779efff: Introduce new translations API

    It is now powered by fuma-translate. Be careful: while the API surface is same, some translation keys are changed, unused labels will be ignored.

Patch Changes

10.10.3

Patch Changes

  • 4f22826: Improve micro-interaction

10.10.2

Patch Changes

10.10.1

Patch Changes

  • 8eb7782: Support components.Heading in client config

10.10.0

Minor Changes

  • 2305581: Support anchor link for schema UI properties

Patch Changes

  • c5d1619: Deprecate renderHeading option

10.9.1

Patch Changes

10.9.0

Minor Changes

  • 214d5b0: Introduce new translations API

Patch Changes

10.8.6

Patch Changes

10.8.5

Patch Changes

10.8.4

Patch Changes

10.8.3

Patch Changes

10.8.2

Patch Changes

10.8.1

Patch Changes

10.8.0

Minor Changes

  • cfeb2c5: Fix @scalar/api-client-react version as 2.0.2 has a breaking change

Patch Changes

10.7.1

Patch Changes

10.7.0

Minor Changes

  • ccad791: Update min Fumadocs versions requirements

Patch Changes

10.6.8

Patch Changes

10.6.7

Patch Changes

10.6.6

Patch Changes

10.6.5

Patch Changes

  • 94a45da: workaround ajv limitations

10.6.4

Patch Changes

10.6.3

Patch Changes

10.6.2

Patch Changes

10.6.1

Patch Changes

  • d38e641: Support forwarding pure playground cookies with proxy

10.6.0

Minor Changes

  • 9b7b5b5: Support non-RSC environment via createClientAPIPage()

Patch Changes

10.5.0

Minor Changes

  • 0edf9ce: Support meta.json file generation

Patch Changes

10.4.1

Patch Changes

10.4.0

Minor Changes

Patch Changes

10.3.18

Patch Changes

10.3.17

Patch Changes

10.3.16

Patch Changes

10.3.15

Patch Changes

  • 440a7ef: Fix intersection resolution
  • e68700e: fix parameter encoding

10.3.14

Patch Changes

10.3.13

Patch Changes

10.3.12

Patch Changes

10.3.11

Patch Changes

  • 5a9b381: Pass isRequired to FieldSet for parameter enum fields in playground, fixing required enum parameters incorrectly showing an "Unset" option.
  • 21e60c3: support cleaning namespace information
  • Updated dependencies [21e60c3]

10.3.10

Patch Changes

10.3.9

Patch Changes

  • 5537900: allow optional parameter schema

10.3.8

Patch Changes

10.3.7

Patch Changes

10.3.6

Patch Changes

10.3.5

Patch Changes

10.3.4

Patch Changes

10.3.3

Patch Changes

10.3.2

Patch Changes

10.3.1

Minor Changes

  • c03f8c3: Support /ui/base for reduced bundle size

Patch Changes

10.2.7

Patch Changes

10.2.6

Patch Changes

  • 8d1362e: Fixed a performance issue where getSchema() would bypass the internal cache and reparse the OpenAPI spec on every call. This was caused by calling the internal getSchemas() function instead of the cached method.

10.2.5

Patch Changes

10.2.4

Patch Changes

10.2.3

Patch Changes

10.2.2

Patch Changes

10.2.1

Patch Changes

  • 058a46b: Support structuredData in virtual file source
  • 52e84ad: improve schema UI for large unions

10.2.0

Minor Changes

  • a69b060: Support both Base UI and Radix UI as base component libraries

Patch Changes

10.1.4

Patch Changes

  • 90ada4b: Fix example value generation for parameters

10.1.3

Patch Changes

10.1.2

Patch Changes

  • 88150ae: Handle empty summary when generating display name

10.1.1

Patch Changes

  • 25393cd: Fix duplicated security scheme name in requirements
  • 928cc25: Fix wrong option types

10.1.0

Minor Changes

  • 4b2a7e4: Require peer dep of Fumadocs 16.2.0
  • e5c9f7f: Display webhook request examples

Patch Changes

10.0.11

Patch Changes

10.0.10

Patch Changes

10.0.9

Patch Changes

10.0.8

Patch Changes

10.0.7

Patch Changes

10.0.6

Patch Changes

  • e792e43: hotfix recursive oneOf schema UI

10.0.5

Patch Changes

10.0.4

Patch Changes

10.0.3

Patch Changes

10.0.2

Patch Changes

  • 6d0ddb9: fix unset values on number & boolean fields

10.0.1

Patch Changes

10.0.0

Major Changes

  • ccae0ac: Rename option content.showExampleInFields to schemaUI.showExample.

  • 87cdffa: Drop renderer & fields API

    Fumadocs OpenAPI now expects per-feature customizations, dropping the old centralized renderer API.

    // components/api-page.tsx
    import { openapi } from "@/lib/openapi";
    import { createAPIPage } from "fumadocs-openapi/ui";
    
    export const APIPage = createAPIPage(openapi, {
      // e.g. customize render functions
      content: {
        renderResponseTabs,
        renderAPIExampleLayout,
        renderAPIExampleUsageTabs,
      },
    });
    

    For migrating the fields option of Playground, you can use render* APIs on client configs.

    // components/api-page.client.tsx
    'use client';
    import { defineClientConfig } from 'fumadocs-openapi/ui/client';
    
    export default defineClientConfig({
      playground: {
        renderParameterField: (fieldName, field) => ...
      }
    })
    

    You can customize the renderers of different layouts:

    // components/api-page.tsx
    import { openapi } from "@/lib/openapi";
    import { createAPIPage } from "fumadocs-openapi/ui";
    
    export const APIPage = createAPIPage(openapi, {
      content: {
        renderResponseTabs: (tabs) => <div></div>,
        renderAPIExampleLayout: ({ selector, usageTabs, responseTabs }) => (
          <div></div>
        ),
        renderAPIExampleUsageTabs: (generators) => <div></div>,
        renderPageLayout: ({ operations, webhooks }) => <div></div>,
        renderOperationLayout: (slots) => <div></div>,
        renderWebhookLayout: ({
          header,
          authSchemes,
          parameters,
          body,
          responses,
          callbacks,
        }) => <div></div>,
      },
    });
    
  • 40d0fa3: Expect OpenAPI server to use generateFiles()

    File generation is now part of OpenAPI server, the input field requires the server instead of string array.

    Before:

    import { openapi } from "@/lib/openapi";
    
    void generateFiles({
      input: ["./products.yaml"],
      output: "./content/docs",
    });
    

    After:

    import { generateFiles } from "fumadocs-openapi";
    import { openapi } from "@/lib/openapi";
    
    void generateFiles({
      input: openapi,
      output: "./content/docs",
    });
    
  • aa4e1ad: Redesign createOpenAPI usage

    1. Isolate API page and API server.

    Before:

    // lib/openapi.ts
    import { createOpenAPI } from 'fumadocs-openapi/server';
    import path from 'node:path';
    
    export const openapi = createOpenAPI({
      input: [path.resolve('./scalar.yaml')],
      proxyUrl: '/api/proxy',
    
      mediaAdapters: { ... },
      shikiOptions: {
        themes: {
          dark: 'vesper',
          light: 'vitesse-light',
        },
      },
    });
    

    After:

    // lib/openapi.ts
    import { createOpenAPI } from "fumadocs-openapi/server";
    import path from "node:path";
    
    export const openapi = createOpenAPI({
      input: [path.resolve("./scalar.yaml")],
      proxyUrl: "/api/proxy",
    });
    
    // components/api-page.tsx
    import { openapi } from '@/lib/openapi';
    import { createAPIPage } from 'fumadocs-openapi/ui';
    
    export const APIPage = createAPIPage(openapi, {
      mediaAdapters: { ... },
      shikiOptions: {
        themes: {
          dark: 'vesper',
          light: 'vitesse-light',
        },
      },
    });
    
    1. Remove disablePlayground from createAPIPage(), use playground.enabled instead:
    // components/api-page.tsx
    import { openapi } from "@/lib/openapi";
    import { createAPIPage } from "fumadocs-openapi/ui";
    
    export const APIPage = createAPIPage(openapi, {
      playground: {
        enabled: false,
      },
    });
    
    1. Support client config:
    // components/api-page.tsx
    import { openapi } from "@/lib/openapi";
    import { createAPIPage } from "fumadocs-openapi/ui";
    import client from "./api-page.client";
    
    export const APIPage = createAPIPage(openapi, {
      client,
    });
    
    // components/api-page.client.tsx
    "use client";
    import { defineClientConfig } from "fumadocs-openapi/ui/client";
    
    export default defineClientConfig({
      playground: {
        transformAuthInputs: (inputs) => [
          ...inputs,
          {
            fieldName: "auth.tests",
            children: <div>Tests</div>,
            defaultValue: "",
          },
        ],
      },
    });
    
    1. Prefer client config for adapter.client:

    Forwarding client-side media adapters is also done with api-page.client.tsx:

    // components/api-page.tsx
    import { openapi } from "@/lib/openapi";
    import { createAPIPage } from "fumadocs-openapi/ui";
    import { adapters } from "./my-media-adapters";
    import client from "./api-page.client";
    
    export const APIPage = createAPIPage(openapi, {
      client,
      mediaAdapters: adapters,
    });
    
    // components/api-page.client.tsx
    "use client";
    import { defineClientConfig } from "fumadocs-openapi/ui/client";
    import { adapters } from "./my-media-adapters";
    
    export default defineClientConfig({
      mediaAdapters: adapters,
    });
    

Minor Changes

  • 189028a: Add storageKeyPrefix option to isolate localStorage for multiple API instances

    When using multiple createOpenAPI() instances in the same application, the server selection state would bleed between different APIs because they all shared the same storage key prefix. Set a prefix to avoid this.

    Usage:

    // components/api-page.client.tsx
    "use client";
    import { defineClientConfig } from "fumadocs-openapi/ui/client";
    
    export default defineClientConfig({
      storageKeyPrefix: "fumadocs-openapi-custom-",
    });
    

Patch Changes

9.7.3

Patch Changes

9.7.2

Patch Changes

9.7.1

Patch Changes

9.7.0

Minor Changes

9.6.5

Patch Changes

9.6.4

Patch Changes

9.6.3

Patch Changes

  • cc179fb: Generate Python objects for code examples

9.6.2

Patch Changes

9.6.1

Patch Changes

9.6.0

Minor Changes

  • 8ebd28f: Redesign schema UI to leverage CSR

    Fumadocs OpenAPI now uses CSR to render recursive components, hugely reducing the size of page for highly nested JSON schemas & improve performance.

  • ef9737d: Add reset value button to non-required fields

Patch Changes

9.5.0

Minor Changes

  • 5cb199f: Support generating virtual pages for Source API

Patch Changes

9.4.1

Patch Changes

9.4.0

Minor Changes

  • ac8e67d: OpenAPI: Custom request timeout for API playground

Patch Changes

9.3.13

Patch Changes

9.3.12

Patch Changes

9.3.11

Patch Changes

  • 3e7e178: OpenAPI: handle undefined description in index.md generation

9.3.10

Patch Changes

9.3.9

Patch Changes

9.3.8

Patch Changes

9.3.7

Patch Changes

9.3.6

Patch Changes

9.3.5

Patch Changes

9.3.4

Patch Changes

9.3.3

Patch Changes

9.3.2

Patch Changes

9.3.1

Patch Changes

9.3.0

Minor Changes

  • 22371ce: Support index generation in generateFiles: create index files to link all generated pages.

Patch Changes

9.2.3

Patch Changes

9.2.2

Patch Changes

9.2.1

Patch Changes

9.2.0

Minor Changes

  • 2ef7f6b: Introduce input API on createOpenAPI(), unify generateFiles()

    Migration: Move the server object from lib/source to lib/openapi

    import { createOpenAPI } from "fumadocs-openapi/server";
    
    export const openapi = createOpenAPI({
      input: ["./my-schema.json"],
    });
    

    Use the server object for generateFiles():

    import { generateFiles } from "fumadocs-openapi";
    import { openapi } from "@/lib/openapi";
    
    void generateFiles({
      input: openapi,
      output: "./content/docs",
      // we recommend to enable it
      // make sure your endpoint description doesn't break MDX syntax.
      includeDescription: true,
    });
    

Patch Changes

9.1.13

Patch Changes

9.1.12

Patch Changes

  • 8e3c07e: load default examples without lazy loading

9.1.11

Patch Changes

9.1.10

Patch Changes

  • 86c973d: fix(multipart): improve encode logic for multipart/form-data

9.1.9

Patch Changes

  • 790494a: fix(ui): Allow decimal values in number inputs
  • 04a73ea: Remove explicit form data Content-Type

9.1.8

Patch Changes

9.1.7

Patch Changes

9.1.6

Patch Changes

9.1.5

Patch Changes

9.1.4

Patch Changes

9.1.3

Patch Changes

9.1.2

Patch Changes

9.1.1

Patch Changes

9.1.0

Minor Changes

  • b60c8ed: Support Parameter Serialization

    Maybe need to update your code if you've added custom media adapters.

Patch Changes

9.0.18

Patch Changes

  • ae38ed0: Fix Scalar upgrade() is somehow ignored
  • a35597e: Use new codeblock tab style
  • 8f69e33: Always display collapsible for array items

9.0.17

Patch Changes

  • 7328590: OpenAPI: Fix non-undefined values not rendering
  • b606d36: support custom slugify function for generate files

9.0.16

Patch Changes

9.0.15

Patch Changes

9.0.14

Patch Changes

9.0.13

Patch Changes

9.0.12

Patch Changes

  • b1f805a: Parse body optionally in proxy

9.0.11

Patch Changes

9.0.10

Patch Changes

9.0.9

Patch Changes

  • 201235f: Fix trailing slashes being normalized

9.0.8

Patch Changes

9.0.7

Patch Changes

  • 77461e5: Fix root schema manipulation with TypeScript definition generation

9.0.6

Patch Changes

9.0.5

Patch Changes

9.0.4

Patch Changes

  • 9721f6f: Introduce allowedOrigins and filterRequest options to createProxy. Deprecate allowedUrls in favour of new APIs.

9.0.3

Patch Changes

9.0.2

Patch Changes

9.0.1

Patch Changes

  • 2f2ae4d: Disable schema inline on generateFiles()
  • 951a1a4: Support overriding request/response from createProxy()
  • 2f2ae4d: Support code samples without label
  • 2f2ae4d: Hide internal APis since their changes are not documented

9.0.0

Major Changes

  • bdef238: Redesign generateFiles

    This redesign will finalize the behaviour of generateFiles to make it simpler, consistent across different versions of Fumadocs OpenAPI.

    • Abandoned groupByFolder, it's deprecated long time ago and can be replaced with groupBy.
    • Improved type safety, groupBy is now only available with per set to operation.
    • name usage changed (see below).

    The name option was supposed to designate an output path for generated page. Since groupBy was introduced, name became somehow useless because its design doesn't work well with groupBy.

    New name Design:

    It now accepts a function:

    generateFiles({
      input: ["./content/docs/openapi/museum.yaml"],
      output: "./content/docs/openapi/(generated)",
      per: "operation",
      name: (output, document) => {
        // page info
        output.item;
        // parsed OpenAPI schema
        document;
        return "dir/my-file";
      },
    });
    

    You can set algorithm to v1 to keep the behaviour of Fumadocs OpenAPI v8:

    generateFiles({
      input: ["./content/docs/openapi/museum.yaml"],
      output: "./content/docs/openapi/(generated)",
      per: "operation",
      name: {
        algorithm: "v1",
      },
    });
    

    per: operation:

    File name will be identical with your operationId if defined, otherwise fallback to endpoint path or webhook name.

    generateFiles({
      input: ["./content/docs/openapi/museum.yaml"],
      output: "./content/docs/openapi/(generated)",
      per: "operation",
    });
    

    With per: operation, you can use groupBy to group pages:

    • tag: {tag}/{file}
    • route: {endpoint}/{method} (it will ignore the name option)
    • none: {file} (default)

    per: tag | file:

    They are unchanged.

Minor Changes

  • c945b5f: Mark mediaAdapters API stable
  • b0c02a0: Redesign schema display UI

Patch Changes

8.1.12

Patch Changes

8.1.11

Patch Changes

8.1.10

Patch Changes

8.1.9

Patch Changes

8.1.8

Patch Changes

8.1.7

Patch Changes

8.1.6

Patch Changes

8.1.5

Patch Changes

8.1.4

Patch Changes

  • 8c67955: Fix duplications with generateFiles
  • 4b1502e: Improve response type UX
  • 47670c8: Support more JSON schema features

8.1.3

Patch Changes

8.1.2

Patch Changes

8.1.1

Patch Changes

  • 4dbb7fb: tolerate array schema without items type
  • 2625723: Fix infinite rendering on schema
  • bd280c8: Change generated file paths for documents

8.1.0

Minor Changes

  • bb515b7: Display Response in a separate section

Patch Changes

  • 540027e: Support fumadocs-openapi/css/preset.css for Tailwind CSS

    We highly recommend to use the following instead:

    @import "tailwindcss";
    @import "fumadocs-ui/css/neutral.css";
    @import "fumadocs-ui/css/preset.css";
    /* do this */
    @import "fumadocs-openapi/css/preset.css";
    
  • Updated dependencies [3a5595a]

  • Updated dependencies [8c9fc1f]

8.0.3

Patch Changes

8.0.2

Patch Changes

8.0.1

Patch Changes

  • 5a6bf83: fix(#1717): add number type stringify for getPathnameFromInput

8.0.0

Major Changes

  • ff12b53: Move APIPage to fumadocs-openapi/ui

    migrate:

    in your mdx-components.tsx (or where you pass MDX components):

    import defaultComponents from "fumadocs-ui/mdx";
    import { APIPage } from "fumadocs-openapi/ui";
    import { openapi } from "@/lib/source";
    import type { MDXComponents } from "mdx/types";
    
    export function getMDXComponents(components?: MDXComponents): MDXComponents {
      return {
        ...defaultComponents,
        // use this instead
        APIPage: (props) => <APIPage {...openapi.getAPIPageProps(props)} />,
        ...components,
      };
    }
    

    why: Next.js compiles the same module in different layers: route handlers, pages (which include browser bundle), and middleware (Edge Runtime). It avoids compiling React components of fumadocs-openapi twice when you reference the OpenAPI server in a route handler.

Patch Changes

7.0.14

Patch Changes

7.0.13

Patch Changes

7.0.12

Patch Changes

7.0.11

Patch Changes

7.0.10

Patch Changes

7.0.9

Patch Changes

7.0.8

Patch Changes

7.0.7

Patch Changes

7.0.6

Patch Changes

7.0.5

Patch Changes

7.0.4

Patch Changes

7.0.3

Patch Changes

7.0.2

Patch Changes

7.0.1

Patch Changes

7.0.0

Major Changes

  • 190ec35: Auto-update generated API example as user interact with API Playground

Minor Changes

  • 670c179: Support cookie parameters

Patch Changes

7.0.0-beta.0

Major Changes

  • Auto-update generated API example as user interact with API Playground

6.3.0

Minor Changes

  • 70d715d: Added auto-generated comments to top of generated openapi docs files

Patch Changes

6.2.1

Patch Changes

6.2.0

Minor Changes

  • ecf7288: Support OAuth 2.0 in-browser authorize dialog

Patch Changes

6.1.1

Patch Changes

6.1.0

Minor Changes

  • 3d211f3: throw error, when input file is not found

Patch Changes

6.0.11

Patch Changes

6.0.10

Patch Changes

6.0.9

Patch Changes

6.0.8

Patch Changes

6.0.7

Patch Changes

6.0.6

Patch Changes

6.0.5

Patch Changes

6.0.4

Patch Changes

6.0.3

Patch Changes

6.0.2

Patch Changes

6.0.1

Patch Changes

6.0.0

Major Changes

  • 1286a04: Change interface for useScalar

    From:

    import { createOpenAPI } from "fumadocs-openapi/server";
    import { APIPlayground } from "fumadocs-openapi/scalar";
    
    export const openapi = createOpenAPI({
      useScalar: true,
    });
    

    To:

    import { createOpenAPI } from "fumadocs-openapi/server";
    import { APIPlayground } from "fumadocs-openapi/scalar";
    
    export const openapi = createOpenAPI({
      renderer: {
        APIPlayground,
      },
    });
    

Minor Changes

  • 9e02460: Add built-in UI to basic auth input (username:password)

5.12.0

Minor Changes

  • 471478b: Support useScalar option

Patch Changes

5.11.8

Patch Changes

5.11.7

Patch Changes

5.11.6

Patch Changes

5.11.5

Patch Changes

5.11.4

Patch Changes

5.11.3

Patch Changes

  • 35a12cd: Add code sample generation support for variable url

5.11.2

Patch Changes

5.11.1

Patch Changes

5.11.0

Minor Changes

  • 0e8be0e: Support XML request body

Patch Changes

5.10.6

Patch Changes

5.10.5

Patch Changes

5.10.4

Patch Changes

5.10.3

Patch Changes

5.10.2

Patch Changes

5.10.1

Patch Changes

5.10.0

Minor Changes

  • 8aff7f4: Support Route Handler Proxy

Patch Changes

5.9.0

Minor Changes

  • ec5fb2e: Replace @apidevtools/json-schema-ref-parser with @scalar/openapi-parser

Patch Changes

5.8.2

Patch Changes

5.8.1

Patch Changes

5.8.0

Minor Changes

Patch Changes

5.7.5

Patch Changes

5.7.4

Patch Changes

5.7.3

Patch Changes

5.7.2

Patch Changes

5.7.1

Patch Changes

5.7.0

Minor Changes

  • c66df64: OpenAPI: Display the server selector only when more than one server is defined in the OpenAPI schema OpenAPI: Improve APIInfo position for better visibility on smaller screens

5.6.2

Patch Changes

5.6.1

Patch Changes

5.6.0

Minor Changes

  • 196b78b: OpenAPI: Server selector to allow interacting with different API environments

5.5.11

Patch Changes

  • 47fc20e: Fix custom name in apiKey type authorization being ignored

5.5.10

Patch Changes

5.5.9

Patch Changes

5.5.8

Patch Changes

5.5.7

Patch Changes

5.5.6

Patch Changes

5.5.5

Patch Changes

5.5.4

Patch Changes

5.5.3

Patch Changes

  • 35695be: Support multiple tags in OpenAPI groupBy: tag file generation

5.5.2

Patch Changes

5.5.1

Patch Changes

5.5.0

Minor Changes

  • 129923e: Support custom shiki options
  • 160e52e: Support disableCache prop on APIPage

Patch Changes

5.4.14

Patch Changes

5.4.13

Patch Changes

5.4.12

Patch Changes

5.4.11

Patch Changes

5.4.10

Patch Changes

5.4.9

Patch Changes

5.4.8

Patch Changes

5.4.7

Patch Changes

5.4.6

Patch Changes

5.4.5

Patch Changes

5.4.4

Patch Changes

5.4.3

Patch Changes

5.4.2

Patch Changes

  • 3d1ec96: Improve schema fields margins

5.4.1

Patch Changes

  • 029a156: Fix display on property components
  • eb922e1: Support adding description to generated document body

5.4.0

Minor Changes

  • 6cf5535: Persist authorization field

5.3.2

Patch Changes

  • 0b93a31: Support required in allOf schemas

5.3.1

Patch Changes

  • 5660e1e: Fix allOf schema display problem
  • 28bb673: Fix fields styles

5.3.0

Minor Changes

  • 3fa2436: Support Python code sample

Patch Changes

5.2.2

Patch Changes

5.2.1

Patch Changes

5.2.0

Minor Changes

  • 70172f1: Change default value of per to operation

Patch Changes

5.1.0

Minor Changes

  • c7aa090: Generate document field on output MDX files

Patch Changes

5.0.3

Patch Changes

5.0.2

Patch Changes

  • 22549cd: Add authorization properties to examples

5.0.1

Patch Changes

  • 444af27: Fix self-referencing schema types
  • 90af678: Reduce initial loaded bundle size

5.0.0

Major Changes

  • 971817c: Migrate to React Server Component

    The API reference page is now a server component. The MDX generator will only generate a small MDX file, and the rest will be handled by our APIPage component.

    ---
    title: Delete Api
    full: true
    method: POST
    route: /v1/apis.deleteApi
    ---
    
    <APIPage
      operations={[{ path: "/v1/apis.deleteApi", method: "post" }]}
      hasHead={false}
    />
    
    • Markdown/MDX content is still supported, but will be processed in the server component (during runtime) instead.
    • Your Remark/Rehype plugins (e.g. Rehype Code) configured in Fumadocs MDX or other source providers, will not be shared. Fumadocs OpenAPI uses a separate MDX processor instance.
    • APIPage component will fetch the OpenAPI Schema when being rendered. On Vercel, if it relies on the file system, ensure the page will not be re-rendered after build.

    Please refer to documentation for the new usage.

Minor Changes

  • 480d211: Change output path logic
  • 4bf9851: Support to group pages by tags
  • 3874ab5: Support Go Sample Request
  • 3874ab5: Replace Response Table of Tabs

Patch Changes

4.4.2

Patch Changes

4.4.1

Patch Changes

4.4.0

Minor Changes

  • b109e44: Improve generated sample requests

Patch Changes

4.3.1

Patch Changes

  • d987912: Show current request pathname in Playground
  • 0146572: Fix empty params

4.3.0

Minor Changes

  • 5acebdd: Support grouping output by folders (per operation)
  • 744bd24: Support accessing context information on custom frontmatter
  • 6bb9d2d: Support integration with Fumadocs Source API

Patch Changes

4.2.2

Patch Changes

4.2.1

Patch Changes

4.2.0

Minor Changes

  • dfcc61f: Implement multipart form data

Patch Changes

  • f2b540a: Fix fetch problems on API Playground

4.1.1

Patch Changes

4.1.0

Minor Changes

  • abf84bb: Support to customize/disable TypeScript Response generation
  • 40728a1: Support custom fields (auth, query, header, path and body)

Patch Changes

4.0.6

Patch Changes

4.0.5

Patch Changes

4.0.4

Patch Changes

4.0.3

Patch Changes

4.0.2

Patch Changes

4.0.1

Patch Changes

4.0.0

Major Changes

  • ad143e1: Move UI implementation from fumadocs-ui to fumadocs-openapi.

    why: Allow a better organization of packages.

    migrate:

    This package is now Tailwind CSS only, you need to use it in conjunction with the official Tailwind CSS plugin.

    Add the package to content under your Tailwind CSS configuration.

    import { createPreset, presets } from "fumadocs-ui/tailwind-plugin";
    
    /** @type {import('tailwindcss').Config} */
    export default {
      content: [
        "./node_modules/fumadocs-ui/dist/**/*.js",
        "./node_modules/fumadocs-openapi/dist/**/*.js",
      ],
      presets: [createPreset()],
    };
    

    Re-generate MDX files if needed.

Minor Changes

  • ad143e1: Implement OpenAPI playground
  • ad143e1: Support passing base url to Root component

Patch Changes

3.3.0

Minor Changes

  • b1b154e: Display object types mentioned in schema
  • 81fde3f: Support complex types & self-referencing types

3.2.0

Minor Changes

  • 0e420cb: Support generating custom code examples

3.1.3

Patch Changes

  • 464e44c: Improve example request URL generation

3.1.2

Patch Changes

  • 78acd55: Use full mode on docs pages by default on OpenAPI generated pages

3.1.1

Patch Changes

  • 318eaf9: Support generating files per operation

3.1.0

Minor Changes

  • 3bdc786: Support JavaScript request example
  • 3bdc786: Support generating Authorization (security) section

3.0.0

Major Changes

  • 284a571: Renew Generate API.

    why: Improve flexibility.

    migrate:

    Removed the render option from generate, generateFiles and generateTags, use frontmatter to customize frontmatter, imports to customize imports.

  • 284a571: Support Custom MDX Renderer.

    why: Allow people to customize how the MDX file is generated.

    migrate:

    Changed the output of MDX files, the new structure requires components:

    • Root
    • API
    • APIInfo
    • APIExample
    • Responses
    • Response
    • ExampleResponse
    • TypeScriptResponse
    • Property
    • ObjectCollapsible
    • ResponseTypes
    <API>
    
    <APIInfo method={"GET"} route={"/pets/{petId}"}>
    
    ## Info for a specific pet
    
    ### Path Parameters
    
    <Property name={"petId"} type={"string"} required={true} deprecated={false}>
    
    The id of the pet to retrieve
    
    </Property>
    
    | Status code | Description                          |
    | ----------- | ------------------------------------ |
    | `200`       | Expected response to a valid request |
    | `default`   | unexpected error                     |
    
    </APIInfo>
    
    <APIExample>
    
    ```bash title="curl"
    curl -X GET "http://petstore.swagger.io/pets/string"
    ```
    
    <Responses items={["200","default"]}>
    
    <Response value={"200"}>
    
    <ResponseTypes>
    
    <ExampleResponse>
    
    ```json
    {
      "id": 0,
      "name": "string",
      "tag": "string"
    }
    ```
    
    </ExampleResponse>
    
    <TypeScriptResponse>
    
    ```ts
    export interface Response {
      id: number;
      name: string;
      tag?: string;
    }
    ```
    
    </TypeScriptResponse>
    
    </ResponseTypes>
    
    </Responses>
    
    </APIExample>
    
    </API>
    

2.0.5

Patch Changes

2.0.4

Patch Changes

  • 310e0ab: Fix multi-line frontmatter

2.0.3

Patch Changes

  • 1d3917f: Fix nullable types cannot be detected

2.0.2

Patch Changes

2.0.1

Patch Changes

2.0.0

Major Changes

  • eacd7b0b: Remove support for bin usages

    why: It is more flexible and faster to write a script directly.

    migrate: Create a script named scripts/generate-docs.mjs:

    import { generateFiles } from "fumadocs-openapi";
    
    void generateFiles({
      input: ["./petstore.yaml"],
      output: "./content/docs",
    });
    

    Execute it with node ./scripts/generate-docs.mjs.

1.1.0

Minor Changes

  • 8665888: Added patterns support to config Inputs.

1.0.1

Patch Changes

  • 6c5a39a: Rename Git repository to fumadocs

1.0.0

Major Changes

  • 2b11c20: Rename to Fumadocs

    next-docs-zeta -> fumadocs-core

    next-docs-ui -> fumadocs-ui

    next-docs-mdx -> fumadocs-mdx

    @fuma-docs/openapi -> fumadocs-openapi

    create-next-docs-app -> create-fumadocs-app

0.1.0

Minor Changes

  • 45a52ae: Support generating docs for OpenAPI schema

    In openapi.config.js:

    /**
     * @type {import("@fuma-docs/openapi").Config}
     */
    module.exports = {
      input: ["./petstore.yaml"],
      output: "./content/docs",
      per: "tag",
      render: (title, description) => {
        return {
          frontmatter: [
            "---",
            `title: ${title}`,
            `description: ${description}`,
            "toc: false",
            "---",
          ].join("\n"),
        };
      },
    };
    

    Run fuma-docs-openapi to generate.