Skip to content

Fix some XML Schema date/time/duration correctness issues - #102

Merged
jviotti merged 1 commit into
mainfrom
xml-fixes
Jul 27, 2026
Merged

Fix some XML Schema date/time/duration correctness issues#102
jviotti merged 1 commit into
mainfrom
xml-fixes

Conversation

@jviotti

@jviotti jviotti commented Jul 27, 2026

Copy link
Copy Markdown
Member

Signed-off-by: Juan Cruz Viotti jv@jviotti.com

Review in cubic

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
@jviotti
jviotti merged commit 1112eff into main Jul 27, 2026
3 checks passed
@jviotti
jviotti deleted the xml-fixes branch July 27, 2026 15:56
@augmentcode

augmentcode Bot commented Jul 27, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: Updates the xsd:dateTime, xsd:time, and xsd:duration JSON Schemas to better match XML Schema lexical rules (no leap seconds, allow 24:00:00, constrain timezones to ±14:00).
Also updates the associated JSON tests to reflect the corrected validity expectations.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review completed. 3 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

"x-links": [ "https://www.w3.org/TR/xmlschema-2/#time" ],
"type": "string",
"pattern": "^(([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\\.[0-9]+)?|24:00:00)(Z|[+-]([01][0-9]|2[0-3]):[0-5][0-9])?$"
"pattern": "^(([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\\.[0-9]+)?|24:00:00(\\.0+)?)(Z|[+-]((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?$"

@augmentcode augmentcode Bot Jul 27, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The regex here permits 24:00:00 with a trailing fractional part of only zeros (e.g. 24:00:00.0), but the file’s $comment says hour 24 is only valid as 24:00:00. Consider aligning the comment with the actual constraint to avoid misleading schema consumers.

Severity: low

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

},
{
"description": "Valid - leap second",
"description": "Invalid - leap second is not an XSD dateTime",

@augmentcode augmentcode Bot Jul 27, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Since the timezone offset range is now constrained to ±14:00 (and minutes must be 00 when the hour is 14), consider adding tests that +14:00 is valid and e.g. +14:01/+15:00 are invalid. This would better lock in the intended correctness fix.

Severity: low

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

},
{
"description": "Valid - leap second",
"description": "Invalid - leap second is not an XSD time",

@augmentcode augmentcode Bot Jul 27, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The updated schema allows 24:00:00 with a fractional part of only zeros (e.g. 24:00:00.0), but the tests only cover 24:00:00 without fractional seconds. Adding a positive case for 24:00:00.0 (and a negative case like 24:00:00.1) would help prevent regressions around this edge case.

Severity: low

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

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.

1 participant