Skip to content

Improve validators to ensure more TCK test coverage #81

@pmlopes

Description

@pmlopes

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:

// date: http://tools.ietf.org/html/rfc3339#section-5.6
private static final Pattern FASTDATE = Pattern.compile("^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\d$");
private static boolean testDate(String value) {
return FASTDATE.matcher(value).find();
}

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions