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 Request: JSON Schema Integration within Config #69

Closed
wingedrhino opened this issue Dec 1, 2015 · 2 comments
Closed

Feature Request: JSON Schema Integration within Config #69

wingedrhino opened this issue Dec 1, 2015 · 2 comments

Comments

@wingedrhino
Copy link

Hi,

Since HCL compiles to JSON, using JSON schema to validate the configuration is natural. For this I suggest a feature of the sort which would look for a magic comment in the file of the form:

# json_schema_web = "https://schema-domain.com/path/to/schema-file.json"

or

# json_schema_path = "../config/service-name-config-schema.json"

Oh and if magic comments are too much magic (I feel so personally), an alternative approach could be used to specify the schema file path.

The validation can be powered by https://github.com/xeipuuv/gojsonschema

When clubbed with #24 I see a pass-through which applications in other languages can invoke so that the HCL format can be used to write config, validate it and translate it to general-purpose JSON input. This means existing apps using JSON can benefit from simpler config and added validation.

PS: This looks like a duplicate of #3 which is closed by what looks like an unrelated commit.

@mitchellh
Copy link
Contributor

My current thinking on this topic is that it should exist as a higher level tool about HCL but that at the moment it isn't proven enough to integrate first class into HCL.

As for #3, I think that was accidentally closed when I did an import of fatih's work into HCL (which was from another repo). Funny. But the same comment stands here. :)

@wingedrhino
Copy link
Author

Thanks for the explanation. I guess it makes sense to keep the HCL library itself light as this feature would be more useful within an IDE while the user is typing the config out by hand.

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