Open K4leri opened 3 weeks ago
It looks to me like the code copies the logic from typebox, which takes the requirement from AJV that the time value must have a timezone. Obviously that doesn't align with ISO8601 though... I thought it would be fun to fix it but since that is done on purpose I dunno what the authors would like to do about that as fixing it involves dealing with the strictTimeZone
argument as whilst true
included for the time value the !tz
check will fail.
I also wasn't convinced the regex was correct per the spec if this is supposed to match JSON schema since the regex does allow some exclusion of timezone minutes.
AJV Docs that says the timezone is required https://ajv.js.org/packages/ajv-formats.html#formats
Codebase issue location (strictTimeZone is always true) https://github.com/elysiajs/elysia/blob/main/src/formats.ts#L125
JSON Schema ref: https://datatracker.ietf.org/doc/html/rfc3339#section-5.6
What version of Elysia is running?
"elysia": "^1.1.23"
What platform is your computer?
Microsoft Windows NT 10.0.19045.0 x64
What steps can reproduce the bug?
he schema defines the timePeriod type as a string with a format of time, which is expected to be in the format HH:MM:SS. The error message returned is: "Expected string to match 'time' format".
The issue occurs consistently when providing values for startTime in the format HH:MM:SS.
What is the expected behavior?
When providing a value for the startTime property in the query, it should be validated against the expected format of HH:MM:SS (24-hour time format). If the value matches this format, the validation should pass, and the query should be processed successfully.
What do you see instead?
Additional information
No response
Have you try removing the
node_modules
andbun.lockb
and try again yet?no