Skip to content

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

Merged
shin19991207 merged 1 commit into
redhat-developer:mainfrom
yhay81:agent/issue-1317
Aug 31, 2026
Merged

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

Conversation

@yhay81

@yhay81 yhay81 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

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.

@yhay81

yhay81 commented Aug 31, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto the latest main. Local validation passes (npm test: 1,319 passing, 5 pending; npm run lint: passed). Thanks!

@shin19991207
shin19991207 merged commit f6e2e8e into redhat-developer:main Aug 31, 2026
4 checks passed
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