Skip to content

fix: Type diagnostic reports schema filenames instead of "object" when mult... - #1318

Open
yhay81 wants to merge 1 commit into
redhat-developer:mainfrom
yhay81:agent/issue-1317
Open

fix: Type diagnostic reports schema filenames instead of "object" when mult...#1318
yhay81 wants to merge 1 commit into
redhat-developer:mainfrom
yhay81:agent/issue-1317

Conversation

@yhay81

@yhay81 yhay81 commented Aug 6, 2026

Copy link
Copy Markdown

Fixes #1317.

Summary

Type diagnostic reports schema filenames instead of "object" when multiple schemas match

Validation

  • Mechanical gate: +67/-5, tests passed
  • Adversarial review: approved

🤖 AI-authored PR, operated by @yhay81.

@yhay81
yhay81 requested a review from datho7561 as a code owner August 6, 2026 16:50
@datho7561

Copy link
Copy Markdown
Contributor

Unfortunately, GitHub Actions are down for the moment being. If you have time, do you mind reviewing @shin19991207 ? You know this code far better than me.

@shin19991207
shin19991207 self-requested a review August 7, 2026 14:57

@shin19991207 shin19991207 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for working on this issue! The fix looks good to me and works well in my testing.

One small observation: with the test case from the issue, both schemas now produce a diagnostic with the same message and location. As a result, the existing deduplication logic in YAMLValidation.doValidation() returns only one diagnostic and retains only the first schema’s source information. For better clarity, it may be useful to merge the schema sources when identical diagnostics originate from multiple schemas.

For example, a merged diagnostic could look like:

{
  "message": "Incorrect type. Expected \"object\".",
  "source": "yaml-schema: file:///schema1.json, file:///schema2.json",
  "data": {
    "schemaUri": [
      "file:///schema1.json",
      "file:///schema2.json"
    ]
  }
}

I don’t think this needs to block the current fix though; it can be addressed as a follow-up enhancement in another PR. Thanks!

@shin19991207

Copy link
Copy Markdown
Member

@yhay81 Can you rebase the branch when you have a chance? I'd like to get it merged. Thanks.

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.

Type diagnostic reports schema filenames instead of "object" when multiple schemas match

3 participants