---
title: "lint expectations for ones that can never match or will not match as written"
method: PUT
path: "/mockserver/lint"
tags: ["troubleshooting"]
---

# lint expectations for ones that can never match or will not match as written

`PUT /mockserver/lint`

## Request

- Base URL: `http://localhost:1080`
- URL: `http://localhost:1080/mockserver/lint`
- Auth: none declared

Checks expectations for mistakes that stop them matching: a shadowed expectation (one evaluated earlier always matches first and never runs out), times or a time to live that allow no match, a percentage of 0, sequential responses that times never reaches, a path without a leading slash, with a scheme and host, with a query string, with a glob * or with a {name} template but no pathParameters, a misspelt method or header name, and (information only) STRICT JSON matching of a body with arrays. With expectations in the body (one or an array) it lints those without storing them; OpenAPI entries are skipped and invalid entries are reported as INVALID_EXPECTATION. With an empty body it lints the active stored expectations in the order they are evaluated. Advisory only: nothing is rejected or changed. The shadowing check compares at most 100,000 pairs and stops a regular expression that backtracks too long; shadowCheckTruncated says when either limit was reached.

## Request body

- union: list of expectations
  - Expectation (unresolved $ref)
  - Expectation[] (unresolved $ref)

## Response `200`

lint report

- object
  - `source` 'request' | 'stored'
  - `note` string
  - `expectationsChecked` integer
  - `openApiExpectationsSkipped` integer: OpenAPI entries in the body, which are not linted (body source only)
  - `inactiveExpectationsSkipped` integer: stored expectations whose times are used up or time to live has expired (stored source only)
  - `issueCount` integer
  - `errorCount` integer
  - `warningCount` integer
  - `infoCount` integer
  - `issuesTruncated` boolean: true when more than 1,000 issues were found and the rest were left out
  - `pairComparisons` integer
  - `maxPairComparisons` integer
  - `shadowCheckTruncated` boolean
  - `issues` object[]
    - `rule` 'INVALID_EXPECTATION' | 'DUPLICATE_ID' | 'SHADOWED' | 'TIMES_ZERO' | 'TIME_TO_LIVE_ZERO' | 'PERCENTAGE_ZERO' | 'UNREACHABLE_RESPONSES' | 'PATH_MISSING_LEADING_SLASH' | 'PATH_INCLUDES_SCHEME_AND_HOST' | 'PATH_INCLUDES_QUERY_STRING' | 'PATH_GLOB_WILDCARD' | 'PATH_TEMPLATE_WITHOUT_PATH_PARAMETERS' | 'METHOD_TYPO' | 'HEADER_NAME_TYPO' | 'STRICT_JSON_BODY_WITH_ARRAYS'
    - `severity` 'ERROR' | 'WARNING' | 'INFO'
    - `expectationId` string
    - `index` integer: position of the entry in the body, from 0 (body source)
    - `position` integer: position in the order the expectations are evaluated, from 1 (stored source)
    - `summary` string
    - `field` string
    - `message` string
    - `relatedExpectationId` string: for SHADOWED the expectation that matches first; for DUPLICATE_ID the one that replaces it
    - `relatedIndex` integer
    - `relatedPosition` integer
    - `relatedSummary` string

## Other responses

- `400`: the body is not JSON, or not an expectation or an array of expectations

---

[API](https://skmtc.dev/mock-server/apis/mockserver-api.md) · [All operations](https://skmtc.dev/mock-server/apis/mockserver-api/llms.txt) · [OpenAPI document](https://skmtc.dev/mock-server/apis/mockserver-api/revisions/9239b693996e?raw)
