# Lint an OpenAPI document

`POST /v1/lint`. Changed on Nov 29, 2026.

> This reference is the **skmtc/skmtc-api** API on Hub. Star it to see each revision, and add a pipeline to get its changes. https://skmtc.dev/skmtc/apis/skmtc-api

Lint an OpenAPI document, in JSON or YAML, sent as the body. Send its `content-length`: a body without one is refused with 400, and one over 60 MiB with 413, before it is read.

With no query, the report has the first 5 problems of each rule. With `rule`, it has only that rule, and `offset` and `limit` page its problems.

422 for a document no rule is for, one the linter cannot read, or one too large for the linter to check. 503 with `Retry-After` when the linter is busy with large documents or stopped. No sign-in; rate-limited per caller.

## Request

- Method: `POST`
- Path: `/v1/lint`
- content-type: `application/octet-stream`

## Query parameters

- `rule` (string): The one rule to report, as `operation-operationId`.
- `offset` (integer): The problems of `rule` to skip, 0 by default. Only with `rule`.
- `limit` (integer): The problems of `rule` to give, 100 by default. Only with `rule`.

## Request body

Content type: `application/octet-stream`. Type: `string`.

## Response

### 200

The request has succeeded.

Content type: `application/json`. Type: `object`.

What the linter found. The counts are of the whole document, whatever the query. Rules with errors come first, then the rules with the most problems.

- `counts` (object, required): How many problems the document has of each severity.
  - `error` (integer, required)
  - `warn` (integer, required)
  - `info` (integer, required)
  - `hint` (integer, required)
- `rules` (array of LintRule, required)
  - `code` (string, required): The name of the rule, as `operation-operationId`.
  - `severity` ('error' | 'warn' | 'info' | 'hint', required): How serious a problem is, as Spectral says it.
  - `count` (integer, required): How many problems the rule has in the document.
  - `problems` (array of LintProblem, required): A page of the problems, in the order of the document.
    - `message` (string, required)
    - `path` (array of string, required): The keys from the root of the document to the value the problem is in.
    - `line` (integer, required): The line the problem starts on, from 1.
    - `character` (integer, required): The character on the line the problem starts at, in UTF-16 code units, from 1.

Example response:

```json
{
  "counts": {
    "error": 0,
    "warn": 0,
    "info": 0,
    "hint": 0
  },
  "rules": [
    {
      "code": "string",
      "severity": "error",
      "count": 0,
      "problems": [
        {
          "message": "string",
          "path": [
            "string"
          ],
          "line": 0,
          "character": 0
        }
      ]
    }
  ]
}
```

### 400

Binds a concrete HTTP `Status` to the shared `ApiError` body.

Content type: `application/json`. Type: `object`.

The uniform error envelope returned for every non-2xx response.

- `code` ('badRequest' | 'unauthorized' | 'forbidden' | 'notFound' | 'conflict' | 'unprocessable' | 'gone' | 'payloadTooLarge' | 'unsupportedMediaType' | 'documentTooLarge' | 'documentRefersToOtherFiles' | 'marked' | 'webhookLimitReached' | 'rateLimited' | 'internal' | 'unavailable' | 'badGateway' | 'notImplemented', required): Machine-readable error category. Each value pairs with one HTTP status.
- `message` (string, required): Human-readable summary safe to surface to end users.
- `requestId` (string, required): Correlates the response with server logs for support.
- `details` (array of ErrorDetail)
  - `field` (string): Dotted path to the offending field, when applicable.
  - `message` (string, required): Human-readable explanation of this specific problem.

Example response:

```json
{
  "code": "badRequest",
  "message": "string",
  "requestId": "string",
  "details": [
    {
      "field": "string",
      "message": "string"
    }
  ]
}
```

### 403

Binds a concrete HTTP `Status` to the shared `ApiError` body.

Content type: `application/json`. Type: `object`.

The uniform error envelope returned for every non-2xx response.

- `code` ('badRequest' | 'unauthorized' | 'forbidden' | 'notFound' | 'conflict' | 'unprocessable' | 'gone' | 'payloadTooLarge' | 'unsupportedMediaType' | 'documentTooLarge' | 'documentRefersToOtherFiles' | 'marked' | 'webhookLimitReached' | 'rateLimited' | 'internal' | 'unavailable' | 'badGateway' | 'notImplemented', required): Machine-readable error category. Each value pairs with one HTTP status.
- `message` (string, required): Human-readable summary safe to surface to end users.
- `requestId` (string, required): Correlates the response with server logs for support.
- `details` (array of ErrorDetail)
  - `field` (string): Dotted path to the offending field, when applicable.
  - `message` (string, required): Human-readable explanation of this specific problem.

Example response:

```json
{
  "code": "badRequest",
  "message": "string",
  "requestId": "string",
  "details": [
    {
      "field": "string",
      "message": "string"
    }
  ]
}
```

