Skip to content

Fix validation crashing on empty enum in 2019-09 and 2020-12#734

Merged
jviotti merged 1 commit intomainfrom
empty-enum
Apr 24, 2026
Merged

Fix validation crashing on empty enum in 2019-09 and 2020-12#734
jviotti merged 1 commit intomainfrom
empty-enum

Conversation

@jviotti
Copy link
Copy Markdown
Member

@jviotti jviotti commented Apr 24, 2026

Signed-off-by: Juan Cruz Viotti jv@jviotti.com

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 20 files

@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented Apr 24, 2026

🤖 Augment PR Summary

Summary: Updates the vendored Blaze engine to prevent validation crashes when an enum keyword is present but empty (notably affecting newer JSON Schema drafts).

Changes:

  • Bumps the vendored vendor/blaze dependency and its embedded JSON-Schema-Test-Suite revision.
  • Adds a new Blaze documentation component (CMake option, install config wiring) plus a schema describing the documentation JSON format.
  • Introduces new canonicalizer rules (InlineSingleUseRef, AllOfMergeCompatibleBranches) and adjusts existing canonicalization behavior around allOf, refs, and type inference.
  • Improves type inference in in-place applicators (including inferring types from non-empty enum siblings and some $ref targets).
  • Adjusts alterschema transformer reference-rewrite logic to better handle relocated reference origins after transforms.
  • Fixes empty-enum validation by compiling it into an unconditional failure and adds a clearer evaluator message for that case.

Technical Notes: The empty-enum case now produces an AssertionFail instruction and a dedicated human-readable message during evaluation.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

Choose a reason for hiding this comment

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

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

if (visited.find(&target_schema) != visited.end()) {
return schema; // NOLINT(bugprone-return-const-ref-from-parameter)
}
return target_schema;
Copy link
Copy Markdown

@augmentcode augmentcode Bot Apr 24, 2026

Choose a reason for hiding this comment

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

vendor/blaze/src/documentation/documentation.cc:595: resolve_ref returns the referenced schema and discards any sibling annotations on the $ref wrapper (e.g., title/description), which means walk_properties/walk_pattern_properties may omit property-level documentation metadata when schemas are written as $ref + annotations.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

auto ref_path{sourcemeta::core::JSON::make_array()};
ref_path.push_back(make_path_segment("synthetic", "root"));
visited.emplace(&target_schema,
VisitedEntry{.identifier = next_identifier,
Copy link
Copy Markdown

@augmentcode augmentcode Bot Apr 24, 2026

Choose a reason for hiding this comment

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

vendor/blaze/src/documentation/documentation.cc:1343-1345: VisitedEntry.identifier is set to next_identifier before walk_schema() consumes that value for the table identifier and then increments again for the first emitted row. If recursiveRef.identifier is meant to point at a target row identifier (as implied by the HTML rendering/target-collection logic), this looks like an off-by-one that could break recursive reference linking.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
@jviotti jviotti merged commit ff2ece8 into main Apr 24, 2026
13 checks passed
@jviotti jviotti deleted the empty-enum branch April 24, 2026 19:42
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.

1 participant