Using spectral I keep getting invalid-ref ENOENT for values of $ref

I have been trying different values for schema references in the $ref property but I keep getting an error. Does anyone have an example that works?

For example with a reference like this, I get an error because the file being used has the reference/schema/application/vnd.sas.error/v2 part repeated.

          "application/json": {
            "schema": {
              "$ref": "reference/schema/application/vnd.sas.error/v2/error2.json"
            }
          }

1:1 error invalid-ref ENOENT: no such file or directory, open ‘/workspaces/ci360/API/mkt-api-public/build/site/marketingDesign/v1**/reference/schema/application/vnd.sas.error/v2**/reference/schema/application/vnd.sas.error/v2/error2.json’

I also tried and even though the URL works in general, I get an error like spectral is looking for a file.

          "application/json": {
            "schema": {
              "$ref": "http://10.240.11.238/reference/schema/application/vnd.sas.error/v2/error2.json"
            }
          }

1:1 error invalid-ref ENOENT: no such file or directory, open ‘/http:/10.240.11.238/reference/schema/application/vnd.sas.error/v2/reference/schema/application/vnd.sas.error/v2/error2.json’

I am running spectral version 4.1.1.

spectral --version
4.1.1

@jack.bulkley Can you open an issue against the Spectral Github repository? The developers probably have a better idea of what could be going wrong here.

Sure. I wasn’t sure of the process.