Steps to reproduce
good.params.json
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "0.0.0.1",
"parameters": {
"var1": {
"value": "4"
},
"var2": {
"reference": {
"keyVault": {
"id": "<keyvault-resource-id>"
},
"secretName": "<secret-name>"
}
}
}
}
$json = Get-Content $PSScriptRoot\good.params.json -Raw
$schemaUri = ($json | ConvertFrom-Json).'$schema' -replace "#.*"
[string]$schema = Invoke-WebRequest $schemaUri
Test-Json -Json $json -Schema $schema
Expected behavior
I have tested the schema and json in two online validators and neither had issues, so I would expect Test-Json to not throw an error.
Actual behavior
Test-Json : Cannot parse the JSON schema.
At /bugrepro.ps1:4 char:1
+ Test-Json -Json $json -Schema $schema
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Test-Json], Exception
+ FullyQualifiedErrorId : InvalidJsonSchema,Microsoft.PowerShell.Commands.TestJsonCommand
Environment data
Name Value
---- -----
PSVersion 6.2.0
PSEdition Core
GitCommitId 6.2.0
OS Darwin 18.5.0 Darwin Kernel Version 18.5.…
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Steps to reproduce
good.params.json
{ "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", "contentVersion": "0.0.0.1", "parameters": { "var1": { "value": "4" }, "var2": { "reference": { "keyVault": { "id": "<keyvault-resource-id>" }, "secretName": "<secret-name>" } } } }Expected behavior
I have tested the schema and json in two online validators and neither had issues, so I would expect
Test-Jsonto not throw an error.Actual behavior
Environment data