boon now included
This commit is contained in:
19
src/tests.rs
19
src/tests.rs
@ -488,6 +488,25 @@ fn test_validate_format_empty_string() {
|
||||
assert_success(&result);
|
||||
}
|
||||
|
||||
#[pg_test]
|
||||
fn test_validate_format_empty_string_with_ref() {
|
||||
let cache_result = format_with_ref_schemas();
|
||||
assert_success(&cache_result);
|
||||
|
||||
// Test that an optional field with a format constraint passes validation
|
||||
// when the value is an empty string, even when the schema is referenced by a punc.
|
||||
let instance = json!({
|
||||
"id": "123e4567-e89b-12d3-a456-426614174000",
|
||||
"type": "job",
|
||||
"worker_id": "" // Optional field with format, but empty string
|
||||
});
|
||||
|
||||
let result = validate_json_schema("save_job.request", jsonb(instance));
|
||||
|
||||
// This should succeed because empty strings are ignored for format validation.
|
||||
assert_success(&result);
|
||||
}
|
||||
|
||||
#[pg_test]
|
||||
fn test_validate_property_merging() {
|
||||
let cache_result = property_merging_schemas();
|
||||
|
||||
Reference in New Issue
Block a user