### 413

Binds a concrete HTTP `Status` to the shared `ApiError` body.

Content type: `application/json`. Type: `object`.

The uniform error envelope returned for every non-2xx response.

- `code` ('badRequest' | 'unauthorized' | 'forbidden' | 'notFound' | 'conflict' | 'unprocessable' | 'gone' | 'payloadTooLarge' | 'unsupportedMediaType' | 'documentTooLarge' | 'documentRefersToOtherFiles' | 'marked' | 'webhookLimitReached' | 'rateLimited' | 'internal' | 'unavailable' | 'badGateway' | 'notImplemented', required): Machine-readable error category. Each value pairs with one HTTP status.
- `message` (string, required): Human-readable summary safe to surface to end users.
- `requestId` (string, required): Correlates the response with server logs for support.
- `details` (array of ErrorDetail)
  - `field` (string): Dotted path to the offending field, when applicable.
  - `message` (string, required): Human-readable explanation of this specific problem.

Example response:

```json
{
  "code": "badRequest",
  "message": "string",
  "requestId": "string",
  "details": [
    {
      "field": "string",
      "message": "string"
    }
  ]
}
```

### 422

Binds a concrete HTTP `Status` to the shared `ApiError` body.

Content type: `application/json`. Type: `object`.

The uniform error envelope returned for every non-2xx response.

- `code` ('badRequest' | 'unauthorized' | 'forbidden' | 'notFound' | 'conflict' | 'unprocessable' | 'gone' | 'payloadTooLarge' | 'unsupportedMediaType' | 'documentTooLarge' | 'documentRefersToOtherFiles' | 'marked' | 'webhookLimitReached' | 'rateLimited' | 'internal' | 'unavailable' | 'badGateway' | 'notImplemented', required): Machine-readable error category. Each value pairs with one HTTP status.
- `message` (string, required): Human-readable summary safe to surface to end users.
- `requestId` (string, required): Correlates the response with server logs for support.
- `details` (array of ErrorDetail)
  - `field` (string): Dotted path to the offending field, when applicable.
  - `message` (string, required): Human-readable explanation of this specific problem.

Example response:

```json
{
  "code": "badRequest",
  "message": "string",
  "requestId": "string",
  "details": [
    {
      "field": "string",
      "message": "string"
    }
  ]
}
```

### 429

Binds a concrete HTTP `Status` to the shared `ApiError` body.

Content type: `application/json`. Type: `object`.

The uniform error envelope returned for every non-2xx response.

- `code` ('badRequest' | 'unauthorized' | 'forbidden' | 'notFound' | 'conflict' | 'unprocessable' | 'gone' | 'payloadTooLarge' | 'unsupportedMediaType' | 'documentTooLarge' | 'documentRefersToOtherFiles' | 'marked' | 'webhookLimitReached' | 'rateLimited' | 'internal' | 'unavailable' | 'badGateway' | 'notImplemented', required): Machine-readable error category. Each value pairs with one HTTP status.
- `message` (string, required): Human-readable summary safe to surface to end users.
- `requestId` (string, required): Correlates the response with server logs for support.
- `details` (array of ErrorDetail)
  - `field` (string): Dotted path to the offending field, when applicable.
  - `message` (string, required): Human-readable explanation of this specific problem.

Example response:

```json
{
  "code": "badRequest",
  "message": "string",
  "requestId": "string",
  "details": [
    {
      "field": "string",
      "message": "string"
    }
  ]
}
```

### 503

503 - the service cannot answer this request now.

Content type: `application/json`. Type: `object`.

The uniform error envelope returned for every non-2xx response.

- `code` ('badRequest' | 'unauthorized' | 'forbidden' | 'notFound' | 'conflict' | 'unprocessable' | 'gone' | 'payloadTooLarge' | 'unsupportedMediaType' | 'documentTooLarge' | 'documentRefersToOtherFiles' | 'marked' | 'webhookLimitReached' | 'rateLimited' | 'internal' | 'unavailable' | 'badGateway' | 'notImplemented', required): Machine-readable error category. Each value pairs with one HTTP status.
- `message` (string, required): Human-readable summary safe to surface to end users.
- `requestId` (string, required): Correlates the response with server logs for support.
- `details` (array of ErrorDetail)
  - `field` (string): Dotted path to the offending field, when applicable.
  - `message` (string, required): Human-readable explanation of this specific problem.

Example response:

```json
{
  "code": "badRequest",
  "message": "string",
  "requestId": "string",
  "details": [
    {
      "field": "string",
      "message": "string"
    }
  ]
}
```

## Changes

### Nov 29, 2026 (`7dfef83950e3`)

- endpoint added

[Operation history](https://skmtc.dev/skmtc/apis/skmtc-api/changes/v1/lint/post)
