fix: request the schema id URL instead of the current page url
When the schema id is defined with an URL should use that hostname to request the references, instead of using the current page URL
EXAMPLE:
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://resourse.example.com/schemas/resources/main.json#",
"title": "This is my main schema",
"description": "This is my main schema description.",
"type": "object",
"properties": {
"$ref": "/schemas/resources/version1.0.1.json#"
}
}
Currently, if the dereference work is being done locally at http://localhost:3000 the deref request will be done with URL http://localhost:3000/schemas/resources/version.1.0.1.json instead of https://resourse.example.com/schemas/resources/version1.0.1.json
This is related to this issue
@Relequestual hey could I bother you for a quick check here? The issue is outlined in #199 and we want to make sure the case is even valid before merging this.
@mmcorrelo hey, sorry for being quiet on this, but it's come up a few times in conversations and I'd like to progress with it. Can you take the time to write some tests so we can see the change in behavior?