Tried to add JSON Schema to VS Code and I can't get it to work #815
Unanswered
IlleNilsson
asked this question in
Q&A
Replies: 5 comments 7 replies
-
Hi @IlleNilsson, I went through the same exercise, but slightly altered the example grabbed from this link. {
"json.schemas": [
{
"fileMatch": [
"**/*.dsc.json",
"**/*.dsc.config.json"
],
"url": "https://aka.ms/dsc/schemas/v3/bundled/config/document.vscode.json"
}
],
"yaml.schemas": {
"https://aka.ms/dsc/schemas/v3/bundled/config/document.vscode.json": "**.dsc.{yaml,yml,config.yaml,config.yml}"
}
} When I'm creating a file now in VSCode, it gives me the IntelliSense I'm looking for. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks, I’ll try that
…________________________________
From: Gijs Reijn ***@***.***>
Sent: Friday, May 16, 2025 7:48:40 AM
To: PowerShell/DSC ***@***.***>
Cc: Ilian Nilsson ***@***.***>; Mention ***@***.***>
Subject: Re: [PowerShell/DSC] Tried to add JSON Schema to VS Code and I can't get it to work (Discussion #815)
Hi @IlleNilsson<https://github.com/IlleNilsson>,
I went through the same exercise, but slightly altered the example grabbed from this link<https://learn.microsoft.com/en-us/powershell/dsc/concepts/enhanced-authoring?view=dsc-3.0#using-the-enhanced-configuration-document-schema>.
{
"json.schemas": [
{
"fileMatch": [
"**/*.dsc.json",
"**/*.dsc.config.json"
],
"url": "https://aka.ms/dsc/schemas/v3/bundled/config/document.vscode.json"
}
],
"yaml.schemas": {
"https://aka.ms/dsc/schemas/v3/bundled/config/document.vscode.json": "**.dsc.{yaml,yml,config.yaml,config.yml}"
}
}
When I'm creating a file now in VSCode, it gives me the IntelliSense I'm looking for.
image.png (view on web)<https://github.com/user-attachments/assets/8509b828-a3fc-45f8-8427-ece47c33990b>
—
Reply to this email directly, view it on GitHub<#815 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AID6F4FAU3HLD6RX3NWZPHT26V33RAVCNFSM6AAAAAB5GIEIFSVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTGMJWGY3DCNY>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Tried it and worked some what, getting errors on parameters and metadata json schema files
…________________________________
From: Ilian Nilsson ***@***.***>
Sent: Friday, May 16, 2025 8:09:23 AM
To: PowerShell/DSC ***@***.***>; PowerShell/DSC ***@***.***>
Cc: Mention ***@***.***>
Subject: Re: [PowerShell/DSC] Tried to add JSON Schema to VS Code and I can't get it to work (Discussion #815)
Thanks, I’ll try that
________________________________
From: Gijs Reijn ***@***.***>
Sent: Friday, May 16, 2025 7:48:40 AM
To: PowerShell/DSC ***@***.***>
Cc: Ilian Nilsson ***@***.***>; Mention ***@***.***>
Subject: Re: [PowerShell/DSC] Tried to add JSON Schema to VS Code and I can't get it to work (Discussion #815)
Hi @IlleNilsson<https://github.com/IlleNilsson>,
I went through the same exercise, but slightly altered the example grabbed from this link<https://learn.microsoft.com/en-us/powershell/dsc/concepts/enhanced-authoring?view=dsc-3.0#using-the-enhanced-configuration-document-schema>.
{
"json.schemas": [
{
"fileMatch": [
"**/*.dsc.json",
"**/*.dsc.config.json"
],
"url": "https://aka.ms/dsc/schemas/v3/bundled/config/document.vscode.json"
}
],
"yaml.schemas": {
"https://aka.ms/dsc/schemas/v3/bundled/config/document.vscode.json": "**.dsc.{yaml,yml,config.yaml,config.yml}"
}
}
When I'm creating a file now in VSCode, it gives me the IntelliSense I'm looking for.
image.png (view on web)<https://github.com/user-attachments/assets/8509b828-a3fc-45f8-8427-ece47c33990b>
—
Reply to this email directly, view it on GitHub<#815 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AID6F4FAU3HLD6RX3NWZPHT26V33RAVCNFSM6AAAAAB5GIEIFSVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTGMJWGY3DCNY>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
6 replies
-
Thanks for explaining. Now we just need best practise documentation
…________________________________
From: michaeltlombardi ***@***.***>
Sent: Monday, May 19, 2025 8:42:36 PM
To: PowerShell/DSC ***@***.***>
Cc: Ilian Nilsson ***@***.***>; Mention ***@***.***>
Subject: Re: [PowerShell/DSC] Tried to add JSON Schema to VS Code and I can't get it to work (Discussion #815)
Then we have an URI problem, should we use https://aka.ms/dsc/schemas/v3/bundled/config/document.json or https://aka.ms/dsc/schemas/v3/bundled/config/document**_.vscode_**.json
The schemas with the .vscode.json are our enhanced authoring schemas<https://learn.microsoft.com/powershell/dsc/concepts/enhanced-authoring?view=dsc-3.0&preserveView=true> - the reason we publish separate schemas for this purpose is that VS Code recognizes some extended vocabulary keywords that aren't part of the JSON Schema standard (such as markdownDescription and errorMessage). The YAML and JSON language servers use those keywords to dramatically improve the experience for authoring files to a schema that uses them, but few other tools will recognize those keywords. VS Code also requires slightly different structure for the defintions, because it doesn't support canonical bundling yet.
The other schemas we publish adhere to the 2020-12 draft of the JSON Schema standard and the files in the bundled folder use canonical bundling to reduce the number of network operations needed to use the schemas. The enhanced authoring schemas include extended documentation (so you don't need to open the docs online) and default snippets to make authoring resource manifests and configuration documents easier.
—
Reply to this email directly, view it on GitHub<#815 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AID6F4CDMKHQT3EEFC4PY3327IQZZAVCNFSM6AAAAAB5GIEIFSVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTGMJZG42TANY>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
1 reply
-
Well the Uris are conflicted so some work need to be done, otherwise a lot better
…________________________________
From: Gijs Reijn ***@***.***>
Sent: Friday, May 23, 2025 10:17:10 AM
To: PowerShell/DSC ***@***.***>
Cc: Ilian Nilsson ***@***.***>; Mention ***@***.***>
Subject: Re: [PowerShell/DSC] Tried to add JSON Schema to VS Code and I can't get it to work (Discussion #815)
Does the following link provide the best practice for documentation: https://learn.microsoft.com/en-us/powershell/dsc/concepts/enhanced-authoring?view=dsc-3.0
The images are only outdated...
—
Reply to this email directly, view it on GitHub<#815 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AID6F4AZOSBVL7YPWI5H2JL273KQNAVCNFSM6AAAAAB5GIEIFSVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTGMRUGM4DEMQ>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Added DSC V3 JSON Schema Uri to VS Code settings.json like this:
Problems loading reference 'https://aka.ms/PowerShell/DSC/main/schemas/v3/config/document.resource.json': Unable to parse content from 'https://aka.ms/PowerShell/DSC/main/schemas/v3/config/document.resource.json': Parse error at offset 0.
Is what I get editing a DSC V3 document with: $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
Any ideas?
Beta Was this translation helpful? Give feedback.
All reactions