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

Assigning $ref to a path that has a pound sign throws an error #180

Open
c3-antonytejakusuma opened this issue Mar 9, 2023 · 1 comment

Comments

@c3-antonytejakusuma
Copy link

It seems like since the # sign is a reserved character in resolving $ref, the following path cannot be used as a value to $ref: ../path/to/Some#Directory/schema.json. The following error will be shown:
Unable to load schema from '..path/to/Some': ENOENT: no such file or directory, open .

Is there a way to use a path that has a pound sign in this case? How can I escape the pound sign in the path?

@Relequestual
Copy link
Contributor

You would need to percent encode the hash/pound sign, as JSON Schema references are URIs.
If some code choose to treat it as a file path, that's allowed, but not defined in the JSON Schema specification.

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

No branches or pull requests

2 participants