Closed msgurgel-zz closed 3 years ago
Thanks Mateus!
There is unfortunately a small chance that this could be a backwards incompatible change seen from a different perspective, even though it would only apply to schemas with invalid data. But I think the risk is small enough that I'm going to merge and release as a minor anyway.
Released as 0.21.0.
We are using
format: date
in a project and we realized that it allows for dates that exceed the valid range of a month or day. e.g.2012-60-82
is considered a valid date in the current implementation.This PR validates the date using the
Date
class to ensure the value is within the correct range.We based this solution on an implemetation in a different JSON schema library: https://github.com/ruby-json-schema/json-schema/blob/765e6d8fdbfdaca1a42fa743f4621e757f9f6a03/lib/json-schema/attributes/formats/date.rb#L13