Cypress plugin (v2.0.2, last release 2023) for API schema validation against JSON schemas, Swagger, or OpenAPI documents. Uses Ajv as the validation engine. Now legacy: replaced by cypress-schema-validator (backward compatible, adds Zod support). Key features: chainable cy.validateSchema() command, supports environment variable disableSchemaValidation, integration with @bahmutov/cy-api and cypress-plugin-api. No recent updates; users should migrate to successor.
npm install cypress-ajv-schema-validatorNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to import the plugin, define a JSON schema, use cy.validateSchema() chained after cy.request(), and optionally disable validation via Cypress environment variable.
Migrate to cypress-schema-validator: npm uninstall cypress-ajv-schema-validator && npm install cypress-schema-validator (backward compatible)
Review your schemas for strict mode compatibility (e.g., remove additionalProperties if not allowed). See Ajv breaking changes.
Add import 'cypress-ajv-schema-validator' to cypress/support/e2e.js or the equivalent support file.
Set disableSchemaValidation in your Cypress config or via command line: cypress run --env disableSchemaValidation=true
import 'cypress-ajv-schema-validator' in cypress/support/e2e.js
npm install ajv --save-dev
Either remove additionalProperties from schema or add the extra fields to the properties.