Skip to content

[P3] Replace vendored Gavel with in-house ajv validation #30

Description

@dalberola

Priority 3 (largest). packages/dredd/lib/vendor/gavel.js is a ~10k-line bundled build of the abandoned apiaryio/gavel.js (see lib/vendor/README.md). Dredd uses one entry point, gavel.validate(expected, real). The OpenAPI 3.1 path already bypasses Gavel for bodies via validateBodySchemaWithAjv (TransactionRunner.js).

Strategy (incremental)

  1. Extend in-house validation to cover what Gavel does for headers, status code, and structure (it already does 3.1 bodies).
  2. Run in-house and Gavel in parallel behind a flag; diff results across the existing fixtures to prove parity.
  3. Switch over per validation aspect, then delete lib/vendor/gavel.js.

Touches the validation core — must be backed by thorough characterization tests before switching. Do after P1/P2.

Done when

gavel.validate is no longer used, the vendored bundle is removed, and validation behavior is unchanged (proven by fixtures).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions