Open almost any OpenAPI spec that has been around for a year and you will find the same things. A POST with no security requirement. A server URL that still says http://. An API key passed in the query string. Path parameters typed as plain integers, so the next ID is easy to guess. None of these stopped a review, because nobody reviews the spec line by line. They only show up later, in a security review or an incident.
An OpenAPI linter catches all of them in seconds. The hard part is what happens after: the first run prints two hundred findings into a CI log, nobody owns them, and a week later the step is muted.
We build Graphwake, which tells the teams that consume an API when a change in its spec is about to break them. Graphwake doesn't read your code; it works only from the spec and from the endpoints each team subscribes to. We just added a spec quality score to it, and this post is what we learned about making lint output something a team actually acts on.
What an OpenAPI linter should check
Lint rules for a spec fall into two groups. Security rules look for the API design mistakes behind the OWASP API Security Top 10: missing authentication, credentials in URLs, weak auth flows, no limits. Design rules look for a spec that is broken or ambiguous, so clients and generators can't rely on it.
Here are the rules worth having from day one, with why each one matters:
| 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. |
| 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 auth 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 or OAuth URL is not HTTPS | Tokens and data in clear text, even if only on an internal network. |
| ID parameter is a plain integer | Sequential IDs make it easy to walk through other people's records if an authorization check is missing. |
429 response has no Retry-After header | Clients retry at once and make the overload worse. |
| Arrays and strings with no size limit | No maxItems or maxLength means the spec allows any payload size. |
| Path parameter missing or not declared | /orders/{id} with no id parameter, or the reverse. Generated clients break on it. |
operationId 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. |
| No success or validation error response | Clients have to guess what a good answer and a rejected request look like. |
| Example does not match its schema | Docs and mocks show a payload the API would reject. |
Not every finding is equally serious. A public GET without security can be on purpose; a public DELETE almost never is. That's why rules carry a severity (error, warning, info) instead of a single pass or fail.
A before and after
Nine lines, and a linter flags most of them: a server without HTTPS, a delete with no security requirement, an API key in the query string, an undeclared {id} path parameter and no operationId:
# Before servers: - url: http://orders.internal paths: /orders/{id}: delete: parameters: - name: api_key in: query And the same operation, fixed:
# 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: uuid The server is HTTPS, the key moved out of the URL into a bearer token, the delete has a security requirement, and the path parameter is declared as a UUID instead of a guessable number.
Why lint output gets ignored
Running a linter is easy. Keeping a team interested in its output is not. Three things usually go wrong:
- The first run is a wall. An old spec has dozens of findings. Shown on every pull request, they drown the one finding that this pull request actually 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.
- The 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 works does the opposite: it shows a pull request only the findings it adds, it turns the rest into a score you can watch go up, and it sends the summary to the team that owns the service.
How Graphwake handles this
Every spec gets a 0 to 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 location in the spec and how to fix it:
The Spec quality tab of a service in the sample workspace: each finding with where it is and how to fix it.
The routing is the part we care most about, because it's what Graphwake does for breaking changes too:
- A pull request shows only the findings it adds. The pull request comment (GitHub and Azure DevOps) gets a section "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. It works on any CI the agent runs on. - Findings never fail a build. They inform. Breaking changes are the only thing the optional
--fail-oncheck looks at. - A weekly summary to the owner (Pro). 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 at all.
- Rules you don't use can be turned off (Pro). An admin switches off a rule, and the score updates right away.
Score, findings, the pull request section and SARIF are on every plan, the Free plan included.
Here is the SARIF setup on GitHub Actions. The if skips the upload when no file was written, for example on a merge to the default branch:
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: graphwake Two limits worth knowing. 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 a finding point at the converted document.
Where to start
If you are adding lint to specs that already exist, don't start by fixing everything. Start by making sure no pull request adds a new error, watch the score, and fix the old findings one service at a time, beginning with the write operations that have no security requirement. That one rule finds the findings that matter most.
What does your team do with lint findings on API specs today: fix them, mute them, or never see them?
About Graphwake. We build Graphwake, a dependency map for your APIs. It watches your OpenAPI specs, knows which teams consume each endpoint, and tells only those teams in Slack, Microsoft Teams or email when a change is about to break them. Start a 14-day free trial at graphwake.com
