API 请求测试器
Web 与网络 按需联网
在本地设计、校验、浏览、模拟、生成代码并比较 OpenAPI 契约。
openapi: 3.2.0
info:
title: Pocket Tasks API
version: 1.0.0
description: A compact example for designing and reviewing an API contract.
servers:
- url: https://api.example.com/v1
paths:
/tasks:
get:
operationId: listTasks
summary: List tasks
tags: [Tasks]
parameters:
- name: limit
in: query
schema:
type: integer
minimum: 1
maximum: 100
default: 20
responses:
"200":
description: Task collection
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Task"
post:
operationId: createTask
summary: Create a task
tags: [Tasks]
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/NewTask"
responses:
"201":
description: Task created
content:
application/json:
schema:
$ref: "#/components/schemas/Task"
/tasks/{taskId}:
get:
operationId: getTask
summary: Get a task
tags: [Tasks]
parameters:
- name: taskId
in: path
required: true
schema: { type: string, format: uuid }
responses:
"200":
description: Task found
content:
application/json:
schema:
$ref: "#/components/schemas/Task"
"404":
description: Task not found
components:
schemas:
NewTask:
type: object
required: [title]
properties:
title: { type: string, example: Ship the release }
done: { type: boolean, default: false }
Task:
allOf:
- $ref: "#/components/schemas/NewTask"
- type: object
required: [id]
properties:
id: { type: string, format: uuid }
createdAt: { type: string, format: date-time }
粘贴或导入 OpenAPI YAML/JSON,切换格式,并执行结构与引用诊断。
浏览操作、参数和响应,生成基于 Schema 的 Mock 数据,并复制 cURL、Fetch 或 Python 示例。
把候选版本与当前契约比较,在发布前发现被移除的操作、响应和新增必填参数。
支持检查 OpenAPI 3.0、3.1 和 3.2 结构;Swagger 2.0 可查看,但会显示迁移提示。
不会。代码与 Mock 数据在本地生成;外部 $ref 会被标出,但不会自动请求。
不是。它提供实用的结构、操作、路径参数、响应和引用检查,最终仍以 OpenAPI 规范为准。
不能。它保守提示高价值结构变更;生产兼容性还取决于 Schema、语义、客户端、安全和运行测试。
继续使用其他专注的浏览器端工具。