Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: request the schema id URL instead of the current page url #198

Closed
wants to merge 3 commits into from

Conversation

mmcorrelo
Copy link

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:https://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:https://localhost:3000 the deref request will be done with URL http:https://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

@philsturgeon
Copy link
Member

@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.

@philsturgeon
Copy link
Member

@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?

@jonluca jonluca closed this Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants