Skip to content

fix: honor explicit ajv strictSchema option - #901

Merged
mcollina merged 1 commit into
fastify:mainfrom
himanshu748:fix/honor-ajv-strict-schema
Oct 22, 2026
Merged

mcollina merged 1 commit into
fastify:mainfrom
himanshu748:fix/honor-ajv-strict-schema

Conversation

@himanshu748

@himanshu748 himanshu748 commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #673.

Honor explicit ajv.strictSchema: true or 'log' instead of always overwriting the option with false. The permissive default stays unchanged, including strict: true without an explicit strictSchema setting. Other enforced Ajv options are unchanged.

Added 18 regression cases covering lazy and eager validator compilation, errors, warnings and defaults. The README clarifies that this only affects schema paths compiled by Ajv, not every schema processed by fast-json-stringify.

Validation on Node 24.19.0:

  • All 605 unit tests pass with 100% statements, branches, functions and lines coverage.
  • All 15 TypeScript assertions pass.
  • ESLint passes.
  • Four targeted regression cases fail without the implementation change; all 18 pass with it.

npm run benchmark --if-present completed successfully on Node 24.19.0. These are local validation results, not a claim that upstream CI has passed.

Checklist

@gurgunday gurgunday left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mcollina
mcollina merged commit f5b5e91 into fastify:main Oct 22, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

lack of strictSchema in ajv options results in silent typos

3 participants