コンテンツへスキップ
uencoder

OpenAPI Specification リファレンス

リファレンス 用 OpenAPI 3.x 用 describing REST APIs: paths, コンポーネント, セキュリティ, および media 型.

Document Structure

An OpenAPI document describes API endpoints under paths, each with HTTP methods and parameters. The components section reuses schemas, parameters, responses, and security schemes. The info section provides metadata (title, version, description). Servers define base URLs for different environments. The document is YAML or JSON conforming to the OpenAPI Schema. Version 3.1 aligns with JSON Schema 2020-12.

paths
Endpoint definitions
/users/{id}
components
Reusable definitions
schemas, parameters
info
API metadata
title, version

Schema and Security

Request and response bodies use Schema Objects defining JSON structure. Parameters can be path, query, header, or cookie types. Security schemes include API key, HTTP (Bearer, Basic), OAuth2, and OpenID Connect. Operation-level security overrides global defaults. The document enables code generation, mocking, documentation, and validation. Tools like Swagger UI and Redoc render interactive docs.

schemas
JSON structure
type, properties
security
Auth schemes
bearer, oauth2
tooling
Docs, codegen, mock
Swagger UI, Redoc

関連ツール

参考链接