Closed
Description
monaco-editor version: >=0.19.0
Browser: Any
OS: Any
MRE Repository: https://github.com/wmain/monaco-bug
Version 0.19.0
introduces a change that breaks JSON schema's ability to utilize relative imports for $ref
properties. This is an important use case for anyone who serves their client code from different environments/hosts. After some digging I believe I've traced the issue to vscode-uri
, specifically in the migration/change referenced here, as defaulting to the file
protocol will throw CORS errors.
Activity
aeschli commentedon Sep 14, 2020
@wmain Can you share a small code sample that contains the schema similar to this: https://microsoft.github.io/monaco-editor/playground.html#extending-language-services-configure-json-defaults ?
wmain commentedon Sep 18, 2020
@aeschli I'm not sure I follow. The provided repository has a full code sample and schema in it.
aeschli commentedon Sep 21, 2020
Thanks, now I see.
I pushed a fix. This kind of worked by coincidence before. Now we properly resolve the relative ref to the URI of the schema. So in your example we will try to fetch
http://myserver/relative.json
as that the schema has URIhttp://myserver/foo-schema.json
wmain commentedon Sep 22, 2020
Thanks for the fix!