# oai/openapi-specification architecture

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

- Interactive diagram: https://gitdiagram.com/oai/openapi-specification
- Repository: https://github.com/oai/openapi-specification

## Overview

#### Purpose and Scope
This repository is the source repository for the OpenAPI Specification (OAS): a language-neutral contract for describing HTTP APIs in YAML or JSON. It is a specification/documentation repository, not an API implementation or web application. Primary authored outputs are versioned Markdown specifications and supporting machine-readable schemas.

#### Primary Entry Points
- Repository orientation, participation, and published-spec links: `README.md`
- Current and historical normative specification sources: `versions/3.2.0.md`, `versions/3.1.2.md`, `versions/3.0.4.md`
- Specification build/render configuration: `spec.config.json`
- Node/Yarn project commands and dependencies: `package.json`

#### Versioned Specification Source of Truth
The `versions/` directory is the central content model. Each release has a Markdown source, with some releases retaining separate editor-credit documents. Changes to these files define the published specification content and are expected to be rendered into authoritative HTML externally.
- `versions/3.2.0.md`
- `versions/3.1.2.md`
- `versions/3.0.4.md`

#### Schema and Compatibility Artifacts
Machine-readable JSON Schema validation is maintained alongside the prose specification. The active schema test surface is rooted in `tests/schema/`; legacy schemas and their examples are deliberately isolated under `_archive_/` to preserve older OAS generations without participating in the main evolution path.
- `tests/schema/oas-schema.mjs`
- `_archive_/schemas/v3.0/schema.yaml`
- `_archive_/schemas/v2.0/schema.json`

#### Build, Rendering, and Publication Boundary
The repository delegates much of build, test, schema-publication, and release machinery to the external `OAI/build-infra` repository, included as a Git submodule. Local configuration supplies repository-specific build inputs; GitHub Actions invokes the shared infrastructure and publication workflow.
- `.gitmodules`
- `spec.config.json`
- `.github/workflows/build-infra-integration.yaml`
- `.github/workflows/schema-publish.yaml`

#### Validation Pipeline
A Node.js/Yarn runtime (version selected by `.nvmrc`) runs local validation and regression tests. The pipeline checks Markdown/spec rendering and schema behavior before publication. GitHub Actions additionally enforces Markdown quality and schema tests on repository changes.
- `package.json`
- `tests/md2html/md2html.test.mjs`
- `vitest.config.mjs`
- `.github/workflows/validate-markdown.yaml`
- `.github/workflows/schema-tests.yaml`

#### Specification Evolution and Governance Flow
Proposals capture candidate changes before or alongside specification edits; contributors follow repository governance and review procedures. The Technical Steering Committee and GitHub issue/PR workflow govern acceptance. Archived materials preserve superseded schemas, while `proposals/` contains non-normative work-in-progress rather than released specification text.
- `proposals/2025-03-20-URIs-for-Tags.md`
- `CONTRIBUTING.md`
- `MAINTAINERS.md`
- `GOVERNANCE.md`

