Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The metaschemas are useful but not strict enough. They don't set `additionalProperties: false`, which is great if you wanna extend the schema with your own properties, but it won't catch simple typos.

For example, the following issues pass under the metaschema.

    {"foo": {"bar": { ... }}}  # wrong
    {"foo": {"type": "object", "properties": {"bar": { ... }}}} # correct

    {"additional_properties": false} # wrong
    {"additionalProperties": false} # correct


This is intentional because unknown keywords are permitted with JSON Schema 2020-12 and prior. We are changing this with the upcoming version, which means we'll be updating the meta-schema to enforce it as well.


Will the new meta-schema still have any mechanism for things like the special keywords that editor UIs often need?


Excellent!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: