OpenAPI Specification (formerly Swagger) is an industry-standard format for describing RESTful APIs. It allows both humans and machines to understand API capabilities.
OpenAPI Specification
A standard format for describing REST APIs, enabling documentation and code generation.
Benefits of OpenAPI
- Documentation: Auto-generate interactive API docs
- Code Generation: Create client SDKs and server stubs
- Validation: Verify requests and responses
- Mock Servers: Generate fake APIs for testing
- Testing: Create automated test cases
Key Components
- Paths: API endpoints and operations
- Schemas: Data models and types
- Parameters: Query, path, and header params
- Responses: Expected response formats
- Security: Authentication methods
Code Examples
OpenAPI YAML
openapi: 3.0.0
info:
title: Users API
version: 1.0.0
paths:
/users:
get:
summary: List users
responses:
200:
description: SuccessRelated Terms
API Mocking
Simulating API behavior to enable development and testing without real backend services.
Read more
Mock API
A simulated API endpoint that returns predefined responses for testing and development.
Read more
WebSocket
A protocol enabling full-duplex, real-time communication between client and server.
Read more
HTTP Status Codes
Standard response codes that indicate the result of an HTTP request.
Read more