Main entry points: [`versions/3.2.0.md`](https://github.com/oai/openapi-specification/blob/main/versions/3.2.0.md) (OAS 3.2.0 source), [`tests/schema/oas-schema.mjs`](https://github.com/oai/openapi-specification/blob/main/tests/schema/oas-schema.mjs) (Active OAS schema), [`tests/md2html/md2html.test.mjs`](https://github.com/oai/openapi-specification/blob/main/tests/md2html/md2html.test.mjs) (Markdown rendering tests), [`.gitmodules`](https://github.com/oai/openapi-specification/blob/main/.gitmodules) (OAI build infrastructure)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_spec["Normative specification"]
  node_spec320["OAS 3.2.0 source<br/>normative Markdown<br/>[3.2.0.md]"]
  node_spec312["OAS 3.1.2 source<br/>normative Markdown<br/>[3.1.2.md]"]
  node_spec304["OAS 3.0.4 source<br/>normative Markdown<br/>[3.0.4.md]"]
  node_schema["Active OAS schema<br/>schema test module<br/>[oas-schema.mjs]"]
  node_archive30["Archived OAS 3.0 schema<br/>legacy schema<br/>[schema.yaml]"]
  node_archive20["Archived OAS 2.0 schema<br/>legacy schema<br/>[schema.json]"]
end

subgraph group_validation["Validation and rendering"]
  node_node["Node/Yarn commands<br/>project runtime<br/>[package.json]"]
  node_render_tests["Markdown rendering tests<br/>regression tests<br/>[md2html.test.mjs]"]
  node_vitest["Vitest configuration<br/>test runner config<br/>[vitest.config.mjs]"]
  node_markdown_ci["Markdown validation CI<br/>GitHub Actions workflow"]
  node_schema_ci["Schema test CI<br/>GitHub Actions workflow<br/>[schema-tests.yaml]"]
end

subgraph group_publication["Shared build and publication"]
  node_spec_config["Specification build config<br/>build configuration<br/>[spec.config.json]"]
  node_submodule{{"OAI build infrastructure<br/>Git submodule<br/>[.gitmodules]"}}
  node_build_ci["Build infrastructure CI<br/>GitHub Actions workflow"]
  node_publish_ci["Schema publication CI<br/>GitHub Actions workflow"]
end

subgraph group_governance["Evolution and governance"]
  node_proposal["URI tags proposal<br/>proposal document"]
  node_contributing["Contribution process<br/>contributor guide<br/>[CONTRIBUTING.md]"]
  node_maintainers["Maintainer review<br/>maintainer policy<br/>[MAINTAINERS.md]"]
  node_governance_doc["Technical governance<br/>governance policy<br/>[GOVERNANCE.md]"]
end

node_readme["Repository orientation<br/>documentation<br/>[README.md]"]

node_readme -->|"links current release"| node_spec320
node_spec312 -.->|"historical lineage"| node_spec320
node_spec304 -.->|"historical lineage"| node_spec312
node_node -->|"runs"| node_render_tests
node_vitest -->|"configures"| node_render_tests
node_spec320 -->|"rendered and checked"| node_render_tests
node_schema -->|"validated by"| node_schema_ci
node_node -->|"provides runtime"| node_schema_ci
node_spec320 -->|"quality checked"| node_markdown_ci
node_spec_config -->|"supplies build inputs"| node_submodule
node_build_ci -->|"invokes"| node_submodule
node_spec320 -->|"builds and renders"| node_build_ci
node_publish_ci -->|"uses publication machinery"| node_submodule
node_schema -->|"publishes"| node_publish_ci
node_proposal -.->|"may become normative edits"| node_spec320
node_contributing -->|"guides submission"| node_proposal
node_maintainers -->|"reviews changes"| node_spec320
node_governance_doc -->|"defines authority"| node_maintainers
node_archive30 -.->|"isolated from active path"| node_schema
node_archive20 -.->|"isolated from active path"| node_schema

click node_readme "https://github.com/oai/openapi-specification/blob/main/README.md"
click node_spec320 "https://github.com/oai/openapi-specification/blob/main/versions/3.2.0.md"
click node_spec312 "https://github.com/oai/openapi-specification/blob/main/versions/3.1.2.md"
click node_spec304 "https://github.com/oai/openapi-specification/blob/main/versions/3.0.4.md"
click node_schema "https://github.com/oai/openapi-specification/blob/main/tests/schema/oas-schema.mjs"
click node_archive30 "https://github.com/oai/openapi-specification/blob/main/_archive_/schemas/v3.0/schema.yaml"
click node_archive20 "https://github.com/oai/openapi-specification/blob/main/_archive_/schemas/v2.0/schema.json"
click node_node "https://github.com/oai/openapi-specification/blob/main/package.json"
click node_render_tests "https://github.com/oai/openapi-specification/blob/main/tests/md2html/md2html.test.mjs"
click node_vitest "https://github.com/oai/openapi-specification/blob/main/vitest.config.mjs"
click node_markdown_ci "https://github.com/oai/openapi-specification/blob/main/.github/workflows/validate-markdown.yaml"
click node_schema_ci "https://github.com/oai/openapi-specification/blob/main/.github/workflows/schema-tests.yaml"
click node_spec_config "https://github.com/oai/openapi-specification/blob/main/spec.config.json"
click node_submodule "https://github.com/oai/openapi-specification/blob/main/.gitmodules"
click node_build_ci "https://github.com/oai/openapi-specification/blob/main/.github/workflows/build-infra-integration.yaml"
click node_publish_ci "https://github.com/oai/openapi-specification/blob/main/.github/workflows/schema-publish.yaml"
click node_proposal "https://github.com/oai/openapi-specification/blob/main/proposals/2025-03-20-URIs-for-Tags.md"
click node_contributing "https://github.com/oai/openapi-specification/blob/main/CONTRIBUTING.md"
click node_maintainers "https://github.com/oai/openapi-specification/blob/main/MAINTAINERS.md"
click node_governance_doc "https://github.com/oai/openapi-specification/blob/main/GOVERNANCE.md"

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_spec320,node_spec312,node_spec304,node_schema,node_archive30,node_archive20 toneBlue
class node_node,node_render_tests,node_vitest,node_markdown_ci,node_schema_ci toneAmber
class node_spec_config,node_submodule,node_build_ci,node_publish_ci toneMint
class node_proposal,node_contributing,node_maintainers,node_governance_doc toneRose
class node_readme toneNeutral
```

## Components

### Normative specification

Versioned Markdown is the released contract source.

- [OAS 3.2.0 source](https://github.com/oai/openapi-specification/blob/main/versions/3.2.0.md): normative Markdown · Current specification source. · `versions/3.2.0.md`
- [OAS 3.1.2 source](https://github.com/oai/openapi-specification/blob/main/versions/3.1.2.md): normative Markdown · Historical released specification. · `versions/3.1.2.md`
- [OAS 3.0.4 source](https://github.com/oai/openapi-specification/blob/main/versions/3.0.4.md): normative Markdown · Historical released specification. · `versions/3.0.4.md`
- [Active OAS schema](https://github.com/oai/openapi-specification/blob/main/tests/schema/oas-schema.mjs): schema test module · Machine-readable schema validation surface. · `tests/schema/oas-schema.mjs`
- [Archived OAS 3.0 schema](https://github.com/oai/openapi-specification/blob/main/_archive_/schemas/v3.0/schema.yaml): legacy schema · Preserved outside active evolution. · `_archive_/schemas/v3.0/schema.yaml`
- [Archived OAS 2.0 schema](https://github.com/oai/openapi-specification/blob/main/_archive_/schemas/v2.0/schema.json): legacy schema · Preserved outside active evolution. · `_archive_/schemas/v2.0/schema.json`

### Validation and rendering

Local and CI checks verify specification and schema changes.

- [Node/Yarn commands](https://github.com/oai/openapi-specification/blob/main/package.json): project runtime · Defines local dependencies and commands. · `package.json`
- [Markdown rendering tests](https://github.com/oai/openapi-specification/blob/main/tests/md2html/md2html.test.mjs): regression tests · `tests/md2html/md2html.test.mjs`
- [Vitest configuration](https://github.com/oai/openapi-specification/blob/main/vitest.config.mjs): test runner config · `vitest.config.mjs`
- [Markdown validation CI](https://github.com/oai/openapi-specification/blob/main/.github/workflows/validate-markdown.yaml): GitHub Actions workflow · `.github/workflows/validate-markdown.yaml`
- [Schema test CI](https://github.com/oai/openapi-specification/blob/main/.github/workflows/schema-tests.yaml): GitHub Actions workflow · `.github/workflows/schema-tests.yaml`

### Shared build and publication

External shared infrastructure performs build and release work.

- [Specification build config](https://github.com/oai/openapi-specification/blob/main/spec.config.json): build configuration · Supplies repository-specific rendering inputs. · `spec.config.json`
- [OAI build infrastructure](https://github.com/oai/openapi-specification/blob/main/.gitmodules): Git submodule · Shared external build, release, and schema-publication machinery. · `.gitmodules`
- [Build infrastructure CI](https://github.com/oai/openapi-specification/blob/main/.github/workflows/build-infra-integration.yaml): GitHub Actions workflow · Invokes the shared build infrastructure. · `.github/workflows/build-infra-integration.yaml`
- [Schema publication CI](https://github.com/oai/openapi-specification/blob/main/.github/workflows/schema-publish.yaml): GitHub Actions workflow · Publishes schemas through shared infrastructure. · `.github/workflows/schema-publish.yaml`

### Evolution and governance

Proposals and contributor process govern accepted changes.

- [URI tags proposal](https://github.com/oai/openapi-specification/blob/main/proposals/2025-03-20-URIs-for-Tags.md): proposal document · Non-normative candidate specification change. · `proposals/2025-03-20-URIs-for-Tags.md`
- [Contribution process](https://github.com/oai/openapi-specification/blob/main/CONTRIBUTING.md): contributor guide · `CONTRIBUTING.md`
- [Maintainer review](https://github.com/oai/openapi-specification/blob/main/MAINTAINERS.md): maintainer policy · `MAINTAINERS.md`
- [Technical governance](https://github.com/oai/openapi-specification/blob/main/GOVERNANCE.md): governance policy · `GOVERNANCE.md`

### Other components

- [Repository orientation](https://github.com/oai/openapi-specification/blob/main/README.md): documentation · Links participants to published specifications. · `README.md`

## Connections

- Repository orientation → OAS 3.2.0 source: links current release
- OAS 3.1.2 source → OAS 3.2.0 source: historical lineage
- OAS 3.0.4 source → OAS 3.1.2 source: historical lineage
- Node/Yarn commands → Markdown rendering tests: runs
- Vitest configuration → Markdown rendering tests: configures
- OAS 3.2.0 source → Markdown rendering tests: rendered and checked
- Active OAS schema → Schema test CI: validated by
- Node/Yarn commands → Schema test CI: provides runtime
- OAS 3.2.0 source → Markdown validation CI: quality checked
- Specification build config → OAI build infrastructure: supplies build inputs
- Build infrastructure CI → OAI build infrastructure: invokes
- OAS 3.2.0 source → Build infrastructure CI: builds and renders
- Schema publication CI → OAI build infrastructure: uses publication machinery
- Active OAS schema → Schema publication CI: publishes
- URI tags proposal → OAS 3.2.0 source: may become normative edits
- Contribution process → URI tags proposal: guides submission
- Maintainer review → OAS 3.2.0 source: reviews changes
- Technical governance → Maintainer review: defines authority
- Archived OAS 3.0 schema → Active OAS schema: isolated from active path
- Archived OAS 2.0 schema → Active OAS schema: isolated from active path
