Skip to content

Conversation

@zaplapl
Copy link

@zaplapl zaplapl commented Apr 14, 2024

Commit motivated by discussion with @Julian here

@gregsdennis
Copy link
Member

I'm pretty sure we already have these kinds of tests. See minLength and maxLength.

These tests are checking the JSON parser, not JSON Schema.

I can provide links in the morning.

@zaplapl
Copy link
Author

zaplapl commented Apr 20, 2024

thanks for your comment @gregsdennis

as far as I can tell, the test cases you mention are different

to me this highlights that the way length is calculated for strings is different than the spec's directive on establishing identity/equality for strings

the reason I thought to put these cases in the tests for const is that it's the place where it makes the most sense to speak the schema validator evaluating equality for two strings

the issue of length might just be separate - and out of scope for the original issue

that is, it may be an issue (for this test suite) that a schema with a string field with maxLength 1 essentially accepts unbounded zalgo input since that may count as a single grapheme - but that seems like it's a consideration that is out of scope for the issue as it was originally raised - and doesn't affect the (in)correctness of this particular change

but maybe I've misunderstood

Copy link
Member

@jdesrosiers jdesrosiers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry we lost track of this. I'm picking up review if you're still interested in moving it forward.

I think @gregsdennis is right that we don't need to test that the unicode is parsed correctly. I think what we really should be testing here is that characters that look the same might not have the same code points.

So, let's pick one representation to test and put the other representation in the description or a comment for reference. I'll provide an inline example of the kind of thing I'm thinking of.

@jdesrosiers jdesrosiers merged commit cabbd65 into json-schema-org:main Oct 29, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants