-
-
Notifications
You must be signed in to change notification settings - Fork 113
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
$ref syntax or other? #1
Comments
Do you mean an inline reference to a file or URL in one YAML file being loaded during the file's resolution? That's not a feature in existing YAML spec, and as far as I know, it's not on the roadmap for YAML 1.3 or even YAML 2. Could you point me towards a reference for this somewhere? If you're interested in getting something like this included in the spec, you should submit an RFC for it. Technically something like what you propose could be implemented as a custom data type that would then be included in the schema, but the security implications are significant enough that it would need to be separately loaded and enabled. |
@eemeli Hey! Sorry, I should have clarified. No this is (unfortunately) not part of the yaml specs. The $ref syntax is described here: json-schema-org/json-schema-spec#514 My preference would be to have something similar added to this repo. Having it disabled / not loaded by default is perfectly fine. However writing it completely separate might also be an option. We've been looking closely at this repo from various serverless issues and when config loading is restructured this repo would be a potentially dependency. Will get back here at some point. |
Closing this as a won't-fix issue for now. It's rather unlikely that I'd get to this myself in any sensible timeframe, but I'm not opposed to having it implemented as an extension; I'm pretty sure that the It's also tbh unlikely that something like this would make sense including in the core repo, as loading external files seems like a rather likely point of failure regarding security. |
@simlu if you're still looking, something like oas-resolver might do the trick (although it resolves to a JS object only, not an AST or a CST) or https://github.com/APIDevTools/json-schema-ref-parser - both support JSON and YAML. |
@MikeRalphson We started using yaml-boost (disclaimer, I'm the auther), as it handles various cases nicely for us. Thank you for the reply though. Very interesting and I hadn't seen it before! |
generated from commit 602b3d720f134ee5ca5f03bbc3eda8d1cd083c52
generated from commit 602b3d720f134ee5ca5f03bbc3eda8d1cd083c52
Following this project with interest!
Are you planning to support resolving and loading external yaml files somehow?
The text was updated successfully, but these errors were encountered: