ajv-cli icon indicating copy to clipboard operation
ajv-cli copied to clipboard

Add support for asynchronous compilation

Open rayvincent2 opened this issue 5 years ago • 1 comments

Adds Asynchronous schema compilation support.

To reduce the complexity of the implementation, the compile command will only attempt asynchronous complication if only one schema is provided. When multiple schemas are provided to compile, asynchronous complication is disabled.

validate and test will always use asynchronous compilation by default. Of course, the application will not attempt to asynchronously request any remote schemas if they're provided by the -r option.

rayvincent2 avatar Jan 27 '21 20:01 rayvincent2

Interesting... If this is added, it should be definitely with additional option, so it's opt-in, otherwise it is a breaking change and I do not think I agree with it - the requirement to resolve URI via network requests is not very common, and in any case non-standard.

So the option to enable it could be --load-schema, and then it would add option loadSchema that gets schemas over HTTP(S) (or any other supported protocol in the URI).

It should work regardless how many schemas are passed

epoberezkin avatar Mar 06 '21 21:03 epoberezkin