In https://github.com/thephpleague/openapi-psr7-validator/blob/master/src/Schema/TypeFormats/StringDateTime.php the four allowed formats are declared, which a passed date-time string should match.
According to the DateTimeInterface documentation the P in Y-m-d\TH:i:sP stands for
Difference to Greenwich time (GMT) with colon between hours and minutes
where an O would stand for
Difference to Greenwich time (GMT) without colon between hours and minutes
If I pass 2025-05-28T17:39:00+0200 (without colon) the method still returns true, since it would match the first format Y-m-d\TH:i:sP.
Why? I expected to return "false" since it does not match one of the declared formats.
I also checked the RFC3339 reference which leads to timezone offset with colons.
In https://github.com/thephpleague/openapi-psr7-validator/blob/master/src/Schema/TypeFormats/StringDateTime.php the four allowed formats are declared, which a passed date-time string should match.
According to the DateTimeInterface documentation the
PinY-m-d\TH:i:sPstands forwhere an
Owould stand forIf I pass
2025-05-28T17:39:00+0200(without colon) the method still returns true, since it would match the first formatY-m-d\TH:i:sP.Why? I expected to return "false" since it does not match one of the declared formats.
I also checked the RFC3339 reference which leads to timezone offset with colons.