What the linter watches: rules and common mistakes
While reading a document the linter finds places that break a rule and reports each with a severity. Tools disagree about what counts as an error, so showing the diagnostic code matters. This tool names codes by area and rule, such as schema.nullableIn31.
Three severity levels
- error — the specification is broken. Most consumers will reject the document or misbehave.
- warning — the document is valid but a consumer may read it differently than you intended.
- note — something useful is missing; a suggestion that raises document quality.
The errors you meet most
| Code | Meaning | Fix |
|---|---|---|
op.duplicateOperationId | the same operationId appears twice | rename one of them or add a suffix |
op.pathParamMissing | a template {id} has no in:path parameter | add the parameter with required: true |
op.pathParamNotRequired | an in:path parameter lacks required: true | add required: true |
ref.unresolved | the target of a #/... reference does not exist | check for a typo or a deleted schema |
resp.missingDescription | a response has no description | write one line about what it means |
How path parameters are checked
The tool extracts every {...} from the path string and looks for in: path entries in the combined list of path item and operation parameters. A template without a parameter is an error; a parameter that is not in the template is a warning. Parameters declared on the path item and overridden by the operation are handled too.
Responses and security
Every operation should have a success response (2xx) and an error response (4xx). A document with only default is treated as having no success response. Security may only reference names defined in components.securitySchemes, and schemes or scopes that nothing uses are split between notes and errors.
Zero lint errors does not mean an API is safe. The linter reads form and consistency, not runtime behaviour, authorisation or data exposure.
Questions
Should I remove every warning?
No. Warnings often flag differences in how consumers interpret the document; if the behaviour is intended, leave them. Repeated warnings are a good reason to tighten your conventions.
May operationId contain a hyphen?
The specification allows any string, but generators use it as a function name, so avoid spaces. This tool warns about spaces and unsupported characters and accepts dots, underscores and hyphens.
Is a default response enough without 2xx?
No. default covers codes that no other key matches, so it does not mean success. This tool warns when there is no 2xx response.
Load the legacy preset to see exactly which codes attach to which lines.
Open the toolWritten against the OpenAPI Specification 3.1.0 (2021-02), 3.0.3 and JSON Schema 2020-12. Every example spec and host is synthetic.