Skip to content

add high-level validator serialization API#117

Closed
srivastava-diya wants to merge 1 commit into
hyperjump-io:mainfrom
srivastava-diya:main
Closed

add high-level validator serialization API#117
srivastava-diya wants to merge 1 commit into
hyperjump-io:mainfrom
srivastava-diya:main

Conversation

@srivastava-diya
Copy link
Copy Markdown
Contributor

Description

Resolves #112

This PR introduces a first-class, high-level API for validator serialization, allowing users to cleanly serialize and restore validators without interacting directly with the low-level AST.

Changes included:

  • Attached a .serialize() method directly to the validator function returned by validate().
  • Added a new restoreValidator(json) API that deserializes the AST and reconstructs the validator by resolving its evaluation plugins.
  • Cleaned up function signatures by removing the obsolete DeserializeOptions type and options parameters, as pluginsById is no longer required with the new approach.
  • Added a test suite (lib/restore-validator.spec.ts) to ensure the high-level API behaves correctly.

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.

Make validator serialization a first-class feature

1 participant