Skip to content

Conversation

@Stranger6667
Copy link
Owner

No description provided.

@codecov
Copy link

codecov bot commented Dec 2, 2025

Codecov Report

❌ Patch coverage is 84.26966% with 294 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.85%. Comparing base (9748dc1) to head (f97def9).
⚠️ Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
crates/jsonschema/src/paths.rs 73.87% 29 Missing ⚠️
crates/jsonschema/src/error.rs 89.28% 27 Missing ⚠️
crates/jsonschema/src/validator.rs 80.16% 24 Missing ⚠️
crates/jsonschema/src/keywords/helpers.rs 4.16% 23 Missing ⚠️
...s/jsonschema/src/keywords/additional_properties.rs 85.98% 22 Missing ⚠️
...tes/jsonschema/src/keywords/legacy/type_draft_4.rs 17.39% 19 Missing ⚠️
crates/jsonschema/src/keywords/content.rs 68.96% 18 Missing ⚠️
crates/jsonschema/src/keywords/dependencies.rs 68.75% 15 Missing ⚠️
crates/jsonschema/src/keywords/type_.rs 88.46% 15 Missing ⚠️
crates/jsonschema/src/keywords/minmax.rs 42.85% 12 Missing ⚠️
... and 16 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #904      +/-   ##
==========================================
- Coverage   94.38%   93.85%   -0.53%     
==========================================
  Files          78       78              
  Lines       17529    18865    +1336     
==========================================
+ Hits        16544    17706    +1162     
- Misses        985     1159     +174     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@codspeed-hq
Copy link

codspeed-hq bot commented Dec 2, 2025

CodSpeed Performance Report

Merging #904 will degrade performance by 36.95%

Comparing dd/fix-evaluation-path (a059b44) with master (14bc0dc)

Summary

⚡ 6 improvements
❌ 2 regressions
✅ 53 untouched

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark BASE HEAD Efficiency
evaluate[Open API/Zuora] 677.6 ms 383.4 ms +76.76%
evaluate[Swagger/Kubernetes] 1,043 ms 428.1 ms ×2.4
is_valid[Fast/Invalid] 922.8 ns 1,463.6 ns -36.95%
evaluate[GeoJSON/Canada] 3,213.4 ms 299.4 ms ×11
evaluate[unevaluated_items] 101.7 µs 86 µs +18.29%
validate[Fast/Invalid] 3.9 µs 4.8 µs -18.23%
build[Open API] 7.4 ms 5.6 ms +31.93%
evaluate[FHIR/Fhir] 8,689.1 µs 313.9 µs ×28

@Stranger6667 Stranger6667 force-pushed the dd/fix-evaluation-path branch 17 times, most recently from e06d3c1 to 4b04080 Compare December 7, 2025 17:40
@Stranger6667 Stranger6667 force-pushed the dd/fix-evaluation-path branch from 4b04080 to 5df9108 Compare December 7, 2025 18:18
### Fixed

- `schemaLocation` in evaluation output now excludes `$ref`/`$dynamicRef`/`$recursiveRef` per JSON Schema spec.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mention perf changes

schema_path: &Location,
) -> Result<(), ValidationError<'i>> {
if !instance.is_string() {
return Err(ctx.custom_error(schema_path, instance_path, instance, "expected a string"));
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe don' put this complexity to the user and allow to return just a message and then properly fixup ValidationError instance. This way they always be correct paths, etc

if value.as_bool() == Some(true) {
Ok(Box::new(MyValidator))
} else {
Err(ValidationError::schema(schema_path, value, "expected true"))
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, we know schema_path & value upfront, so maybe we can handle errors on the caller side instead & simplify the api?

errors.extend(self.node.iter_errors(item, &location.push(idx), ctx));
errors.extend(
self.node
.iter_errors(item, &location.push(idx), ref_path, ctx),
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should ref_path be extended? it is evaluation path

/// is already a valid JSON pointer path.
#[must_use]
pub(crate) fn join_raw_suffix(&self, suffix: &str) -> Self {
if suffix.is_empty() {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can it happen?

Comment on lines +323 to +330
let mut buffer = String::with_capacity(parent.len() + suffix.len());
buffer.push_str(parent);
buffer.push_str(suffix);
Self(Arc::from(buffer))
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just format! will be fine

Comment on lines +97 to +63
Deferred {
schema_location: Location,
/// Captured state with precomputed `eval_prefix` (computed at capture time).
captured: CapturedRefState,
/// Cached computed result (thread-safe).
cached: OnceLock<Location>,
},
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is it needed?


#[test]
fn evaluation_path_ref_unique_items() {
// Test uniqueItems validator through $ref
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe use test_case???

Stranger6667 and others added 3 commits December 22, 2025 12:01
Signed-off-by: Dmitry Dygalo <[email protected]>
Signed-off-by: Dmitry Dygalo <[email protected]>
Signed-off-by: Dmitry Dygalo <[email protected]>
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