Uh oh!
There was an error while loading. Please reload this page.
Require explicit JSON Schema pattern handling - #7149
Conversation
🦋 Changeset detectedLatest commit: 909e23b The changes in this PR will be included in the next version bump. This PR includes changesets to release 30 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Bundle Size AnalysisGenerated from PR build output; treat the content below as untrusted.
|
There was a problem hiding this comment.
ℹ️ No critical issues — one minor suggestion on test coverage.
Reviewed changes — this PR adds an explicit patterns policy to fromJsonSchemaDocument / fromJsonSchemaMultiDocument, defaulting to "error" so regex constraints no longer block validation implicitly:
patternsoption ("error"|"ignore"|"apply") added toFromJsonSchemaOptions, routing stringpattern,patternPropertieskeys, and patterns nested inpropertyNamesthrough the newimportPatternguard infromJsonSchemaDocument.ts:794.collectIndexSignaturesmarks ignored pattern properties and, when any are ignored, skips both their value constraints andadditionalProperties(documented, since matching keys can't be determined without evaluating the patterns).JsonSchemaGeneratornow opts intopatterns: "apply"to preserve prior always-apply behavior for code generation; tests confirmSchema.isPattern(...)is still emitted.- JSDoc/SCHEMA.md/changeset updated, with tests covering default-rejection, apply, ignore, the multi-document path, and a typetest constraining the option union.
I verified every fromJsonSchemaDocument / fromJsonSchemaMultiDocument call site: the only runtime consumer outside tests/schema tools is JsonSchemaGenerator, which is opted into "apply". The hasIgnoredPattern early-return is behaviorally equivalent to a plain assignment (in "ignore" mode every entry yields undefined), but it reads fine. No correctness issues found.
@v0 or keep the SHA fresh with Dependabot | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
Uh oh!
There was an error while loading. Please reload this page.
96f8fed to
909e23bCompareUh oh!
There was an error while loading. Please reload this page.

No description provided.