# swagger-api/swagger-ui architecture

> Architecture diagram of the GitHub repository swagger-api/swagger-ui, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/swagger-api/swagger-ui
- Repository: https://github.com/swagger-api/swagger-ui

## Overview

Swagger UI turns an OpenAPI description into interactive API documentation: users browse operations, inspect schemas and examples, authorize, and try requests. The core entry point merges configuration, creates a plugin system, loads or accepts a specification, and renders the UI. Major documented capabilities include OpenAPI 2.0/3.x compatibility, OAuth2, deep linking, and React packaging. Source excerpts establish core initialization, configuration and plugin registration, schema-sample generation, and Docker environment configuration; some feature-level connections are supported by the README rather than sampled implementation.

Main entry points: [`src/core/index.js`](https://github.com/swagger-api/swagger-ui/blob/main/src/core/index.js) (UI entry point), [`src/core/components/operations.jsx`](https://github.com/swagger-api/swagger-ui/blob/main/src/core/components/operations.jsx) (Operations view), [`src/core/plugins/swagger-client`](https://github.com/swagger-api/swagger-ui/tree/main/src/core/plugins/swagger-client) (Swagger client), [`src/core/plugins/json-schema-2020-12`](https://github.com/swagger-api/swagger-ui/tree/main/src/core/plugins/json-schema-2020-12) (Schema views)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Core runtime"]
  node_entry["UI entry point<br/>[index.js]"]
  node_configuration["Configuration<br/>[index.js]"]
  node_system["Plugin system<br/>[system.js]"]
  node_specstate["Spec loading"]
  node_swaggerclient["Swagger client"]
end

subgraph group_spec["Specification views"]
  node_app["Rendered application<br/>[app.jsx]"]
  node_operations["Operations view<br/>[operations.jsx]"]
  node_oas["OpenAPI views"]
  node_schemas["Schema views"]
  node_samples["Example generation<br/>[main.js]"]
end

subgraph group_interaction["API interaction"]
  node_auth["Authorization<br/>[index.js]"]
  node_execute["Try requests<br/>[execute.jsx]"]
  node_responses["Response display<br/>[live-response.jsx]"]
  node_deep["Deep linking"]
  node_filter["Operation filter"]
  node_snippets["Request snippets"]
end

subgraph group_extensions["Integrations"]
  node_react["React wrapper<br/>[index.jsx]"]
  node_docker["Docker config<br/>[index.js]"]
  node_translator["Env translation<br/>[translator.js]"]
end

node_user(("API reader"))
node_openapi["OpenAPI document"]
node_api(("Documented API"))

node_user -->|"opens UI"| node_entry
node_openapi -->|"provides definition"| node_specstate
node_entry -->|"merges options"| node_configuration
node_entry -->|"creates system"| node_system
node_entry -->|"updates or downloads"| node_specstate
node_entry -->|"renders"| node_app
node_entry -->|"registers plugin"| node_oas
node_entry -->|"registers plugin"| node_auth
node_entry -->|"registers plugin"| node_schemas
node_app -->|"presents operations"| node_operations
node_operations -->|"renders API details"| node_oas
node_operations -->|"shows schemas"| node_schemas
node_schemas -->|"shows generated examples"| node_samples
node_user -->|"authorizes"| node_auth
node_user -->|"tries operation"| node_execute
node_execute -.->|"dispatches request"| node_swaggerclient
node_swaggerclient -.->|"sends request"| node_api
node_swaggerclient -.->|"returns response"| node_responses
node_user -->|"navigates links"| node_deep
node_user -.->|"filters operations"| node_filter
node_operations -.->|"offers request snippets"| node_snippets
node_react -->|"packages UI"| node_entry
node_docker -->|"translates environment"| node_translator
node_translator -.->|"produces options"| node_configuration

click node_entry "https://github.com/swagger-api/swagger-ui/blob/main/src/core/index.js"
click node_configuration "https://github.com/swagger-api/swagger-ui/blob/main/src/core/config/index.js"
click node_system "https://github.com/swagger-api/swagger-ui/blob/main/src/core/system.js"
click node_specstate "https://github.com/swagger-api/swagger-ui/tree/main/src/core/plugins/spec"
click node_swaggerclient "https://github.com/swagger-api/swagger-ui/tree/main/src/core/plugins/swagger-client"
click node_app "https://github.com/swagger-api/swagger-ui/blob/main/src/core/components/app.jsx"
click node_operations "https://github.com/swagger-api/swagger-ui/blob/main/src/core/components/operations.jsx"
click node_oas "https://github.com/swagger-api/swagger-ui/tree/main/src/core/plugins/oas3"
click node_schemas "https://github.com/swagger-api/swagger-ui/tree/main/src/core/plugins/json-schema-2020-12"
click node_samples "https://github.com/swagger-api/swagger-ui/blob/main/src/core/plugins/json-schema-2020-12-samples/fn/main.js"
click node_auth "https://github.com/swagger-api/swagger-ui/blob/main/src/core/plugins/auth/index.js"
click node_execute "https://github.com/swagger-api/swagger-ui/blob/main/src/core/components/execute.jsx"
click node_responses "https://github.com/swagger-api/swagger-ui/blob/main/src/core/components/live-response.jsx"
click node_deep "https://github.com/swagger-api/swagger-ui/tree/main/src/core/plugins/deep-linking"
click node_filter "https://github.com/swagger-api/swagger-ui/tree/main/src/core/plugins/filter"
click node_snippets "https://github.com/swagger-api/swagger-ui/tree/main/src/core/plugins/request-snippets"
click node_react "https://github.com/swagger-api/swagger-ui/blob/main/flavors/swagger-ui-react/index.jsx"
click node_docker "https://github.com/swagger-api/swagger-ui/blob/main/docker/configurator/index.js"
click node_translator "https://github.com/swagger-api/swagger-ui/blob/main/docker/configurator/translator.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_entry,node_configuration,node_system,node_specstate,node_swaggerclient toneBlue
class node_app,node_operations,node_oas,node_schemas,node_samples toneAmber
class node_auth,node_execute,node_responses,node_deep,node_filter,node_snippets,node_user,node_openapi,node_api toneMint
class node_react,node_docker,node_translator toneRose
```

## Components

### Core runtime

- [UI entry point](https://github.com/swagger-api/swagger-ui/blob/main/src/core/index.js): `src/core/index.js`
- [Configuration](https://github.com/swagger-api/swagger-ui/blob/main/src/core/config/index.js): `src/core/config/index.js`
- [Plugin system](https://github.com/swagger-api/swagger-ui/blob/main/src/core/system.js): `src/core/system.js`
- [Spec loading](https://github.com/swagger-api/swagger-ui/tree/main/src/core/plugins/spec): `src/core/plugins/spec`
- [Swagger client](https://github.com/swagger-api/swagger-ui/tree/main/src/core/plugins/swagger-client): `src/core/plugins/swagger-client`

### Specification views

- [Rendered application](https://github.com/swagger-api/swagger-ui/blob/main/src/core/components/app.jsx): `src/core/components/app.jsx`
- [Operations view](https://github.com/swagger-api/swagger-ui/blob/main/src/core/components/operations.jsx): `src/core/components/operations.jsx`
- [OpenAPI views](https://github.com/swagger-api/swagger-ui/tree/main/src/core/plugins/oas3): `src/core/plugins/oas3`
- [Schema views](https://github.com/swagger-api/swagger-ui/tree/main/src/core/plugins/json-schema-2020-12): `src/core/plugins/json-schema-2020-12`
- [Example generation](https://github.com/swagger-api/swagger-ui/blob/main/src/core/plugins/json-schema-2020-12-samples/fn/main.js): `src/core/plugins/json-schema-2020-12-samples/fn/main.js`

### API interaction

- [Authorization](https://github.com/swagger-api/swagger-ui/blob/main/src/core/plugins/auth/index.js): `src/core/plugins/auth/index.js`
- [Try requests](https://github.com/swagger-api/swagger-ui/blob/main/src/core/components/execute.jsx): `src/core/components/execute.jsx`
- [Response display](https://github.com/swagger-api/swagger-ui/blob/main/src/core/components/live-response.jsx): `src/core/components/live-response.jsx`
- [Deep linking](https://github.com/swagger-api/swagger-ui/tree/main/src/core/plugins/deep-linking): `src/core/plugins/deep-linking`
- [Operation filter](https://github.com/swagger-api/swagger-ui/tree/main/src/core/plugins/filter): `src/core/plugins/filter`
- [Request snippets](https://github.com/swagger-api/swagger-ui/tree/main/src/core/plugins/request-snippets): `src/core/plugins/request-snippets`

### Integrations

- [React wrapper](https://github.com/swagger-api/swagger-ui/blob/main/flavors/swagger-ui-react/index.jsx): `flavors/swagger-ui-react/index.jsx`
- [Docker config](https://github.com/swagger-api/swagger-ui/blob/main/docker/configurator/index.js): `docker/configurator/index.js`
- [Env translation](https://github.com/swagger-api/swagger-ui/blob/main/docker/configurator/translator.js): `docker/configurator/translator.js`

### Other components

- **API reader**
- **OpenAPI document**
- **Documented API**

## Connections

- API reader → UI entry point: opens UI
- OpenAPI document → Spec loading: provides definition
- UI entry point → Configuration: merges options (evidence: `src/core/index.js`)
- UI entry point → Plugin system: creates system (evidence: `src/core/index.js`)
- UI entry point → Spec loading: updates or downloads (evidence: `src/core/index.js`)
- UI entry point → Rendered application: renders (evidence: `src/core/index.js`)
- UI entry point → OpenAPI views: registers plugin (evidence: `src/core/index.js`)
- UI entry point → Authorization: registers plugin (evidence: `src/core/index.js`)
- UI entry point → Schema views: registers plugin (evidence: `src/core/index.js`)
- Rendered application → Operations view: presents operations
- Operations view → OpenAPI views: renders API details
- Operations view → Schema views: shows schemas
- Schema views → Example generation: shows generated examples
- API reader → Authorization: authorizes
- API reader → Try requests: tries operation
- Try requests → Swagger client: dispatches request
- Swagger client → Documented API: sends request
- Swagger client → Response display: returns response
- API reader → Deep linking: navigates links
- API reader → Operation filter: filters operations
- Operations view → Request snippets: offers request snippets
- React wrapper → UI entry point: packages UI
- Docker config → Env translation: translates environment (evidence: `docker/configurator/index.js`)
- Env translation → Configuration: produces options
