parser-js icon indicating copy to clipboard operation
parser-js copied to clipboard

parseFromUrl does not resolve relative references

Open jonaslagoni opened this issue 3 years ago • 2 comments

Describe the bug

Given the use of parseFromUrl I would expect that if the remote document contained relative references, they would be resolved based on the URL passed to parseFromUrl 🤔

How to Reproduce

Given a reference such as "$ref": "./components/parameters.json#/server_id" in an AsyncAPI document located at https://raw.githubusercontent.com/org/repo/main/asyncapi.json I would expect it to fetch the parameter from https://raw.githubusercontent.com/org/repo/main/components/parameters.json#/server_id instead of trying to fetch it locally on the machine.

jonaslagoni avatar Mar 25 '22 02:03 jonaslagoni

@jonaslagoni just to be sure, this is feature request, not really a bug. Especially that if someone wants to do that what you just described has an option to pass custom resolver to parseFromUrl. We just do not provide such a resolver out of the box

derberg avatar Jul 18 '22 07:07 derberg

@derberg that would make sense yes.

jonaslagoni avatar Jul 18 '22 10:07 jonaslagoni

:tada: This issue has been resolved in version 1.16.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

asyncapi-bot avatar Sep 14 '22 12:09 asyncapi-bot

:tada: This issue has been resolved in version 2.0.0-next-major.18 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

asyncapi-bot avatar Apr 24 '23 09:04 asyncapi-bot