json-schema-org / json-schema-spec

The JSON Schema specification
http://json-schema.org/
Other
3.43k stars 251 forks source link

Remove support for unrecognized keywords #1512

Closed gregsdennis closed 2 weeks ago

gregsdennis commented 1 month ago

We discussed this a lot, but never actually made the changes.

Resolves #1340 Resolves #1365

gregsdennis commented 2 weeks ago

I'm going to leave it out of the extensions section.

x-foo and x-bar have the same annotation collection and validation behavior, but they aren't the same keyword. They have different semantics given to them by the schema author, not by the spec.

You're not wrong about this. However, those extra semantics only apply outside of the context of evaluating the schema, regardless of how or for what purpose the evaluation occurs.

The specification is saying that x- keywords are annotations only, which means the only semantics they carry or behavior they exhibit during evaluation of the schema is collection of their values as annotations. Any other semantics that a schema author or application infers must be carried out outside of the context of evaluation, where the spec cannot define requirements.