MCPcopy
hub / github.com/Redocly/redoc

github.com/Redocly/redoc @v2.5.3 sqlite

repository ↗ · DeepWiki ↗ · release v2.5.3 ↗
748 symbols 1,518 edges 214 files 27 documented · 4%
README

Redoc logo

Generate beautiful API documentation from OpenAPI

npm License

bundle size npm jsDelivr status

About Redoc

Redoc is an open source tool for generating documentation from OpenAPI (formerly Swagger) definitions.

By default Redoc offers a three-panel, responsive layout:

  • The left panel contains a search bar and navigation menu.
  • The central panel contains the documentation.
  • The right panel contains request and response examples.

Redoc demo

Live demo

If you want to see how Redoc renders your OpenAPI definition, you can try it out online at https://redocly.github.io/redoc/.

A version of the Swagger Petstore API is displayed by default. To test it with your own OpenAPI definition, enter the URL for your definition and select TRY IT.

Redoc features

  • Responsive three-panel design with menu/scrolling synchronization
  • Support for OpenAPI 3.1, OpenAPI 3.0, and Swagger 2.0
  • Ability to integrate your API introduction into the side menu
  • High-level grouping in side menu with the x-tagGroups specification extension
  • Simple integration with create-react-app
  • Code samples support (with vendor extension)

code samples in action

Usage

Redoc is provided as a CLI tool (also distributed as a Docker image), HTML tag, and React component.

Generate documentation from the CLI

If you have Node installed, quickly generate documentation using npx:

npx @redocly/cli build-docs openapi.yaml

The tool outputs by default to a file named redoc-static.html that you can open in your browser.

Redocly CLI does more than docs; check it out and add linting, bundling, and more to your API workflow.

Add an HTML element to the page

Create an HTML page, or edit an existing one, and add the following within the body tags:

    <redoc spec-url="http://petstore.swagger.io/v2/swagger.json"></redoc>
    <script src="https://cdn.redoc.ly/redoc/latest/bundles/redoc.standalone.js"> </script>

Open the HTML file in your browser, and your API documentation is shown on the page.

Add your own spec-url to the <redoc> tag; this attribute can also be a local file. The JavaScript library can also be installed locally using npm and served from your own server, see the HTML deployment documentation for more details.

More usage options

Check out the deployment documentation for more options, and detailed documentation for each.

Redoc vs. Redocly API Reference

Redoc is Redocly's community-edition product. Looking for something more? We also offer hosted API reference documentation with additional features including:

  • Try-it console
  • Automated code samples
  • Pagination
  • Extra theme options

Documentation and resources

Showcase

A sample of the organizations using Redocly tools in the wild:

Pull requests to add your own API page to the list are welcome

Configuration

Redoc is highly configurable, see the configuration documentation for details.

OpenAPI specification extensions

Redoc uses the following specification extensions:

  • x-logo - is used to specify API logo
  • x-traitTag - useful for tags that refer to non-navigation properties like Pagination, Rate-Limits, etc
  • x-codeSamples - specify operation code samples
  • x-badges - specify operation badges
  • x-examples - specify JSON example for requests
  • x-nullable - mark schema param as a nullable
  • x-displayName - specify human-friendly names for the menu categories
  • x-tagGroups - group tags by categories in the side menu
  • x-servers - ability to specify different servers for API (backported from OpenAPI 3.0)
  • x-additionalPropertiesName - ability to supply a descriptive name for the additional property keys
  • x-summary - for Response object, use as the response button text, with description rendered under the button
  • x-explicitMappingOnly - in Schemas, display a more descriptive property name in objects with additionalProperties when viewing the property list with an object

Releases

The README for the 1.x version is on the v1.x branch.

All the 2.x releases are deployed to npm and can be used with Redocly-cdn: - particular release, for example, v2.0.0: https://cdn.redoc.ly/redoc/v2.0.0/bundles/redoc.standalone.js - latest release: https://cdn.redoc.ly/redoc/latest/bundles/redoc.standalone.js

Additionally, all the 1.x releases are hosted on our GitHub Pages-based CDN (deprecated): - particular release, for example v1.2.0: https://rebilly.github.io/ReDoc/releases/v1.2.0/redoc.min.js - v1.x.x release: https://rebilly.github.io/ReDoc/releases/v1.x.x/redoc.min.js - latest release: https://rebilly.github.io/ReDoc/releases/latest/redoc.min.js - points to latest 1.x.x release since 2.x releases are not hosted on this CDN but on unpkg.

Development

see CONTRIBUTING.md

Extension points exported contracts — how you extend this code

IMenuItem (Interface)
(no doc) [4 implementers]
src/services/types.ts
OpenAPIInfo (Interface)
(no doc) [1 implementers]
src/types/open-api.ts
Element (Interface)
(no doc)
custom.d.ts
ColorSetting (Interface)
(no doc)
src/theme.ts
RedocStandaloneProps (Interface)
(no doc)
src/components/RedocStandalone.tsx
TestCase (Interface)
(no doc)
src/utils/__tests__/openapi.test.ts
CopyButtonWrapperProps (Interface)
(no doc)
src/common-elements/CopyButtonWrapper.tsx
ThemedStyledComponentsModule (Interface)
(no doc)
typings/styled-patch.d.ts

Core symbols most depended-on inside this repo

get
called by 32
src/utils/JsonPointer.ts
replace
called by 32
src/services/HistoryService.ts
isArray
called by 28
src/utils/helpers.ts
argValueToBoolean
called by 28
src/services/RedocNormalizedOptions.ts
add
called by 27
src/services/SearchStore.ts
l
called by 24
src/services/Labels.ts
humanizeNumberRange
called by 19
src/utils/openapi.ts
join
called by 19
src/utils/JsonPointer.ts

Shape

Method 238
Function 228
Class 160
Interface 121
Enum 1

Languages

TypeScript100%

Modules by API surface

src/utils/openapi.ts41 symbols
src/types/open-api.ts28 symbols
src/utils/helpers.ts21 symbols
src/services/models/Operation.ts15 symbols
src/services/RedocNormalizedOptions.ts15 symbols
src/services/MenuStore.ts15 symbols
src/services/models/Schema.ts14 symbols
src/services/MarkdownRenderer.ts14 symbols
src/components/ContentItems/ContentItems.tsx14 symbols
src/services/types.ts13 symbols
src/services/OpenAPIParser.ts13 symbols
src/services/ScrollService.ts12 symbols

Dependencies from manifests, versioned

@cfaester/enzyme-adapter-react-180.8.0 · 1×
@cypress/webpack-preprocessor7.1.0 · 1×
@redocly/openapi-core1.34.15 · 1×
@redocly/workerize-loader1.3.1 · 1×
@size-limit/file11.1.4 · 1×
@types/chai4.2.18 · 1×
@types/dompurify2.2.2 · 1×
@types/enzyme3.10.5 · 1×
@types/enzyme-to-json1.5.3 · 1×
@types/jest29.5.6 · 1×
@types/json-pointer1.0.30 · 1×
@types/lunr2.3.3 · 1×

For agents

$ claude mcp add redoc \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact