fix: Type diagnostic reports schema filenames instead of "object" when mult... - #1318
Conversation
|
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. |
…hen multiple schemas match (redhat-developer#1317)
|
Rebased onto the latest |
d651bce to
9d98032
Compare
Fixes #1317.
Summary
Type diagnostic reports schema filenames instead of
"object"when multiple schemas matchValidation
🤖 AI-authored PR, operated by @yhay81.