Skip to content

Conversation

@oguzhanunlu
Copy link
Member

@oguzhanunlu oguzhanunlu commented Oct 31, 2025

Overview

This PR adds a comprehensive test suite (ValidatorMessageFormatSpec) to establish a baseline of error message behavior with json-schema-validator 1.0.76. This provides confidence that future validator upgrades maintain backward compatibility in error message formatting.

Motivation

During the upgrade from json-schema-validator 1.0.76 to 1.5.8, we need to ensure that error messages remain consistent to avoid breaking changes for downstream consumers who may depend on specific error message formats.

Changes

  • Added ValidatorMessageFormatSpec: Comprehensive test suite covering all JSON Schema Draft 4 validation keywords
  • Complete coverage: 26 tests covering all validators:
    • Numeric: minimum, maximum, multipleOf, exclusiveMinimum, exclusiveMaximum
    • String: minLength, maxLength, pattern
    • Array: minItems, maxItems, uniqueItems, items, additionalItems
    • Object: minProperties, maxProperties, required, additionalProperties, patternProperties, dependencies
    • Type: type, enum
    • Composition: allOf, anyOf, oneOf, not
    • Format: format
  • Exact matching: All assertions use beEqualTo with exact error messages (no fuzzy contain matching) for maximum confidence
  • Tested on baseline: All 26 tests pass with validator 1.0.76

Next Steps

This test suite will be used to verify that the upcoming upgrade to json-schema-validator 1.5.8 maintains backward compatibility in error message formatting.

ref: https://snplow.atlassian.net/browse/PDP-2203

…patibility

This spec serves as a baseline for validator 1.0.76 error message format.
It tests all major validator types to ensure error messages remain consistent
after upgrading json-schema-validator to 1.5.8.

All 20 tests pass with validator 1.0.76, confirming that the test expectations
accurately capture the current error message behavior.
… suite

Added ValidatorMessageFormatSpec with complete coverage of all JSON Schema
Draft 4 validation keywords supported by json-schema-validator 1.0.76.

## Coverage (26 validators)
- Numeric: minimum, maximum, multipleOf, exclusiveMinimum, exclusiveMaximum
- String: minLength, maxLength, pattern
- Array: minItems, maxItems, uniqueItems, items, additionalItems
- Object: minProperties, maxProperties, required, additionalProperties, patternProperties, dependencies
- Type: type, enum
- Composition: allOf, anyOf, oneOf, not
- Format: format

## Implementation Details
- All test methods numbered sequentially (e1-e26) matching spec definition order
- All assertions use beEqualTo with exact error messages for precise matching
- No fuzzy contain() assertions - maximum confidence in error message stability

This baseline test suite will be used to verify backward compatibility
when upgrading from json-schema-validator 1.0.76 to 1.5.8.
@oguzhanunlu oguzhanunlu force-pushed the test-spec-on-old-validator branch from e59aced to 58eeaa7 Compare October 31, 2025 10:42
@oguzhanunlu oguzhanunlu merged commit bd1c6bc into develop Oct 31, 2025
1 check passed
@oguzhanunlu oguzhanunlu deleted the test-spec-on-old-validator branch October 31, 2025 11:04
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.

3 participants