Skip to content

$ref and fetching tree node from external source#720

Open
desertkun wants to merge 2 commits into
jdorn:masterfrom
desertkun:ref-fixes
Open

$ref and fetching tree node from external source#720
desertkun wants to merge 2 commits into
jdorn:masterfrom
desertkun:ref-fixes

Conversation

@desertkun

Copy link
Copy Markdown

Apparently, there were no way to fetch some part of external schema with $ref. This pull request fixes this commit.

{
    "$ref": "http://example.com/path/schema.json#/node_a/subnode_b"
}

Also, this commit allows enumSource to use $ref:

{
    "type": "string",
    "enumSource": [{
        "source": {
            "$ref": "http://example.com/path/schema.json#/items"
        },
        "value": "{{item.id}}",
        "title": "Item <{{item.id}}>"
     }],
}

@desertkun

Copy link
Copy Markdown
Author

Fixes this issue #697

@joel-dixon

Copy link
Copy Markdown

That's a great fix! Seems like there are some holes in handling $ref. Question: does your fork also handle relative $refs? I saw issue #544 which is having the same problem I'm having, but it hasn't been fixed.

@desertkun

Copy link
Copy Markdown
Author

Unfortunately, it does not. It just pulls https://example.com/schema.json if

"$ref": "https://example.com/schema.json#/subnode"

is mentioned, and then iterates over tree to return subnode. But I can agree, $ref functionality has bad support.

@coderofsalvation

Copy link
Copy Markdown

can somebody please merge this? I need this :)

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.

3 participants