Skip to content

Support relative symlinks as schema paths #2780

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

h3ndrk
Copy link

@h3ndrk h3ndrk commented Jun 3, 2025

Description

This PR allows quicktype to resolve schemas behind a relative symbolic link.

Related Issue

I did not create a issue before fixing it, but here are the steps to reproduce:

echo '{}' > schema.json
mkdir schemas
ln -s ../schema.json schemas/schema.json
quicktype --debug all --lang python --src-lang schema -o generated.py schemas/schema.json
# resolving # relative to schemas/schema.json# (schemas/schema.json#)
# trying to fetch schemas/schema.json
# couldn't fetch schemas/schema.json
# trying to fetch schemas/schema.json
# couldn't fetch schemas/schema.json
# Error: Internal error: .

Motivation and Context

Absolute symbolic links are already supported, but relative links are not supported yet. This PR adds support for them.

Previous Behaviour / Output

resolving # relative to schemas/schema.json# (schemas/schema.json#)
trying to fetch schemas/schema.json
couldn't fetch schemas/schema.json
trying to fetch schemas/schema.json
couldn't fetch schemas/schema.json
Error: Internal error: .

New Behaviour / Output

Only debug output, but no errors anymore regarding schema fetching.

How Has This Been Tested?

For simplicity reasons I only included an empty schema in the steps to reproduce. Other than that, use the steps to reproduce to test.

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.

1 participant