vertx-json-schema icon indicating copy to clipboard operation
vertx-json-schema copied to clipboard

Improve validators to ensure more TCK test coverage

Open pmlopes opened this issue 2 years ago • 2 comments

Currently, we skip about 300 tests from the TCK:

https://github.com/eclipse-vertx/vertx-json-schema/blob/master/src/test/resources/unsupported-tck-tests.properties

This is a general purpose issue to track pull request to address the issues. The issues should be considered "good first issue" kind of tasks.

To address an unsupported test, first one needs to understand the test, for example:

draft2019-09/optional/format/date/validation\ of\ date\ strings/a\ invalid\ date\ string\ with\ 29\ days\ in\ February\ (normal)=skip
draft2019-09/optional/format/date/validation\ of\ date\ strings/a\ invalid\ date\ string\ with\ 30\ days\ in\ February\ (leap)=skip
draft2019-09/optional/format/date/validation\ of\ date\ strings/a\ invalid\ date\ string\ with\ 31\ days\ in\ April=skip
draft2019-09/optional/format/date/validation\ of\ date\ strings/a\ invalid\ date\ string\ with\ 31\ days\ in\ June=skip
draft2019-09/optional/format/date/validation\ of\ date\ strings/a\ invalid\ date\ string\ with\ 31\ days\ in\ November=skip
draft2019-09/optional/format/date/validation\ of\ date\ strings/a\ invalid\ date\ string\ with\ 31\ days\ in\ September=skip
draft2019-09/optional/format/date/validation\ of\ date\ strings/a\ invalid\ date\ string\ with\ 32\ days\ in\ August=skip
draft2019-09/optional/format/date/validation\ of\ date\ strings/a\ invalid\ date\ string\ with\ 32\ days\ in\ December=skip
draft2019-09/optional/format/date/validation\ of\ date\ strings/a\ invalid\ date\ string\ with\ 32\ days\ in\ January=skip
draft2019-09/optional/format/date/validation\ of\ date\ strings/a\ invalid\ date\ string\ with\ 32\ days\ in\ July=skip
draft2019-09/optional/format/date/validation\ of\ date\ strings/a\ invalid\ date\ string\ with\ 32\ days\ in\ March=skip
draft2019-09/optional/format/date/validation\ of\ date\ strings/a\ invalid\ date\ string\ with\ 32\ days\ in\ May=skip
draft2019-09/optional/format/date/validation\ of\ date\ strings/a\ invalid\ date\ string\ with\ 32\ days\ in\ October=skip

shows that the code we have here:

https://github.com/eclipse-vertx/vertx-json-schema/blob/cce9a6169bb979bfbf990841b2230a3fa1243f26/src/main/java/io/vertx/json/schema/impl/Format.java#L197-L202

Is actually not fully correct. It does validate that the input follows the right notation but doesn't validate edge cases like mentioned in the case above.

To fix this, that method must be refactored to perform the complete validation, not just the format string.

While this issue can be solved without much thinking, extra attention should be used to verify the performance/thread safety of the implementation as the code can be on the "hot" path of the execution of a vert.x application.

We will be availabe to support new contributors to work on these issues!

pmlopes avatar Dec 09 '22 11:12 pmlopes

looks interesting. would like to work on it.

douglas-chanwh avatar Dec 08 '23 21:12 douglas-chanwh

@pmlopes could you please give me some comments on the PR? many thanks.

douglas-chanwh avatar Dec 10 '23 11:12 douglas-chanwh