Suppressing issues

Accept intentional differences between the OpenAPI contract and the code without turning analysis off.

Documentation pages

In the contract

Add x-openapi-guard-ignore: true to an operation, a path item, or the whole document. Ignored operations still document their route, but never need an implementation and are shown as Ignored in the Operations view.

paths:
  /internal/health:
    get:
      x-openapi-guard-ignore: true

In the code

Annotate a handler or a controller with the rule’s ID. The IDs are the same as in the IntelliJ plugin, so one annotation works in both.

Rule ID
Undocumented endpoint OpenApiUndocumentedEndpoint
HTTP method mismatch OpenApiHttpMethodMismatch
Every rule ALL
@SuppressWarnings("OpenApiUndocumentedEndpoint")
@GetMapping("/internal/metrics")
public String metrics() { … }

In Kotlin, use @Suppress("OpenApiUndocumentedEndpoint"). A suppressed method mismatch is hidden on both sides.

Endpoints hidden from API documentation

Endpoints excluded from the generated API documentation are never reported as undocumented: springdoc’s @Hidden and @Operation(hidden = true), and NestJS’s @ApiExcludeEndpoint() and @ApiExcludeController().

Turning a rule off

To stop reporting a rule everywhere, set it to off in stackblender.openApiGuard.ruleSeverity. See Settings.