Skip to content

Commit c180e2e

Browse files
committed
docs(readme): clarify maxErrors wording for accuracy
- Change "original behavior" to "pre-v0.x default" in the maxErrors: 1 code comment to avoid misleading upgrading users - Reword API Reference description from "controlling how many schema errors are collected before stopping" to "that limits how many validation errors the underlying JSON Schema validator collects"
1 parent e9b5b48 commit c180e2e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ $validator = new OpenApiResponseValidator(maxErrors: 5);
155155
// Report all errors (unlimited)
156156
$validator = new OpenApiResponseValidator(maxErrors: 0);
157157

158-
// Stop at first error (original behavior)
158+
// Stop at first error (pre-v0.x default)
159159
$validator = new OpenApiResponseValidator(maxErrors: 1);
160160
```
161161

@@ -232,7 +232,7 @@ The package auto-detects the OAS version from the `openapi` field and handles sc
232232

233233
Main validator class. Validates a response body against the spec.
234234

235-
The constructor accepts a `maxErrors` parameter (default: `20`) controlling how many schema errors are collected before stopping. Use `0` for unlimited, `1` to stop at the first error.
235+
The constructor accepts a `maxErrors` parameter (default: `20`) that limits how many validation errors the underlying JSON Schema validator collects. Use `0` for unlimited, `1` to stop at the first error.
236236

237237
The optional `responseContentType` parameter enables content negotiation: when provided, non-JSON content types (e.g., `text/html`) are checked for spec presence only, while JSON-compatible types proceed to full schema validation.
238238

0 commit comments

Comments
 (0)