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

feat: add custom format validator #128

Merged
merged 1 commit into from
Mar 1, 2024
Merged

feat: add custom format validator #128

merged 1 commit into from
Mar 1, 2024

Conversation

pk-work
Copy link
Contributor

@pk-work pk-work commented Feb 21, 2024

No description provided.

Signed-off-by: Pascal Krause <pascal.krause@sap.com>
@pk-work
Copy link
Contributor Author

pk-work commented Feb 21, 2024

This is a proposal for PR (#125).

After I cleaned up the constructors of SchemaValidatorImpl, I saw that there were only 2 places, where the custom JsonFormatValidator needs to be added.

  1. Validator.java https://github.com/eclipse-vertx/vertx-json-schema/pull/128/files#diff-2e1fb547e8e1538ba2b1077bbd72d66d0e9365fe54455ed3bd5c66ba63e7f3a7R57
  2. SchemaRepository.java https://github.com/eclipse-vertx/vertx-json-schema/pull/128/files#diff-55b554f9d69c21b8d6a68359aef901cf24fcedf8c39e917f86d95cb46447fbd6R47

These create methods are very simple, so I decided against a builder pattern, which would add more complexity in my opinion.

This JsonFormatValidator also provides the instanceType, which could be very beneficial.

AsciiDoc is missing. I will add it, when we agreed on the API.

@pk-work pk-work requested a review from vietj February 21, 2024 14:30
@pk-work
Copy link
Contributor Author

pk-work commented Feb 21, 2024

@CheesyBoy123 what do you think?

@CheesyBoy123
Copy link
Contributor

Thanks @pk-work for this! This looks like it is exactly what we need for vertx-openapi. I've compiled this locally and installed the artifact to be used in eclipse-vertx/vertx-openapi#51. It is working without any issues, and with this change the changes are pretty minimal for vertx-openapi (only adding the custom formats)! 😄

@pk-work pk-work marked this pull request as ready for review February 22, 2024 05:39
@pk-work pk-work merged commit d6008e8 into master Mar 1, 2024
5 checks passed
@pk-work pk-work deleted the custom_format branch March 1, 2024 12:10
pk-work added a commit that referenced this pull request Mar 1, 2024
pk-work added a commit that referenced this pull request Mar 1, 2024
* fix: testDate to identify invalid date and leap year

* Fix testDate to identify invalid date and leap year

* Refine importation

* Adding idn-hostname support and some additional TCK coverages (#126)

* Fixing TCK test for ipv4 starting with a 0.

Signed-off-by: Gerrett <Gerrett.Pape@colorado.edu>

* Fixing leap second issue with negative offsets

Signed-off-by: Gerrett <Gerrett.Pape@colorado.edu>

* Adding some more checks for idn hostname.

Signed-off-by: Gerrett <Gerrett.Pape@colorado.edu>

* Reverting time change.

Signed-off-by: Gerrett <Gerrett.Pape@colorado.edu>

* adding MIDDLE dot regex checks.

Signed-off-by: Gerrett <Gerrett.Pape@colorado.edu>

* Some more support for idn hostname checking.

Signed-off-by: Gerrett <Gerrett.Pape@colorado.edu>

* Fixing naming

Signed-off-by: Gerrett <Gerrett.Pape@colorado.edu>

* Adding check for the Virma character.

* Adding idn-email checks as well.

---------

Signed-off-by: Gerrett <Gerrett.Pape@colorado.edu>

* feat: add custom format validator (#128)

* docs: add format validator docs

Signed-off-by: Pascal Krause <pascal.krause@sap.com>

---------

Signed-off-by: Gerrett <Gerrett.Pape@colorado.edu>
Signed-off-by: Pascal Krause <pascal.krause@sap.com>
Co-authored-by: lindangcdrom <130278973+lindangcdrom@users.noreply.github.com>
Co-authored-by: Gerrett Pape <Gerrett.Pape@colorado.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants