-
-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JSON schema property with both $ref
and description
incorrectly resolves and does not show description
#729
Comments
This might be an issue with https://github.com/Stranger6667/jsonschema, not sure exactly where the responsibility for this comes from. Happy to remake this over there if this is the case. |
I'm now wondering if this is of my own fault. It is more likely that the behavior I expect is simply not how JSON Schema itself works/is defined. In that case I can probably use something like https://github.com/orgs/json-schema-org/discussions/502 to move the reference out of the top level area for this property, but let me know if my schema snippet is invalid and I can close this :) |
@Stranger6667 do you know if this is a bug in Taplo/JSONSchema or simply not part of the spec for JSON Schema? |
JSON Schema drafts 7 and earlier ignore all other keywords if Then it depends on how it is propagated to the editor. My assumption is that it is not from the Therefore I think the issue is somewhere in |
I recently made a change for the SchemaStore
Cargo.toml
schema that added support for[lints]
/[workspace.lints]
.For
workspace.lints
specifically, this looks like:(https://github.com/SchemaStore/schemastore/blob/7c91a8e5a643d68cd11ce7ebcd18214a88d1cf7e/src/schemas/json/cargo.json#L1185-L1193)
You can see that both
$ref
anddescription
are defined for this property. However, when using the Taplo LSP/extension in VS Code (and presumably in other editors), hovering over thelints
part ofworkspace.lints
shows no information/tooltip:When applying the same schema in a JSON file with the same contents, hovering over the
lints
property ofworkspace.lints
does show a tooltip:Contents of the two files for reference
I suspect this is an issue where when resolving the
$ref
, thedescription
field is ignored.I can confirm that the definition on hover works in general with the TOML file, as evidenced by the tooltip shown if I hover over the
clippy
property ofworkspace.lints
:And of course this still works for the JSON file:
The text was updated successfully, but these errors were encountered: