You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fromJsonSchemaDocument: import open patternProperties #10048
On 4.0.7, an object schema with patternProperties and no additionalProperties: false fails:
SchemaRepresentation.fromJsonSchemaDocument(JsonSchema.fromSchemaDraft07({type: "object",properties: {name: {type: "string"}},patternProperties: {"^x-": {type: "string"}}}),{patterns: "apply"})// Cannot import open "patternProperties": unmatched keys cannot be typed correctly.
github-workflow.json uses this shape, for example for workflow inputs and environment maps.
Context: validating .github/dependabot.yaml and GitHub workflow files with SchemaRepresentation.fromJsonSchemaDocument against the SchemaStore documents dependabot-2.0.json and github-workflow.json, to replace ajv. Since #7410 the importer rejects keywords it cannot represent, which is the right failure, but it means both real-world documents cannot be imported at all. This is one of five gaps found in those two documents; each is filed separately.
What is the feature you are proposing to solve the problem?
Import open patternProperties with unmatched keys typed as unknown, checking keys that match a pattern against its schema. The decoded type would be less precise than the closed case, which seems acceptable for an import that otherwise cannot happen at all.
What alternatives have you considered?
Adding additionalProperties: false to the vendored document: changes the published contract and rejects valid files.
Keeping ajv for these documents: what we do today.
Activity
Import open patternProperties with unknown unmatched values
Cover open patternProperties imports and isPatternProperties
Add failing tests for importing open patternProperties
Import open patternProperties with unknown unmatched values
Cover open patternProperties imports and isPatternProperties
Add failing tests for importing open patternProperties
Import open patternProperties with unknown unmatched values
Cover open patternProperties imports and isPatternProperties
Add failing tests for importing open patternProperties
Import open patternProperties with unknown unmatched values
Cover open patternProperties imports and isPatternProperties
Add failing tests for importing open patternProperties
Import open patternProperties with unknown unmatched values
Cover open patternProperties imports and isPatternProperties
24 remaining items
Add failing tests for importing open patternProperties
Import open patternProperties with unknown unmatched values
Cover open patternProperties imports and isPatternProperties
Add failing tests for importing open patternProperties
Import open patternProperties with unknown unmatched values
Cover open patternProperties imports and isPatternProperties
Add failing tests for importing open patternProperties
Import open patternProperties with unknown unmatched values
Cover open patternProperties imports and isPatternProperties
Add failing tests for importing open patternProperties
Import open patternProperties with unknown unmatched values
Cover open patternProperties imports and isPatternProperties
Add failing tests for importing open patternProperties
Import open patternProperties with unknown unmatched values
Cover open patternProperties imports and isPatternProperties