Skip to content

feat(config): add schema-based configuration validator with field error reporting (#694) - #744

Open
ravendevhub wants to merge 1 commit into
Core-Foundry:mainfrom
ravendevhub:feat/config-schema-validation-694
Open

feat(config): add schema-based configuration validator with field error reporting (#694)#744
ravendevhub wants to merge 1 commit into
Core-Foundry:mainfrom
ravendevhub:feat/config-schema-validation-694

Conversation

@ravendevhub

Copy link
Copy Markdown

Summary

Resolves #694 by implementing a deterministic, schema-based configuration validation engine (listener/src/config/schema-validator.ts) that enforces explicit types, bounds, and enums on environment configurations while aggregating violations and identifying the exact affected field.

Changes

  1. Schema Validation Engine (listener/src/config/schema-validator.ts):
    • Validates required fields (CONTRACT_ADDRESSES), network enums (STELLAR_NETWORK), log levels (LOG_LEVEL), and numeric ranges (POLL_INTERVAL_MS, PORT).
    • Custom ConfigSchemaValidationError pinpoints exact offending field paths and reasons.
  2. Automated Unit Tests (listener/src/config/schema-validator.test.ts):
    • Tests valid configurations, missing required fields, enum validation, and numeric out-of-bounds errors.
  3. Documentation (docs/CONFIGURATION_SCHEMA_VALIDATION.md):
    • Documents configuration schema matrix and validation error formats.

Acceptance Criteria

  • Configuration fields have explicit types.
  • Required values are validated.
  • Numeric and enumerated values are validated.
  • Validation errors identify the affected configuration field.

…or reporting (Core-Foundry#694)

- Define explicit types, enums, and bounds for application configuration
- Validate required fields (CONTRACT_ADDRESSES), enums (STELLAR_NETWORK, LOG_LEVEL), and numeric bounds
- Aggregate validation errors pinpointing exact offending fields
- Add test suite in schema-validator.test.ts and docs in docs/CONFIGURATION_SCHEMA_VALIDATION.md
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.

Add Configuration Schema Validation

1 participant