Skip to content

test(format/date): assert hyphen literal separator compliance#950

Open
AcEKaycgR wants to merge 1 commit into
json-schema-org:mainfrom
AcEKaycgR:date-hyphen-separators
Open

test(format/date): assert hyphen literal separator compliance#950
AcEKaycgR wants to merge 1 commit into
json-schema-org:mainfrom
AcEKaycgR:date-hyphen-separators

Conversation

@AcEKaycgR

Copy link
Copy Markdown
Contributor

Applies to: draft-v1, draft-07, draft/2019-09, draft/2020-12

Adds 6 new cases covering separator character validation in the RFC 3339 Section 5.6 full-date grammar. This ensures that parsers strictly reject non-hyphen separators, mixed separators, and duplicated hyphens.

Added:

  • Colon separators (2020:01:01)
  • Dot separators (2020.01.01)
  • Space separators (2020 01 01)
  • Mixed slash and hyphen separators (2020-01/01)
  • Duplicated first hyphen (2020--01-01)
  • Duplicated second hyphen (2020-01--01)

@jviotti @jdesrosiers @karenetheridge Ready for review.

@AcEKaycgR AcEKaycgR requested a review from a team as a code owner June 24, 2026 13:44

@jviotti jviotti left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It would be nice to see if any existing implementation does fail at this, just to get a better sense of the value of the tests as we've been very recently doing. But other than that, it looks spec correct!

@AcEKaycgR

Copy link
Copy Markdown
Contributor Author

Thanks for the approval, @jviotti

Under Bowtie verification, strict engines like Go and Rust correctly reject these invalid separators. For engines like Python, C#, and Ruby, these tests establish necessary compliance boundaries when optional format checkers are explicitly enabled.

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.

2 participants