Path should not include query parameters. The query parameters should be defined on the PathItem or Operation.
| OAS | Compatibility |
|---|---|
| 2.0 | ✅ |
| 3.0 | ✅ |
| 3.1 | ✅ |
| 3.2 | ✅ |
Don't put query string items in the path, they belong in parameters with in: query. This rule is not opinionated. Its root cause is inexperience with OpenAPI (no holy war here).
| Option | Type | Description |
|---|---|---|
| severity | string | Possible values: off, warn, error. Default off (in recommended configuration). |
An example configuration:
rules:
path-not-include-query: errorGiven this configuration:
rules:
path-not-include-query: errorExample of an incorrect path:
paths:
/customers?id={id}:
get:
parameters:
- name: id
in: query
required: trueExample of a correct path:
paths:
/customers/{id}:
get:
parameters:
- name: id
in: path
required: true
description: The customer's ID.