vscode-yaml icon indicating copy to clipboard operation
vscode-yaml copied to clipboard

validate doesn't flag unknown fields

Open dcsan opened this issue 4 years ago • 2 comments

I've created a schema, and while the plugin will suggest to me fields, and flag when I add the wrong types for know fields,

it does NOT flag if I add random new fields / wrongly named fields to the doc.

Is there a strict setting or something similar?

currently it's very easy to name a field like numbr instead of number and get no warning

also the actual suggestion ctrl-space seems to not suggest a lot of stuff.

is there a way to run a "validate" command to flag all the problems? I do see some issues come up in the Problems panel while editing, but only while I'm in the middle of typing and the data is in incomplete / editing mode. As soon as it's finished all my bugs/mitsakes get ignored.

dcsan avatar Jul 28 '20 02:07 dcsan

NVM

"additionalProperties": false

https://json-schema.org/understanding-json-schema/reference/object.html#required-properties

If i put a Getting Started together for n00bs like me in a PR would that be useful? anything else people often stumble upon?

dcsan avatar Jul 28 '20 02:07 dcsan

If you put together something simple for a getting started I can add it to the Wiki page

JPinkney avatar Jul 28 '20 12:07 JPinkney