json-schema-org / JSON-Schema-Test-Suite

A language agnostic test suite for the JSON Schema specifications
MIT License
625 stars 209 forks source link

Add missing $schema keyword to required test cases #689

Closed skryukov closed 1 year ago

skryukov commented 1 year ago

This PR adds missing $schema keywords to required test cases.

Validation with absent $schema keyword shouldn't be considered as required by implementations.

Spec reference:

The "$schema" keyword SHOULD be used in the document root schema object, and MAY be used in the root schema objects of embedded schema resources. It MUST NOT appear in non-resource root schema objects. If absent from the document root schema, the resulting behavior is implementation-defined.

https://json-schema.org/draft/2020-12/json-schema-core#section-8.1.1-4

gregsdennis commented 1 year ago

Weird. This was already done in https://github.com/json-schema-org/JSON-Schema-Test-Suite/pull/586.

@Julian do you know if/why this was reverted?

Julian commented 1 year ago

They just look like new tests where it was forgotten (because we don't have a sanity check ensuring we don't forget of course).

gregsdennis commented 1 year ago

Looks like https://github.com/json-schema-org/JSON-Schema-Test-Suite/pull/594 was merged a week later and just wasn't correspondingly updated.