Skip to content

Removed wildcard support example from filter doc #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions documentation/contract_tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,7 @@ specmatic test --filter="METHOD='POST' && PATH='/users'"
|----------|-----------------------------------------------------------------------------|
| `METHOD` | Filter by HTTP methods (GET, POST, etc.) |
| `PATH` | Filter by request paths (`/users`, `/products`, etc.) |
| `STATUS` | Filter by response status codes (200, 400, etc.) — supports pattern matching with `xx` (e.g., 4xx, 2xx) |
| `STATUS` | Filter by response status codes (200, 400, etc.) |
| `HEADERS`| Filter by request headers name |
| `QUERY` | Filter by query parameters name |

Expand All @@ -980,12 +980,12 @@ specmatic test --filter="METHOD='POST' && PATH='/users'"

1. Run only successful response tests:
```bash
specmatic test --filter="STATUS='2xx'"
specmatic test --filter="STATUS='200'"
```

2. Skip 4xx error tests:
```bash
specmatic test --filter="STATUS!='4xx'"
specmatic test --filter="STATUS<'400' && STATUS>'499'"
```

3. Skip specific status codes:
Expand Down Expand Up @@ -1038,7 +1038,6 @@ System.setProperty("filter", "STATUS!='400,401'");
- Within a single filter with multiple values, tests matching **ANY** value will be included (**OR** operation).
- **Negation(!)** causes a block to be excluded from being considered.
- **Wildcard(*)** can only be used with **PATH**.
- **Range (2xx, 50x)** can only be used with **STATUS**.


> **Note:** Endpoints that are filtered out as a result of this expression are also excluded from the reports generated by Specmatic and from the coverage calculation.
Expand Down