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

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

add more anchor validation tests #724

Closed gregsdennis closed 4 months ago

gregsdennis commented 4 months ago

I had a user report that my library isn't checking anchors correctly. Apparently I missed that the allowable characters changed from 2019-09 (and previous) to 2020-12.

This PR adds more tests for anchor validity.

I have updated my implementation and verified these new tests against it.

notEthan commented 4 months ago

Over in (unmerged) PR https://github.com/json-schema-org/JSON-Schema-Test-Suite/pull/718 I remove the tests this expands, after discussion in https://github.com/json-schema-org/JSON-Schema-Test-Suite/pull/716, on the basis that it's not really testing anything in particular about $anchor but is just testing the pattern that the meta-schema applies to the value.

gregsdennis commented 4 months ago

Ah, yeah, I remember seeing that.

While I don't disagree with the argument, I hadn't noticed the pattern change, and I feel that this would have caught my error.

gregsdennis commented 4 months ago

I guess we really just need a way to say, "This schema is invalid," which is something that seems to keep coming up.

gregsdennis commented 4 months ago

I'm going to close this in favor of #718. I'll need to add these tests locally.