Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Json Schema usage with a custom date-time pattern is not replacing the default date time regex pattern #82

Closed
pantinor opened this issue Dec 12, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@pantinor
Copy link

pantinor commented Dec 12, 2022

Questions

Refer to io.vertx.json.schema.common.SchemaImpl which has a list of validators iterated during processing.

https://github.com/eclipse-vertx/vertx-json-schema/blob/master/src/main/java/io/vertx/json/schema/common/SchemaImpl.java#L171

https://github.com/eclipse-vertx/vertx-json-schema/blob/master/src/main/java/io/vertx/json/schema/common/BaseFormatValidatorFactory.java#L103

Am adding a custom pattern on a date-time property to override the default DATETIME pattern regex, however, when processing, notice that the default BaseFormatValidatorFactory FormatValidator still remains in the validator list along with the custom PatternValidatorFactory PatternValidator that was added.

Is it a bug? Why is the default format validator there, as expected it to be replaced / removed by the custom one.

Version

4.1.2

Context

I encountered an exception which looks suspicious while testing validateSync with a schema.

Do you have a reproducer?

Yes there is a testng but it is in private project, not portable as a public project. But the existing vertx unit test might be enhanced to use a custom date time pattern to see that the default formatter is not removed from the validator list.

Steps to reproduce

Extra

The schema am using is this one:

                "effective-start": {
                    "type": "string",
                    "format": "date-time",
                    "pattern" : "^\\d{4}\\-\\d{2}\\-\\d{2}[\\s]\\d{2}:\\d{2}:\\d{2}"
                }

`

@pantinor pantinor added the bug Something isn't working label Dec 12, 2022
@pantinor pantinor changed the title Custom date-time pattern not replacing default pattern Json Schema usage with a custom date-time pattern is not replacing the default date time regex pattern Dec 15, 2022
@pk-work
Copy link
Contributor

pk-work commented May 31, 2024

Hi,

this is an issue related to a component that is not longer maintained and removed in Vert.x 5. Because of this I will close this issue. Feel free to open a new issue, in case this problem also exists in the latest validator.

@pk-work pk-work closed this as completed May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants