DevTools Logo

OpenAPI Best Practices Linter

OpenAPI Best Practices Linter

Design-style findings for OpenAPI 2.0/3.x specs — operationIds, errors, security, pagination and more.

Runs in your browser
Rules are advisory style checks, not structural validation.
Try an example

OpenAPI spec (YAML or JSON)

Rule configuration

Findings

Awaiting spec

Paste an OpenAPI spec to lint it

Try the planted-violations example to see every rule in action.

Details

This is a design-review aid, not a schema validator. It parses YAML or JSON specs (Swagger 2.0, OpenAPI 3.0, 3.1), indexes operations — including path-level inherited parameters and 3.1 webhooks — and applies a curated set of style rules: operationId presence, uniqueness and naming convention; documented 4xx responses; security requirements on writes (respecting explicit security: []); pagination consistency across collection endpoints; schema property naming consistency; operation descriptions; request examples; undeclared tags; and GET request bodies. Every finding carries a severity, JSONPath, rationale and fix snippet. Per-rule severities can be escalated, downgraded or disabled, and the report can be exported as Markdown or JSON. Specs never leave the tab.

More examples

operationId audit

get: operationId: listUsers
post: operationId: UpdateUser → not camelCase

The naming rule flags mixed conventions so SDK method names stay predictable.

Write without error response

post /users → responses: {'200': …} → WARN no 4xx response

Clients need documented error shapes for write operations.

Mixed pagination

/users?page=1&per_page=20 vs /orders?cursor=abc → pagination warning listing both styles

Path-level parameters are merged into operations before the consistency scan.

Examples

Mixed operationId styles

Input
listUsers + UpdateUser
Output
WARN: operationId "UpdateUser" is not camelCase

One convention across the spec keeps generated client method names predictable.

Pagination inconsistency

Input
/users?page=1&per_page=20, /orders?cursor=abc
Output
WARN with /users: page and /orders: cursor

Path-level parameters are inherited before classification.

Security opt-out

Input
post with security: [] and bearerAuth defined
Output
No security finding

An explicit empty array is a deliberate public-operation signal in OpenAPI.

About this tool

OpenAPI Best Practices Linter reviews a pasted spec for style erosion: operationIds that mix camelCase and snake_case, write operations without 4xx responses, inconsistent pagination parameters, undocumented tags, and requests without examples. Each finding includes a severity, JSONPath location, short rationale and a copyable fix snippet.

The spec is parsed locally from YAML or JSON. Operations are indexed from paths and 3.1 webhooks, with path-item-level parameters inherited by each operation — so a shared page parameter still counts toward pagination consistency. Swagger 2.0 definitions and securityDefinitions are mapped to their 3.x equivalents.

Rules are advisory and configurable. You can escalate, downgrade or disable each rule independently and switch the expected naming convention. Explicit security: [] is respected as an intentional public operation rather than reported as a missing requirement.

This tool complements structural validators: it does not check unknown keywords, resolve external $refs, or perform a full Spectral ruleset evaluation. Specs stay in the tab and exports contain only finding metadata.

What this tool does not do

  • A small YAML subset is supported (mappings, sequences, quoted/plain scalars, flow collections); very advanced YAML anchors are not resolved.
  • External $refs are not fetched and structural validation is out of scope.
  • Rules are a curated subset of Spectral-style design checks, not a general ruleset engine.
  • Findings are advisory and may be intentionally ignored by an organization's API guidelines.

How to use this tool

  1. Paste or load a spec

    Paste YAML/JSON into the spec panel or click an example chip. A version chip identifies Swagger 2.0 vs OpenAPI 3.x.

  2. Choose conventions

    Select camelCase or snake_case for operation IDs and property names, then adjust per-rule severities in the configuration grid.

  3. Review findings

    Group by rule or by path, filter by severity, and expand a finding to read its rationale and fix snippet.

  4. Export the report

    Copy the Markdown summary or download Markdown/JSON findings for a PR description or design review ticket.

Use cases

Pre-release design review

Catch style drift across dozens of endpoints before publishing a spec.

PR checks

Attach a Markdown findings report to a pull request changing the API.

Third-party audit

Review a vendor's spec for consistency without uploading confidential documents.

Team conventions

Agree on naming and pagination rules, then tune rule severities to match the house style.

Curated design rules

RuleWhat it checks
operationIdPresent, unique and matching the selected naming convention
errorResponses4xx response documented on non-GET operations
securitySecurity requirement or explicit opt-out on writes when schemes exist
paginationOne pagination style across collection endpoints
propertyNaming / description / tags / examplesSchema property style, operation descriptions, declared tags, request examples
requestBodyGET operations without a request body (error)

Severity is configurable per rule; off removes the rule from the result entirely.

Common mistakes

Mistake:Expecting structural/schema validation.

Fix:This tool checks design style only; use a structural validator for unknown keywords and broken references.

Mistake:Assuming security: [] means a missing requirement.

Fix:The empty array is an explicit public opt-out and is respected by the security rule.

Mistake:Declaring tags only on operations.

Fix:Declare each tag at the document root; the tags rule reports operations using undeclared tags.

Mistake:Comma-separating scopes or expecting external $ref resolution.

Fix:Scopes are space-separated and external refs are not fetched; the linter works on the pasted document only.

Mistake:Treating warnings as API errors.

Fix:Rules are advisory: configure severities or disable rules that do not match your organization's guidelines.

Frequently asked questions

Is this a full Spectral replacement?

No. It applies a curated set of style rules in your browser with per-rule severity controls. It does not load Spectral rulesets, custom JS functions or external $refs.

Which OpenAPI versions are supported?

Swagger 2.0, OpenAPI 3.0.x and 3.1 are accepted. Swagger definitions/securityDefinitions are mapped to components, and 3.1 webhooks are indexed alongside paths.

What naming convention does it enforce?

You choose camelCase (default) or snake_case for operationIds and schema properties. A finding is raised when a name does not match the selected convention.

Can I add custom rules?

Not arbitrary rules. You can configure each built-in rule's severity (off/info/warn/error) and the naming convention, which covers most house-style adjustments.

Does it validate schemas?

No. It checks design style — for example missing descriptions, pagination styles or error responses — not schema correctness, unknown keywords or broken references.

Is my spec uploaded?

Never. Parsing and linting run locally in your browser tab; nothing is sent over the network and the report contains only finding metadata.

References & standards