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

Allow $schema in JSON schema #696

Merged
merged 2 commits into from
Sep 25, 2022
Merged

Allow $schema in JSON schema #696

merged 2 commits into from
Sep 25, 2022

Conversation

jrmajor
Copy link
Contributor

@jrmajor jrmajor commented Aug 30, 2022

Adding {"$schema": "vendor/humbug/box/res/schema.json"} to the config file allows PhpStorm to provide completions. However, the $schema key is reported as not allowed.

@theofidry theofidry merged commit 5b2e12d into box-project:master Sep 25, 2022
@theofidry
Copy link
Member

Thank you very much @jrmajor!

@jrmajor jrmajor deleted the schema branch October 11, 2022 22:50
@danepowell
Copy link
Contributor

danepowell commented Feb 16, 2023

This only works if you've installed Box via Composer in your local project, which you're generally not encouraged to do (or can't do, if you have conflicting dependencies).

What's the alternative if you've installed the Phar?

@theofidry
Copy link
Member

I don't think you have one unfortunately. This would require to publish the schema from an easily downloadable place. Unless adding it to the release actually works, I don't see how it can be done.

Although maybe there is a way to point at the one contained in the PHAR?

@danepowell
Copy link
Contributor

"$schema": "https://raw.githubusercontent.com/box-project/box/main/res/schema.json" seems to work

Although it's not ideal, since the version is likely to get out of sync with the installed Box version.

@jrmajor
Copy link
Contributor Author

jrmajor commented Feb 26, 2023

I would suggest referencing the exact version instead of the main branch:

- "$schema": "https://raw.githubusercontent.com/box-project/box/main/res/schema.json"
+ "$schema": "https://raw.githubusercontent.com/box-project/box/4.2.0/res/schema.json"

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