Skip to content

Fix crash on --default-dialect relative path without $id#776

Merged
jviotti merged 2 commits into
mainfrom
meta-default-dialect-no-id
Jun 10, 2026
Merged

Fix crash on --default-dialect relative path without $id#776
jviotti merged 2 commits into
mainfrom
meta-default-dialect-no-id

Conversation

@jviotti

@jviotti jviotti commented Jun 10, 2026

Copy link
Copy Markdown
Member

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

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

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

1 issue found across 3 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="test/CMakeLists.txt">

<violation number="1" location="test/CMakeLists.txt:760">
P2: Missing JSON variant for fail error test case. The test `fail_lint_default_dialect_config_file_uri_no_id` asserts lint violation output in human-readable form but does not include a `_json` variant that asserts on the structured JSON error output with `--json`. This means JSON error reporting is not validated for this crash-fix scenario.</violation>
</file>

Tip: cubic used a learning from your PR history. Let your coding agent read cubic learnings directly with the cubic MCP.

Re-trigger cubic

Comment thread test/CMakeLists.txt
@augmentcode

augmentcode Bot commented Jun 10, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: This PR prevents a crash when using a relative --default-dialect (or config defaultDialect) that resolves to a schema without an explicit $id.

Changes:

  • Added `ensure_identifier()` to detect fetched schema documents with an empty identifier and reidentify them using the fetch target.
  • Updated `CustomResolver::operator()` to run this normalization step on any successfully fetched schema.
  • Added a regression lint test that uses a custom default dialect metaschema file lacking `$id` and verifies lint output/exit code.
  • Registered the new test in the test CMakeLists.

Technical Notes: The resolver now assigns an identifier based on the resolved base dialect’s ID keyword, ensuring downstream dialect/vocabulary handling doesn’t assume $id is present and non-empty.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review completed. No suggestions at this time.

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

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
@jviotti jviotti merged commit 71ff30d into main Jun 10, 2026
15 checks passed
@jviotti jviotti deleted the meta-default-dialect-no-id branch June 10, 2026 18:25
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