feat: add validate_json_schema function#1443
Conversation
validate_json_schema function
Based on feedback during the pull request review. Co-authored-by: Pavlos Rontidis <pavlos.rontidis@gmail.com>
…more understandable, updates based on pull request feedback
Can you followup after this PR is merged? 🙏 |
…ema_support_function
|
Several CI checks are failing. You can run all these locally. For example, |
…m:jlambatl/vrl into add_validate_json_schema_support_function
|
The script is failing the license check because MIT-0 should be compatible with MIT, the primary change is that it doesn't require attribution like MIT does. Here's the license declaration https://github.com/aws/mit-0. I am unsure how to proceed on this. Given that it's licensing-related, I don't think I should update the files without first raising this. I am keen to hear your suggestion on what the best next step is. I think the errors, apart from the one above, should be resolved. I have a branch waiting to create a PR in the main vector repository, I'll finalise that tomorrow |
Hi @jlambatl, we can safely add it to the |
|
The PR for Vector can be found here: vectordotdev/vector#23359 I've updated the license check_deny configuration, and that is now passing. looking at why the wasm test/build is not passing. |
|
I've had to exclude wasm support for the JSON schema add-on due to its use of I'm not 100% confident that this has been done correctly, it's the first time I've had to have target based configuration in rust. |
I have attempted this in the past but we had to revert because we couldn't integrate with Vector. See #1351. I don't remember exactly which crate was blocking this, but I think we are still blocked. So excluding sounds good for now. |
validate_json_schema() function support
This pull request creates a VRL function that validates a payload against a JSON schema definition file. The primary goal of this feature has been to provide a mechanism for users to quickly assert that the schema matches what they expect; this simplifies various error-handling conditions into a single function.
The capability validates that the format (if included in the schema definition) matches and allows the user to determine how to handle non-standard types.
Notes:
Change Type
Is this a breaking change?
How did you test this PR?
I have created several test cases in the same file as the function that test various features.
Does this PR include user-facing changes?
our guidelines.
Checklist
run
dd-rust-license-tool writeand commit the changes. More details here.References