fix: Monaco JSON schema validation not enforcing additionalProperties#185
Draft
Copilot wants to merge 4 commits into
Draft
fix: Monaco JSON schema validation not enforcing additionalProperties#185Copilot wants to merge 4 commits into
Copilot wants to merge 4 commits into
Conversation
…SON schema validation Co-authored-by: NecatiMeral <7882753+NecatiMeral@users.noreply.github.com>
…safe optional chaining for matchMedia Co-authored-by: NecatiMeral <7882753+NecatiMeral@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add Monaco editor integration with JSON schema validation
feat: Integrate Monaco editor for profile filter configuration with JSON schema validation
Feb 20, 2026
…quest: false and using universal fileMatch Co-authored-by: NecatiMeral <7882753+NecatiMeral@users.noreply.github.com>
Copilot
AI
changed the title
feat: Integrate Monaco editor for profile filter configuration with JSON schema validation
fix: Monaco JSON schema validation not enforcing additionalProperties
Mar 7, 2026
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Monaco's JSON worker was silently ignoring the
additionalProperties: falseconstraints defined throughoutpr-filter-schema.ts, allowing arbitrary extra properties without any validation error.Root causes
1.
enableSchemaRequestnot set →$refresolution brokenWithout
enableSchemaRequest: false, Monaco's JSON worker attempted to fetch the schema from theurifield (https://pullrequest-manager.local/…). That address is unreachable, the fetch failed silently, and$refresolution against the document root failed with it — meaningFilterNode,UserFilter, andReviewerFilterdefinitions were never applied.2. Custom-scheme
fileMatchnever matched['pullrequest-manager:///profile-filter/*.json']relied on Monaco's glob matcher treating the custom scheme as a literal prefix. It doesn't — the match failed and the schema was never associated with the editor model at all.Fix
monaco.languages.json.jsonDefaults.setDiagnosticsOptions({ validate: true, allowComments: false, + enableSchemaRequest: false, schemas: [{ uri: SCHEMA_URI, - fileMatch: [`${SCHEMA_PATH_PREFIX}*.json`], + fileMatch: ['**'], schema: PR_FILTER_SCHEMA, }], })enableSchemaRequest: false— forces Monaco to use the inlineschemaobject directly, making$ref → #/definitions/*resolution work correctly.fileMatch: ['**']— universally matches any model URI, bypassing the custom-scheme matching issue. Since the profile filter editor is the only Monaco JSON editor in this renderer, the broad match is safe.The
additionalProperties: falseconstraints inpr-filter-schema.tswere already correct and needed no changes.💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.