Skip to content

Commit

Permalink
fix(ns-openapi-3-0): fix polynomial regular expression (#3784)
Browse files Browse the repository at this point in the history
  • Loading branch information
char0n authored Feb 2, 2024
1 parent c771a46 commit c35c34a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class CallbackVisitor extends Mixin(PatternedFieldsVisitor, FallbackVisitor) {
this.element = new CallbackElement();
this.specPath = always(['document', 'objects', 'PathItem']);
this.canSupportSpecificationExtensions = true;
this.fieldPatternPredicate = (value) => /{(?<expression>.*)}/.test(String(value));
this.fieldPatternPredicate = (value) => /{(?<expression>[^}]{1,2083})}/.test(String(value)); // 2,083 characters is the maximum length of a URL in Chrome
}

ObjectElement(objectElement: ObjectElement) {
Expand Down

0 comments on commit c35c34a

Please sign in to comment.