On this page
What an OpenAPI linter checks
A linter reads the spec, not the running service, so it finds problems before the first request. Its rules fall into two groups. Security rules catch API design mistakes that lead to the risks in the OWASP API Security Top 10. Design rules catch a spec that is broken or ambiguous, which breaks generated clients, mocks and docs.
Security rules
| Rule | Why it matters |
|---|---|
| Write operation has no security requirement | A POST, PUT, PATCH or DELETE anyone can call is the most common way an API leaks or loses data. |
| Read operation has no security requirement | Sometimes on purpose (a public catalog), so a warning, not an error. |
| Security requirement names an undefined scheme | The operation looks protected in the spec, but the scheme it names does not exist. |
| API key or credentials sent in the URL | URLs end up in proxy logs, browser history and monitoring tools. Keys belong in a header. |
| Uses HTTP Basic or an outdated authentication scheme | A password on every request. OAuth 2.0, OpenID Connect or a bearer token is the safer default. |
| Uses the OAuth password or implicit flow | Both are discouraged today. The authorization code flow with PKCE replaces them. |
| Server, OAuth or OpenID URL is not HTTPS | Tokens and data travel in clear text, even if only on an internal network. |
| Description contains a script tag or eval() | Docs portals render descriptions as Markdown. A script in a description runs in the reader’s browser. |
| ID parameter is a plain integer | Sequential IDs make it easy to walk through other people’s records when an authorization check is missing. |
| 429 response has no Retry-After header | Clients retry at once and make an overload worse. |
| Array or string has no size limit | Without maxItems or maxLength, the spec accepts any payload size. |
Design rules
| Rule | Why it matters |
|---|---|
| Spec is not valid OpenAPI | Every tool that reads the spec may read it differently, or not at all. |
| Path parameter is missing or not declared | /orders/{id} with no id parameter, or the reverse. Generated clients break on it. |
| operationId is missing or used twice | Code generators name methods after it. A duplicate silently overwrites one of them. |
| Two paths match the same request | /orders/{id} and /orders/{orderId} can’t both route. One of them never runs. |
| Path contains a query string or ends with a slash | The query belongs in parameters; a trailing slash is a different path to many routers. |
| Operation has no success or validation error response | Clients have to guess what a good answer and a rejected request look like. |
| Example or enum value does not match its schema | Docs and mocks show a payload the API would reject. |
Rules carry a severity (error, warning or info) instead of a single pass or fail. A public GET without security can be a choice; a public DELETE almost never is.
A before and after
# Before
servers:
- url: http://orders.internal
paths:
/orders/{id}:
delete:
parameters:
- name: api_key
in: query{id} path parameter and no operationId.# After
servers:
- url: https://orders.internal
components:
securitySchemes:
bearer:
type: http
scheme: bearer
paths:
/orders/{id}:
delete:
operationId: deleteOrder
security:
- bearer: []
parameters:
- name: id
in: path
required: true
schema:
type: string
format: uuidWhy lint output gets ignored
Running a linter takes minutes. Keeping a team interested in its output is the hard part, and it usually fails the same three ways:
The first run is a wall
An old spec has dozens of findings. Shown on every pull request, they drown the one finding this pull request added, and people stop reading.
There is no sense of progress
A list of 140 findings that becomes 131 doesn’t feel like anything. A number that moves does.
Findings go to whoever is looking
A CI log belongs to whoever opened it. The team that owns the spec, the only one that can fix it, often never sees it.
So a lint setup that lasts does the opposite: a pull request shows only the findings it adds, the rest becomes a score, and the summary goes to the team that owns the service. Adding lint to specs that already exist? Start by keeping new errors out of pull requests, then fix old findings one service at a time, beginning with write operations that have no security requirement.
How Graphwake scores and routes spec findings
Every spec gets a 0–100 quality score from security and design rules, based on the OWASP API Security Top 10. The score starts at 100. Each error takes off 10 points and each warning 3, counting at most two findings per rule, so one repeated mistake doesn’t sink the whole score. Info findings are shown but cost nothing. The service page shows the score, where the points went, and each finding with its place in the spec and how to fix it.
New findings on the pull request
On GitHub and Azure DevOps, the pull request comment adds “New spec findings in this pull request” below the breaking changes and the teams they affect. Old findings stay on the service page.
SARIF for code scanning
With
--sarif, the CI step writes the spec’s findings to a SARIF file that GitHub code scanning shows next to the code. Agent 0.4.0 or later.A weekly summary to the owner
On Pro and Enterprise, the team that owns the service gets “Spec quality this week” in its own Slack, Microsoft Teams or email channel. Consumer teams get no lint messages.
Rules you don’t use, off
On Pro and Enterprise, admins can turn off individual rules, and the score updates right away.
Findings never fail a build. Breaking changes are the only thing the optional --fail-on check looks at. The score, the findings, the pull request section and SARIF are in every plan, the Free plan included; see pricing.
permissions:
contents: read
pull-requests: write
security-events: write
actions: read # private repositories only, for upload-sarif
jobs:
api-spec:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# ... build and produce openapi.json
- uses: graphwake/agent/github-action@v0.4.0
env:
GRAPHWAKE_SARIF: graphwake.sarif
with:
spec: openapi.json
key: ${{ secrets.GRAPHWAKE_KEY }}
- uses: github/codeql-action/upload-sarif@v4
if: ${{ !cancelled() && hashFiles('graphwake.sarif') != '' }}
with:
sarif_file: graphwake.sarif
category: graphwakeif skips the upload when no file was written, for example on a merge to the default branch.Two limits. The score is for OpenAPI specs only: AsyncAPI documents get breaking change alerts but no score. And a Swagger 2.0 spec is scored on its converted OpenAPI 3.0 form, so the paths in its findings point at the converted document.
Next steps
- What breaks clients once the spec is clean: OpenAPI breaking changes.
- Run spec checks on every pull request: OpenAPI diff in CI.
- A reviewer’s list for API pull requests: API breaking change PR checklist.
- Who to tell when a change does break someone: API breaking change alerts.
Questions
What is OpenAPI linting?
Checking an OpenAPI spec against a set of rules before the API is called: security rules (authentication, credentials in URLs, HTTPS, limits) and design rules (valid structure, declared parameters, unique operationIds, documented responses). Each finding has a severity and a place in the spec.
Which OpenAPI security issues should a linter catch first?
Write operations with no security requirement, API keys or credentials in the URL, server and OAuth URLs without HTTPS, HTTP Basic or outdated auth schemes, and the OAuth password and implicit flows. These are errors; plain integer IDs, a missing Retry-After on 429 and unlimited arrays or strings come after.
Should lint findings fail the build?
Not when you start. On an existing spec, a failing step gets muted within a week. Show each pull request only the findings it adds, track the rest as a score, and fix them service by service. In Graphwake, findings never fail a build.
Does Graphwake lint OpenAPI specs?
Yes. Every OpenAPI spec gets a 0–100 quality score from security and design rules, with each finding and how to fix it. A pull request shows only the findings it adds, and the CI step can write them to a SARIF file. Findings never fail a build. On Pro and Enterprise the owning team gets a weekly summary, and admins can turn off rules they don't use.
Pick an endpoint. See who it reaches. 14-day free trial, then a free plan. No credit card needed.
Start free trialSources and last verified
- owasp.org/API-Security/editions/2023/en/0x11-t10/
- spec.openapis.org/oas/v3.1.0
- docs.oasis-open.org/sarif/sarif/v2.1.0/
- docs.github.com/en/code-security/code-scanning/integrating-with-code-scanning/uploading-a-sarif-file-to-github
Sources checked on 2026-11-01.