voxpupuli / metadata-json-lint

Tool to check the validity of Puppet metadata.json files
Apache License 2.0
29 stars 27 forks source link

Perhaps use a JSON Schema document #92

Open glennsarti opened 6 years ago

glennsarti commented 6 years ago

As part of the Puppet VS Code extension I ended up writing a JSON Schema doc for metadata.json. This gem already makes use of the JSON Schema gem (https://github.com/voxpupuli/metadata-json-lint/blob/master/lib/metadata_json_lint.rb#L85-L89)

Instead of writing/encoding the JSON rules in ruby, they can easily be expressed in JSON Schema format. Although the more esoteric rules may require more ruby magic.

This would hopefully make it easy to consume this gem programmatically (as per #85)

Source code for JSON Schema Doc. https://github.com/jpogran/puppet-vscode/blob/master/client/src/metadata-json-schema.json

rnelson0 commented 6 years ago

I'm all for PRs that make use of this, in whole or in part!

3flex commented 6 years ago

The link to metadata-json-schema.json in the original issue description stale, as that project now directly sources the official schema published on the Forge - https://forgeapi.puppet.com/schemas/module.json