Lint an OpenAPI 3.0/3.1 JSON document against ten style rules (operationId, kebab-case paths, tags, summaries, response descriptions) and apply safe idempotent autofixes. Use when reviewing or cleaning an API spec or enforcing naming conventions.
95%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
Ten fixed style rules. Severities can be changed per run with --rule OASnnn=error|warn|off.
| Rule | Default | Checks | Autofix |
|---|---|---|---|
OAS001 | error | Operation has an operationId. | No |
OAS002 | error | operationId matches ^[a-z][a-zA-Z0-9]*$ (camelCase). | Yes, unless the new name already exists |
OAS003 | warn | Literal path segments are kebab-case (^[a-z0-9]+(-[a-z0-9]+)*$); {param} segments are ignored. | No |
OAS004 | error | A path other than / has no trailing slash. | Yes, unless the trimmed path already exists |
OAS005 | warn | Operation has a non-empty summary. | No |
OAS006 | warn | Every operation tag appears in the top-level tags list. | Yes, adds {name} and sorts tags by name |
OAS007 | error | Every {param} in a path has a matching in: path parameter, at path or operation level. | No |
OAS008 | error | Every response object has a non-empty description. | Yes, standard reason phrase |
OAS009 | error | operationId is unique; one finding per later duplicate. | No |
OAS010 | warn | Property names in components.schemas are camelCase, including nested properties, items, allOf, anyOf and oneOf. | No |
fix works on a deep copy and applies, in this order: OAS004, OAS002, OAS006, OAS008.
It then lints the result once more. Fixes are idempotent: running fix on fixed output changes
nothing.
OAS004: /users/ becomes /users; the entry moves to the end of paths.OAS002: words are split on non-alphanumeric runs and before an uppercase letter that follows
a lowercase letter or digit, lowercased, then joined in camelCase (list_books becomes
listBooks, create-book becomes createBook). Skipped when the result is empty or already
used by another operation.OAS006: missing tag names are appended as {"name": "<tag>"} and the tag list is sorted by
name.OAS008: description from the reason table: 200 OK, 201 Created, 202 Accepted, 204 No Content,
400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 409 Conflict,
422 Unprocessable Content, 429 Too Many Requests, 500 Internal Server Error,
503 Service Unavailable, default Unexpected error, any other code Response.Each finding has rule, severity (error or warn), pointer (RFC 6901 JSON pointer into
the document), message and fixable (true when fix would change it). Findings are sorted by
pointer, then rule. Operations are found under the methods get, put, post, delete, options, head,
patch and trace.
Document nesting up to 128 levels, file size up to 10 MiB, OpenAPI 3.0.x or 3.1.x only.