Failed to load staticwebapp.config.json schema

601 Views Asked by At

enter image description here

when I run the above ADO pipeline task, I get error "Invalid response body while trying to fetch https://json.schemastore.org/staticwebapp.config.json: read ECONNRESET✖ Failed to load staticwebapp.config.json schema. Continuing without validation! ##[error]Script failed with exit code: 1 /usr/local/bin/az account clear"

Even after adding the "curl -o dist/staticwebapp.config.schema.json https://json.schemastore.org/staticwebapp.config.json" in an attempt to download the schema locally. I still get same error.

1

There are 1 best solutions below

5
On

The "https://json.schemastore.org/staticwebapp.config.json" is not a download URL of a json file, instead, it just will return a response body with json content.

To save the response as a json file to the local, you just need to update the command lines like as below.

# If the 'dist' folder does not exist, create it.
mkdir dist

# Call the URL and save its output to a json file in the 'dist' folder.
curl https://json.schemastore.org/staticwebapp.config.json > dist/staticwebapp.config.schema.json