From 5d292ce8baf4729a166e0b00c2cac4908d92fa04 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Tue, 8 Jul 2025 10:55:22 +1000 Subject: [PATCH 01/10] add documentation for validate_json_schema vrl function --- .../remap/functions/validate_json_schema.cue | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 website/cue/reference/remap/functions/validate_json_schema.cue diff --git a/website/cue/reference/remap/functions/validate_json_schema.cue b/website/cue/reference/remap/functions/validate_json_schema.cue new file mode 100644 index 0000000000000..1e5aa43a10c47 --- /dev/null +++ b/website/cue/reference/remap/functions/validate_json_schema.cue @@ -0,0 +1,76 @@ +package metadata + +remap: functions: validate_json_schema: { + category: "Type" + description: """ + Check if `value` conforms to a JSON Schema definition. + + This function validates a JSON payload against a JSON Schema definition. It can be used to ensure that the data structure and types in `value` match the expectations defined in `schema_definition`. + """ + + arguments: [ + { + name: "value" + description: #"The value to check if it conforms to the JSON schema definition."# + required: true + type: ["any"] + }, + { + name: "schema_definition" + description: #"The location (path) of the JSON Schema definition."# + required: true + type: ["any"] + }, + { + name: "ignore_unknown_formats" + description: #"Unknown formats can be silently ignored by setting this to `true` and validation continues without failing due to those fields."# + required: false + type: ["boolean"] + }, + + ] + internal_failure_reasons: [ + "`value` is not a valid JSON Schema payload.", + "`value` contains custom format declarations and `ignore_unknown_formats` has not been set to `true`.", + "`schema_definition` is not a valid JSON Schema definition.", + "`schema_definition` file does not exist.", + ] + return: { + types: ["boolean"] + rules: [ + #"Returns `true` if `value` conforms to the JSON Schema definition."#, + #"Returns `false` if `value` is anything else."#, + ] + } + + examples: [ + { + title: "Payload contains a valid email." + source: """ + validate_json_schema!(s'{{ "productUser": "valid@email.com" }}', "resources/json-schema_definition.json", false) + """ + return: true + }, + { + title: "Payload contains an invalid email." + source: """ + validate_json_schema!(s'{{ "productUser": "invalidEmail" }}', "resources/json-schema_definition.json", false) + """ + return: false + }, + { + title: "Payload contains a custom format declaration." + source: """ + validate_json_schema!(s'{{ "productUser": "a-custom-formatted-string" }}', "resources/json-schema_definition.json", false) + """ + return: false + }, + { + title: "Payload contains a custom format declaration, with ignore_unknown_formats set to true." + source: """ + validate_json_schema!(s'{{ "productUser": "a-custom-formatted-string" }}', "resources/json-schema_definition.json", true) + """ + return: true + }, + ] +} From 06751025d742a9931c9090772a76c1f9672ea805 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Tue, 8 Jul 2025 18:22:16 +1000 Subject: [PATCH 02/10] doc(validate_json_schema) docs update --- .../remap/functions/validate_json_schema.cue | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/website/cue/reference/remap/functions/validate_json_schema.cue b/website/cue/reference/remap/functions/validate_json_schema.cue index 1e5aa43a10c47..c24f90305e36d 100644 --- a/website/cue/reference/remap/functions/validate_json_schema.cue +++ b/website/cue/reference/remap/functions/validate_json_schema.cue @@ -3,11 +3,14 @@ package metadata remap: functions: validate_json_schema: { category: "Type" description: """ - Check if `value` conforms to a JSON Schema definition. - - This function validates a JSON payload against a JSON Schema definition. It can be used to ensure that the data structure and types in `value` match the expectations defined in `schema_definition`. + Check if `value` conforms to a JSON Schema definition. This function validates a JSON payload against a JSON Schema definition. It can be used to ensure that the data structure and types in `value` match the expectations defined in `schema_definition`. """ - + notices: [ + """ + This function uses a compiled schema cache. The first time it is called with a specific `schema_definition`, it will compile the schema and cache it for subsequent calls. This improves performance when validating multiple values against the same schema. + The cache implementation is fairly naive and does not support refreshing the schema if it changes. If you update the schema definition file, you must restart Vector to clear the cache. + """, + ] arguments: [ { name: "value" @@ -65,7 +68,7 @@ remap: functions: validate_json_schema: { """ return: false }, - { + { title: "Payload contains a custom format declaration, with ignore_unknown_formats set to true." source: """ validate_json_schema!(s'{{ "productUser": "a-custom-formatted-string" }}', "resources/json-schema_definition.json", true) From ab717610d210c034210970816e2e8842c8cb5468 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Fri, 11 Jul 2025 16:37:20 +1000 Subject: [PATCH 03/10] add documentation changelog fragment --- .../23359_document_validate_json_schema_vrl_function.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 changelog.d/23359_document_validate_json_schema_vrl_function.md diff --git a/changelog.d/23359_document_validate_json_schema_vrl_function.md b/changelog.d/23359_document_validate_json_schema_vrl_function.md new file mode 100644 index 0000000000000..6ca054d7dcbf9 --- /dev/null +++ b/changelog.d/23359_document_validate_json_schema_vrl_function.md @@ -0,0 +1,3 @@ +Documentation for `validate_json_schema` function for validating JSON payloads against JSON schema files. A optional configuration parameter `ignore_unknown_formats` is provided to change how custom formats are handled by the validator. Unknown formats can be silently ignored by setting this to `true` and validation continues without failing due to those fields. + +authors: jlambatl \ No newline at end of file From c7292d03353b1b0a4589552b4597fba21b190028 Mon Sep 17 00:00:00 2001 From: Pavlos Rontidis Date: Fri, 11 Jul 2025 13:27:08 -0400 Subject: [PATCH 04/10] Update website/cue/reference/remap/functions/validate_json_schema.cue Co-authored-by: Brett Blue <84536271+brett0000FF@users.noreply.github.com> --- website/cue/reference/remap/functions/validate_json_schema.cue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/cue/reference/remap/functions/validate_json_schema.cue b/website/cue/reference/remap/functions/validate_json_schema.cue index c24f90305e36d..862ae2ccf11df 100644 --- a/website/cue/reference/remap/functions/validate_json_schema.cue +++ b/website/cue/reference/remap/functions/validate_json_schema.cue @@ -42,7 +42,7 @@ remap: functions: validate_json_schema: { types: ["boolean"] rules: [ #"Returns `true` if `value` conforms to the JSON Schema definition."#, - #"Returns `false` if `value` is anything else."#, + #"Returns `false` if `value` does not conform to the JSON Schema definition."#, ] } From adaa747a33d2393f42d1aab149a246f10e47cc9d Mon Sep 17 00:00:00 2001 From: Pavlos Rontidis Date: Fri, 11 Jul 2025 13:28:03 -0400 Subject: [PATCH 05/10] cargo update -p vrl --- Cargo.lock | 199 +++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 163 insertions(+), 36 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7be10c60ede05..5ece83e0e7cc1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -102,6 +102,7 @@ dependencies = [ "cfg-if", "getrandom 0.2.15", "once_cell", + "serde", "version_check", "zerocopy 0.7.31", ] @@ -1841,6 +1842,12 @@ dependencies = [ "serde_with 3.14.0", ] +[[package]] +name = "borrow-or-share" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3eeab4423108c5d7c744f4d234de88d18d636100093ae04caf4825134b9c3a32" + [[package]] name = "brotli" version = "8.0.0" @@ -1933,6 +1940,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "bytecount" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "175812e0be2bccb6abe50bb8d566126198344f707e304f45c648fd8f2cc0365e" + [[package]] name = "bytemuck" version = "1.21.0" @@ -2291,7 +2304,7 @@ dependencies = [ "similar-asserts", "smallvec", "snafu 0.8.6", - "syslog_loose 0.22.0", + "syslog_loose", "tokio", "tokio-util", "tracing 0.1.41", @@ -3400,6 +3413,15 @@ dependencies = [ "zeroize", ] +[[package]] +name = "email_address" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e079f19b08ca6239f47f8ba8509c11cf3ea30095831f7fed61441475edd8c449" +dependencies = [ + "serde", +] + [[package]] name = "ena" version = "0.14.2" @@ -3815,6 +3837,17 @@ dependencies = [ "bitflags 1.3.2", ] +[[package]] +name = "fluent-uri" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1918b65d96df47d3591bed19c5cca17e3fa5d0707318e4b5ef2eae01764df7e5" +dependencies = [ + "borrow-or-share", + "ref-cast", + "serde", +] + [[package]] name = "flume" version = "0.10.14" @@ -3871,6 +3904,16 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "fraction" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b486ab61634f05b11b591c38c71fb25139cb55e22be4fb6ecf649cc3736c074a" +dependencies = [ + "lazy_static", + "num", +] + [[package]] name = "fsevent-sys" version = "4.1.0" @@ -4795,7 +4838,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.5.10", + "socket2 0.4.10", "tokio", "tower-service", "tracing 0.1.41", @@ -5501,11 +5544,37 @@ version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c6e529149475ca0b2820835d3dce8fcc41c6b943ca608d32f35b449255e4627" dependencies = [ - "fluent-uri", + "fluent-uri 0.1.4", "serde", "serde_json", ] +[[package]] +name = "jsonschema" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1b46a0365a611fbf1d2143104dcf910aada96fafd295bab16c60b802bf6fa1d" +dependencies = [ + "ahash 0.8.11", + "base64 0.22.1", + "bytecount", + "email_address", + "fancy-regex", + "fraction", + "idna 1.0.3", + "itoa", + "num-cmp", + "num-traits", + "once_cell", + "percent-encoding", + "referencing", + "regex", + "regex-syntax 0.8.5", + "serde", + "serde_json", + "uuid-simd", +] + [[package]] name = "k8s-e2e-tests" version = "0.1.0" @@ -6010,11 +6079,11 @@ dependencies = [ [[package]] name = "lz4_flex" -version = "0.11.3" +version = "0.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75761162ae2b0e580d7e7c390558127e5f01b4194debd6221fd8c207fc80e3f5" +checksum = "08ab2867e3eeeca90e844d1940eab391c9dc5228783db2ed999acbc0a9ed375a" dependencies = [ - "twox-hash 1.6.3", + "twox-hash", ] [[package]] @@ -6627,6 +6696,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "nom-language" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2de2bc5b451bfedaef92c90b8939a8fff5770bdcc1fafd6239d086aab8fa6b29" +dependencies = [ + "nom 8.0.0", +] + [[package]] name = "nonzero_ext" version = "0.3.0" @@ -6694,6 +6772,20 @@ dependencies = [ "rand 0.8.5", ] +[[package]] +name = "num" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b05180d69e3da0e530ba2a1dae5110317e49e3b7f3d41be227dc5f92e49ee7af" +dependencies = [ + "num-bigint", + "num-complex", + "num-integer", + "num-iter", + "num-rational 0.4.2", + "num-traits", +] + [[package]] name = "num-bigint" version = "0.4.6" @@ -6721,6 +6813,12 @@ dependencies = [ "zeroize", ] +[[package]] +name = "num-cmp" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63335b2e2c34fae2fb0aa2cecfd9f0832a1e24b3b32ecec612c3426d46dc8aaa" + [[package]] name = "num-complex" version = "0.4.4" @@ -6778,6 +6876,17 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-rational" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" +dependencies = [ + "num-bigint", + "num-integer", + "num-traits", +] + [[package]] name = "num-traits" version = "0.2.19" @@ -7818,6 +7927,17 @@ dependencies = [ "syn 2.0.104", ] +[[package]] +name = "proptest-derive" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "095a99f75c69734802359b682be8daaf8980296731f6470434ea2c652af1dd30" +dependencies = [ + "proc-macro2 1.0.95", + "quote 1.0.40", + "syn 2.0.104", +] + [[package]] name = "prost" version = "0.11.9" @@ -7898,7 +8018,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be769465445e8c1474e9c5dac2018218498557af32d9ed057325ec9a41ae81bf" dependencies = [ "heck 0.5.0", - "itertools 0.14.0", + "itertools 0.10.5", "log", "multimap", "once_cell", @@ -7944,7 +8064,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a56d757972c98b346a9b766e3f02746cde6dd1cd1d1d563472929fdd74bec4d" dependencies = [ "anyhow", - "itertools 0.14.0", + "itertools 0.10.5", "proc-macro2 1.0.95", "quote 1.0.40", "syn 2.0.104", @@ -8581,6 +8701,20 @@ dependencies = [ "syn 2.0.104", ] +[[package]] +name = "referencing" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8eff4fa778b5c2a57e85c5f2fe3a709c52f0e60d23146e2151cbef5893f420e" +dependencies = [ + "ahash 0.8.11", + "fluent-uri 0.3.2", + "once_cell", + "parking_lot", + "percent-encoding", + "serde_json", +] + [[package]] name = "regex" version = "1.11.1" @@ -10335,16 +10469,6 @@ dependencies = [ "time", ] -[[package]] -name = "syslog_loose" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "161028c00842709450114c39db3b29f44c898055ed8833bb9b535aba7facf30e" -dependencies = [ - "chrono", - "nom 7.1.3", -] - [[package]] name = "syslog_loose" version = "0.22.0" @@ -11335,16 +11459,6 @@ dependencies = [ "utf-8", ] -[[package]] -name = "twox-hash" -version = "1.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" -dependencies = [ - "cfg-if", - "static_assertions", -] - [[package]] name = "twox-hash" version = "2.1.1" @@ -11557,7 +11671,7 @@ version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1ee6bfd0a27bf614353809a035cf6880b74239ec6c5e39a7b2860ca16809137" dependencies = [ - "num-rational", + "num-rational 0.3.2", "num-traits", "typenum", ] @@ -11623,6 +11737,17 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "uuid-simd" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b082222b4f6619906941c17eb2297fff4c2fb96cb60164170522942a200bd8" +dependencies = [ + "outref", + "uuid", + "vsimd", +] + [[package]] name = "valuable" version = "0.1.0" @@ -11799,7 +11924,7 @@ dependencies = [ "portpicker", "postgres-openssl", "proptest", - "proptest-derive", + "proptest-derive 0.5.1", "prost 0.12.6", "prost-build 0.12.6", "prost-reflect", @@ -12119,7 +12244,7 @@ name = "vector-lookup" version = "0.1.0" dependencies = [ "proptest", - "proptest-derive", + "proptest-derive 0.5.1", "serde", "vector-config", "vector-config-macros", @@ -12141,7 +12266,7 @@ dependencies = [ "tokio-util", "tower 0.5.2", "tracing 0.1.41", - "twox-hash 2.1.1", + "twox-hash", "vector-common", "vector-core", ] @@ -12233,7 +12358,7 @@ checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" [[package]] name = "vrl" version = "0.25.0" -source = "git+https://github.com/vectordotdev/vrl.git?branch=main#25ec43955c030f6f51e7d8353a7fc3388664ca02" +source = "git+https://github.com/vectordotdev/vrl.git?branch=main#e717f1820138a0da0394fe609fd7d9bf072f95e2" dependencies = [ "aes", "aes-siv", @@ -12278,12 +12403,14 @@ dependencies = [ "indoc", "influxdb-line-protocol", "itertools 0.14.0", + "jsonschema", "lalrpop", "lalrpop-util", "lz4_flex", "md-5", "mlua", - "nom 7.1.3", + "nom 8.0.0", + "nom-language", "ofb", "onig", "ordered-float 4.6.0", @@ -12295,7 +12422,7 @@ dependencies = [ "prettydiff", "prettytable-rs", "proptest", - "proptest-derive", + "proptest-derive 0.6.0", "prost 0.13.5", "prost-reflect", "psl", @@ -12319,7 +12446,7 @@ dependencies = [ "snafu 0.8.6", "snap", "strip-ansi-escapes", - "syslog_loose 0.21.0", + "syslog_loose", "termcolor", "thiserror 2.0.3", "tokio", From 6d03d02f13910a46744f0d2fee45e424da32a834 Mon Sep 17 00:00:00 2001 From: Pavlos Rontidis Date: Fri, 11 Jul 2025 13:28:42 -0400 Subject: [PATCH 06/10] remove changelog --- .../23359_document_validate_json_schema_vrl_function.md | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 changelog.d/23359_document_validate_json_schema_vrl_function.md diff --git a/changelog.d/23359_document_validate_json_schema_vrl_function.md b/changelog.d/23359_document_validate_json_schema_vrl_function.md deleted file mode 100644 index 6ca054d7dcbf9..0000000000000 --- a/changelog.d/23359_document_validate_json_schema_vrl_function.md +++ /dev/null @@ -1,3 +0,0 @@ -Documentation for `validate_json_schema` function for validating JSON payloads against JSON schema files. A optional configuration parameter `ignore_unknown_formats` is provided to change how custom formats are handled by the validator. Unknown formats can be silently ignored by setting this to `true` and validation continues without failing due to those fields. - -authors: jlambatl \ No newline at end of file From fd4883efc259f57983b2a5b23e13a554b486a020 Mon Sep 17 00:00:00 2001 From: Pavlos Rontidis Date: Fri, 11 Jul 2025 15:17:21 -0400 Subject: [PATCH 07/10] update licenses --- LICENSE-3rdparty.csv | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/LICENSE-3rdparty.csv b/LICENSE-3rdparty.csv index d1be769292d5c..b74c671b206cb 100644 --- a/LICENSE-3rdparty.csv +++ b/LICENSE-3rdparty.csv @@ -104,12 +104,14 @@ block-padding,https://github.com/RustCrypto/utils,MIT OR Apache-2.0,RustCrypto D blocking,https://github.com/smol-rs/blocking,Apache-2.0 OR MIT,Stjepan Glavina bloomy,https://docs.rs/bloomy/,MIT,"Aleksandr Bezobchuk , Alexis Sellier " bollard,https://github.com/fussybeaver/bollard,Apache-2.0,Bollard contributors +borrow-or-share,https://github.com/yescallop/borrow-or-share,MIT-0,Scallop Ye brotli,https://github.com/dropbox/rust-brotli,BSD-3-Clause AND MIT,"Daniel Reiter Horn , The Brotli Authors" brotli-decompressor,https://github.com/dropbox/rust-brotli-decompressor,BSD-3-Clause OR MIT,"Daniel Reiter Horn , The Brotli Authors" bson,https://github.com/mongodb/bson-rust,MIT,"Y. T. Chung , Kevin Yeh , Saghm Rossi , Patrick Freed , Isabel Atkinson , Abraham Egnor " bstr,https://github.com/BurntSushi/bstr,MIT OR Apache-2.0,Andrew Gallant bumpalo,https://github.com/fitzgen/bumpalo,MIT OR Apache-2.0,Nick Fitzgerald bytecheck,https://github.com/djkoloski/bytecheck,MIT,David Koloski +bytecount,https://github.com/llogiq/bytecount,Apache-2.0 OR MIT,"Andre Bogus , Joshua Landau " bytemuck,https://github.com/Lokathor/bytemuck,Zlib OR Apache-2.0 OR MIT,Lokathor byteorder,https://github.com/BurntSushi/byteorder,Unlicense OR MIT,Andrew Gallant bytes,https://github.com/carllerche/bytes,MIT,Carl Lerche @@ -206,6 +208,7 @@ ed25519,https://github.com/RustCrypto/signatures/tree/master/ed25519,Apache-2.0 ed25519-dalek,https://github.com/dalek-cryptography/ed25519-dalek,BSD-3-Clause,"isis lovecruft , Tony Arcieri , Michael Rosenberg " either,https://github.com/bluss/either,MIT OR Apache-2.0,bluss elliptic-curve,https://github.com/RustCrypto/traits/tree/master/elliptic-curve,Apache-2.0 OR MIT,RustCrypto Developers +email_address,https://github.com/johnstonskj/rust-email_address,MIT,Simon Johnston encode_unicode,https://github.com/tormol/encode_unicode,Apache-2.0 OR MIT,Torbjørn Birch Moltu encoding_rs,https://github.com/hsivonen/encoding_rs,(Apache-2.0 OR MIT) AND BSD-3-Clause,Henri Sivonen endian-type,https://github.com/Lolirofle/endian-type,MIT,Lolirofle @@ -240,6 +243,7 @@ flume,https://github.com/zesterer/flume,Apache-2.0 OR MIT,Joshua Barretto foldhash,https://github.com/orlp/foldhash,Zlib,Orson Peters foreign-types,https://github.com/sfackler/foreign-types,MIT OR Apache-2.0,Steven Fackler +fraction,https://github.com/dnsl48/fraction,MIT OR Apache-2.0,dnsl48 fsevent-sys,https://github.com/octplane/fsevent-rust/tree/master/fsevent-sys,MIT,Pierre Baillet fslock,https://github.com/brunoczim/fslock,MIT,The fslock Authors funty,https://github.com/myrrlyn/funty,MIT,myrrlyn @@ -346,6 +350,7 @@ js-sys,https://github.com/rustwasm/wasm-bindgen/tree/master/crates/js-sys,MIT OR json-patch,https://github.com/idubrov/json-patch,MIT OR Apache-2.0,Ivan Dubrov jsonpath-rust,https://github.com/besok/jsonpath-rust,MIT,BorisZhguchev jsonptr,https://github.com/chanced/jsonptr,MIT OR Apache-2.0,chance dinkins +jsonschema,https://github.com/Stranger6667/jsonschema,MIT,Dmitry Dygalo k8s-openapi,https://github.com/Arnavion/k8s-openapi,Apache-2.0,Arnav Singh keccak,https://github.com/RustCrypto/sponges/tree/master/keccak,Apache-2.0 OR MIT,RustCrypto Developers kqueue,https://gitlab.com/rust-kqueue/rust-kqueue,MIT,William Orr @@ -419,8 +424,11 @@ notify-types,https://github.com/notify-rs/notify,MIT OR Apache-2.0,Daniel Faust ntapi,https://github.com/MSxDOS/ntapi,Apache-2.0 OR MIT,MSxDOS nu-ansi-term,https://github.com/nushell/nu-ansi-term,MIT,"ogham@bsago.me, Ryan Scheel (Havvy) , Josh Triplett , The Nushell Project Developers" nuid,https://github.com/casualjim/rs-nuid,Apache-2.0,Ivan Porto Carrero +num,https://github.com/rust-num/num,MIT OR Apache-2.0,The Rust Project Developers num-bigint,https://github.com/rust-num/num-bigint,MIT OR Apache-2.0,The Rust Project Developers num-bigint-dig,https://github.com/dignifiedquire/num-bigint,MIT OR Apache-2.0,"dignifiedquire , The Rust Project Developers" +num-cmp,https://github.com/lifthrasiir/num-cmp,MIT OR Apache-2.0,Kang Seonghoon +num-complex,https://github.com/rust-num/num-complex,MIT OR Apache-2.0,The Rust Project Developers num-conv,https://github.com/jhpratt/num-conv,MIT OR Apache-2.0,Jacob Pratt num-format,https://github.com/bcmyers/num-format,MIT OR Apache-2.0,Brian Myers num-integer,https://github.com/rust-num/num-integer,MIT OR Apache-2.0,The Rust Project Developers @@ -707,6 +715,7 @@ utf16_iter,https://github.com/hsivonen/utf16_iter,Apache-2.0 OR MIT,Henri Sivone utf8-width,https://github.com/magiclen/utf8-width,MIT,Magic Len utf8_iter,https://github.com/hsivonen/utf8_iter,Apache-2.0 OR MIT,Henri Sivonen uuid,https://github.com/uuid-rs/uuid,Apache-2.0 OR MIT,"Ashley Mannix, Dylan DPC, Hunar Roop Kahlon" +uuid-simd,https://github.com/Nugine/simd,MIT,The uuid-simd Authors valuable,https://github.com/tokio-rs/valuable,MIT,The valuable Authors void,https://github.com/reem/rust-void,MIT,Jonathan Reem vrl,https://github.com/vectordotdev/vrl,MPL-2.0,Vector Contributors From 6a64aea04bf7af50d80ec6b5bcf3037e66ce14cd Mon Sep 17 00:00:00 2001 From: James Lamb Date: Wed, 16 Jul 2025 08:39:39 +1000 Subject: [PATCH 08/10] add json-schema_definition for tests to pass --- lib/vector-vrl/tests/resources/json-schema_definition.json | 1 + 1 file changed, 1 insertion(+) create mode 100644 lib/vector-vrl/tests/resources/json-schema_definition.json diff --git a/lib/vector-vrl/tests/resources/json-schema_definition.json b/lib/vector-vrl/tests/resources/json-schema_definition.json new file mode 100644 index 0000000000000..6a497621ecfd2 --- /dev/null +++ b/lib/vector-vrl/tests/resources/json-schema_definition.json @@ -0,0 +1 @@ +{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://example.com/product.schema.json","title":"Product","description":"A product from Acme's catalog","type":"object","properties":{"productUser":{"description":"The unique identifier for a product user","type":"string","format":"email"}}} \ No newline at end of file From 91247ba680a4ffbb764b42afd8652ea21287f024 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Thu, 17 Jul 2025 09:12:58 +1000 Subject: [PATCH 09/10] add newline to json-schema_definition.json so cargo vdec check fmt passes --- lib/vector-vrl/tests/resources/json-schema_definition.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vector-vrl/tests/resources/json-schema_definition.json b/lib/vector-vrl/tests/resources/json-schema_definition.json index 6a497621ecfd2..9c4c8a00d0b28 100644 --- a/lib/vector-vrl/tests/resources/json-schema_definition.json +++ b/lib/vector-vrl/tests/resources/json-schema_definition.json @@ -1 +1 @@ -{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://example.com/product.schema.json","title":"Product","description":"A product from Acme's catalog","type":"object","properties":{"productUser":{"description":"The unique identifier for a product user","type":"string","format":"email"}}} \ No newline at end of file +{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://example.com/product.schema.json","title":"Product","description":"A product from Acme's catalog","type":"object","properties":{"productUser":{"description":"The unique identifier for a product user","type":"string","format":"email"}}} From eabfdfc14a905186b7b4bd979b1bfb1e33a743a6 Mon Sep 17 00:00:00 2001 From: Thomas Date: Fri, 18 Jul 2025 10:24:27 -0400 Subject: [PATCH 10/10] Fix invalid json --- .../reference/remap/functions/validate_json_schema.cue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/website/cue/reference/remap/functions/validate_json_schema.cue b/website/cue/reference/remap/functions/validate_json_schema.cue index 862ae2ccf11df..4930e35ec904a 100644 --- a/website/cue/reference/remap/functions/validate_json_schema.cue +++ b/website/cue/reference/remap/functions/validate_json_schema.cue @@ -50,28 +50,28 @@ remap: functions: validate_json_schema: { { title: "Payload contains a valid email." source: """ - validate_json_schema!(s'{{ "productUser": "valid@email.com" }}', "resources/json-schema_definition.json", false) + validate_json_schema!(s'{ "productUser": "valid@email.com" }', "resources/json-schema_definition.json", false) """ return: true }, { title: "Payload contains an invalid email." source: """ - validate_json_schema!(s'{{ "productUser": "invalidEmail" }}', "resources/json-schema_definition.json", false) + validate_json_schema!(s'{ "productUser": "invalidEmail" }', "resources/json-schema_definition.json", false) """ return: false }, { title: "Payload contains a custom format declaration." source: """ - validate_json_schema!(s'{{ "productUser": "a-custom-formatted-string" }}', "resources/json-schema_definition.json", false) + validate_json_schema!(s'{ "productUser": "a-custom-formatted-string" }', "resources/json-schema_definition.json", false) """ return: false }, { title: "Payload contains a custom format declaration, with ignore_unknown_formats set to true." source: """ - validate_json_schema!(s'{{ "productUser": "a-custom-formatted-string" }}', "resources/json-schema_definition.json", true) + validate_json_schema!(s'{ "productUser": "a-custom-formatted-string" }', "resources/json-schema_definition.json", true) """ return: true },