fix: Type diagnostic reports schema filenames instead of "object" when mult... - #1318
fix: Type diagnostic reports schema filenames instead of "object" when mult...#1318yhay81 wants to merge 1 commit into
"object" when mult...#1318Conversation
…hen multiple schemas match (redhat-developer#1317)
|
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
left a comment
There was a problem hiding this comment.
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!
|
@yhay81 Can you rebase the branch when you have a chance? I'd like to get it merged. Thanks. |
Fixes #1317.
Summary
Type diagnostic reports schema filenames instead of
"object"when multiple schemas matchValidation
🤖 AI-authored PR, operated by @yhay81.