Skip to main content

OpenAPI Path Generator

Build OpenAPI 3.x path definitions in YAML or JSON format. Configure HTTP method, path and query parameters, request body schema, and response codes — then copy directly into your openapi.yaml.

✓ GET / POST / PUT / PATCH / DELETE ✓ Path, query, header & cookie params ✓ Request body with JSON Schema ✓ Response code toggles ✓ YAML & JSON output

Frequently Asked Questions

What is an OpenAPI path definition?▼

An OpenAPI path definition describes a single HTTP endpoint in your API. It lives under the top-level 'paths' key in your openapi.yaml or openapi.json file and specifies the HTTP method (GET, POST, etc.), input parameters, request body schema, and all possible response codes. The OpenAPI 3.x specification is maintained by the OpenAPI Initiative and is the industry standard for describing REST APIs in a language-agnostic way.

What is the difference between OpenAPI 3.0 and 3.1?▼

OpenAPI 3.1 (released 2021) aligns fully with JSON Schema Draft 2020-12, removing several OpenAPI-specific keywords in favour of standard JSON Schema equivalents. Key changes: 'nullable' is replaced by adding 'null' to the 'type' array (e.g. type: [string, null]), 'exclusiveMinimum'/'exclusiveMaximum' are now numeric values, and 'discriminator' works with any schema combiner. Most tooling (Swagger UI, Redoc, code generators) supports both versions. The output from this tool is compatible with both 3.0 and 3.1.

What is an operationId and why does it matter?▼

The operationId is a unique string identifier for an operation across the entire API. It must be unique within the document. It is used by code generators (openapi-generator, swagger-codegen, Kiota) to name the generated client methods — so 'getUser' becomes client.getUser(). A missing or duplicate operationId breaks most code-gen tools. Best practice: use camelCase, follow the pattern verbResource (e.g. listUsers, createOrder, deleteComment).

When should I use 'in: path' vs 'in: query' parameters?▼

Use 'in: path' for resource identifiers that are part of the URL structure, such as /users/{id} or /orders/{orderId}/items/{itemId}. Path parameters are always required. Use 'in: query' for filtering, sorting, pagination, and optional modifiers: /users?role=admin&page=2&limit=20. Use 'in: header' for technical metadata like API versions (X-API-Version), idempotency keys (Idempotency-Key), or correlation IDs. Never put sensitive data like API keys in path or query params — use 'in: header' or a security scheme.

How do I reference reusable schemas instead of inlining them?▼

OpenAPI supports $ref pointers to avoid repeating schemas. Define shared schemas under components/schemas in your openapi.yaml: components: schemas: User: type: object properties: id: { type: string } Then reference them anywhere: $ref: '#/components/schemas/User'. This tool generates inline schemas for quick starts — for production APIs, extract schemas to components/schemas and replace inline definitions with $refs.

How do I validate my OpenAPI document?▼

Several free tools can validate your OpenAPI YAML or JSON: (1) Swagger Editor at editor.swagger.io — paste your document for instant feedback. (2) Redocly CLI: npm install -g @redocly/cli && redocly lint openapi.yaml — strict linting with opinionated rules. (3) Spectral by Stoplight: npm install -g @stoplight/spectral-cli — highly configurable rule sets including custom rules. (4) openapi-generator validate — validates before generating client SDKs. For CI/CD, Redocly and Spectral both support config files and exit codes for pipeline gates.

Share this tool: X / Twitter LinkedIn
✓ 60,000+ developers use DevPlaybook ★★★★★ 4.8 / 5 on Gumroad ✓ MIT licensed · Instant download ✓ No login required

Related Products

on Gumroad

You Might Also Need

More Free Tools

Enjoying this tool? Get more like it.

Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.

DevPlaybook Pro 7 days free

Unlock AI-Powered Dev Tools

  • ⚡ AI Code Review, Doc Generator & SQL Builder
  • ⚡ All premium templates & early access
  • ⚡ Member discounts on Gumroad products
Start Free Trial →

$9/mo after trial · Cancel anytime

Want the full toolkit?

Get DevPlaybook Pro

Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.

$79
$241 separately Save $162 (67% off)
Get DevPlaybook Pro — $79 →

MIT licensed · Instant download · No subscription

See what's included → Browse all deals →