Skip to content

Fix Draft 2020-12 schema loading error in Monaco editor#204

Draft
imApoorva36 wants to merge 2 commits intojson-schema-org:mainfrom
imApoorva36:fix/103-monaco-schema-resolution
Draft

Fix Draft 2020-12 schema loading error in Monaco editor#204
imApoorva36 wants to merge 2 commits intojson-schema-org:mainfrom
imApoorva36:fix/103-monaco-schema-resolution

Conversation

@imApoorva36
Copy link

What kind of change does this PR introduce?

Bugfix

Issue Number:

Screenshots/videos:

image

If relevant, did you update the documentation?

NA

Summary

Fixes the editor error:

Unable to load schema from 'https://json-schema.org/draft/2020-12/schema
'. No schema request service available

by updating the Monaco dependency and registering a local Draft 2020-12 schema mapping.
This prevents the editor from attempting to fetch the meta-schema remotely and removes the runtime error while keeping existing validation behavior unchanged.

Does this PR introduce a breaking change?

No

Copy link
Member

@jdesrosiers jdesrosiers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is obviously not an equivalent of a the 2020-12 meta-schema. Please don't submit slop from an LLM unless you fully understand what it has generated and have verified that it makes sense.

Are you sure you still need to register the meta-schema even after updating the monaco dependency? I wasn't expecting that it would be necessary. Did you determine if monaco is fully up-to-date with the recent changes to the JSON language server?

@imApoorva36
Copy link
Author

Hi @jdesrosiers
You were right about the earlier meta-schema approach and I've removed it entirely, apologies for the oversight.

Also, I dug deeper into why the Monaco update alone didn’t resolve this. The current Monaco release (0.55.1) bundles vscode-json-languageservice@5.3.11. The upstream fixes for Draft 2020-12 (bundled flat schema + warning removal) landed in vscode-json-languageservice version 5.6.3 (via PRs #294 and #295). Hence, standalone Monaco is effectively still behind that change.

Given this gap, I’ve updated the PR to:

  • Remove the custom meta-schema entirely
  • Update the editor configuration to keep basic JSON syntax diagnostics enabled while suppressing the schema diagnostics that the outdated internal language service cannot yet handle correctly

This stops the "No schema request service" error and the $dynamicRef warning.
From my understanding, since the tour relies on @hyperjump/json-schema for actual Draft 2020-12 validation, this keeps the editor clean for anyone without pretending Monaco supports the spec fully yet

Would love to know your thoughts!

@jdesrosiers
Copy link
Member

The current Monaco release (0.55.1) bundles vscode-json-languageservice@5.3.11. The upstream fixes for Draft 2020-12 (bundled flat schema + warning removal) landed in vscode-json-languageservice version 5.6.3 (via PRs #294 and #295). Hence, standalone Monaco is effectively still behind that change.

Great. That's the information we need.

I think instead of putting in this hack, the next step is raising an issue with Monaco asking them to update their dependency and telling them why we need it. Hopefully, that gets resolved in reasonable amount of time and no hack is necessary.

@imApoorva36
Copy link
Author

Awesome!
I can also open the upstream issue with the Monaco team if that helps, but I’m not very familiar with their contribution process yet, so any guidance there would be appreciated..

In the meantime, is there anything you'd like me to change in this PR? For example, should I keep the Monaco version bump but remove the diagnostic suppression, or would you prefer I convert this to a draft until the upstream issue moves forward?

The current Monaco release (0.55.1) bundles vscode-json-languageservice@5.3.11. The upstream fixes for Draft 2020-12 (bundled flat schema + warning removal) landed in vscode-json-languageservice version 5.6.3 (via PRs #294 and #295). Hence, standalone Monaco is effectively still behind that change.

Great. That's the information we need.

I think instead of putting in this hack, the next step is raising an issue with Monaco asking them to update their dependency and telling them why we need it. Hopefully, that gets resolved in reasonable amount of time and no hack is necessary.

@jdesrosiers
Copy link
Member

Yes, please open an issue with Monaco. Don't forget to link our issue (#103) in the issue that you create with them.

I think converting this to a draft PR is a good idea for now. Ideally, in the end, the only change that should be needed for this PR is updating the Monaco dependency.

@imApoorva36 imApoorva36 marked this pull request as draft January 7, 2026 18:58
@imApoorva36
Copy link
Author

Sounds good
I’ve converted this PR to a draft for now

I’ve also opened an upstream issue with the Monaco team here: microsoft/monaco-editor#5172.
It also links back to our issue #103.

I’ll keep this PR updated as the upstream issue progresses. Thanks for the guidance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to load schema from 'https://json-schema.org/draft/2020-12/schema'. No schema request service available

2 participants