Default `#[schemars(deny_unknown_fields)] for json-language-server schemas (#33883)
Followup to #33678, doing the same thing for all JSON Schema files provided to json-language-server Release Notes: * Added warnings for unknown fields when editing `tasks.json` / `snippets.json`.
This commit is contained in:
parent
38544e514a
commit
ed7552d3e3
14 changed files with 136 additions and 149 deletions
|
@ -427,6 +427,10 @@ impl KeymapFile {
|
|||
}
|
||||
|
||||
pub fn generate_json_schema_for_registered_actions(cx: &mut App) -> Value {
|
||||
// instead of using DefaultDenyUnknownFields, actions typically use
|
||||
// `#[serde(deny_unknown_fields)]` so that these cases are reported as parse failures. This
|
||||
// is because the rest of the keymap will still load in these cases, whereas other settings
|
||||
// files would not.
|
||||
let mut generator = schemars::generate::SchemaSettings::draft2019_09().into_generator();
|
||||
|
||||
let action_schemas = cx.action_schemas(&mut generator);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue