Skip to content

Use ECMA-262 validator when requested#272

Merged
stevehu merged 1 commit intonetworknt:masterfrom
eirnym:joni
Mar 13, 2020
Merged

Use ECMA-262 validator when requested#272
stevehu merged 1 commit intonetworknt:masterfrom
eirnym:joni

Conversation

@eirnym
Copy link
Copy Markdown

@eirnym eirnym commented Mar 13, 2020

Add ECMA-262 regex check support for pattern.

Fixes #15

@stevehu stevehu merged commit e4809e7 into networknt:master Mar 13, 2020
@stevehu
Copy link
Copy Markdown
Contributor

stevehu commented Mar 13, 2020

Cool. Thanks a lot for your contribution.

@eirnym eirnym deleted the joni branch March 13, 2020 18:17
@stevehu
Copy link
Copy Markdown
Contributor

stevehu commented Mar 13, 2020

I have released 1.0.35 and added a document on how to choose the regex library. Please review the document and make changes if necessary. Thanks.

https://github.com/networknt/json-schema-validator/blob/master/doc/ecma-262.md

@SridharSubramaniam
Copy link
Copy Markdown

It would be good to add these new additions as separate repo instead of adding dependencies to the core lib. (especially when it requires 3rd party lib and is an optional feature)

Adding dependencies would need lot of security reviews in a large organization and it slows down the adoption of new releases. Although we won't use this new lib, we had to get it reviewed as it is now a dependency for this core validator.

@eirnym
Copy link
Copy Markdown
Author

eirnym commented Apr 9, 2020

@SridharSubramaniam per standard the library should use ECMA-262 compatible regex, while java.util.regex is quite buggy and not compliant to standard.

That library provide compliance and everything is quite good.

For example, java.util.regex successfully compiles and matches nothing this regex: {2,3} (yes, I've omitted a token to repeat), and this could be not the only issue.

BTW, it's theoretically possible to use provided library to fulfil your requirement before this behaviour become default.

@stevehu Please, make a decision, I'll provide a patch for it if needed.

@stevehu
Copy link
Copy Markdown
Contributor

stevehu commented Apr 13, 2020

@SridharSubramaniam I totally understand your concerns and want to make sure that can help to smooth the upgrade process. As @eirnym mentioned, it is OK with your organization if we change the dependency to provided?

@eirnym
Copy link
Copy Markdown
Author

eirnym commented Apr 13, 2020

@stevehu Yes, thank you

@SridharSubramaniam
Copy link
Copy Markdown

@stevehu I submitted 1.0.36 for review - waiting for review. Will update based on the outcome.. probably a couple of days out. Will get back. thanks!

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.

Regular expression should allowed input be limited?

3 participants