JSON Schema can't find local external reference

I'm writing a JSON schema, so far this works great in WebStorm.

It validates my testdata.json and it is very helpful.

But when I put some objects in separate json files, saved in the same folder WebStorms complains about 'property not found'.

According to https://www.jsonschemavalidator.net/ my schema is valid. Webstorm is still correctly validating my testdata.json using this local schema but the editor complains:

The schema can be found at https://raw.githubusercontent.com/andrejellema/GlobalCoffeeDataStandard/master/schema/global-coffee-data-standard.schema.json and https://github.com/andrejellema/GlobalCoffeeDataStandard

So far I'm ignoring these warning but I don't like warnings in my code.

Please assist how to satisfy WebStorm.

Thanks,

Paul

2 comments

Specifying a relative path there, like

"$ref": "./global-unique-id.json"

should solve the issue

1

Thanks that was the trick.

Now all my editors and validators are happy.

Thanks,

Paul

0

Please sign in to leave a comment.