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

Feature: Support Inline Schemas #36

Open
brianespinosa opened this issue Sep 26, 2023 · 1 comment
Open

Feature: Support Inline Schemas #36

brianespinosa opened this issue Sep 26, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@brianespinosa
Copy link

Feature: Support inline schemas

It is possible to define a path to a schema in both json and yaml files. It would be great if we could pick these schema references up and use them to validate a file.

For yaml, this inline syntax looks to be part of the spec. For json, this is technically not part of the json-schema spec, but is specific to VSCode... though is starting to pick up more broad use. The trick would be to be able to validate a JSON file and understand if the file is itself a schema or if it is referencing a schema draft.

I would be happy to take a shot at adding support for both of these use cases, but if we think this is out of scope for this plugin, please let me know so I can instead implement this separately as a different action that only supports this inline syntax.

Success Criteria:

  • Allows validation of JSON files when they have an inline reference to a $schema file.
  • Allows validation of YAML files when they have an inline reference to a # yaml-language-server: $schema= comment.
  • Both of the above should work with relative, absolute, or url paths.
@GrantBirki
Copy link
Owner

I would be happy to take a shot at adding support for both of these use cases

@brianespinosa Thank you so much! I think this is absolutely in-scope of this Action and other folks may very well appreciate this feature. Give it a go, open a pull request, and I'll take a look when its ready! @ mention me if you need any support ❤️

@GrantBirki GrantBirki added the enhancement New feature or request label Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants