Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Update jsonschema usage #17

Merged
merged 1 commit into from
Jan 2, 2025

Conversation

Stranger6667
Copy link
Contributor

Hey!

This PR updates some usages of the jsonschema crate including the recent meta API which is dedicated to meta-schema validation (and is substantially faster than creating a new validator via Validator::new). Also, validation_error_into_owned is not needed anymore, as Validator::new returns ValidationError<'static> + there is the ValidationError::to_owned method which does exactly what validation_error_into_owned was doing.

Another small detail is that I've noticed that the actual validation error is ignored in JsonColumnMetadata::validate, so I replaced it with is_valid which is usually significantly faster for invalid instances.

Signed-off-by: Dmitry Dygalo <[email protected]>
@ignatz ignatz merged commit 6288e14 into trailbaseio:main Jan 2, 2025
1 check passed
@ignatz
Copy link
Contributor

ignatz commented Jan 2, 2025

Much appreciated, thank you!

@Stranger6667 Stranger6667 deleted the dd/update-jsonschema-usage branch January 2, 2025 08:44
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.

2 participants