Skip to content

specgate rules

specgate rules displays all of the rules that SpecGate enforces. Errors fail the check and return a non-zero exit code. Warnings are reported but do not fail the check unless you pass the --strict option.

Errors

RuleReason
Operations must have a summarySummaries are the first thing API users see in documentation and tooling like Swagger UI. Without them, the API is difficult to navigate.
Operations must include at least one 2xx responseA missing success response means the specification doesn’t describe what a successful call returns, leaving API users to guess.
Operations must include at least one error responseWithout error responses, users won’t know how to handle failures.
No placeholder or non-production URLsConsumers cannot use the API if the base URL does not point to a real environment or an environment they can’t access.
Servers object must be definedWithout a servers object, consumers have no base URL to call the API.
Success responses must include descriptionsWithout a description, consumers don’t know what a successful response means or what to expect from the returned data.
Error responses must include descriptionsWithout a description, consumers have no guidance on what caused the error or how to resolve it, making the API difficult to debug and integrate with.

Warnings

RuleReason
Operations should have a descriptionDescriptions provide additional context beyond the summary, such as behavior and edge cases.
Operations should have an operationIdMissing operationIds make SDK method and function names unpredictable and hard to read.
Operations should have a meaningful tagUsing tags can help enhance readability in your API documentation, as it groups related requests together.