speccy
speccy copied to clipboard
Feature: Support JS modules
Detailed description
Understanding a schema in a module that can be require()
d would allow a more standard way of specifying the schema.
Context
YAML is an odd format to use for JS projects, and JSON is annoying for its lack of comment support, and trailing commas (which makes diffs a mess), and the ability to compose schemas (which requires refs / oneOf / allOf etc, which have their own limitations). Supporting a definition exported from a JS file is preferable to either for many.
module.exports = {
// definition goes here
}
Possible implementation
Infer the appropriate type from file extensions when loading a file, or via a command line flag when accepting stdin.
Your environment
Not relevant