Repository navigation
feat: Notify Invalid RegExp Patterns - #261
Martin Aeschlimann (aeschli) merged 7 commits into
Conversation
|
@microsoft-github-policy-service agree company="Shadowscape, Inc." |
|
The JSON schema spec says that regexes must match the Regular Expression specification from JavaScript. https://json-schema.org/understanding-json-schema/reference/regular_expressions. So likely this is an issue with the The error should be shown on the schema document and not on the document that is being validated. Something like 'Unable to validate value. Pattern {0} provided by the schema is not supported.' |
|
Thanks Martin Aeschlimann (@aeschli)! |
* prepare 5.4.3 (microsoft#257) * prepare 5.4.4 (microsoft#258) * feat: make the capability of newJSONDocument and JSONDocument constructor consistent (microsoft#259) * prepare 5.5.0 (microsoft#264) * use https locations for all ols schema drafts (microsoft#268) * feat: enhance JSON schema completion with enum sorting and details (microsoft#269) * prepare 5.6.0 (microsoft#271) * feat: Notify Invalid RegExp Patterns (microsoft#261) * report problem if extendedRegExp catches an error * only report invalid regex if needed * add test for invalid patterns * no optional chaining * ignore invalid regex * chore: bump action and node versions (microsoft#274) * feat: allow format range to be undefined (microsoft#272) * prepare 5.6.1 (microsoft#278) * feat: examples completion for propertyNames (microsoft#286) * update to @types/node:22x (microsoft#288) * prepare 5.6.2 (microsoft#287) * prepare 5.6.2 * update * include bundled schemas 2020-12 & 2019-09 (microsoft#294) * use flat 2019-09 and 2020-12 schemas (microsoft#295) * prepare 5.6.3 (microsoft#296) * Escape plain text description hover correctly (microsoft#283) * Escape plain text description hover correctly * Trim and escape `<` * Update test * Add PR description example as a test case Removed `MarkedString.fromPlainText` as that escapes the input and is not what we want here (we use `toMarkdown` which isn't the same) --------- Co-authored-by: Martin Aeschlimann <martinae@microsoft.com> * Bump js-yaml from 4.1.0 to 4.1.1 (microsoft#297) Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 4.1.0 to 4.1.1. - [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md) - [Commits](nodeca/js-yaml@4.1.0...4.1.1) --- updated-dependencies: - dependency-name: js-yaml dependency-version: 4.1.1 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump glob (microsoft#298) Bumps and [glob](https://github.com/isaacs/node-glob). These dependencies needed to be updated together. Updates `glob` from 10.4.5 to 10.5.0 - [Changelog](https://github.com/isaacs/node-glob/blob/main/changelog.md) - [Commits](isaacs/node-glob@v10.4.5...v10.5.0) Updates `glob` from 11.0.3 to 11.1.0 - [Changelog](https://github.com/isaacs/node-glob/blob/main/changelog.md) - [Commits](isaacs/node-glob@v10.4.5...v10.5.0) --- updated-dependencies: - dependency-name: glob dependency-version: 10.5.0 dependency-type: indirect - dependency-name: glob dependency-version: 11.1.0 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * prepare 5.6.4 (microsoft#299) * feat: make getMatchingSchemas return keys matching propertyNames schema (microsoft#279) * feat: make getMatchingSchemas return keys matching propertyNames schema * test: add test for schema matching on propertyNames --------- Co-authored-by: Martin Aeschlimann <martinae@microsoft.com> * feat: add discriminator support for JSON schema validation (microsoft#292) * feat: implement discriminator optimization for JSON schema validation * polish and extract common patterns --------- Co-authored-by: Martin Aeschlimann <martinae@microsoft.com> * prepare 5.7.0 (microsoft#301) * prepare 5.7.0 * polish * prepare 5.7.1, add DiagnosticRelatedInformation (microsoft#303) * fix typo in `additionalProperties` JSON Schema property description (microsoft#310) * Only escape to ` ` when needed (microsoft#309) * prepare 5.7.2 (microsoft#311) --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Martin Aeschlimann <martinae@microsoft.com> Co-authored-by: MO <9125255+fengzilong@users.noreply.github.com> Co-authored-by: Aeden Murray <aeden@aedenmurray.dev> Co-authored-by: Raymond Zhao <7199958+rzhao271@users.noreply.github.com> Co-authored-by: Danila Schelkov <54549682+danila-schelkov@users.noreply.github.com> Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Marco Pinton <34537387+marcopiii@users.noreply.github.com> Co-authored-by: mohanram <mohankumarelec@gmail.com> Co-authored-by: Neven Sajko <4944410+nsajko@users.noreply.github.com>

This PR allows users to be notified when an invalid regex pattern is encountered.
This is useful if a JSON schema is published that contains patterns that are not supported by
new RegExp().For example, as of time of writing, the
versionpattern for thecomposer.jsonschema includes a possessive quantifier (*+) that is not supported by JavaScript (see composer.json schema definition).