mirror of
https://github.com/LukeHagar/redocly-cli.git
synced 2025-12-07 20:57:49 +00:00
* docs: Start with a more developer and purpose oriented landing page * docs: Clear installation options, autocomplete is a separate guide * docs: update links in installation guide * docs: Move update instructions to be a guide, remove local installation * docs: Remove git documentation from starter project * docs: Add a quicker quickstart * docs: Re-organise and flesh out commands page * docs: add built-in ruleset docs, add concept, start guide * docs: Add a guide for configuring linting * Docs: rename custom rules to assertions * docs: Sort assertion docs and examples alphabetically * docs: clearer linting explanations and signposting of rule types * Apply suggestions from code review Co-authored-by: Adam Altman <adam@redoc.ly> * docs: Remove reference to a config object, after user confusion * docs: Add docs-building entrypoint article * docs: Add one-line descriptions alongside rule names * fix: Correct images for docs overview page * docs: Link to custom function in custom plugin docs * fix: Links in rules need updating after this file moved * docs: Add concept article for openapi file wrangling * docs: assertions are now called configurable rules * fix: Broken links and a renamed file * docs: Titles, links, and restructuring * Apply suggestions from code review Co-authored-by: Adam Altman <adam@redoc.ly> * fix: Redirect for renamed CLI update guide * Apply suggestions from code review Co-authored-by: Adam Altman <adam@redoc.ly> * chore: reduce filesize of images * docs: Detangle the custom/configurable rules vs assertions confusion * fix: labels as well as links to configurable rules * Update docs/guides/configure-rules.md Co-authored-by: Adam Altman <adam@redoc.ly> * fix: Better example wording and fix title case * Update docs/commands/index.md Co-authored-by: Adam Altman <adam@redoc.ly> * Update docs/rules/recommended.md Co-authored-by: Adam Altman <adam@redoc.ly> * Update docs/quickstart.md Co-authored-by: Adam Altman <adam@redoc.ly> * Update docs/rules.md Co-authored-by: Adam Altman <adam@redoc.ly> * chore: rename file built-in-rules.md and corresponding links (#1075) --------- Co-authored-by: Adam Altman <adam@redoc.ly>
77 lines
1.5 KiB
Markdown
77 lines
1.5 KiB
Markdown
# path-not-include-query
|
|
|
|
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|✅|
|
|
|
|
## API design principles
|
|
|
|
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).
|
|
|
|
## Configuration
|
|
|
|
|
|
|Option|Type|Description|
|
|
|---|---|---|
|
|
|severity|string|Possible values: `off`, `warn`, `error`. Default `off` (in `recommended` configuration). |
|
|
|
|
An example configuration:
|
|
|
|
```yaml
|
|
rules:
|
|
path-not-included-query: error
|
|
```
|
|
|
|
## Examples
|
|
|
|
|
|
Given this configuration:
|
|
|
|
```yaml
|
|
rules:
|
|
path-not-included-query: error
|
|
```
|
|
|
|
Example of an **incorrect** path:
|
|
|
|
```yaml
|
|
paths:
|
|
/customers?id={id}:
|
|
get:
|
|
parameters:
|
|
- name: id
|
|
in: query
|
|
required: true
|
|
```
|
|
|
|
Example of a **correct** path:
|
|
|
|
```yaml
|
|
paths:
|
|
/customers/{id}:
|
|
get:
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
required: true
|
|
description: The customer's ID.
|
|
```
|
|
|
|
## Related rules
|
|
|
|
- [path-parameters-defined](./path-parameters-defined.md)
|
|
- [configurable rules](./configurable-rules.md)
|
|
|
|
## Resources
|
|
|
|
- [Rule source](https://github.com/Redocly/redocly-cli/blob/main/packages/core/src/rules/common/parameter-description.ts)
|
|
- [Paths docs](https://redocly.com/docs/openapi-visual-reference/paths/)
|
|
- [Operation docs](https://redocly.com/docs/openapi-visual-reference/operation/)
|